diff options
author | Preston Pan <preston@nullring.xyz> | 2024-01-09 12:04:19 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2024-01-09 12:04:19 -0800 |
commit | 0cfcbe979277f6d3b096b85d7fb6f4c02c366c72 (patch) | |
tree | bce0a91a88459050f9ba793796af440ec66b5c83 /parser.h | |
parent | dfe729c98b63d0f6c0041799a0fb46b2f476502e (diff) |
fix invalid read/write of size 1; add framework for custom structs
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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); |