This is Unofficial EPICS BASE Doxygen Site
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
yajl_parser.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2007-2011, Lloyd Hilaiel <lloyd@hilaiel.com>
3
*
4
* Permission to use, copy, modify, and/or distribute this software for any
5
* purpose with or without fee is hereby granted, provided that the above
6
* copyright notice and this permission notice appear in all copies.
7
*
8
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
*/
16
17
#ifndef __YAJL_PARSER_H__
18
#define __YAJL_PARSER_H__
19
20
#include "
yajl_parse.h
"
21
#include "
yajl_bytestack.h
"
22
#include "
yajl_buf.h
"
23
#include "
yajl_lex.h
"
24
25
26
typedef
enum
{
27
yajl_state_start
= 0,
28
yajl_state_parse_complete
,
29
yajl_state_parse_error
,
30
yajl_state_lexical_error
,
31
yajl_state_map_start
,
32
yajl_state_map_sep
,
33
yajl_state_map_need_val
,
34
yajl_state_map_got_val
,
35
yajl_state_map_need_key
,
36
yajl_state_array_start
,
37
yajl_state_array_got_val
,
38
yajl_state_array_need_val
,
39
yajl_state_got_value
,
40
}
yajl_state
;
41
42
struct
yajl_handle_t
{
43
const
yajl_callbacks
*
callbacks
;
44
void
*
ctx
;
45
yajl_lexer
lexer
;
46
const
char
*
parseError
;
47
/* the number of bytes consumed from the last client buffer,
48
* in the case of an error this will be an error offset, in the
49
* case of an error this can be used as the error offset */
50
size_t
bytesConsumed
;
51
/* temporary storage for decoded strings */
52
yajl_buf
decodeBuf
;
53
/* a stack of states. access with yajl_state_XXX routines */
54
yajl_bytestack
stateStack
;
55
/* memory allocation routines */
56
yajl_alloc_funcs
alloc
;
57
/* bitfield */
58
unsigned
int
flags
;
59
};
60
61
#ifdef __cplusplus
62
extern
"C"
{
63
#endif
64
65
yajl_status
66
yajl_do_parse
(
yajl_handle
handle,
const
unsigned
char
* jsonText,
67
size_t
jsonTextLen);
68
69
yajl_status
70
yajl_do_finish
(
yajl_handle
handle);
71
72
unsigned
char
*
73
yajl_render_error_string
(
yajl_handle
hand,
const
unsigned
char
* jsonText,
74
size_t
jsonTextLen,
int
verbose
);
75
76
/* A little built in integer parsing routine with the same semantics as strtol
77
* that's unaffected by LOCALE. */
78
long
long
79
yajl_parse_integer
(
const
unsigned
char
*number,
size_t
length);
80
81
#ifdef __cplusplus
82
}
83
#endif
84
85
#endif
yajl_handle_t::alloc
yajl_alloc_funcs alloc
Definition:
yajl_parser.h:56
yajl_parse_integer
long long yajl_parse_integer(const unsigned char *number, size_t length)
Definition:
yajl_parser.c:41
yajl_state_map_sep
Definition:
yajl_parser.h:32
yajl_state_map_got_val
Definition:
yajl_parser.h:34
yajl_state_array_need_val
Definition:
yajl_parser.h:38
yajl_do_finish
yajl_status yajl_do_finish(yajl_handle handle)
Definition:
yajl_parser.c:160
yajl_buf.h
yajl_state
yajl_state
Definition:
yajl_parser.h:26
yajl_handle_t::parseError
const char * parseError
Definition:
yajl_parser.h:46
yajl_state_start
Definition:
yajl_parser.h:27
yajl_state_map_start
Definition:
yajl_parser.h:31
yajl_state_got_value
Definition:
yajl_parser.h:39
yajl_do_parse
yajl_status yajl_do_parse(yajl_handle handle, const unsigned char *jsonText, size_t jsonTextLen)
Definition:
yajl_parser.c:187
yajl_handle_t::lexer
yajl_lexer lexer
Definition:
yajl_parser.h:45
yajl_handle_t::bytesConsumed
size_t bytesConsumed
Definition:
yajl_parser.h:50
yajl_parse.h
Interface to YAJL's JSON stream parsing facilities.
yajl_handle_t
Definition:
yajl_parser.h:42
yajl_state_map_need_key
Definition:
yajl_parser.h:35
yajl_callbacks
Definition:
yajl_parse.h:71
yajl_bytestack.h
yajl_handle_t::decodeBuf
yajl_buf decodeBuf
Definition:
yajl_parser.h:52
yajl_lexer_t
Definition:
yajl_lex.c:68
yajl_render_error_string
unsigned char * yajl_render_error_string(yajl_handle hand, const unsigned char *jsonText, size_t jsonTextLen, int verbose)
Definition:
yajl_parser.c:66
yajl_buf_t
Definition:
yajl_buf.c:25
yajl_state_parse_error
Definition:
yajl_parser.h:29
yajl_state_array_start
Definition:
yajl_parser.h:36
yajl_status
yajl_status
Definition:
yajl_parse.h:32
yajl_state_lexical_error
Definition:
yajl_parser.h:30
verbose
void verbose(void)
Definition:
verbose.c:27
yajl_handle_t::ctx
void * ctx
Definition:
yajl_parser.h:44
yajl_state_array_got_val
Definition:
yajl_parser.h:37
yajl_alloc_funcs
Definition:
yajl_common.h:67
yajl_handle_t::callbacks
const yajl_callbacks * callbacks
Definition:
yajl_parser.h:43
yajl_lex.h
yajl_bytestack_t
Definition:
yajl_bytestack.h:29
yajl_state_parse_complete
Definition:
yajl_parser.h:28
yajl_handle_t::flags
unsigned int flags
Definition:
yajl_parser.h:58
yajl_state_map_need_val
Definition:
yajl_parser.h:33
yajl_handle_t::stateStack
yajl_bytestack stateStack
Definition:
yajl_parser.h:54
modules
libcom
src
yajl
yajl_parser.h
Generated by
1.8.11