text_array.h
Go to the documentation of this file.
/*
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef TEXT_ARRAY_H
#define TEXT_ARRAY_H
struct text_array *text_array_create(int w, int h);
void text_array_delete(struct text_array *t);
int text_array_width(struct text_array *t);
int text_array_height(struct text_array *t);
const char *text_array_get(struct text_array *t, int x, int y);
int text_array_set(struct text_array *t, int x, int y, const char *c);
int text_array_load(struct text_array *t, const char *filename);
int text_array_save(struct text_array *t, const char *filename);
int text_array_save_range(struct text_array *t, const char *filename, int x, int y, int w, int h);
#endif
text_array_get
const char * text_array_get(struct text_array *t, int x, int y)
Look up one cell in the array.
text_array_save_range
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.
text_array_create
struct text_array * text_array_create(int w, int h)
Create a new text array.
text_array_save
int text_array_save(struct text_array *t, const char *filename)
Save an array to a file.
text_array_delete
void text_array_delete(struct text_array *t)
Delete a text array and all of its contents.
text_array_width
int text_array_width(struct text_array *t)
Get the width of the array.
text_array_height
int text_array_height(struct text_array *t)
Get the height of the array.
text_array_set
int text_array_set(struct text_array *t, int x, int y, const char *c)
Set one cell in the array.
text_array_load
int text_array_load(struct text_array *t, const char *filename)
Load an array from a file.