Crate yyjson_sys

Crate yyjson_sys 

Source

Structs§

_G_fpos64_t
_G_fpos_t
_IO_FILE
_IO_codecvt
_IO_marker
_IO_wide_data
__fsid_t
__locale_data
__locale_struct
__mbstate_t
__pthread_cond_s
__pthread_cond_s__bindgen_ty_1__bindgen_ty_1
__pthread_cond_s__bindgen_ty_2__bindgen_ty_1
__pthread_internal_list
__pthread_internal_slist
__pthread_mutex_s
__pthread_rwlock_arch_t
__sigset_t
__va_list_tag
div_t
drand48_data
fd_set
ldiv_t
lldiv_t
max_align_t
random_data
timespec
timeval
yyjson_alc
A memory allocator.
yyjson_arr_iter
A JSON array iterator.
yyjson_doc
yyjson_mut_arr_iter
A mutable JSON array iterator.
yyjson_mut_doc
yyjson_mut_obj_iter
A mutable JSON object iterator.
yyjson_mut_val
Mutable JSON value, 24 bytes. The ‘tag’ and ‘uni’ field is same as immutable value. The ‘next’ field links all elements inside the container to be a cycle.
yyjson_obj_iter
A JSON object iterator.
yyjson_read_err
Error information for JSON reader.
yyjson_str_chunk
A memory chunk in string memory pool.
yyjson_str_pool
A memory pool to hold all strings in a mutable document.
yyjson_val
Immutable JSON value, 16 bytes.
yyjson_val_chunk
A memory chunk in value memory pool. sizeof(yyjson_val_chunk) should not larger than sizeof(yyjson_mut_val).
yyjson_val_pool
A memory pool to hold all values in a mutable document.
yyjson_write_err
Error information for JSON writer.

Constants§

AIO_PRIO_DELTA_MAX
ARG_MAX
BC_BASE_MAX
BC_DIM_MAX
BC_SCALE_MAX
BC_STRING_MAX
BIG_ENDIAN
BUFSIZ
BYTE_ORDER
CHARCLASS_NAME_MAX
COLL_WEIGHTS_MAX
DELAYTIMER_MAX
EOF
EXIT_FAILURE
EXIT_SUCCESS
EXPR_NEST_MAX
FD_SETSIZE
FILENAME_MAX
FOPEN_MAX
HOST_NAME_MAX
INT8_MAX
INT8_MIN
INT16_MAX
INT16_MIN
INT32_MAX
INT32_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST8_MAX
INT_FAST8_MIN
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST32_MAX
INT_FAST32_MIN
INT_LEAST8_MAX
INT_LEAST8_MIN
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST32_MAX
INT_LEAST32_MIN
LINE_MAX
LINK_MAX
LITTLE_ENDIAN
LOGIN_NAME_MAX
L_ctermid
L_tmpnam
MAX_CANON
MAX_INPUT
MB_LEN_MAX
MQ_PRIO_MAX
NAME_MAX
NGROUPS_MAX
NR_OPEN
PATH_MAX
PDP_ENDIAN
PIPE_BUF
PTHREAD_DESTRUCTOR_ITERATIONS
PTHREAD_KEYS_MAX
PTHREAD_STACK_MIN
PTRDIFF_MAX
PTRDIFF_MIN
P_tmpdir
RAND_MAX
RE_DUP_MAX
RTSIG_MAX
SEEK_CUR
SEEK_END
SEEK_SET
SEM_VALUE_MAX
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIZE_MAX
TMP_MAX
TTY_NAME_MAX
UINT8_MAX
UINT16_MAX
UINT32_MAX
UINTPTR_MAX
UINT_FAST8_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_LEAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
WCONTINUED
WEXITED
WINT_MAX
WINT_MIN
WNOHANG
WNOWAIT
WSTOPPED
WUNTRACED
XATTR_LIST_MAX
XATTR_NAME_MAX
XATTR_SIZE_MAX
YYJSON_CPP_VER
YYJSON_HAS_CONSTANT_P
YYJSON_IS_REAL_GCC
YYJSON_MSC_VER
YYJSON_PADDING_SIZE
YYJSON_READ_ALLOW_COMMENTS
Allow C-style single line and multiple line comments (non-standard).
YYJSON_READ_ALLOW_INF_AND_NAN
Allow inf/nan number and literal, case-insensitive, such as 1e999, NaN, inf, -Infinity (non-standard).
YYJSON_READ_ALLOW_INVALID_UNICODE
Allow reading invalid unicode when parsing string values (non-standard). Invalid characters will be allowed to appear in the string values, but invalid escape sequences will still be reported as errors. This flag does not affect the performance of correctly encoded strings.
YYJSON_READ_ALLOW_TRAILING_COMMAS
Allow single trailing comma at the end of an object or array, such as [1,2,3,], {"a":1,"b":2,} (non-standard).
YYJSON_READ_BIGNUM_AS_RAW
Read big numbers as raw strings. These big numbers include integers that cannot be represented by int64_t and uint64_t, and floating-point numbers that cannot be represented by finite double. The flag will be overridden by YYJSON_READ_NUMBER_AS_RAW flag.
YYJSON_READ_ERROR_EMPTY_CONTENT
Input JSON string is empty.
YYJSON_READ_ERROR_FILE_OPEN
Failed to open a file.
YYJSON_READ_ERROR_FILE_READ
Failed to read a file.
YYJSON_READ_ERROR_INVALID_COMMENT
Invalid comment, such as unclosed multi-line comment.
YYJSON_READ_ERROR_INVALID_NUMBER
Invalid number, such as 123.e12, 000.
YYJSON_READ_ERROR_INVALID_PARAMETER
Invalid parameter, such as NULL input string or 0 input length.
YYJSON_READ_ERROR_INVALID_STRING
Invalid string, such as invalid escaped character inside a string.
YYJSON_READ_ERROR_JSON_STRUCTURE
Invalid JSON structure, such as [1,].
YYJSON_READ_ERROR_LITERAL
Invalid JSON literal, such as truu.
YYJSON_READ_ERROR_MEMORY_ALLOCATION
Memory allocation failure occurs.
YYJSON_READ_ERROR_UNEXPECTED_CHARACTER
Unexpected character inside the document, such as [abc].
YYJSON_READ_ERROR_UNEXPECTED_CONTENT
Unexpected content after document, such as [123]abc.
YYJSON_READ_ERROR_UNEXPECTED_END
Unexpected ending, such as [123.
YYJSON_READ_INSITU
Read the input data in-situ. This option allows the reader to modify and use input data to store string values, which can increase reading speed slightly. The caller should hold the input data before free the document. The input data must be padded by at least YYJSON_PADDING_SIZE bytes. For example: [1,2] should be [1,2]\0\0\0\0, input length should be 5.
YYJSON_READ_NOFLAG
Default option (RFC 8259 compliant):
YYJSON_READ_NUMBER_AS_RAW
Read all numbers as raw strings (value with YYJSON_TYPE_RAW type), inf/nan literal is also read as raw with ALLOW_INF_AND_NAN flag.
YYJSON_READ_STOP_WHEN_DONE
Stop when done instead of issuing an error if there’s additional content after a JSON document. This option may be used to parse small pieces of JSON in larger data, such as NDJSON.
YYJSON_READ_SUCCESS
Success, no error.
YYJSON_U64_TO_F64_NO_IMPL
YYJSON_VERSION_HEX
YYJSON_VERSION_MAJOR
YYJSON_VERSION_MINOR
YYJSON_VERSION_PATCH
YYJSON_VERSION_STRING
YYJSON_WRITE_ALLOW_INF_AND_NAN
Write inf and nan number as ‘Infinity’ and ‘NaN’ literal (non-standard).
YYJSON_WRITE_ALLOW_INVALID_UNICODE
Allow invalid unicode when encoding string values (non-standard). Invalid characters in string value will be copied byte by byte. If YYJSON_WRITE_ESCAPE_UNICODE flag is also set, invalid character will be escaped as U+FFFD (replacement character). This flag does not affect the performance of correctly encoded strings.
YYJSON_WRITE_ERROR_FILE_OPEN
Failed to open a file.
YYJSON_WRITE_ERROR_FILE_WRITE
Failed to write a file.
YYJSON_WRITE_ERROR_INVALID_PARAMETER
Invalid parameter, such as NULL document.
YYJSON_WRITE_ERROR_INVALID_STRING
Invalid unicode in string.
YYJSON_WRITE_ERROR_INVALID_VALUE_TYPE
Invalid value type in JSON document.
YYJSON_WRITE_ERROR_MEMORY_ALLOCATION
Memory allocation failure occurs.
YYJSON_WRITE_ERROR_NAN_OR_INF
NaN or Infinity number occurs.
YYJSON_WRITE_ESCAPE_SLASHES
Escape ‘/’ as ‘/’.
YYJSON_WRITE_ESCAPE_UNICODE
Escape unicode as uXXXX, make the output ASCII only.
YYJSON_WRITE_FP_FLAG_BITS
YYJSON_WRITE_FP_PREC_BITS
YYJSON_WRITE_INF_AND_NAN_AS_NULL
Write inf and nan number as null literal. This flag will override YYJSON_WRITE_ALLOW_INF_AND_NAN flag.
YYJSON_WRITE_NEWLINE_AT_END
Adds a newline character \n at the end of the JSON. This can be helpful for text editors or NDJSON.
YYJSON_WRITE_NOFLAG
Default option:
YYJSON_WRITE_PRETTY
Write JSON pretty with 4 space indent.
YYJSON_WRITE_PRETTY_TWO_SPACES
Write JSON pretty with 2 space indent. This flag will override YYJSON_WRITE_PRETTY flag.
YYJSON_WRITE_SUCCESS
Success, no error.
_ALLOCA_H
_ATFILE_SOURCE
_BITS_BYTESWAP_H
_BITS_ENDIANNESS_H
_BITS_ENDIAN_H
_BITS_POSIX1_LIM_H
_BITS_POSIX2_LIM_H
_BITS_PTHREADTYPES_ARCH_H
_BITS_PTHREADTYPES_COMMON_H
_BITS_STDINT_INTN_H
_BITS_STDINT_UINTN_H
_BITS_STDIO_LIM_H
_BITS_TIME64_H
_BITS_TYPESIZES_H
_BITS_TYPES_H
_BITS_TYPES_LOCALE_T_H
_BITS_TYPES___LOCALE_T_H
_BITS_UINTN_IDENTITY_H
_BITS_WCHAR_H
_DEFAULT_SOURCE
_ENDIAN_H
_FEATURES_H
_IOFBF
_IOLBF
_IONBF
_IO_EOF_SEEN
_IO_ERR_SEEN
_IO_USER_LOCK
_LIBC_LIMITS_H_
_POSIX2_BC_BASE_MAX
_POSIX2_BC_DIM_MAX
_POSIX2_BC_SCALE_MAX
_POSIX2_BC_STRING_MAX
_POSIX2_CHARCLASS_NAME_MAX
_POSIX2_COLL_WEIGHTS_MAX
_POSIX2_EXPR_NEST_MAX
_POSIX2_LINE_MAX
_POSIX2_RE_DUP_MAX
_POSIX_AIO_LISTIO_MAX
_POSIX_AIO_MAX
_POSIX_ARG_MAX
_POSIX_CHILD_MAX
_POSIX_CLOCKRES_MIN
_POSIX_C_SOURCE
_POSIX_DELAYTIMER_MAX
_POSIX_HOST_NAME_MAX
_POSIX_LINK_MAX
_POSIX_LOGIN_NAME_MAX
_POSIX_MAX_CANON
_POSIX_MAX_INPUT
_POSIX_MQ_OPEN_MAX
_POSIX_MQ_PRIO_MAX
_POSIX_NAME_MAX
_POSIX_NGROUPS_MAX
_POSIX_OPEN_MAX
_POSIX_PATH_MAX
_POSIX_PIPE_BUF
_POSIX_RE_DUP_MAX
_POSIX_RTSIG_MAX
_POSIX_SEM_NSEMS_MAX
_POSIX_SEM_VALUE_MAX
_POSIX_SIGQUEUE_MAX
_POSIX_SOURCE
_POSIX_SSIZE_MAX
_POSIX_STREAM_MAX
_POSIX_SYMLINK_MAX
_POSIX_SYMLOOP_MAX
_POSIX_THREAD_DESTRUCTOR_ITERATIONS
_POSIX_THREAD_KEYS_MAX
_POSIX_THREAD_THREADS_MAX
_POSIX_TIMER_MAX
_POSIX_TTY_NAME_MAX
_POSIX_TZNAME_MAX
_STDC_PREDEF_H
_STDINT_H
_STDIO_H
_STDLIB_H
_STRINGS_H
_STRING_H
_STRUCT_TIMESPEC
_SYS_CDEFS_H
_SYS_SELECT_H
_SYS_TYPES_H
_THREAD_MUTEX_INTERNAL_H
_THREAD_SHARED_TYPES_H
__BIG_ENDIAN
__BIT_TYPES_DEFINED__
__BYTE_ORDER
__ENUM_IDTYPE_T
__FD_SETSIZE
__FD_ZERO_STOS
__FILE_defined
__FLOAT_WORD_ORDER
__GLIBC_MINOR__
__GLIBC_USE_DEPRECATED_GETS
__GLIBC_USE_DEPRECATED_SCANF
__GLIBC_USE_IEC_60559_BFP_EXT
__GLIBC_USE_IEC_60559_BFP_EXT_C2X
__GLIBC_USE_IEC_60559_FUNCS_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
__GLIBC_USE_IEC_60559_TYPES_EXT
__GLIBC_USE_ISOC2X
__GLIBC_USE_LIB_EXT2
__GLIBC__
__GNUC_VA_LIST
__GNU_LIBRARY__
__HAVE_DISTINCT_FLOAT16
__HAVE_DISTINCT_FLOAT32
__HAVE_DISTINCT_FLOAT64
__HAVE_DISTINCT_FLOAT32X
__HAVE_DISTINCT_FLOAT64X
__HAVE_DISTINCT_FLOAT128
__HAVE_DISTINCT_FLOAT128X
__HAVE_FLOAT16
__HAVE_FLOAT32
__HAVE_FLOAT64
__HAVE_FLOAT32X
__HAVE_FLOAT64X
__HAVE_FLOAT64X_LONG_DOUBLE
__HAVE_FLOAT128
__HAVE_FLOAT128X
__HAVE_FLOATN_NOT_TYPEDEF
__HAVE_GENERIC_SELECTION
__INO_T_MATCHES_INO64_T
__LITTLE_ENDIAN
__LONG_DOUBLE_USES_FLOAT128
__OFF_T_MATCHES_OFF64_T
__PDP_ENDIAN
__PTHREAD_MUTEX_HAVE_PREV
__RLIM_T_MATCHES_RLIM64_T
__SIZEOF_PTHREAD_ATTR_T
__SIZEOF_PTHREAD_BARRIERATTR_T
__SIZEOF_PTHREAD_BARRIER_T
__SIZEOF_PTHREAD_CONDATTR_T
__SIZEOF_PTHREAD_COND_T
__SIZEOF_PTHREAD_MUTEXATTR_T
__SIZEOF_PTHREAD_MUTEX_T
__SIZEOF_PTHREAD_RWLOCKATTR_T
__SIZEOF_PTHREAD_RWLOCK_T
__STATFS_MATCHES_STATFS64
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_ISO_10646__
__SYSCALL_WORDSIZE
__TIMESIZE
__USE_ATFILE
__USE_FORTIFY_LEVEL
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_POSIX_IMPLICITLY
__USE_XOPEN2K
__USE_XOPEN2K8
__WALL
__WCLONE
__WCOREFLAG
__WNOTHREAD
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
__W_CONTINUED
____FILE_defined
_____fpos64_t_defined
_____fpos_t_defined
____mbstate_t_defined
__bool_true_false_are_defined
__clock_t_defined
__clockid_t_defined
__glibc_c99_flexarr_available
__have_pthread_attr_t
__ldiv_t_defined
__lldiv_t_defined
__sigset_t_defined
__struct_FILE_defined
__time_t_defined
__timer_t_defined
__timeval_defined
false_
idtype_t_P_ALL
idtype_t_P_PGID
idtype_t_P_PID
true_

Statics§

stderr
stdin
stdout
sys_errlist
sys_nerr

Functions§

_Exit
__bswap_16
__bswap_32
__bswap_64
__ctype_get_mb_cur_max
__getdelim
__overflow
__stpcpy
__stpncpy
__strtok_r
__uflow
__uint16_identity
__uint32_identity
__uint64_identity
a64l
abort
abs
aligned_alloc
alloca
at_quick_exit
atexit
atof
atoi
atol
atoll
bcmp
bcopy
bsearch
bzero
calloc
clearenv
clearerr
clearerr_unlocked
ctermid
div
dprintf
drand48
drand48_r
ecvt
ecvt_r
erand48
erand48_r
exit
explicit_bzero
fclose
fcvt
fcvt_r
fdopen
feof
feof_unlocked
ferror
ferror_unlocked
fflush
fflush_unlocked
ffs
ffsl
ffsll
fgetc
fgetc_unlocked
fgetpos
fgets
fileno
fileno_unlocked
flockfile
fmemopen
fopen
fprintf
fputc
fputc_unlocked
fputs
fread
fread_unlocked
free
freopen
fscanf
fscanf1
fseek
fseeko
fsetpos
ftell
ftello
ftrylockfile
funlockfile
fwrite
fwrite_unlocked
gcvt
getc
getc_unlocked
getchar
getchar_unlocked
getdelim
getenv
getline
getloadavg
getsubopt
getw
index
initstate
initstate_r
jrand48
jrand48_r
l64a
labs
lcong48
lcong48_r
ldiv
llabs
lldiv
lrand48
lrand48_r
malloc
mblen
mbstowcs
mbtowc
memccpy
memchr
memcmp
memcpy
memmove
memset
mkdtemp
mkstemp
mkstemps
mktemp
mrand48
mrand48_r
nrand48
nrand48_r
on_exit
open_memstream
pclose
perror
popen
posix_memalign
printf
pselect
putc
putc_unlocked
putchar
putchar_unlocked
putenv
puts
putw
qecvt
qecvt_r
qfcvt
qfcvt_r
qgcvt
qsort
quick_exit
rand
rand_r
random
random_r
realloc
reallocarray
realpath
remove
rename
renameat
rewind
rindex
rpmatch
scanf
scanf1
seed48
seed48_r
select
setbuf
setbuffer
setenv
setlinebuf
setstate
setstate_r
setvbuf
snprintf
sprintf
srand
srand48
srand48_r
srandom
srandom_r
sscanf
sscanf1
stpcpy
stpncpy
strcasecmp
strcasecmp_l
strcat
strchr
strcmp
strcoll
strcoll_l
strcpy
strcspn
strdup
strerror
strerror_l
strerror_r
strlen
strncasecmp
strncasecmp_l
strncat
strncmp
strncpy
strndup
strnlen
strpbrk
strrchr
strsep
strsignal
strspn
strstr
strtod
strtof
strtok
strtok_r
strtol
strtold
strtoll
strtoq
strtoul
strtoull
strtouq
strxfrm
strxfrm_l
system
tempnam
tmpfile
tmpnam
tmpnam_r
ungetc
unsafe_yyjson_arr_is_flat
unsafe_yyjson_equals
unsafe_yyjson_equals_str
unsafe_yyjson_equals_strn
unsafe_yyjson_get_bool
unsafe_yyjson_get_first
unsafe_yyjson_get_int
unsafe_yyjson_get_len
unsafe_yyjson_get_next
unsafe_yyjson_get_num
unsafe_yyjson_get_raw
unsafe_yyjson_get_real
unsafe_yyjson_get_sint
unsafe_yyjson_get_str
unsafe_yyjson_get_subtype
unsafe_yyjson_get_tag
unsafe_yyjson_get_type
unsafe_yyjson_get_uint
unsafe_yyjson_inc_len
unsafe_yyjson_is_arr
unsafe_yyjson_is_bool
unsafe_yyjson_is_ctn
unsafe_yyjson_is_false
unsafe_yyjson_is_int
unsafe_yyjson_is_null
unsafe_yyjson_is_num
unsafe_yyjson_is_obj
unsafe_yyjson_is_raw
unsafe_yyjson_is_real
unsafe_yyjson_is_sint
unsafe_yyjson_is_str
unsafe_yyjson_is_str_noesc
unsafe_yyjson_is_true
unsafe_yyjson_is_uint
unsafe_yyjson_mut_equals
unsafe_yyjson_mut_obj_add
unsafe_yyjson_mut_obj_remove
unsafe_yyjson_mut_obj_replace
unsafe_yyjson_mut_obj_rotate
unsafe_yyjson_mut_str_alc
unsafe_yyjson_mut_strncpy
unsafe_yyjson_mut_val
unsafe_yyjson_set_arr
unsafe_yyjson_set_bool
unsafe_yyjson_set_double
unsafe_yyjson_set_float
unsafe_yyjson_set_fp_to_fixed
unsafe_yyjson_set_fp_to_float
unsafe_yyjson_set_len
unsafe_yyjson_set_null
unsafe_yyjson_set_obj
unsafe_yyjson_set_raw
unsafe_yyjson_set_real
unsafe_yyjson_set_sint
unsafe_yyjson_set_str
unsafe_yyjson_set_str_noesc
unsafe_yyjson_set_strn
unsafe_yyjson_set_tag
unsafe_yyjson_set_type
unsafe_yyjson_set_uint
unsafe_yyjson_str_pool_grow
unsafe_yyjson_u64_to_f64
unsafe_yyjson_val_pool_grow
unsetenv
valloc
vdprintf
vfprintf
vfscanf
vfscanf1
vprintf
vscanf
vscanf1
vsnprintf
vsprintf
vsscanf
vsscanf1
wcstombs
wctomb
yyjson_alc_dyn_free
Free a dynamic allocator which is created by yyjson_alc_dyn_new(). @param alc The dynamic allocator to be destroyed.
yyjson_alc_dyn_new
A dynamic allocator.
yyjson_alc_pool_init
A pool allocator uses fixed length pre-allocated memory.
yyjson_arr_get
Returns the element at the specified position in this array. Returns NULL if array is NULL/empty or the index is out of bounds. @warning This function takes a linear search time if array is not flat. For example: [1,{},3] is flat, [1,[2],3] is not flat.
yyjson_arr_get_first
Returns the first element of this array. Returns NULL if arr is NULL/empty or type is not array.
yyjson_arr_get_last
Returns the last element of this array. Returns NULL if arr is NULL/empty or type is not array. @warning This function takes a linear search time if array is not flat. For example: [1,{},3] is flat, [1,[2],3] is not flat.
yyjson_arr_iter_has_next
Returns whether the iteration has more elements. If iter is NULL, this function will return false.
yyjson_arr_iter_init
Initialize an iterator for this array.
yyjson_arr_iter_next
Returns the next element in the iteration, or NULL on end. If iter is NULL, this function will return NULL.
yyjson_arr_iter_with
Create an iterator with an array , same as yyjson_arr_iter_init().
yyjson_arr_size
Returns the number of elements in this array. Returns 0 if arr is NULL or type is not array.
yyjson_doc_free
Release the JSON document and free the memory. After calling this function, the doc and all values from the doc are no longer available. This function will do nothing if the doc is NULL.
yyjson_doc_get_read_size
Returns read size of input JSON data. Returns 0 if doc is NULL. For example: the read size of [1,2,3] is 7 bytes.
yyjson_doc_get_root
Returns the root value of this JSON document. Returns NULL if doc is NULL.
yyjson_doc_get_val_count
Returns total value count in this JSON document. Returns 0 if doc is NULL. For example: the value count of [1,2,3] is 4.
yyjson_doc_mut_copy
Copies and returns a new mutable document from input, returns NULL on error. This makes a deep-copy on the immutable document. If allocator is NULL, the default allocator will be used. @note imut_doc -> mut_doc.
yyjson_equals
Returns whether two JSON values are equal (deep compare). Returns false if input is NULL. @note the result may be inaccurate if object has duplicate keys. @warning This function is recursive and may cause a stack overflow if the object level is too deep.
yyjson_equals_str
Returns whether the JSON value is equals to a string. Returns false if input is NULL or type is not string.
yyjson_equals_strn
Returns whether the JSON value is equals to a string. The str should be a UTF-8 string, null-terminator is not required. Returns false if input is NULL or type is not string.
yyjson_get_bool
Returns the content if the value is bool. Returns NULL if val is NULL or type is not bool.
yyjson_get_int
Returns the content and cast to int. Returns 0 if val is NULL or type is not integer(sint/uint).
yyjson_get_len
Returns the content length (string length, array size, object size. Returns 0 if val is NULL or type is not string/array/object.
yyjson_get_num
Returns the content and typecast to double if the value is number. Returns 0.0 if val is NULL or type is not number(uint/sint/real).
yyjson_get_raw
Returns the content if the value is raw. Returns NULL if val is NULL or type is not raw.
yyjson_get_real
Returns the content if the value is real number, or 0.0 on error. Returns 0.0 if val is NULL or type is not real(double).
yyjson_get_sint
Returns the content and cast to int64_t. Returns 0 if val is NULL or type is not integer(sint/uint).
yyjson_get_str
Returns the content if the value is string. Returns NULL if val is NULL or type is not string.
yyjson_get_subtype
Returns the JSON value’s subtype. Returns YYJSON_SUBTYPE_NONE if val is NULL.
yyjson_get_tag
Returns the JSON value’s tag. Returns 0 if val is NULL.
yyjson_get_type
Returns the JSON value’s type. Returns YYJSON_TYPE_NONE if val is NULL.
yyjson_get_type_desc
Returns the JSON value’s type description. The return value should be one of these strings: “raw”, “null”, “string”, “array”, “object”, “true”, “false”, “uint”, “sint”, “real”, “unknown”.
yyjson_get_uint
Returns the content and cast to uint64_t. Returns 0 if val is NULL or type is not integer(sint/uint).
yyjson_is_arr
Returns whether the JSON value is array. Returns false if val is NULL.
yyjson_is_bool
Returns whether the JSON value is bool (true/false). Returns false if val is NULL.
yyjson_is_ctn
Returns whether the JSON value is container (array/object). Returns false if val is NULL.
yyjson_is_false
Returns whether the JSON value is false. Returns false if val is NULL.
yyjson_is_int
Returns whether the JSON value is integer (uint64_t/int64_t). Returns false if val is NULL.
yyjson_is_null
Returns whether the JSON value is null. Returns false if val is NULL.
yyjson_is_num
Returns whether the JSON value is number (uint64_t/int64_t/double). Returns false if val is NULL.
yyjson_is_obj
Returns whether the JSON value is object. Returns false if val is NULL.
yyjson_is_raw
Returns whether the JSON value is raw. Returns false if val is NULL.
yyjson_is_real
Returns whether the JSON value is real number (double). Returns false if val is NULL.
yyjson_is_sint
Returns whether the JSON value is signed integer (int64_t). Returns false if val is NULL.
yyjson_is_str
Returns whether the JSON value is string. Returns false if val is NULL.
yyjson_is_true
Returns whether the JSON value is true. Returns false if val is NULL.
yyjson_is_uint
Returns whether the JSON value is unsigned integer (uint64_t). Returns false if val is NULL.
yyjson_locate_pos
Locate the line and column number for a byte position in a string. This can be used to get better description for error position.
yyjson_mut_arr
Creates and returns an empty mutable array. @param doc A mutable document, used for memory allocation only. @return The new array. NULL if input is NULL or memory allocation failed.
yyjson_mut_arr_add_arr
Creates and adds a new array at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @return The new array, or NULL on error.
yyjson_mut_arr_add_bool
Adds a bool value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param val The bool value to be added. @return Whether successful.
yyjson_mut_arr_add_double
Adds a double value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param num The number to be added. @return Whether successful.
yyjson_mut_arr_add_false
Adds a false value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @return Whether successful.
yyjson_mut_arr_add_float
Adds a float value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param num The number to be added. @return Whether successful.
yyjson_mut_arr_add_int
Adds an integer value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param num The number to be added. @return Whether successful.
yyjson_mut_arr_add_null
Adds a null value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @return Whether successful.
yyjson_mut_arr_add_obj
Creates and adds a new object at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @return The new object, or NULL on error.
yyjson_mut_arr_add_real
Adds a double value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param num The number to be added. @return Whether successful.
yyjson_mut_arr_add_sint
Adds a signed integer value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param num The number to be added. @return Whether successful.
yyjson_mut_arr_add_str
Adds a string value at the end of the array (no copy). @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param str A null-terminated UTF-8 string. @return Whether successful. @warning The input string is not copied, you should keep this string unmodified for the lifetime of this JSON document.
yyjson_mut_arr_add_strcpy
Adds a string value at the end of the array (copied). @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param str A null-terminated UTF-8 string. @return Whether successful.
yyjson_mut_arr_add_strn
Adds a string value at the end of the array (no copy). @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param str A UTF-8 string, null-terminator is not required. @param len The length of the string, in bytes. @return Whether successful. @warning The input string is not copied, you should keep this string unmodified for the lifetime of this JSON document.
yyjson_mut_arr_add_strncpy
Adds a string value at the end of the array (copied). @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param str A UTF-8 string, null-terminator is not required. @param len The length of the string, in bytes. @return Whether successful.
yyjson_mut_arr_add_true
Adds a true value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @return Whether successful.
yyjson_mut_arr_add_uint
Adds an unsigned integer value at the end of the array. @param doc The doc is only used for memory allocation. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param num The number to be added. @return Whether successful.
yyjson_mut_arr_add_val
Adds a value at the end of the array. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param val The value to be inserted. Returns false if it is NULL. @return Whether successful.
yyjson_mut_arr_append
Inserts a value at the end of the array. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param val The value to be inserted. Returns false if it is NULL. @return Whether successful.
yyjson_mut_arr_clear
Removes all values in this array. @param arr The array from which all of the values are to be removed. Returns false if it is NULL or not an array. @return Whether successful.
yyjson_mut_arr_get
Returns the element at the specified position in this array. Returns NULL if array is NULL/empty or the index is out of bounds. @warning This function takes a linear search time.
yyjson_mut_arr_get_first
Returns the first element of this array. Returns NULL if arr is NULL/empty or type is not array.
yyjson_mut_arr_get_last
Returns the last element of this array. Returns NULL if arr is NULL/empty or type is not array.
yyjson_mut_arr_insert
Inserts a value into an array at a given index. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param val The value to be inserted. Returns false if it is NULL. @param idx The index to which to insert the new value. Returns false if the index is out of range. @return Whether successful. @warning This function takes a linear search time.
yyjson_mut_arr_iter_has_next
Returns whether the iteration has more elements. If iter is NULL, this function will return false.
yyjson_mut_arr_iter_init
Initialize an iterator for this array.
yyjson_mut_arr_iter_next
Returns the next element in the iteration, or NULL on end. If iter is NULL, this function will return NULL.
yyjson_mut_arr_iter_remove
Removes and returns current element in the iteration. If iter is NULL, this function will return NULL.
yyjson_mut_arr_iter_with
Create an iterator with an array , same as yyjson_mut_arr_iter_init().
yyjson_mut_arr_prepend
Inserts a value at the head of the array. @param arr The array to which the value is to be inserted. Returns false if it is NULL or not an array. @param val The value to be inserted. Returns false if it is NULL. @return Whether successful.
yyjson_mut_arr_remove
Removes and returns a value at index. @param arr The array from which the value is to be removed. Returns false if it is NULL or not an array. @param idx The index from which to remove the value. Returns false if the index is out of range. @return Old value, or NULL on error. @warning This function takes a linear search time.
yyjson_mut_arr_remove_first
Removes and returns the first value in this array. @param arr The array from which the value is to be removed. Returns false if it is NULL or not an array. @return The first value, or NULL on error.
yyjson_mut_arr_remove_last
Removes and returns the last value in this array. @param arr The array from which the value is to be removed. Returns false if it is NULL or not an array. @return The last value, or NULL on error.
yyjson_mut_arr_remove_range
Removes all values within a specified range in the array. @param arr The array from which the value is to be removed. Returns false if it is NULL or not an array. @param idx The start index of the range (0 is the first). @param len The number of items in the range (can be 0). @return Whether successful. @warning This function takes a linear search time.
yyjson_mut_arr_replace
Replaces a value at index and returns old value. @param arr The array to which the value is to be replaced. Returns false if it is NULL or not an array. @param idx The index to which to replace the value. Returns false if the index is out of range. @param val The new value to replace. Returns false if it is NULL. @return Old value, or NULL on error. @warning This function takes a linear search time.
yyjson_mut_arr_rotate
Rotates values in this array for the given number of times. For example: [1,2,3,4,5] rotate 2 is [3,4,5,1,2]. @param arr The array to be rotated. @param idx Index (or times) to rotate. @warning This function takes a linear search time.
yyjson_mut_arr_size
Returns the number of elements in this array. Returns 0 if arr is NULL or type is not array.
yyjson_mut_arr_with_bool
Creates and returns a new mutable array with the given boolean values.
yyjson_mut_arr_with_double
Creates and returns a new mutable array with the given double numbers.
yyjson_mut_arr_with_float
Creates and returns a new mutable array with the given float numbers.
yyjson_mut_arr_with_real
Creates and returns a new mutable array with the given real numbers.
yyjson_mut_arr_with_sint
Creates and returns a new mutable array with the given sint numbers.
yyjson_mut_arr_with_sint8
Creates and returns a new mutable array with the given int8 numbers.
yyjson_mut_arr_with_sint16
Creates and returns a new mutable array with the given int16 numbers.
yyjson_mut_arr_with_sint32
Creates and returns a new mutable array with the given int32 numbers.
yyjson_mut_arr_with_sint64
Creates and returns a new mutable array with the given int64 numbers.
yyjson_mut_arr_with_str
Creates and returns a new mutable array with the given strings, these strings will not be copied.
yyjson_mut_arr_with_strcpy
Creates and returns a new mutable array with the given strings, these strings will be copied.
yyjson_mut_arr_with_strn
Creates and returns a new mutable array with the given strings and string lengths, these strings will not be copied.
yyjson_mut_arr_with_strncpy
Creates and returns a new mutable array with the given strings and string lengths, these strings will be copied.
yyjson_mut_arr_with_uint
Creates and returns a new mutable array with the given uint numbers.
yyjson_mut_arr_with_uint8
Creates and returns a new mutable array with the given uint8 numbers.
yyjson_mut_arr_with_uint16
Creates and returns a new mutable array with the given uint16 numbers.
yyjson_mut_arr_with_uint32
Creates and returns a new mutable array with the given uint32 numbers.
yyjson_mut_arr_with_uint64
Creates and returns a new mutable array with the given uint64 numbers.
yyjson_mut_bool
Creates and returns a bool value, returns NULL on error.
yyjson_mut_doc_free
Release the JSON document and free the memory. After calling this function, the doc and all values from the doc are no longer available. This function will do nothing if the doc is NULL.
yyjson_mut_doc_get_root
Returns the root value of this JSON document. Returns NULL if doc is NULL.
yyjson_mut_doc_imut_copy
Copies and returns a new immutable document from input, returns NULL on error. This makes a deep-copy on the mutable document. The returned document should be freed with yyjson_doc_free(). @note mut_doc -> imut_doc. @warning This function is recursive and may cause a stack overflow if the object level is too deep.
yyjson_mut_doc_mut_copy
Copies and returns a new mutable document from input, returns NULL on error. This makes a deep-copy on the mutable document. If allocator is NULL, the default allocator will be used. @note mut_doc -> mut_doc.
yyjson_mut_doc_new
Creates and returns a new mutable JSON document, returns NULL on error. If allocator is NULL, the default allocator will be used.
yyjson_mut_doc_set_root
Sets the root value of this JSON document. Pass NULL to clear root value of the document.
yyjson_mut_doc_set_str_pool_size
Set the string pool size for a mutable document. This function does not allocate memory immediately, but uses the size when the next memory allocation is needed.
yyjson_mut_doc_set_val_pool_size
Set the value pool size for a mutable document. This function does not allocate memory immediately, but uses the size when the next memory allocation is needed.
yyjson_mut_double
Creates and returns a double number value, returns NULL on error.
yyjson_mut_equals
Returns whether two JSON values are equal (deep compare). Returns false if input is NULL. @note the result may be inaccurate if object has duplicate keys. @warning This function is recursive and may cause a stack overflow if the object level is too deep.
yyjson_mut_equals_str
Returns whether the JSON value is equals to a string. The str should be a null-terminated UTF-8 string. Returns false if input is NULL or type is not string.
yyjson_mut_equals_strn
Returns whether the JSON value is equals to a string. The str should be a UTF-8 string, null-terminator is not required. Returns false if input is NULL or type is not string.
yyjson_mut_false
Creates and returns a false value, returns NULL on error.
yyjson_mut_float
Creates and returns a float number value, returns NULL on error.
yyjson_mut_get_bool
Returns the content if the value is bool. Returns NULL if val is NULL or type is not bool.
yyjson_mut_get_int
Returns the content and cast to int. Returns 0 if val is NULL or type is not integer(sint/uint).
yyjson_mut_get_len
Returns the content length (string length, array size, object size. Returns 0 if val is NULL or type is not string/array/object.
yyjson_mut_get_num
Returns the content and typecast to double if the value is number. Returns 0.0 if val is NULL or type is not number(uint/sint/real).
yyjson_mut_get_raw
Returns the content if the value is raw. Returns NULL if val is NULL or type is not raw.
yyjson_mut_get_real
Returns the content if the value is real number. Returns 0.0 if val is NULL or type is not real(double).
yyjson_mut_get_sint
Returns the content and cast to int64_t. Returns 0 if val is NULL or type is not integer(sint/uint).
yyjson_mut_get_str
Returns the content if the value is string. Returns NULL if val is NULL or type is not string.
yyjson_mut_get_subtype
Returns the JSON value’s subtype. Returns YYJSON_SUBTYPE_NONE if val is NULL.
yyjson_mut_get_tag
Returns the JSON value’s tag. Returns 0 if val is NULL.
yyjson_mut_get_type
Returns the JSON value’s type. Returns YYJSON_TYPE_NONE if val is NULL.
yyjson_mut_get_type_desc
Returns the JSON value’s type description. The return value should be one of these strings: “raw”, “null”, “string”, “array”, “object”, “true”, “false”, “uint”, “sint”, “real”, “unknown”.
yyjson_mut_get_uint
Returns the content and cast to uint64_t. Returns 0 if val is NULL or type is not integer(sint/uint).
yyjson_mut_int
Creates and returns a signed integer value, returns NULL on error.
yyjson_mut_is_arr
Returns whether the JSON value is array. Returns false if val is NULL.
yyjson_mut_is_bool
Returns whether the JSON value is bool (true/false). Returns false if val is NULL.
yyjson_mut_is_ctn
Returns whether the JSON value is container (array/object). Returns false if val is NULL.
yyjson_mut_is_false
Returns whether the JSON value is false. Returns false if val is NULL.
yyjson_mut_is_int
Returns whether the JSON value is integer (uint64_t/int64_t). Returns false if val is NULL.
yyjson_mut_is_null
Returns whether the JSON value is null. Returns false if val is NULL.
yyjson_mut_is_num
Returns whether the JSON value is number (uint/sint/real). Returns false if val is NULL.
yyjson_mut_is_obj
Returns whether the JSON value is object. Returns false if val is NULL.
yyjson_mut_is_raw
Returns whether the JSON value is raw. Returns false if val is NULL.
yyjson_mut_is_real
Returns whether the JSON value is real number (double). Returns false if val is NULL.
yyjson_mut_is_sint
Returns whether the JSON value is signed integer (int64_t). Returns false if val is NULL.
yyjson_mut_is_str
Returns whether the JSON value is string. Returns false if val is NULL.
yyjson_mut_is_true
Returns whether the JSON value is true. Returns false if val is NULL.
yyjson_mut_is_uint
Returns whether the JSON value is unsigned integer (uint64_t). Returns false if val is NULL.
yyjson_mut_null
Creates and returns a null value, returns NULL on error.
yyjson_mut_obj
Creates and returns a mutable object, returns NULL on error.
yyjson_mut_obj_add
Adds a key-value pair at the end of the object. This function allows duplicated key in one object. @param obj The object to which the new key-value pair is to be added. @param key The key, should be a string which is created by yyjson_mut_str(), yyjson_mut_strn(), yyjson_mut_strcpy() or yyjson_mut_strncpy(). @param val The value to add to the object. @return Whether successful.
yyjson_mut_obj_add_arr
Creates and adds a new array to the target object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_bool
Adds a bool value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_double
Adds a double value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_false
Adds a false value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_float
Adds a float value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_int
Adds an int value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_null
Adds a null value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_obj
Creates and adds a new object to the target object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_real
Adds a real value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_sint
Adds a signed integer value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_str
Adds a string value at the end of the object. The key and val should be null-terminated UTF-8 strings. This function allows duplicated key in one object.
yyjson_mut_obj_add_strcpy
Adds a string value at the end of the object. The key and val should be null-terminated UTF-8 strings. The value string is copied. This function allows duplicated key in one object.
yyjson_mut_obj_add_strn
Adds a string value at the end of the object. The key should be a null-terminated UTF-8 string. The val should be a UTF-8 string, null-terminator is not required. The len should be the length of the val, in bytes. This function allows duplicated key in one object.
yyjson_mut_obj_add_strncpy
Adds a string value at the end of the object. The key should be a null-terminated UTF-8 string. The val should be a UTF-8 string, null-terminator is not required. The len should be the length of the val, in bytes. This function allows duplicated key in one object.
yyjson_mut_obj_add_true
Adds a true value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_uint
Adds an unsigned integer value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_add_val
Adds a JSON value at the end of the object. The key should be a null-terminated UTF-8 string. This function allows duplicated key in one object.
yyjson_mut_obj_clear
Removes all key-value pairs in this object. @param obj The object from which all of the values are to be removed. @return Whether successful.
yyjson_mut_obj_get
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
yyjson_mut_obj_getn
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
yyjson_mut_obj_insert
Inserts a key-value pair to the object at the given position. This function allows duplicated key in one object. @param obj The object to which the new key-value pair is to be added. @param key The key, should be a string which is created by yyjson_mut_str(), yyjson_mut_strn(), yyjson_mut_strcpy() or yyjson_mut_strncpy(). @param val The value to add to the object. @param idx The index to which to insert the new pair. @return Whether successful.
yyjson_mut_obj_iter_get
Iterates to a specified key and returns the value.
yyjson_mut_obj_iter_get_val
Returns the value for key inside the iteration. If iter is NULL, this function will return NULL.
yyjson_mut_obj_iter_getn
Iterates to a specified key and returns the value.
yyjson_mut_obj_iter_has_next
Returns whether the iteration has more elements. If iter is NULL, this function will return false.
yyjson_mut_obj_iter_init
Initialize an iterator for this object.
yyjson_mut_obj_iter_next
Returns the next key in the iteration, or NULL on end. If iter is NULL, this function will return NULL.
yyjson_mut_obj_iter_remove
Removes current key-value pair in the iteration, returns the removed value. If iter is NULL, this function will return NULL.
yyjson_mut_obj_iter_with
Create an iterator with an object, same as yyjson_obj_iter_init().
yyjson_mut_obj_put
Sets a key-value pair at the end of the object. This function may remove all key-value pairs for the given key before add. @param obj The object to which the new key-value pair is to be added. @param key The key, should be a string which is created by yyjson_mut_str(), yyjson_mut_strn(), yyjson_mut_strcpy() or yyjson_mut_strncpy(). @param val The value to add to the object. If this value is null, the behavior is same as yyjson_mut_obj_remove(). @return Whether successful.
yyjson_mut_obj_remove
Removes all key-value pair from the object with given key. @param obj The object from which the key-value pair is to be removed. @param key The key, should be a string value. @return The first matched value, or NULL if no matched value. @warning This function takes a linear search time.
yyjson_mut_obj_remove_key
Removes all key-value pair from the object with given key. @param obj The object from which the key-value pair is to be removed. @param key The key, should be a UTF-8 string with null-terminator. @return The first matched value, or NULL if no matched value. @warning This function takes a linear search time.
yyjson_mut_obj_remove_keyn
Removes all key-value pair from the object with given key. @param obj The object from which the key-value pair is to be removed. @param key The key, should be a UTF-8 string, null-terminator is not required. @param key_len The length of the key. @return The first matched value, or NULL if no matched value. @warning This function takes a linear search time.
yyjson_mut_obj_remove_str
Removes all key-value pairs for the given key. Returns the first value to which the specified key is mapped or NULL if this object contains no mapping for the key. The key should be a null-terminated UTF-8 string.
yyjson_mut_obj_remove_strn
Removes all key-value pairs for the given key. Returns the first value to which the specified key is mapped or NULL if this object contains no mapping for the key. The key should be a UTF-8 string, null-terminator is not required. The len should be the length of the key, in bytes.
yyjson_mut_obj_rename_key
Replaces all matching keys with the new key. Returns true if at least one key was renamed. The key and new_key should be a null-terminated UTF-8 string. The new_key is copied and held by doc.
yyjson_mut_obj_rename_keyn
Replaces all matching keys with the new key. Returns true if at least one key was renamed. The key and new_key should be a UTF-8 string, null-terminator is not required. The new_key is copied and held by doc.
yyjson_mut_obj_replace
Replaces value from the object with given key. If the key is not exist, or the value is NULL, it will fail. @param obj The object to which the value is to be replaced. @param key The key, should be a string value. @param val The value to replace into the object. @return Whether successful. @warning This function takes a linear search time.
yyjson_mut_obj_rotate
Rotates key-value pairs in the object for the given number of times. For example: {"a":1,"b":2,"c":3,"d":4} rotate 1 is {"b":2,"c":3,"d":4,"a":1}. @param obj The object to be rotated. @param idx Index (or times) to rotate. @return Whether successful. @warning This function takes a linear search time.
yyjson_mut_obj_size
Returns the number of key-value pairs in this object. Returns 0 if obj is NULL or type is not object.
yyjson_mut_obj_with_kv
Creates and returns a mutable object with key-value pairs and pair count, returns NULL on error. The keys and values are not copied. The strings should be a null-terminated UTF-8 string.
yyjson_mut_obj_with_str
Creates and returns a mutable object with keys and values, returns NULL on error. The keys and values are not copied. The strings should be a null-terminated UTF-8 string.
yyjson_mut_raw
Creates and returns a raw value, returns NULL on error. The str should be a null-terminated UTF-8 string.
yyjson_mut_rawcpy
Creates and returns a raw value, returns NULL on error. The str should be a null-terminated UTF-8 string. The input string is copied and held by the document.
yyjson_mut_rawn
Creates and returns a raw value, returns NULL on error. The str should be a UTF-8 string, null-terminator is not required.
yyjson_mut_rawncpy
Creates and returns a raw value, returns NULL on error. The str should be a UTF-8 string, null-terminator is not required. The input string is copied and held by the document.
yyjson_mut_read_number
Read a JSON number.
yyjson_mut_real
Creates and returns a real number value, returns NULL on error.
yyjson_mut_set_arr
Set the value to array. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_bool
Set the value to bool. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_double
Set the value to double. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_float
Set the value to float. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_fp_to_fixed
Set the floating-point number’s output format to fixed-point notation. Returns false if input is NULL or val is not real type. @see YYJSON_WRITE_FP_TO_FIXED flag. @warning This will modify the immutable value, use with caution.
yyjson_mut_set_fp_to_float
Set the floating-point number’s output format to single-precision. Returns false if input is NULL or val is not real type. @see YYJSON_WRITE_FP_TO_FLOAT flag. @warning This will modify the immutable value, use with caution.
yyjson_mut_set_int
Set the value to int. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_null
Set the value to null. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_obj
Set the value to array. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_raw
Set the value to raw. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_real
Set the value to real. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_sint
Set the value to sint. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_str
Set the value to string (null-terminated). Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_str_noesc
Marks this string as not needing to be escaped during JSON writing. This can be used to avoid the overhead of escaping if the string contains only characters that do not require escaping. Returns false if input is NULL or val is not string. @see YYJSON_SUBTYPE_NOESC subtype. @warning This will modify the immutable value, use with caution.
yyjson_mut_set_strn
Set the value to string (with length). Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_set_uint
Set the value to uint. Returns false if input is NULL. @warning This function should not be used on an existing object or array.
yyjson_mut_sint
Creates and returns a signed integer value, returns NULL on error.
yyjson_mut_str
Creates and returns a string value, returns NULL on error. The str should be a null-terminated UTF-8 string. @warning The input string is not copied, you should keep this string unmodified for the lifetime of this JSON document.
yyjson_mut_strcpy
Creates and returns a string value, returns NULL on error. The str should be a null-terminated UTF-8 string. The input string is copied and held by the document.
yyjson_mut_strn
Creates and returns a string value, returns NULL on error. The str should be a UTF-8 string, null-terminator is not required. @warning The input string is not copied, you should keep this string unmodified for the lifetime of this JSON document.
yyjson_mut_strncpy
Creates and returns a string value, returns NULL on error. The str should be a UTF-8 string, null-terminator is not required. The input string is copied and held by the document.
yyjson_mut_true
Creates and returns a true value, returns NULL on error.
yyjson_mut_uint
Creates and returns an unsigned integer value, returns NULL on error.
yyjson_mut_val_imut_copy
Copies and returns a new immutable document from input, returns NULL on error. This makes a deep-copy on the mutable value. The returned document should be freed with yyjson_doc_free(). @note mut_val -> imut_doc. @warning This function is recursive and may cause a stack overflow if the object level is too deep.
yyjson_mut_val_mut_copy
Copies and returns a new mutable value from input, returns NULL on error. This makes a deep-copy on the mutable value. The memory was managed by mutable document. @note mut_val -> mut_val. @warning This function is recursive and may cause a stack overflow if the object level is too deep.
yyjson_mut_val_write
Write a value to JSON string.
yyjson_mut_val_write_file
Write a value to JSON file with options.
yyjson_mut_val_write_fp
Write a value to JSON file with options.
yyjson_mut_val_write_opts
Write a value to JSON string with options.
yyjson_mut_write
Write a document to JSON string.
yyjson_mut_write_file
Write a document to JSON file with options.
yyjson_mut_write_fp
Write a document to file pointer with options.
yyjson_mut_write_opts
Write a document to JSON string with options.
yyjson_obj_get
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
yyjson_obj_getn
Returns the value to which the specified key is mapped. Returns NULL if this object contains no mapping for the key. Returns NULL if obj/key is NULL, or type is not object.
yyjson_obj_iter_get
Iterates to a specified key and returns the value.
yyjson_obj_iter_get_val
Returns the value for key inside the iteration. If iter is NULL, this function will return NULL.
yyjson_obj_iter_getn
Iterates to a specified key and returns the value.
yyjson_obj_iter_has_next
Returns whether the iteration has more elements. If iter is NULL, this function will return false.
yyjson_obj_iter_init
Initialize an iterator for this object.
yyjson_obj_iter_next
Returns the next key in the iteration, or NULL on end. If iter is NULL, this function will return NULL.
yyjson_obj_iter_with
Create an iterator with an object, same as yyjson_obj_iter_init().
yyjson_obj_size
Returns the number of key-value pairs in this object. Returns 0 if obj is NULL or type is not object.
yyjson_read
Read a JSON string.
yyjson_read_file
Read a JSON file.
yyjson_read_fp
Read JSON from a file pointer.
yyjson_read_max_memory_usage
Returns the size of maximum memory usage to read a JSON data.
yyjson_read_number
Read a JSON number.
yyjson_read_opts
Read JSON with options.
yyjson_set_bool
Set the value to bool. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_double
Set the value to double. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_float
Set the value to float. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_fp_to_fixed
Set the floating-point number’s output format to fixed-point notation. Returns false if input is NULL or val is not real type. @see YYJSON_WRITE_FP_TO_FIXED flag. @warning This will modify the immutable value, use with caution.
yyjson_set_fp_to_float
Set the floating-point number’s output format to single-precision. Returns false if input is NULL or val is not real type. @see YYJSON_WRITE_FP_TO_FLOAT flag. @warning This will modify the immutable value, use with caution.
yyjson_set_int
Set the value to int. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_null
Set the value to null. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_raw
Set the value to raw. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_real
Set the value to real. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_sint
Set the value to sint. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_str
Set the value to string (null-terminated). Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_str_noesc
Marks this string as not needing to be escaped during JSON writing. This can be used to avoid the overhead of escaping if the string contains only characters that do not require escaping. Returns false if input is NULL or val is not string. @see YYJSON_SUBTYPE_NOESC subtype. @warning This will modify the immutable value, use with caution.
yyjson_set_strn
Set the value to string (with length). Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_set_uint
Set the value to uint. Returns false if input is NULL or val is object or array. @warning This will modify the immutable value, use with caution.
yyjson_val_mut_copy
Copies and returns a new mutable value from input, returns NULL on error. This makes a deep-copy on the immutable value. The memory was managed by mutable document. @note imut_val -> mut_val.
yyjson_val_write
Write a value to JSON string.
yyjson_val_write_file
Write a value to JSON file with options.
yyjson_val_write_fp
Write a value to file pointer with options.
yyjson_val_write_opts
Write a value to JSON string with options.
yyjson_version
The version of yyjson in hex, same as YYJSON_VERSION_HEX.
yyjson_write
Write a document to JSON string.
yyjson_write_file
Write a document to JSON file with options.
yyjson_write_fp
Write a document to file pointer with options.
yyjson_write_opts
Write a document to JSON string with options.

Type Aliases§

FILE
_Float32
_Float64
_Float32x
_Float64x
_IO_lock_t
__FILE
__blkcnt64_t
__blkcnt_t
__blksize_t
__builtin_va_list
__caddr_t
__clock_t
__clockid_t
__compar_fn_t
__daddr_t
__dev_t
__fd_mask
__fpos64_t
__fpos_t
__fsblkcnt64_t
__fsblkcnt_t
__fsfilcnt64_t
__fsfilcnt_t
__fsword_t
__gid_t
__gnuc_va_list
__id_t
__ino64_t
__ino_t
__int8_t
__int16_t
__int32_t
__int64_t
__int_least8_t
__int_least16_t
__int_least32_t
__int_least64_t
__intmax_t
__intptr_t
__key_t
__locale_t
__loff_t
__mode_t
__nlink_t
__off64_t
__off_t
__pid_t
__pthread_list_t
__pthread_slist_t
__quad_t
__rlim64_t
__rlim_t
__sig_atomic_t
__socklen_t
__ssize_t
__suseconds_t
__syscall_slong_t
__syscall_ulong_t
__time_t
__timer_t
__u_char
__u_int
__u_long
__u_quad_t
__u_short
__uid_t
__uint8_t
__uint16_t
__uint32_t
__uint64_t
__uint_least8_t
__uint_least16_t
__uint_least32_t
__uint_least64_t
__uintmax_t
__useconds_t
blkcnt_t
blksize_t
caddr_t
clock_t
clockid_t
daddr_t
dev_t
fd_mask
fpos_t
fsblkcnt_t
fsfilcnt_t
fsid_t
gid_t
id_t
idtype_t
ino_t
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
key_t
locale_t
loff_t
mode_t
nlink_t
off_t
pid_t
pthread_key_t
pthread_once_t
pthread_spinlock_t
pthread_t
quad_t
register_t
sigset_t
suseconds_t
time_t
timer_t
u_char
u_int
u_int8_t
u_int16_t
u_int32_t
u_int64_t
u_long
u_quad_t
u_short
uid_t
uint
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t
ulong
ushort
va_list
wchar_t
yyjson_read_code
Result code for JSON reader.
yyjson_read_flag
Run-time options for JSON reader.
yyjson_subtype
Subtype of a JSON value (2 bit).
yyjson_type
Type of a JSON value (3 bit).
yyjson_write_code
Result code for JSON writer
yyjson_write_flag
Run-time options for JSON writer.

Unions§

__mbstate_t__bindgen_ty_1
__pthread_cond_s__bindgen_ty_1
__pthread_cond_s__bindgen_ty_2
pthread_attr_t
pthread_barrier_t
pthread_barrierattr_t
pthread_cond_t
pthread_condattr_t
pthread_mutex_t
pthread_mutexattr_t
pthread_rwlock_t
pthread_rwlockattr_t
yyjson_val_uni
Payload of a JSON value (8 bytes).