From 0cfcbe979277f6d3b096b85d7fb6f4c02c366c72 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 9 Jan 2024 12:04:19 -0800 Subject: fix invalid read/write of size 1; add framework for custom structs --- parser.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'parser.h') diff --git a/parser.h b/parser.h index 3fc1772..ba30f51 100644 --- a/parser.h +++ b/parser.h @@ -46,6 +46,12 @@ typedef struct { size_t size; } ht_t; +typedef struct { + void (*printfunc)(void *); + void *(*copyfunc)(void *); + void (*freefunc)(void *); +} custom_t; + void func_free(void *f); array_t *init_array(size_t size); @@ -66,6 +72,10 @@ value_t *value_copy(value_t *v); void value_free(void *v); +custom_t *init_custom(void (*)(void *), void (*)(void *), void *(*)(void *)); + +void custom_free(void *); + parser_t *init_parser(char *source); void parser_reset(parser_t *p, char *source); -- cgit