34 #if !defined(LWS_ARRAY_SIZE)
35 #define LWS_ARRAY_SIZE(_x) (sizeof(_x) / sizeof(_x[0]))
37 #define LEJP_FLAG_WS_KEEP 64
38 #define LEJP_FLAG_WS_COMMENTLINE 32
85 #define LEJP_FLAG_CB_IS_VALUE 64
180 #ifndef LEJP_MAX_PARSING_STACK_DEPTH
181 #define LEJP_MAX_PARSING_STACK_DEPTH 8
183 #ifndef LEJP_MAX_DEPTH
184 #define LEJP_MAX_DEPTH 16
186 #ifndef LEJP_MAX_INDEX_DEPTH
187 #define LEJP_MAX_INDEX_DEPTH 12
189 #ifndef LEJP_MAX_PATH
190 #define LEJP_MAX_PATH 192
192 #ifndef LEJP_STRING_CHUNK
194 #define LEJP_STRING_CHUNK 254
248 #define LEJP_FLAG_FEAT_OBJECT_INDEXES (1 << 0)
249 #define LEJP_FLAG_FEAT_LEADING_WC (1 << 1)
250 #define LEJP_FLAG_LATEST \
251 (LEJP_FLAG_FEAT_OBJECT_INDEXES | \
252 LEJP_FLAG_FEAT_LEADING_WC)
272 signed char (*callback)(
struct lejp_ctx *ctx,
char reason),
273 void *user,
const char *
const *paths,
unsigned char paths_count);
283 signed char (*callback)(
struct lejp_ctx *ctx,
char reason));
LWS_VISIBLE LWS_EXTERN void lejp_construct(struct lejp_ctx *ctx, signed char(*callback)(struct lejp_ctx *ctx, char reason), void *user, const char *const *paths, unsigned char paths_count)
struct _lejp_stack st[LEJP_MAX_DEPTH]
#define LEJP_MAX_PARSING_STACK_DEPTH
LWS_VISIBLE LWS_EXTERN int lejp_parser_pop(struct lejp_ctx *ctx)
@ LEJP_REJECT_ILLEGAL_HEX
@ LEJP_REJECT_MP_C_OR_E_NEITHER
@ LEJP_REJECT_MP_VAL_NUM_FORMAT
@ LEJP_REJECT_MP_ARRAY_END_MISSING
@ LEJP_REJECT_MP_DELIM_MISSING_COLON
@ LEJP_REJECT_MP_C_OR_E_UNDERF
@ LEJP_REJECT_MP_STRING_ESC_ILLEGAL_ESC
@ LEJP_REJECT_MP_VAL_TOK_UNKNOWN
@ LEJP_REJECT_MP_C_OR_E_NOTARRAY
@ LEJP_REJECT_MP_VAL_NUM_INT_NO_FRAC
@ LEJP_REJECT_MEMBERS_NO_CLOSE
@ LEJP_REJECT_MP_DELIM_ISTACK
@ LEJP_REJECT_IDLE_NO_BRACE
@ LEJP_REJECT_NUM_TOO_LONG
@ LEJP_REJECT_MP_STRING_UNDERRUN
@ LEJP_REJECT_MP_NO_OPEN_QUOTE
@ LEJP_REJECT_MP_ILLEGAL_CTRL
@ LEJP_REJECT_STACK_OVERFLOW
@ LEJP_REJECT_MP_DELIM_BAD_VALUE_START
@ LEJP_REJECT_MP_VAL_NUM_EXP_BAD_EXP
LWS_VISIBLE LWS_EXTERN void lejp_check_path_match(struct lejp_ctx *ctx)
LWS_VISIBLE LWS_EXTERN int lejp_parse(struct lejp_ctx *ctx, const unsigned char *json, int len)
uint16_t wild[LEJP_MAX_INDEX_DEPTH]
LWS_VISIBLE LWS_EXTERN const char * lejp_error_to_string(int e)
LWS_VISIBLE LWS_EXTERN void lejp_change_callback(struct lejp_ctx *ctx, signed char(*callback)(struct lejp_ctx *ctx, char reason))
LWS_EXTERN signed char _lejp_callback(struct lejp_ctx *ctx, char reason)
#define LEJP_STRING_CHUNK
LWS_VISIBLE LWS_EXTERN int lejp_parser_push(struct lejp_ctx *ctx, void *user, const char *const *paths, unsigned char paths_count, lejp_callback lejp_cb)
#define LEJP_FLAG_CB_IS_VALUE
LWS_VISIBLE LWS_EXTERN void lejp_destruct(struct lejp_ctx *ctx)
signed char(* lejp_callback)(struct lejp_ctx *ctx, char reason)
uint16_t i[LEJP_MAX_INDEX_DEPTH]
#define LEJP_MAX_INDEX_DEPTH
#define LEJP_FLAG_WS_KEEP
char buf[LEJP_STRING_CHUNK+1]
struct _lejp_parsing_stack pst[LEJP_MAX_PARSING_STACK_DEPTH]
LWS_VISIBLE LWS_EXTERN int lejp_get_wildcard(struct lejp_ctx *ctx, int wildcard, char *dest, int len)
signed char(* callback)(struct lejp_ctx *ctx, char reason)
const char *const * paths