yyjson_val_write_opts

Function yyjson_val_write_opts 

Source
pub unsafe extern "C" fn yyjson_val_write_opts(
    val: *const yyjson_val,
    flg: yyjson_write_flag,
    alc: *const yyjson_alc,
    len: *mut usize,
    err: *mut yyjson_write_err,
) -> *mut c_char
Expand description

Write a value to JSON string with options.

This function is thread-safe when: The alc is thread-safe or NULL.

@param val The JSON root value. If this parameter is NULL, the function will fail and return NULL. @param flg The JSON write options. Multiple options can be combined with | operator. 0 means no options. @param alc The memory allocator used by JSON writer. Pass NULL to use the libc’s default allocator. @param len A pointer to receive output length in bytes (not including the null-terminator). Pass NULL if you don’t need length information. @param err A pointer to receive error information. Pass NULL if you don’t need error information. @return A new JSON string, or NULL if an error occurs. This string is encoded as UTF-8 with a null-terminator. When it’s no longer needed, it should be freed with free() or alc->free().