yyjson_mut_write_opts

Function yyjson_mut_write_opts 

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

Write a document to JSON string with options.

This function is thread-safe when:

  1. The doc is not modified by other threads.
  2. The alc is thread-safe or NULL.

@param doc The mutable JSON document. If this doc is NULL or has no root, the function will fail and return false. @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().