Wireshark
4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wsutil
jsmn.h
Go to the documentation of this file.
1
24
#ifndef __JSMN_H_
25
#define __JSMN_H_
26
27
#include "ws_symbol_export.h"
28
29
#include <stddef.h>
30
31
#ifdef __cplusplus
32
extern
"C"
{
33
#endif
34
42
typedef
enum
{
43
JSMN_UNDEFINED = 0,
44
JSMN_OBJECT = 1,
45
JSMN_ARRAY = 2,
46
JSMN_STRING = 3,
47
JSMN_PRIMITIVE = 4
48
}
jsmntype_t
;
49
50
enum
jsmnerr {
51
/* Not enough tokens were provided */
52
JSMN_ERROR_NOMEM = -1,
53
/* Invalid character inside JSON string */
54
JSMN_ERROR_INVAL = -2,
55
/* The string is not a full JSON packet, more bytes expected */
56
JSMN_ERROR_PART = -3
57
};
58
65
typedef
struct
{
66
jsmntype_t
type;
67
int
start;
68
int
end;
69
int
size;
70
#ifdef JSMN_PARENT_LINKS
71
int
parent;
72
#endif
73
}
jsmntok_t
;
74
79
typedef
struct
{
80
unsigned
int
pos;
/* offset in the JSON string */
81
unsigned
int
toknext;
/* next token to allocate */
82
int
toksuper;
/* superior token node, e.g parent object or array */
83
}
jsmn_parser
;
84
88
WS_DLL_PUBLIC
void
jsmn_init
(
jsmn_parser
*parser);
89
94
WS_DLL_PUBLIC
int
jsmn_parse
(
jsmn_parser
*parser,
const
char
*js,
size_t
len,
95
jsmntok_t
*tokens,
unsigned
int
num_tokens);
96
97
#ifdef __cplusplus
98
}
99
#endif
100
101
#endif
/* __JSMN_H_ */
jsmntype_t
jsmntype_t
Definition
jsmn.h:42
jsmn_init
WS_DLL_PUBLIC void jsmn_init(jsmn_parser *parser)
Definition
jsmn.c:328
jsmn_parse
WS_DLL_PUBLIC int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t *tokens, unsigned int num_tokens)
Definition
jsmn.c:173
jsmn_parser
Definition
jsmn.h:79
jsmntok_t
Definition
jsmn.h:65
Generated by
1.9.8