This is Unofficial EPICS BASE Doxygen Site
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 {
40 } yajl_state;
41 
42 struct yajl_handle_t {
44  void * ctx;
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 */
53  /* a stack of states. access with yajl_state_XXX routines */
55  /* memory allocation routines */
57  /* bitfield */
58  unsigned int flags;
59 };
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
66 yajl_do_parse(yajl_handle handle, const unsigned char * jsonText,
67  size_t jsonTextLen);
68 
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_alloc_funcs alloc
Definition: yajl_parser.h:56
long long yajl_parse_integer(const unsigned char *number, size_t length)
Definition: yajl_parser.c:41
yajl_status yajl_do_finish(yajl_handle handle)
Definition: yajl_parser.c:160
yajl_state
Definition: yajl_parser.h:26
const char * parseError
Definition: yajl_parser.h:46
yajl_status yajl_do_parse(yajl_handle handle, const unsigned char *jsonText, size_t jsonTextLen)
Definition: yajl_parser.c:187
yajl_lexer lexer
Definition: yajl_parser.h:45
size_t bytesConsumed
Definition: yajl_parser.h:50
Interface to YAJL&#39;s JSON stream parsing facilities.
yajl_buf decodeBuf
Definition: yajl_parser.h:52
unsigned char * yajl_render_error_string(yajl_handle hand, const unsigned char *jsonText, size_t jsonTextLen, int verbose)
Definition: yajl_parser.c:66
yajl_status
Definition: yajl_parse.h:32
void verbose(void)
Definition: verbose.c:27
const yajl_callbacks * callbacks
Definition: yajl_parser.h:43
unsigned int flags
Definition: yajl_parser.h:58
yajl_bytestack stateStack
Definition: yajl_parser.h:54