47#ifndef coreJSON_ASSERT
48 #define coreJSON_ASSERT( expr ) assert( expr )
182#define JSON_Search( buf, max, query, queryLength, outValue, outValueLength ) \
183 JSON_SearchT( buf, max, query, queryLength, outValue, outValueLength, NULL )
190#define MAX_INDEX_VALUE ( 0x7FFFFFF7 )
227 size_t * outValueLength,
249 const char ** outValue,
250 size_t * outValueLength,
JSONStatus_t JSON_SearchConst(const char *buf, size_t max, const char *query, size_t queryLength, const char **outValue, size_t *outValueLength, JSONTypes_t *outType)
Same as JSON_SearchT(), but with const qualified buf and outValue arguments.
Definition: core_json.c:1663
JSONStatus_t JSON_SearchT(char *buf, size_t max, const char *query, size_t queryLength, char **outValue, size_t *outValueLength, JSONTypes_t *outType)
Same as JSON_Search(), but also outputs a type for the value found.
Definition: core_json.c:1713
JSONStatus_t JSON_Iterate(const char *buf, size_t max, size_t *start, size_t *next, JSONPair_t *outPair)
Output the next key-value pair or value from a collection.
Definition: core_json.c:1802
JSONStatus_t JSON_Validate(const char *buf, size_t max)
Parse a buffer to determine if it contains a valid JSON document.
Definition: core_json.c:1160
JSONStatus_t
Return codes from coreJSON library functions.
Definition: core_json.h:57
JSONTypes_t
Value types from the JSON standard.
Definition: core_json.h:197
@ JSONNotFound
Query key could not be found in the JSON document.
Definition: core_json.h:62
@ JSONIllegalDocument
JSON document is invalid or malformed.
Definition: core_json.h:60
@ JSONSuccess
JSON document is valid and complete.
Definition: core_json.h:59
@ JSONBadParameter
Query key is empty, or any subpart is empty, or max is 0.
Definition: core_json.h:64
@ JSONMaxDepthExceeded
JSON document has nesting that exceeds JSON_MAX_DEPTH.
Definition: core_json.h:61
@ JSONNullParameter
Pointer parameter passed to a function is NULL.
Definition: core_json.h:63
@ JSONPartial
JSON document is valid so far but incomplete.
Definition: core_json.h:58
@ JSONObject
A collection of zero or more key-value pairs.
Definition: core_json.h:204
@ JSONNull
The literal value null.
Definition: core_json.h:203
@ JSONNumber
A rational number.
Definition: core_json.h:200
@ JSONTrue
The literal value true.
Definition: core_json.h:201
@ JSONString
A quote delimited sequence of Unicode characters.
Definition: core_json.h:199
@ JSONArray
A collection of zero or more values.
Definition: core_json.h:205
@ JSONFalse
The literal value false.
Definition: core_json.h:202
@ JSONInvalid
Not a valid JSON type.
Definition: core_json.h:198
Structure to represent a key-value pair.
Definition: core_json.h:259
const char * value
Pointer to the code point sequence for value.
Definition: core_json.h:262
size_t keyLength
Length of the code point sequence for key.
Definition: core_json.h:261
JSONTypes_t jsonType
JSON-specific type of the value.
Definition: core_json.h:264
size_t valueLength
Length of the code point sequence for value.
Definition: core_json.h:263
const char * key
Pointer to the code point sequence for key.
Definition: core_json.h:260