cJSON_PrintPreallocated function

  1. @Native<cJSON_bool Function(Pointer<cJSON>, Pointer<Char>, Int, cJSON_bool)>(ffi.Pointer<cJSON>, ffi.Pointer<ffi.Char>, ffi.Int, cJSON_bool)>()
int cJSON_PrintPreallocated(
  1. Pointer<cJSON> item,
  2. Pointer<Char> buffer,
  3. int length,
  4. int format,
)

Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. / / NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need

Implementation

@ffi.Native<
  cJSON_bool Function(
    ffi.Pointer<cJSON>,
    ffi.Pointer<ffi.Char>,
    ffi.Int,
    cJSON_bool,
  )
>()
external int cJSON_PrintPreallocated(
  ffi.Pointer<cJSON> item,
  ffi.Pointer<ffi.Char> buffer,
  int length,
  int format,
);