grid: add grid_snapshot()

This function deep copies a grid into a newly *allocated* grid struct.
This commit is contained in:
Daniel Eklöf 2021-02-22 10:21:58 +01:00
parent bb74fe3f7d
commit ae3ec52507
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 83 additions and 0 deletions

1
grid.h
View file

@ -4,6 +4,7 @@
#include "debug.h"
#include "terminal.h"
struct grid *grid_snapshot(const struct grid *grid);
void grid_free(struct grid *grid);
void grid_swap_row(struct grid *grid, int row_a, int row_b);