version 1.1.2.2, 2017/11/24 10:29:15
|
version 1.1.2.4, 2017/11/27 19:37:31
|
Line 53 typedef enum {
|
Line 53 typedef enum {
|
J_OBJECT = 1, |
J_OBJECT = 1, |
J_ARRAY = 2, |
J_ARRAY = 2, |
J_STRING = 3, |
J_STRING = 3, |
J_NUMBER = 4, | J_VALUE = 4 |
J_BOOL = 5, | |
J_NULL = 6 | |
} jtype_t; |
} jtype_t; |
|
|
/* JSON error numbers */ |
/* JSON error numbers */ |
Line 63 typedef enum {
|
Line 61 typedef enum {
|
J_ERR_OK = 0, |
J_ERR_OK = 0, |
J_ERR_NOMEM = 1, |
J_ERR_NOMEM = 1, |
J_ERR_INVAL = 2, |
J_ERR_INVAL = 2, |
J_ERR_PART = 3 | J_ERR_PART = 3, |
| J_ERR_PARAM = 4 |
} jerr_t; |
} jerr_t; |
|
|
/* JSON error strings */ | typedef struct _tagHandler { |
typedef const char jerrstr[] = { | unsigned long h_pos; |
"No error", | unsigned long h_next; |
"Not enough tokens were provided", | long h_parent; |
"Invalid character", | void *h_alloc; |
"JSON string isn't full", | int h_strict; |
NULL | |
}; | |
| |
typedef struct _tagParser { | |
unsigned long pos; | |
unsigned long next; | |
long parent; | |
} json_t; |
} json_t; |
|
|
typedef struct _tagToken { |
typedef struct _tagToken { |
Line 94 typedef struct _tagToken {
|
Line 86 typedef struct _tagToken {
|
* json_init() - Initialize JSON handler |
* json_init() - Initialize JSON handler |
* |
* |
* @json = JSON handler, if there is NULL then dynamically will be allocated |
* @json = JSON handler, if there is NULL then dynamically will be allocated |
* return: =NULL error or !=NULL ready for use JSON handler. | * @jstrict = JSON strict mode, when we select strict mode every unquoted value is error |
| * return: =NULL error or !=NULL ready for use JSON handler and should be free with json_free() |
*/ |
*/ |
json_t *json_init(json_t * __restrict json); | json_t *json_init(json_t * __restrict json, int jstrict); |
|
|
/* |
/* |
* json_free() - Free JSON handler |
* json_free() - Free JSON handler |
Line 104 json_t *json_init(json_t * __restrict json);
|
Line 97 json_t *json_init(json_t * __restrict json);
|
* @json = JSON handler |
* @json = JSON handler |
* return: none |
* return: none |
*/ |
*/ |
void json_free(json_t **json); | void json_free(json_t * __restrict json); |
|
|
/* |
/* |
* json_parse() - Parse JSON string |
* json_parse() - Parse JSON string |