diff options
author | JSDurand <mmemmew@gmail.com> | 2022-01-04 11:51:58 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2022-01-04 11:51:58 +0800 |
commit | 55dc897da6e81f2a26cfc7e66ac942824773498b (patch) | |
tree | fce0d7d57832907c991d551833bf5eecde947dd2 /src/list.h | |
parent | 53b8b6ffab5a968db75e9babddf4e2dbb2c688a3 (diff) |
temporary commit
Now we can read grammars from a file.
But we need to check if it works for reading strings still.
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -69,10 +69,21 @@ unsigned char list_set_length(List *ls, NUM len); The number of elements of the array will be stored in *NUM. */ void *list_to_array(List *ls, NUM element_bytes, NUM *num); +/* Create a list from an array. + + The array will be re-used, so it will be destroyed when the list is + destroyed. */ +List *array_to_list(void ** array, NUM size); + + /* destroy the list: If ALL_FREE_P is 1, this frees every void pointers contained in the list; if it is 2, this frees the first pointer. In any case, the list is de-allocated. */ void destroy_list(List *ls, unsigned char all_free_p); +void destroy_list_free_all(void *ls); +void destroy_list_free_first(void *ls); +void destroy_list_no_free(void *ls); + #endif |