open62541 1.3.12
Open source implementation of OPC UA
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
10
19
20enum jsmnerr {
21 /* Not enough tokens were provided */
23 /* Invalid character inside JSON string */
25 /* The string is not a full JSON packet, more bytes expected */
27};
28
29
30typedef struct {
32 int start;
33 int end;
34 int size;
35#ifdef JSMN_PARENT_LINKS
36 int parent;
37#endif
38} jsmntok_t;
39
40
41typedef struct {
42 unsigned int pos; /* offset in the JSON string */
43 unsigned int toknext; /* next token to allocate */
44 int toksuper; /* superior token node, e.g parent object or array */
46
47
48void jsmn_init(jsmn_parser *parser);
49
50
51int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
52 jsmntok_t *tokens, unsigned int num_tokens);
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif /* __JSMN_H_ */
jsmntype_t
Definition jsmn.h:11
@ JSMN_PRIMITIVE
Definition jsmn.h:16
@ JSMN_OBJECT
Definition jsmn.h:13
@ JSMN_UNDEFINED
Definition jsmn.h:12
@ JSMN_PROCESSED
Definition jsmn.h:17
@ JSMN_ARRAY
Definition jsmn.h:14
@ JSMN_STRING
Definition jsmn.h:15
int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens)
void jsmn_init(jsmn_parser *parser)
jsmnerr
Definition jsmn.h:20
@ JSMN_ERROR_INVAL
Definition jsmn.h:24
@ JSMN_ERROR_PART
Definition jsmn.h:26
@ JSMN_ERROR_NOMEM
Definition jsmn.h:22
unsigned int pos
Definition jsmn.h:42
int toksuper
Definition jsmn.h:44
unsigned int toknext
Definition jsmn.h:43
int start
Definition jsmn.h:32
int size
Definition jsmn.h:34
int end
Definition jsmn.h:33
jsmntype_t type
Definition jsmn.h:31