This is Unofficial EPICS BASE Doxygen Site
yajl_lex.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_LEX_H__
18 #define __YAJL_LEX_H__
19 
20 #include "yajl_common.h"
21 
22 typedef enum {
33 
34  /* we differentiate between integers and doubles to allow the
35  * parser to interpret the number without re-scanning */
38 
39  /* we differentiate between strings which require further processing,
40  * and strings that do not */
43 
44  /* comment tokens are not currently returned to the parser, ever */
46 } yajl_tok;
47 
48 typedef struct yajl_lexer_t * yajl_lexer;
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
55  unsigned int allowComments,
56  unsigned int validateUTF8);
57 
58 void yajl_lex_free(yajl_lexer lexer);
59 
82 yajl_tok yajl_lex_lex(yajl_lexer lexer, const unsigned char * jsonText,
83  size_t jsonTextLen, size_t * offset,
84  const unsigned char ** outBuf, size_t * outLen);
85 
87 yajl_tok yajl_lex_peek(yajl_lexer lexer, const unsigned char * jsonText,
88  size_t jsonTextLen, size_t offset);
89 
90 
91 typedef enum {
104 
105 const char * yajl_lex_error_to_string(yajl_lex_error error);
106 
109 yajl_lex_error yajl_lex_get_error(yajl_lexer lexer);
110 
112 size_t yajl_lex_current_offset(yajl_lexer lexer);
113 
115 size_t yajl_lex_current_line(yajl_lexer lexer);
116 
119 size_t yajl_lex_current_char(yajl_lexer lexer);
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif
void yajl_lex_free(yajl_lexer lexer)
Definition: yajl_lex.c:121
yajl_lex_error error
Definition: yajl_lex.c:74
yajl_tok yajl_lex_peek(yajl_lexer lexer, const unsigned char *jsonText, size_t jsonTextLen, size_t offset)
Definition: yajl_lex.c:749
size_t yajl_lex_current_offset(yajl_lexer lexer)
unsigned int validateUTF8
Definition: yajl_lex.c:91
yajl_tok yajl_lex_lex(yajl_lexer lexer, const unsigned char *jsonText, size_t jsonTextLen, size_t *offset, const unsigned char **outBuf, size_t *outLen)
Definition: yajl_lex.c:503
yajl_alloc_funcs * alloc
Definition: yajl_lex.c:93
struct yajl_lexer_t * yajl_lexer
Definition: yajl_lex.h:48
yajl_lexer yajl_lex_alloc(yajl_alloc_funcs *alloc, unsigned int allowComments, unsigned int validateUTF8)
Definition: yajl_lex.c:104
yajl_lex_error yajl_lex_get_error(yajl_lexer lexer)
Definition: yajl_lex.c:733
const char * yajl_lex_error_to_string(yajl_lex_error error)
Definition: yajl_lex.c:695
yajl_tok
Definition: yajl_lex.h:22
Common routines and macros used by other YAJL APIs.
size_t yajl_lex_current_line(yajl_lexer lexer)
Definition: yajl_lex.c:739
unsigned int allowComments
Definition: yajl_lex.c:88
yajl_lex_error
Definition: yajl_lex.h:91
size_t yajl_lex_current_char(yajl_lexer lexer)
Definition: yajl_lex.c:744