Typedefs | |
typedef gdsl_2darray * | gdsl_2darray_t |
GDSL 2D-array type. | |
typedef void(* | gdsl_2darray_write_func_t )(gdsl_element_t E, const FILE *OUTPUT_FILE, gdsl_2darray_position_t POSITION, void *USER_DATA) |
GDSL 2D-array write function type. | |
Enumerations | |
enum | gdsl_2darray_position_t { GDSL_2DARRAY_POSITION_FIRST_ROW = 1, GDSL_2DARRAY_POSITION_LAST_ROW = 2, GDSL_2DARRAY_POSITION_FIRST_COL = 4, GDSL_2DARRAY_POSITION_LAST_COL = 8 } |
This type is for gdsl_2darray_write_func_t. More... | |
Functions | |
gdsl_2darray_t | gdsl_2darray_alloc (const char *NAME, const ulong R, const ulong C, const gdsl_alloc_func_t ALLOC_F, const gdsl_free_func_t FREE_F) |
Create a new 2D-array. | |
void | gdsl_2darray_free (gdsl_2darray_t A) |
Destroy a 2D-array. | |
const char * | gdsl_2darray_get_name (const gdsl_2darray_t A) |
Get the name of a 2D-array. | |
ulong | gdsl_2darray_get_rows_number (const gdsl_2darray_t A) |
Get the number of rows of a 2D-array. | |
ulong | gdsl_2darray_get_columns_number (const gdsl_2darray_t A) |
Get the number of columns of a 2D-array. | |
ulong | gdsl_2darray_get_size (const gdsl_2darray_t A) |
Get the size of a 2D-array. | |
gdsl_element_t | gdsl_2darray_get_content (const gdsl_2darray_t A, const ulong R, const ulong C) |
Get an element from a 2D-array. | |
gdsl_2darray_t | gdsl_2darray_set_name (gdsl_2darray_t A, const char *NEW_NAME) |
Set the name of a 2D-array. | |
gdsl_element_t | gdsl_2darray_set_content (gdsl_2darray_t A, const ulong R, const ulong C, void *VALUE) |
Modify an element in a 2D-array. | |
void | gdsl_2darray_write (const gdsl_2darray_t A, const gdsl_2darray_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Write the content of a 2D-array to a file. | |
void | gdsl_2darray_write_xml (const gdsl_2darray_t A, const gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Write the content of a 2D array to a file into XML. | |
void | gdsl_2darray_dump (const gdsl_2darray_t A, const gdsl_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Dump the internal structure of a 2D array to a file. |
|
GDSL 2D-array type. This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module. Definition at line 52 of file gdsl_2darray.h. |
|
GDSL 2D-array write function type.
Definition at line 82 of file gdsl_2darray.h. |
|
This type is for gdsl_2darray_write_func_t.
Definition at line 57 of file gdsl_2darray.h. |
|
Create a new 2D-array. Allocate a new 2D-array data structure with R rows and C columns and its name is set to a copy of NAME. The functions pointers ALLOC_F and FREE_F could be used to respectively, alloc and free elements in the 2D-array. These pointers could be set to NULL to use the default ones:
|
|
Dump the internal structure of a 2D array to a file. Dump A's structure to OUTPUT_FILE. If WRITE_F != NULL, then uses WRITE_F to write A's elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.
|
|
Destroy a 2D-array. Flush and destroy the 2D-array A. The FREE_F function passed to gdsl_2darray_alloc() is used to free elements from A, but no check is done to see if an element was set (ie. != NULL) or not.It's up to you to check if the element to free is NULL or not into the FREE_F function.
|
|
Get the number of columns of a 2D-array.
|
|
Get an element from a 2D-array.
|
|
Get the name of a 2D-array.
|
|
Get the number of rows of a 2D-array.
|
|
Get the size of a 2D-array.
|
|
Modify an element in a 2D-array. Change the element at row R and column C of the 2D-array A, and returns it. The new element to insert is allocated using the ALLOC_F function passed to gdsl_2darray_create() applied on VALUE. The previous element contained in row R and in column C is NOT deallocated. It's up to you to do it before, if necessary.
|
|
Set the name of a 2D-array. Change the previous name of the 2D-array A to a copy of NEW_NAME.
|
|
Write the content of a 2D-array to a file. Write the elements of the 2D-array A to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F.
|
|
Write the content of a 2D array to a file into XML. Write all A's elements to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then uses WRITE_F to write A's elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.
|