VCOM Linux Driver
Advantech Inc.
Loading...
Searching...
No Matches
jsmn.h
Go to the documentation of this file.
1#ifndef __JSMN_H_
2#define __JSMN_H_
3
4#include <stddef.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
24
25enum jsmnerr {
26 /* Not enough tokens were provided */
28 /* Invalid character inside JSON string */
30 /* The string is not a full JSON packet, more bytes expected */
32};
33
40typedef struct {
42 int start;
43 int end;
44 int size;
45#ifdef JSMN_PARENT_LINKS
46 int parent;
47#endif
48} jsmntok_t;
49
54typedef struct {
55 unsigned int pos; /* offset in the JSON string */
56 unsigned int toknext; /* next token to allocate */
57 int toksuper; /* superior token node, e.g parent object or array */
59
63void jsmn_init(jsmn_parser *parser);
64
69int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
70 jsmntok_t *tokens, unsigned int num_tokens);
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif /* __JSMN_H_ */
jsmntype_t
Definition jsmn.h:17
@ JSMN_PRIMITIVE
Definition jsmn.h:22
@ JSMN_OBJECT
Definition jsmn.h:19
@ JSMN_UNDEFINED
Definition jsmn.h:18
@ JSMN_ARRAY
Definition jsmn.h:20
@ JSMN_STRING
Definition jsmn.h:21
int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens)
Definition jsmn.c:151
void jsmn_init(jsmn_parser *parser)
Definition jsmn.c:309
jsmnerr
Definition jsmn.h:25
@ JSMN_ERROR_INVAL
Definition jsmn.h:29
@ JSMN_ERROR_PART
Definition jsmn.h:31
@ JSMN_ERROR_NOMEM
Definition jsmn.h:27
Definition jsmn.h:54
unsigned int toknext
Definition jsmn.h:56
int toksuper
Definition jsmn.h:57
unsigned int pos
Definition jsmn.h:55
Definition jsmn.h:40
int start
Definition jsmn.h:42
int size
Definition jsmn.h:44
jsmntype_t type
Definition jsmn.h:41
int end
Definition jsmn.h:43
unsigned short len
Definition vcom_proto.h:3