Loading...
Searching...
No Matches
jsonbourne.c
Go to the documentation of this file.
50#define JSONBOURNE_READ_SUCCESS_MSG "JSONbourne found zero errors and is now insufferable at parties."
52#define JSONBOURNE_READ_ERROR_EXPECTED_SEPARATOR_MSG "The comma and closing bracket have both rage-quit this syntax rave."
54#define JSONBOURNE_READ_ERROR_EXPECTED_COLON_MSG "This key and value eloped without filing the mandatory colon paperwork."
56#define JSONBOURNE_READ_ERROR_EXPECTED_KEY_MSG "That member name needs quotes, not a fake moustache and a convincing backstory."
58#define JSONBOURNE_READ_ERROR_INVALID_ESCAPE_MSG "That string escape tried to clear Unicode customs with a counterfeit surrogate."
60#define JSONBOURNE_READ_ERROR_INVALID_NUMBER_MSG "That alleged number has been banned from every calculator in three dimensions."
62#define JSONBOURNE_READ_ERROR_LITERAL_MSG "Wishful thinking in a trench coat is still not a JSON value."
64#define JSONBOURNE_READ_ERROR_UNEXPECTED_END_MSG "Your input rolled the end credits while the document was still introducing itself."
66#define JSONBOURNE_READ_ERROR_INVALID_STRING_MSG "An unescaped control character is rearranging the furniture inside your string."
68#define JSONBOURNE_READ_ERROR_MEMORY_ALLOCATION_MSG "Your DOM ordered a penthouse and the allocator delivered a shoebox with no floor."
70#define JSONBOURNE_READ_ERROR_UNEXPECTED_CONTENT_MSG "Your document is finished but the trailing input has launched an unsolicited podcast."
72#define JSONBOURNE_READ_ERROR_DEPTH_MSG "Your containers nested past the depth limit and filed for their own postcode."
74#define JSONBOURNE_READ_ERROR_INVALID_COMMENT_MSG "Your block comment swallowed the entire document while waiting for its missing */."
76#define JSONBOURNE_READ_ERROR_UNKNOWN_MSG "Your JSON structure belongs in a modern-art museum, not in this parser."
78#define JSONBOURNE_READ_ERROR_INVALID_UTF8_MSG "UTF-8 cannot decode whatever experimental keyboard jazz these bytes are performing."
80#define JSONBOURNE_READ_ERROR_LIMIT_MSG "Your resource or arithmetic limit refuses to finance infinity's latest shopping spree."
82#define JSONBOURNE_READ_ERROR_INVALID_PARAMETER_MSG "Your arguments, flags or buffer layout have turned this call into a constitutional crisis."
169static inline int jsonbourne_pool_copy(struct jsonbourne_pool *pool, const char *src, size_t len) {
289static inline int jsonbourne_char_is_digit(unsigned char chr) { return chr >= '0' && chr <= '9'; }
468static inline void jsonbourne_read_locate(struct jsonbourne_read_ctx *ctx, size_t pos, size_t *line,
876static inline int jsonbourne_read_document(struct jsonbourne_read_ctx *ctx, jsonbourne_val **root) {
1622 if (!jsonbourne_walk(val, jsonbourne_write_visit, &out) || !jsonbourne_write_bytes(&out, "", 1) ||
1667static inline int jsonbourne_write_buffer(const jsonbourne_val *val, int pretty, const char *indent,
1690int jsonbourne_val_write_buf(const jsonbourne_val *val, char *buf, size_t cap, size_t *out_len) {
1708 struct jsonbourne_copy_frame frames[JSONBOURNE_WRITER_DEPTH_LIMIT]; /**< Bounded append stack. */
1870jsonbourne_val *jsonbourne_val_copy_opts(const jsonbourne_val *val, void *(*alc_fn)(void *, size_t),
1911/* These borrowed views inspect tags only; ownership and structural validation stay with callers. */
1982const jsonbourne_val *jsonbourne_obj_getn(const jsonbourne_val *val, const char *key, size_t len) {
2040 if (!jsonbourne_num_to_uint(&magnitude, &val) || val > (uint64_t)INT64_MAX + (unsigned)negative)
2056static inline int jsonbourne_ptr_key_eq(const jsonbourne_str *name, const char *token, size_t len) {
static bool start(uint32_t session)
Admit a nonzero session and discard correlation from the previous one.
Definition dipla_camera_backend.c:170
int jsonbourne_num_to_sint(const jsonbourne_num *num, int64_t *out)
Convert a signed decimal integer token exactly, including INT64_MIN.
Definition jsonbourne.c:2031
int jsonbourne_is_null(const jsonbourne_val *val)
Distinguish JSON null from a missing C pointer.
Definition jsonbourne.c:1936
const jsonbourne_val * jsonbourne_ptr_getn(const jsonbourne_val *val, const char *pointer, size_t len)
Resolve an RFC 6901 pointer without allocating decoded path tokens.
Definition jsonbourne.c:2075
const jsonbourne_val * jsonbourne_arr_get(const jsonbourne_val *val, size_t idx)
Locate a zero-based array element by bounded linked traversal.
Definition jsonbourne.c:1991
int jsonbourne_is_false(const jsonbourne_val *val)
Test the false tag without truthiness conversion.
Definition jsonbourne.c:1932
const char * jsonbourne_read_err_desc(jsonbourne_read_code code)
Borrow human-readable diagnostic text without allocating.
Definition jsonbourne.c:2138
const jsonbourne_val * jsonbourne_obj_getn(const jsonbourne_val *val, const char *key, size_t len)
Find the first exact decoded member name, including embedded NUL bytes.
Definition jsonbourne.c:1982
int jsonbourne_num_to_uint(const jsonbourne_num *num, uint64_t *out)
Convert an unsigned decimal integer token exactly, without coercion.
Definition jsonbourne.c:2013
jsonbourne_arr * jsonbourne_get_arr(jsonbourne_val *val)
Borrow the ordered array payload.
Definition jsonbourne.c:1924
jsonbourne_obj * jsonbourne_get_obj(jsonbourne_val *val)
Borrow the ordered object payload.
Definition jsonbourne.c:1920
jsonbourne_str * jsonbourne_get_str(jsonbourne_val *val)
Borrow a string payload without allocating or copying.
Definition jsonbourne.c:1912
const jsonbourne_val * jsonbourne_obj_getn_unique(const jsonbourne_val *val, const char *key, size_t len)
Require exactly one decoded matching key instead of silently choosing.
Definition jsonbourne.c:1986
int jsonbourne_is_true(const jsonbourne_val *val)
Test the true tag without coercing numbers or strings.
Definition jsonbourne.c:1928
jsonbourne_num * jsonbourne_get_num(jsonbourne_val *val)
Borrow the original number-token view.
Definition jsonbourne.c:1916
#define JSONBOURNE_VERSION_HEX
Packed major/minor/patch version for compile-time comparisons.
Definition jsonbourne.h:90
uint32_t jsonbourne_version(void)
Query the linked implementation rather than the including header.
Definition jsonbourne.c:104
#define JSONBOURNE_WRITER_DEPTH_LIMIT
Positive writer/copy nesting bound, defaulting to the reader bound.
Definition jsonbourne.h:111
#define JSONBOURNE_READER_DEPTH_LIMIT
Maximum simultaneous open reader containers; must be positive.
Definition jsonbourne.h:103
#define JSONBOURNE_MAX_HEX_DIGITS
Maximum significant hexadecimal digits converted to decimal output.
Definition jsonbourne.h:122
#define JSONBOURNE_READ_ALLOW_EXT_NUMBER
Numeric spelling extensions; does not by itself permit Infinity or NaN.
Definition jsonbourne.h:312
size_t jsonbourne_read_code
Stable storage type for a diagnostic code, separate from display text.
Definition jsonbourne.h:267
size_t jsonbourne_read_flag
Read-option bitmask; combine named options with bitwise OR.
Definition jsonbourne.h:147
@ JSONBOURNE_READ_ERROR_INVALID_NUMBER
Definition jsonbourne.h:275
@ JSONBOURNE_READ_ERROR_EXPECTED_SEPARATOR
Definition jsonbourne.h:271
@ JSONBOURNE_READ_ERROR_EXPECTED_COLON
Definition jsonbourne.h:272
@ JSONBOURNE_READ_ERROR_INVALID_PARAMETER
Definition jsonbourne.h:286
@ JSONBOURNE_READ_ERROR_MEMORY_ALLOCATION
Definition jsonbourne.h:279
@ JSONBOURNE_READ_ERROR_UNEXPECTED_END
Definition jsonbourne.h:277
@ JSONBOURNE_READ_ERROR_INVALID_STRING
Definition jsonbourne.h:278
@ JSONBOURNE_READ_ERROR_INVALID_COMMENT
Definition jsonbourne.h:282
@ JSONBOURNE_READ_ERROR_UNEXPECTED_CONTENT
Definition jsonbourne.h:280
@ JSONBOURNE_READ_ERROR_INVALID_ESCAPE
Definition jsonbourne.h:274
@ JSONBOURNE_READ_ALLOW_TRAILING_COMMAS
Definition jsonbourne.h:155
@ JSONBOURNE_READ_ALLOW_SINGLE_QUOTED_STR
Definition jsonbourne.h:163
jsonbourne_val * jsonbourne_read(const void *src, size_t len)
Read strict JSON with default limits and malloc-backed ownership.
Definition jsonbourne.c:1180
jsonbourne_val * jsonbourne_read_opts_with_limits(const void *src, size_t len, jsonbourne_read_flag flg, const jsonbourne_read_limits *limits, void *(*alc_fn)(void *, size_t), void *alc_ctx, jsonbourne_read_err *err)
Validate against explicit budgets, then allocate the entire DOM once.
Definition jsonbourne.c:1147
int jsonbourne_read_measure(const void *src, size_t len, jsonbourne_read_flag flg, const jsonbourne_read_limits *limits, size_t *required, jsonbourne_read_err *err)
Validate input and measure the exact single-allocation DOM size.
Definition jsonbourne.c:1043
jsonbourne_val * jsonbourne_read_opts(const void *src, size_t len, jsonbourne_read_flag flg, void *(*alc_fn)(void *, size_t), void *alc_ctx, jsonbourne_read_err *err)
Read with named options and the linked implementation's default limits.
Definition jsonbourne.c:1174
struct jsonbourne_read_limits jsonbourne_read_limits_default(void)
Create default budgets using the linked implementation's reader limit.
Definition jsonbourne.c:106
jsonbourne_val * jsonbourne_read_buf(const void *src, size_t len, jsonbourne_read_flag flg, const jsonbourne_read_limits *limits, void *buf, size_t cap, size_t *required, jsonbourne_read_err *err)
Read a DOM into aligned caller storage without heap allocation.
Definition jsonbourne.c:1123
int jsonbourne_read_validate(const void *src, size_t len, jsonbourne_read_flag flg, const jsonbourne_read_limits *limits, jsonbourne_read_err *err)
Validate the entire extent without allocating a DOM or changing input.
Definition jsonbourne.c:1060
void * jsonbourne_val_write_pretty_opts(const jsonbourne_val *val, const char *indent, const char *newline, void *(*alc_fn)(void *, size_t), void(*free_fn)(void *, void *), void *alc_ctx, size_t *out_len)
Validate and allocate pretty output with explicit formatting/ownership.
Definition jsonbourne.c:1644
void * jsonbourne_val_write(const jsonbourne_val *val, size_t *out_len)
Allocate minified JSON using malloc.
Definition jsonbourne.c:1640
int jsonbourne_val_write_buf(const jsonbourne_val *val, char *buf, size_t cap, size_t *out_len)
Preflight minified output, then write only if the caller buffer fits.
Definition jsonbourne.c:1690
void * jsonbourne_val_write_pretty(const jsonbourne_val *val, const char *indent, const char *newline, size_t *out_len)
Allocate pretty JSON using malloc.
Definition jsonbourne.c:1651
jsonbourne_val * jsonbourne_val_copy(const jsonbourne_val *val)
Make an independently owned deep copy using malloc.
Definition jsonbourne.c:1907
jsonbourne_val * jsonbourne_val_copy_opts(const jsonbourne_val *val, void *(*alc_fn)(void *, size_t), void *alc_ctx)
Deep-copy a validated value into one independent allocation.
Definition jsonbourne.c:1870
int jsonbourne_val_write_pretty_buf(const jsonbourne_val *val, const char *indent, const char *newline, char *buf, size_t cap, size_t *out_len)
Preflight pretty output without allocating storage.
Definition jsonbourne.c:1694
void * jsonbourne_val_write_opts(const jsonbourne_val *val, void *(*alc_fn)(void *, size_t), void(*free_fn)(void *, void *), void *alc_ctx, size_t *out_len)
Validate a DOM and allocate minified JSON output.
Definition jsonbourne.c:1635
static size_t jsonbourne_utf8_len(const unsigned char *src, size_t len)
Validate exactly one UTF-8 scalar without reading beyond the extent.
Definition jsonbourne.c:311
static int jsonbourne_write_num(struct jsonbourne_write_ctx *out, const jsonbourne_num *num)
Preserve strict numeric text or normalize enabled relaxed spellings.
Definition jsonbourne.c:1454
static int jsonbourne_write_ctx_init(struct jsonbourne_write_ctx *out, int pretty, const char *indent, const char *newline)
Initialize a counting sink and validate pretty-print whitespace.
Definition jsonbourne.c:1566
static int jsonbourne_write_indent(struct jsonbourne_write_ctx *out, size_t depth)
Write a configured line break and one indentation unit per nesting level.
Definition jsonbourne.c:1499
#define JSONBOURNE_READ_ERROR_EXPECTED_SEPARATOR_MSG
Missing container separator/closure diagnostic.
Definition jsonbourne.c:52
static int jsonbourne_write_visit(void *ctx, enum jsonbourne_event event, const jsonbourne_val *val, const jsonbourne_str *name, size_t depth, size_t idx)
Translate shared walker events into JSON punctuation and scalar text.
Definition jsonbourne.c:1521
#define JSONBOURNE_READ_ERROR_UNEXPECTED_CONTENT_MSG
Non-trivia input remaining after the root diagnostic.
Definition jsonbourne.c:70
#define JSONBOURNE_READ_ERROR_UNKNOWN_MSG
Generic diagnostic, also used for unrecognized codes.
Definition jsonbourne.c:76
#define JSONBOURNE_ALIGNOF(type)
Required C11 alignment for an arena's typed record region.
Definition jsonbourne.c:92
static int jsonbourne_char_is_digit(unsigned char chr)
Recognize the decimal digits permitted by JSON number grammar.
Definition jsonbourne.c:289
#define JSONBOURNE_READ_ERROR_MEMORY_ALLOCATION_MSG
Allocation failure or insufficient caller-storage diagnostic.
Definition jsonbourne.c:68
static int jsonbourne_ptr_key_eq(const jsonbourne_str *name, const char *token, size_t len)
Compare a decoded member name with an RFC 6901 token as escapes are read.
Definition jsonbourne.c:2056
static size_t jsonbourne_space_span(const unsigned char *src, size_t len)
Skip a bounded run of JSON whitespace with the available SIMD baseline.
Definition jsonbourne.c:239
static void jsonbourne_read_report(const struct jsonbourne_read_ctx *ctx, jsonbourne_read_err *err)
Normalize parser/arena failure into an optional public diagnostic.
Definition jsonbourne.c:1020
static int jsonbourne_char_is_id(unsigned char chr)
Classify this reader's relaxed, ASCII-only unquoted-key alphabet.
Definition jsonbourne.c:298
static int jsonbourne_write_bytes(struct jsonbourne_write_ctx *out, const char *bytes, size_t len)
Reserve output bytes before optionally copying them.
Definition jsonbourne.c:1334
static int jsonbourne_write_str(struct jsonbourne_write_ctx *out, const jsonbourne_str *str)
Emit a UTF-8 string with JSON quoting and exact control-byte escaping.
Definition jsonbourne.c:1354
static int jsonbourne_read_str(struct jsonbourne_read_ctx *ctx, int key, jsonbourne_str **out)
Decode one quoted string or enabled unquoted key through the same two passes.
Definition jsonbourne.c:595
static int jsonbourne_read_val(struct jsonbourne_read_ctx *ctx, jsonbourne_val **out, struct jsonbourne_read_frame *stack, size_t *depth, int is_global)
Consume a scalar or push a new container without a recursive call.
Definition jsonbourne.c:765
#define JSONBOURNE_READ_ERROR_UNEXPECTED_END_MSG
Premature end-of-input diagnostic.
Definition jsonbourne.c:64
static const void * jsonbourne_next(const void *elem, size_t type)
Advance either entry type without relying on their layouts being interchangeable.
Definition jsonbourne.c:1208
static int jsonbourne_pool_copy(struct jsonbourne_pool *pool, const char *src, size_t len)
Account for or copy a byte extent into the text region.
Definition jsonbourne.c:169
#define JSONBOURNE_READ_ERROR_LITERAL_MSG
Invalid true/false/null token diagnostic.
Definition jsonbourne.c:62
static int jsonbourne_write_hex_num(struct jsonbourne_write_ctx *out, const char *src, size_t len)
Convert hexadecimal magnitude text exactly using bounded decimal digits.
Definition jsonbourne.c:1410
#define JSONBOURNE_READ_ERROR_EXPECTED_COLON_MSG
Missing key/value separator diagnostic.
Definition jsonbourne.c:54
static void jsonbourne_read_locate(struct jsonbourne_read_ctx *ctx, size_t pos, size_t *line, size_t *row)
Advance a lazy location cursor instead of rescanning each node's prefix.
Definition jsonbourne.c:468
jsonbourne_event
Shared traversal protocol so writing and cloning use identical structural checks.
Definition jsonbourne.c:1185
static int jsonbourne_skip_trivia(struct jsonbourne_read_ctx *ctx)
Consume whitespace and enabled comments without swallowing grammar bytes.
Definition jsonbourne.c:487
static int jsonbourne_read_num_token(const unsigned char *src, size_t len, jsonbourne_read_flag flg, size_t *read_len)
Recognize a numeric prefix without converting or rounding its value.
Definition jsonbourne.c:349
static const jsonbourne_val * jsonbourne_obj_lookup(const jsonbourne_val *val, const char *key, size_t len, int unique)
Share exact-byte member comparison while keeping ambiguity policy explicit.
Definition jsonbourne.c:1950
#define JSONBOURNE_READ_ERROR_INVALID_COMMENT_MSG
Unterminated block-comment diagnostic.
Definition jsonbourne.c:74
static int jsonbourne_overlap(const void *first, size_t first_size, const void *second, size_t second_size)
Compare numeric address distances instead of forming overflowing end pointers.
Definition jsonbourne.c:1074
#define JSONBOURNE_READ_ERROR_LIMIT_MSG
Resource-budget or arithmetic-limit diagnostic.
Definition jsonbourne.c:80
static int jsonbourne_char_is_space(unsigned char chr)
Recognize only the four JSON whitespace bytes, independently of locale.
Definition jsonbourne.c:228
static int jsonbourne_write_buffer(const jsonbourne_val *val, int pretty, const char *indent, const char *newline, char *buf, size_t cap, size_t *out_len)
Protect a short caller buffer by measuring before any output write.
Definition jsonbourne.c:1667
static int jsonbourne_read_document(struct jsonbourne_read_ctx *ctx, jsonbourne_val **root)
Drive one complete JSON document using explicit container frames.
Definition jsonbourne.c:876
static int jsonbourne_walk(const jsonbourne_val *val, int(*visit)(void *, enum jsonbourne_event, const jsonbourne_val *, const jsonbourne_str *, size_t, size_t), void *ctx)
Validate/traverse an accessible DOM with a fixed explicit stack.
Definition jsonbourne.c:1242
#define JSONBOURNE_READ_ERROR_INVALID_UTF8_MSG
Invalid Unicode scalar encoding diagnostic.
Definition jsonbourne.c:78
static void * jsonbourne_write_document(const jsonbourne_val *val, int pretty, const char *indent, const char *newline, void *(*alc_fn)(void *, size_t), void(*free_fn)(void *, void *), void *alc_ctx, size_t *out_len)
Measure, allocate once and replay the same traversal into exact output storage.
Definition jsonbourne.c:1602
static int jsonbourne_read_hex4(struct jsonbourne_read_ctx *ctx, uint32_t *unit)
Consume the four hexadecimal digits following a Unicode escape marker.
Definition jsonbourne.c:537
static int jsonbourne_read_ctx_init(struct jsonbourne_read_ctx *ctx, const void *src, size_t len, jsonbourne_read_flag flg, const jsonbourne_read_limits *limits)
Establish cursor/limit invariants before any grammar byte is accessed.
Definition jsonbourne.c:989
static int jsonbourne_acyclic_step(const void **slow, const void **fast, size_t type)
Advance Floyd's two cursors without allocating a visited-address set.
Definition jsonbourne.c:1224
static int jsonbourne_read_str_bytes(struct jsonbourne_read_ctx *ctx, size_t start, const char *bytes, size_t count)
Enforce a decoded-string budget before reserving any more text bytes.
Definition jsonbourne.c:522
static jsonbourne_val * jsonbourne_read_materialize(struct jsonbourne_read_ctx *ctx, void *buf, size_t val_len, size_t str_len, jsonbourne_read_err *err)
Replay a successful counting pass into precisely bounded record/text regions.
Definition jsonbourne.c:1095
#define JSONBOURNE_READ_ERROR_INVALID_STRING_MSG
Disallowed string control-byte diagnostic.
Definition jsonbourne.c:66
#define JSONBOURNE_READ_FLAG_MASK
Derive the accepted bits from named options so flag remaps cannot stale this mask.
Definition jsonbourne.c:86
static int jsonbourne_set_read_error(struct jsonbourne_read_ctx *ctx, jsonbourne_read_code code)
Preserve the first grammar failure while supporting short-circuit returns.
Definition jsonbourne.c:453
static int jsonbourne_is_delimiter(const struct jsonbourne_read_ctx *ctx, size_t pos)
Verify the token boundary separately from the token's own spelling.
Definition jsonbourne.c:745
static int jsonbourne_hex_to_digit(unsigned char chr)
Decode an ASCII hexadecimal digit without locale-sensitive conversion.
Definition jsonbourne.c:274
#define JSONBOURNE_READ_ERROR_INVALID_NUMBER_MSG
Invalid numeric-token diagnostic.
Definition jsonbourne.c:60
#define JSONBOURNE_ZERO
C11 aggregate zero-initializer without byte-copying object representations.
Definition jsonbourne.c:90
static size_t jsonbourne_ascii_span(const unsigned char *src, size_t len, unsigned char quote)
Find bytes that need no string escaping or Unicode decoding.
Definition jsonbourne.c:189
#define JSONBOURNE_READ_ERROR_INVALID_ESCAPE_MSG
Invalid escape/surrogate diagnostic.
Definition jsonbourne.c:58
static jsonbourne_str * jsonbourne_copy_str(struct jsonbourne_pool *pool, const jsonbourne_str *src)
Validate and duplicate a decoded string instead of borrowing source text.
Definition jsonbourne.c:1721
#define JSONBOURNE_READ_ERROR_EXPECTED_KEY_MSG
Invalid member-name diagnostic.
Definition jsonbourne.c:56
#define JSONBOURNE_READ_ERROR_INVALID_PARAMETER_MSG
Invalid API arguments or buffer-layout diagnostic.
Definition jsonbourne.c:82
static int jsonbourne_read_utf8_encode(struct jsonbourne_read_ctx *ctx, size_t start, uint32_t codepoint)
Encode a validated Unicode scalar into the decoded text arena.
Definition jsonbourne.c:560
static int jsonbourne_copy_visit(void *ctx, enum jsonbourne_event event, const jsonbourne_val *src, const jsonbourne_str *name, size_t depth, size_t idx)
Build copied records from the same validated events used for writing.
Definition jsonbourne.c:1761
static void * jsonbourne_pool_take(struct jsonbourne_pool *pool, size_t len, int is_str)
Reserve checked space in one arena region or merely account for it.
Definition jsonbourne.c:143
JSON reader, writer and DOM utilities for Linux C11 with a C++11-compatible API.
Ordered array elements; explicit length supports bounded traversal.
Definition jsonbourne.h:240
Copy visitor state; the arena layout is shared with the parser.
Definition jsonbourne.c:1706
struct jsonbourne_copy_frame frames[JSONBOURNE_WRITER_DEPTH_LIMIT]
Definition jsonbourne.c:1708
Per-depth destination append state, separate from source-walker frames.
Definition jsonbourne.c:1700
Original number spelling, retained so reading never rounds through a double.
Definition jsonbourne.h:208
One object member; linked order and duplicate decoded keys are retained.
Definition jsonbourne.h:219
Ordered object members; len must exactly match the linked-list length.
Definition jsonbourne.h:226
Two-region arena shared by measurement and materialization.
Definition jsonbourne.c:122
Per-call parser state; no mutable global state or input modification is needed.
Definition jsonbourne.c:418
Optional read result; coordinates describe the parser's failure cursor.
Definition jsonbourne.h:290
One open container, replacing an equivalent recursive parser call.
Definition jsonbourne.c:438
Per-read budgets checked during validation, before a DOM is allocated.
Definition jsonbourne.h:303
Decoded UTF-8 bytes; len, not strlen(), determines the string's extent.
Definition jsonbourne.h:189
Value view followed by coordinates recorded only with TRACK_LOCATION.
Definition jsonbourne.h:259
Tagged DOM value; children and text borrow the root allocation's lifetime.
Definition jsonbourne.h:250
Suspended container traversal with constant-space sibling-cycle detection.
Definition jsonbourne.c:1193
One output sink used unchanged for measuring and writing JSON text.
Definition jsonbourne.c:1315