pub unsafe extern "C" fn yyjson_read_opts(
dat: *mut c_char,
len: usize,
flg: yyjson_read_flag,
alc: *const yyjson_alc,
err: *mut yyjson_read_err,
) -> *mut yyjson_docExpand description
Read JSON with options.
This function is thread-safe when:
- The
datis not modified by other threads. - The
alcis thread-safe or NULL.
@param dat The JSON data (UTF-8 without BOM), null-terminator is not required.
If this parameter is NULL, the function will fail and return NULL.
The dat will not be modified without the flag YYJSON_READ_INSITU, so you
can pass a const char * string and case it to char * if you don’t use
the YYJSON_READ_INSITU flag.
@param len The length of JSON data in bytes.
If this parameter is 0, the function will fail and return NULL.
@param flg The JSON read options.
Multiple options can be combined with | operator. 0 means no options.
@param alc The memory allocator used by JSON reader.
Pass NULL to use the libc’s default allocator.
@param err A pointer to receive error information.
Pass NULL if you don’t need error information.
@return A new JSON document, or NULL if an error occurs.
When it’s no longer needed, it should be freed with yyjson_doc_free().