18 lines
393 B
C
18 lines
393 B
C
|
|
#ifndef GRID_H
|
||
|
|
#define GRID_H
|
||
|
|
|
||
|
|
typedef struct {
|
||
|
|
int cols;
|
||
|
|
int rows;
|
||
|
|
unsigned char *cells;
|
||
|
|
int show_lines;
|
||
|
|
} grid_t;
|
||
|
|
|
||
|
|
void grid_init(grid_t *g, int cols, int rows);
|
||
|
|
void grid_free(grid_t *g);
|
||
|
|
void grid_resize(grid_t *g, int new_cols, int new_rows);
|
||
|
|
void grid_clear(grid_t *g);
|
||
|
|
int grid_get(const grid_t *g, int c, int r);
|
||
|
|
void grid_set(grid_t *g, int c, int r, int val);
|
||
|
|
|
||
|
|
#endif
|