You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**IMPORTANT**: Do not mix regular and `_auto` functions on the same buffer. Always use either the regular functions with a fixed-size buffer or the `_auto` functions with a dynamically allocated buffer throughout your code.
74
+
41
75
Since json-build is a single-header, header-only library, for more complex use
42
76
cases you might need to define additional macros. `#define JSONB_STATIC`hides all
43
77
json-build API symbols by making them static. Also, if you want to include `json-build.h`
@@ -70,9 +104,10 @@ for multiple C files, to avoid duplication of symbols you may define `JSONB_HEAD
70
104
The following are the possible return codes for the builder functions:
71
105
*`JSONB_OK` - operation was a success, user can proceed with the next operation
72
106
*`JSONB_END` - operation was a success, JSON is complete and expects no more operations
73
-
*`JSONB_ERROR_NOMEM` - buffer is not large enough
107
+
*`JSONB_ERROR_NOMEM` - buffer is not large enough, or `_auto` function couldn't reallocate
74
108
*`JSONB_ERROR_INPUT` - user action don't match expected next token
75
109
*`JSONB_ERROR_STACK` - user action would lead to out of boundaries access, increase `JSONB_MAX_DEPTH`!
110
+
*`JSONB_ERROR_OVERFLOW` - automatic buffer increase would lead to an overflow, only use with `_auto` functions
76
111
77
112
Its worth mentioning that all `JSONB_ERROR_` prefixed codes are negative.
0 commit comments