cctools
text_array.h
Go to the documentation of this file.
1/*
2Copyright (C) 2022 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See the file COPYING for details.
5*/
6
7#ifndef TEXT_ARRAY_H
8#define TEXT_ARRAY_H
9
21struct text_array *text_array_create(int w, int h);
22
26void text_array_delete(struct text_array *t);
27
32int text_array_width(struct text_array *t);
33
38int text_array_height(struct text_array *t);
39
46const char *text_array_get(struct text_array *t, int x, int y);
47
54int text_array_set(struct text_array *t, int x, int y, const char *c);
55
60int text_array_load(struct text_array *t, const char *filename);
61
66int text_array_save(struct text_array *t, const char *filename);
67
76int text_array_save_range(struct text_array *t, const char *filename, int x, int y, int w, int h);
77
78#endif
const char * text_array_get(struct text_array *t, int x, int y)
Look up one cell in the array.
int text_array_save_range(struct text_array *t, const char *filename, int x, int y, int w, int h)
Save a portion of an array to a file.
struct text_array * text_array_create(int w, int h)
Create a new text array.
int text_array_save(struct text_array *t, const char *filename)
Save an array to a file.
void text_array_delete(struct text_array *t)
Delete a text array and all of its contents.
int text_array_width(struct text_array *t)
Get the width of the array.
int text_array_height(struct text_array *t)
Get the height of the array.
int text_array_set(struct text_array *t, int x, int y, const char *c)
Set one cell in the array.
int text_array_load(struct text_array *t, const char *filename)
Load an array from a file.