MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxStringifyJSONChars

Function fxStringifyJSONChars

xs/sources/xsJSON.c:886–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

884}
885
886void fxStringifyJSONChars(txMachine* the, txJSONStringifier* theStringifier, char* s, txSize theSize)
887{
888 //fprintf(stderr, "%s", s);
889 if ((theStringifier->offset + theSize) >= theStringifier->size) {
890 char* aBuffer;
891 theStringifier->size += ((theSize / 1024) + 1) * 1024;
892 aBuffer = c_realloc(theStringifier->buffer, theStringifier->size);
893 if (!aBuffer)
894 fxAbort(the, XS_NOT_ENOUGH_MEMORY_EXIT);
895 theStringifier->buffer = aBuffer;
896 }
897 c_memcpy(theStringifier->buffer + theStringifier->offset, s, theSize);
898 theStringifier->offset += theSize;
899}
900
901void fxStringifyJSONIndent(txMachine* the, txJSONStringifier* theStringifier)
902{

Callers 8

fx_JSON_stringifyFunction · 0.85
fxStringifyJSONIndentFunction · 0.85
fxStringifyJSONIntegerFunction · 0.85
fxStringifyJSONNameFunction · 0.85
fxStringifyJSONNumberFunction · 0.85
fxStringifyJSONPropertyFunction · 0.85
fxStringifyJSONStringFunction · 0.85

Calls 1

fxAbortFunction · 0.70

Tested by

no test coverage detected