json: Changes enum name of square brackets from list to array
Marked JSON_TOK_LIST_ as deprecated in favor of JSON_TOK_ARRAY_ Signed-off-by: Ramiro Merello <rmerello@itba.edu.ar>
This commit is contained in:
parent
17238ab26b
commit
28da82c0e1
2 changed files with 19 additions and 15 deletions
|
@ -37,8 +37,12 @@ enum json_tokens {
|
|||
JSON_TOK_NONE = '_',
|
||||
JSON_TOK_OBJECT_START = '{',
|
||||
JSON_TOK_OBJECT_END = '}',
|
||||
JSON_TOK_LIST_START = '[',
|
||||
JSON_TOK_LIST_END = ']',
|
||||
/* JSON_TOK_LIST_START will be removed use JSON_TOK_ARRAY_START */
|
||||
JSON_TOK_LIST_START __deprecated = '[',
|
||||
JSON_TOK_ARRAY_START = '[',
|
||||
/* JSON_TOK_LIST_END will be removed use JSON_TOK_ARRAY_END */
|
||||
JSON_TOK_LIST_END __deprecated = ']',
|
||||
JSON_TOK_ARRAY_END = ']',
|
||||
JSON_TOK_STRING = '"',
|
||||
JSON_TOK_COLON = ':',
|
||||
JSON_TOK_COMMA = ',',
|
||||
|
@ -65,7 +69,7 @@ struct json_obj_descr {
|
|||
|
||||
/* Valid values here (enum json_tokens): JSON_TOK_STRING,
|
||||
* JSON_TOK_NUMBER, JSON_TOK_TRUE, JSON_TOK_FALSE,
|
||||
* JSON_TOK_OBJECT_START, JSON_TOK_LIST_START. (All others
|
||||
* JSON_TOK_OBJECT_START, JSON_TOK_ARRAY_START. (All others
|
||||
* ignored.) Maximum value is '}' (125), so this has to be 7 bits
|
||||
* long.
|
||||
*/
|
||||
|
@ -201,7 +205,7 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
|
|||
.field_name = (#field_name_), \
|
||||
.align_shift = Z_ALIGN_SHIFT(struct_), \
|
||||
.field_name_len = sizeof(#field_name_) - 1, \
|
||||
.type = JSON_TOK_LIST_START, \
|
||||
.type = JSON_TOK_ARRAY_START, \
|
||||
.offset = offsetof(struct_, field_name_), \
|
||||
{ \
|
||||
.array = { \
|
||||
|
@ -258,7 +262,7 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
|
|||
.field_name = (#field_name_), \
|
||||
.align_shift = Z_ALIGN_SHIFT(struct_), \
|
||||
.field_name_len = sizeof(#field_name_) - 1, \
|
||||
.type = JSON_TOK_LIST_START, \
|
||||
.type = JSON_TOK_ARRAY_START, \
|
||||
.offset = offsetof(struct_, field_name_), \
|
||||
{ \
|
||||
.array = { \
|
||||
|
@ -331,14 +335,14 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
|
|||
.field_name = (#field_name_), \
|
||||
.align_shift = Z_ALIGN_SHIFT(struct_), \
|
||||
.field_name_len = sizeof(#field_name_) - 1, \
|
||||
.type = JSON_TOK_LIST_START, \
|
||||
.type = JSON_TOK_ARRAY_START, \
|
||||
.offset = offsetof(struct_, field_name_), \
|
||||
{ \
|
||||
.array = { \
|
||||
.element_descr = (struct json_obj_descr[]) { { \
|
||||
.align_shift = \
|
||||
Z_ALIGN_SHIFT(struct_), \
|
||||
.type = JSON_TOK_LIST_START, \
|
||||
.type = JSON_TOK_ARRAY_START, \
|
||||
.offset = offsetof(struct_, \
|
||||
len_field_), \
|
||||
{ \
|
||||
|
@ -434,7 +438,7 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
|
|||
.field_name = (json_field_name_), \
|
||||
.align_shift = Z_ALIGN_SHIFT(struct_), \
|
||||
.field_name_len = sizeof(json_field_name_) - 1, \
|
||||
.type = JSON_TOK_LIST_START, \
|
||||
.type = JSON_TOK_ARRAY_START, \
|
||||
.offset = offsetof(struct_, struct_field_name_), \
|
||||
{ \
|
||||
.array = { \
|
||||
|
@ -498,7 +502,7 @@ typedef int (*json_append_bytes_t)(const char *bytes, size_t len,
|
|||
.field_name = json_field_name_, \
|
||||
.align_shift = Z_ALIGN_SHIFT(struct_), \
|
||||
.field_name_len = sizeof(json_field_name_) - 1, \
|
||||
.type = JSON_TOK_LIST_START, \
|
||||
.type = JSON_TOK_ARRAY_START, \
|
||||
.offset = offsetof(struct_, struct_field_name_), \
|
||||
{ \
|
||||
.array = { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue