From 55dc897da6e81f2a26cfc7e66ac942824773498b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Tue, 4 Jan 2022 11:51:58 +0800 Subject: temporary commit Now we can read grammars from a file. But we need to check if it works for reading strings still. --- src/list.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/list.h') diff --git a/src/list.h b/src/list.h index b710aa2..ff401f4 100644 --- a/src/list.h +++ b/src/list.h @@ -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 -- cgit v1.2.3-18-g5258