API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

JSONGEN_CTOR()

Brew Release
Brew MP 1.0.2
Description

Initializes the JSONGen structure.
If the original buffer runs out of space and a reallocation function is provided, then a new buffer is created with the data from original buffer and expanded as needed.
The caller provides the JSONGen structure. This allows the structure to be stack declared or dynamically declared based on the caller needs. Stack allocation is attractive option for quick parsing needs. It is also safe to provide stack declared buffer as the original buffer.

Params
pj
[]:
JSON generator
psz
[]:
Buffer to hold JSON text
nMax
[]:
Max size of the psz buffer
pfnRealloc
[]:
Reallocation function for buffer creation and expansion
pvCtx
[]:
Context to be passed back to pfnRealloc while calling
Interface
Prototype
  •    void JSONGen_Ctor(JSONGen *pj, char *psz, int nMax,
                         JSONGenReallocFunc pfnRealloc, void *pvCtx);
    
Return

  • None