rsstats 0.0.1
Redis Enterprise Statistic collector
|
Wrapper around cJSON library with helpers. More...
#include "cJSON.h"
Go to the source code of this file.
Functions | |
char * | json2text (cJSON *value_json) |
Convert a cJSON object in a C String. More... | |
Wrapper around cJSON library with helpers.
This library is only a simple wrapper around the cJSON library, providing helper functions.
Definition in file json.h.
char * json2text | ( | cJSON * | value_json | ) |
Convert a cJSON object in a C String.
value_json | the cJSON value to convert |
NULL | if there was a problem, such as an Out Of Memory |
Pointer | to a zero terminated C string. |
It converts NULL values, String values, Integer values, Boolean values in C strings. If the value is an array, it is fully pretty printed. If the JSON value is nothing in this list, the function returns the "Invalid data" string.
The returned strings are allocated using malloc on the heap and should be freed by the calling application.