cJSON_AddItemToObjectCS function

  1. @Native<cJSON_bool Function(Pointer<cJSON>, Pointer<Char>, Pointer<cJSON>)>(ffi.Pointer<cJSON>, ffi.Pointer<ffi.Char>, ffi.Pointer<cJSON>)>()
int cJSON_AddItemToObjectCS(
  1. Pointer<cJSON> object,
  2. Pointer<Char> string,
  3. Pointer<cJSON> item
)

Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before writing to item->string

Implementation

@ffi.Native<
  cJSON_bool Function(
    ffi.Pointer<cJSON>,
    ffi.Pointer<ffi.Char>,
    ffi.Pointer<cJSON>,
  )
>()
external int cJSON_AddItemToObjectCS(
  ffi.Pointer<cJSON> object,
  ffi.Pointer<ffi.Char> string,
  ffi.Pointer<cJSON> item,
);