Convert everything to c api

This commit is contained in:
2025-05-23 11:59:50 -04:00
parent f7ad84a79a
commit 1217ded8a7
8 changed files with 130 additions and 89 deletions

View File

@@ -41,7 +41,8 @@ typedef struct WeaselJsonParser WeaselJsonParser;
/** Create a parser. Increasing stack size increases memory usage but also
* increases the depth of nested json accepted. `callbacks` and `data` must
* outlive the returned parser. */
* outlive the returned parser. Returns null if there's insufficient available
* memory */
WeaselJsonParser *WeaselJsonParser_create(int stackSize,
const WeaselJsonCallbacks *callbacks,
void *data);
@@ -53,7 +54,8 @@ void WeaselJsonParser_reset(WeaselJsonParser *parser);
void WeaselJsonParser_destroy(WeaselJsonParser *parser);
/** Incrementally parse `len` more bytes starting at `buf`. `buf` may be
* modified. Call with `len` 0 to indicate end of data */
* modified. Call with `len` 0 to indicate end of data. `buf` may be null if
* `len` is 0 */
WeaselJsonStatus WeaselJsonParser_parse(WeaselJsonParser *parser, char *buf,
int len);