123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef __JSMN_H_
- #define __JSMN_H_
- #include <stddef.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef enum {
- JSMN_UNDEFINED = 0,
- JSMN_OBJECT = 1,
- JSMN_ARRAY = 2,
- JSMN_STRING = 3,
- JSMN_PRIMITIVE = 4,
- JSMN_PROCESSED = 5
- } jsmntype_t;
- enum jsmnerr {
-
- JSMN_ERROR_NOMEM = -1,
-
- JSMN_ERROR_INVAL = -2,
-
- JSMN_ERROR_PART = -3
- };
- typedef struct {
- jsmntype_t type;
- int start;
- int end;
- int size;
- #ifdef JSMN_PARENT_LINKS
- int parent;
- #endif
- } jsmntok_t;
- typedef struct {
- unsigned int pos;
- unsigned int toknext;
- int toksuper;
- } jsmn_parser;
- void jsmn_init(jsmn_parser *parser);
- int jsmn_parse(jsmn_parser *parser, const char *js, size_t len,
- jsmntok_t *tokens, unsigned int num_tokens);
- #ifdef __cplusplus
- }
- #endif
- #endif
|