yyjson_mut_arr_with_str

Function yyjson_mut_arr_with_str 

Source
pub unsafe extern "C" fn yyjson_mut_arr_with_str(
    doc: *mut yyjson_mut_doc,
    vals: *mut *const c_char,
    count: usize,
) -> *mut yyjson_mut_val
Expand description

Creates and returns a new mutable array with the given strings, these strings will not be copied.

@param doc A mutable document, used for memory allocation only. If this parameter is NULL, the function will fail and return NULL. @param vals A C array of UTF-8 null-terminator strings. If this array contains NULL, the function will fail and return NULL. @param count The number of values in vals. If this value is 0, an empty array will return. @return The new array. NULL if input is invalid or memory allocation failed.

@warning The input strings are not copied, you should keep these strings unmodified for the lifetime of this JSON document. If these strings will be modified, you should use yyjson_mut_arr_with_strcpy() instead.

@par Example @code const char *vals[3] = { “a”, “b”, “c” }; yyjson_mut_val *arr = yyjson_mut_arr_with_str(doc, vals, 3); @endcode