aboutsummaryrefslogtreecommitdiff
path: root/dependencies/jsmn
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-09-15 17:03:59 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-09-15 17:03:59 +0200
commit2a5e5a020b14229e312294a345d3f079002f24e8 (patch)
treeab7cf78b16517fb70657ed9132214e6964f2bc79 /dependencies/jsmn
parente54c2df63b292257822cd07678fa20b38552585f (diff)
parent8e096b19c1e0b45ccd43cc89d9d80b59bd783529 (diff)
Merge commit '8e096b19c1e0b45ccd43cc89d9d80b59bd783529'
Diffstat (limited to 'dependencies/jsmn')
-rw-r--r--dependencies/jsmn/README.md10
-rw-r--r--dependencies/jsmn/jsmn.h8
2 files changed, 9 insertions, 9 deletions
diff --git a/dependencies/jsmn/README.md b/dependencies/jsmn/README.md
index f8249f3dd..e94679775 100644
--- a/dependencies/jsmn/README.md
+++ b/dependencies/jsmn/README.md
@@ -89,7 +89,7 @@ jsmn_parser p;
jsmntok_t t[128]; /* We expect no more than 128 JSON tokens */
jsmn_init(&p);
-r = jsmn_parse(&p, s, strlen(s), t, 128);
+r = jsmn_parse(&p, s, strlen(s), t, 128); // "s" is the char array holding the json content
```
Since jsmn is a single-header, header-only library, for more complex use cases
@@ -113,10 +113,10 @@ Token types are described by `jsmntype_t`:
typedef enum {
JSMN_UNDEFINED = 0,
- JSMN_OBJECT = 1,
- JSMN_ARRAY = 2,
- JSMN_STRING = 3,
- JSMN_PRIMITIVE = 4
+ JSMN_OBJECT = 1 << 0,
+ JSMN_ARRAY = 1 << 1,
+ JSMN_STRING = 1 << 2,
+ JSMN_PRIMITIVE = 1 << 3
} jsmntype_t;
**Note:** Unlike JSON data types, primitive tokens are not divided into
diff --git a/dependencies/jsmn/jsmn.h b/dependencies/jsmn/jsmn.h
index 3178dcc97..41219b7dd 100644
--- a/dependencies/jsmn/jsmn.h
+++ b/dependencies/jsmn/jsmn.h
@@ -45,10 +45,10 @@ extern "C" {
*/
typedef enum {
JSMN_UNDEFINED = 0,
- JSMN_OBJECT = 1,
- JSMN_ARRAY = 2,
- JSMN_STRING = 3,
- JSMN_PRIMITIVE = 4
+ JSMN_OBJECT = 1 << 0,
+ JSMN_ARRAY = 1 << 1,
+ JSMN_STRING = 1 << 2,
+ JSMN_PRIMITIVE = 1 << 3
} jsmntype_t;
enum jsmnerr {