Main Page
Modules
Namespaces
Classes
Files
File List
File Members
sm
lib
json-c
json_tokener.h
Go to the documentation of this file.
1
/*
2
* $Id: json_tokener.h,v 1.10 2006/07/25 03:24:50 mclark Exp $
3
*
4
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
5
* Michael Clark <michael@metaparadigm.com>
6
*
7
* This library is free software; you can redistribute it and/or modify
8
* it under the terms of the MIT license. See COPYING for details.
9
*
10
*/
11
12
#ifndef _json_tokener_h_
13
#define _json_tokener_h_
14
15
#include "
json_object.h
"
16
17
enum
json_tokener_error
{
18
json_tokener_success
,
19
json_tokener_continue
,
20
json_tokener_error_depth
,
21
json_tokener_error_parse_eof
,
22
json_tokener_error_parse_unexpected
,
23
json_tokener_error_parse_null
,
24
json_tokener_error_parse_boolean
,
25
json_tokener_error_parse_number
,
26
json_tokener_error_parse_array
,
27
json_tokener_error_parse_object_key_name
,
28
json_tokener_error_parse_object_key_sep
,
29
json_tokener_error_parse_object_value_sep
,
30
json_tokener_error_parse_string
,
31
json_tokener_error_parse_comment
32
};
33
34
enum
json_tokener_state
{
35
json_tokener_state_eatws
,
36
json_tokener_state_start
,
37
json_tokener_state_finish
,
38
json_tokener_state_null
,
39
json_tokener_state_comment_start
,
40
json_tokener_state_comment
,
41
json_tokener_state_comment_eol
,
42
json_tokener_state_comment_end
,
43
json_tokener_state_string
,
44
json_tokener_state_string_escape
,
45
json_tokener_state_escape_unicode
,
46
json_tokener_state_boolean
,
47
json_tokener_state_number
,
48
json_tokener_state_array
,
49
json_tokener_state_array_add
,
50
json_tokener_state_array_sep
,
51
json_tokener_state_object_field_start
,
52
json_tokener_state_object_field
,
53
json_tokener_state_object_field_end
,
54
json_tokener_state_object_value
,
55
json_tokener_state_object_value_add
,
56
json_tokener_state_object_sep
57
};
58
59
struct
json_tokener_srec
60
{
61
enum
json_tokener_state
state
,
saved_state
;
62
struct
json_object
*
obj
;
63
struct
json_object
*
current
;
64
char
*
obj_field_name
;
65
};
66
67
#define JSON_TOKENER_MAX_DEPTH 32
68
69
struct
json_tokener
70
{
71
char
*
str
;
72
struct
printbuf
*
pb
;
73
int
depth, is_double,
st_pos
, char_offset;
74
enum
json_tokener_error
err;
75
unsigned
int
ucs_char
;
76
char
quote_char
;
77
struct
json_tokener_srec
stack[
JSON_TOKENER_MAX_DEPTH
];
78
};
79
80
extern
const
char
*
json_tokener_errors
[];
81
82
extern
struct
json_tokener
*
json_tokener_new
(
void
);
83
extern
void
json_tokener_free
(
struct
json_tokener
*tok);
84
extern
void
json_tokener_reset
(
struct
json_tokener
*tok);
85
extern
struct
json_object
*
json_tokener_parse
(
const
char
*str);
86
extern
struct
json_object
*
json_tokener_parse_ex
(
struct
json_tokener
*tok,
87
const
char
*str,
int
len);
88
89
#endif
json_tokener_state_object_sep
Definition:
json_tokener.h:56
json_tokener_state_comment_end
Definition:
json_tokener.h:42
json_tokener_state_finish
Definition:
json_tokener.h:37
json_tokener_error_parse_unexpected
Definition:
json_tokener.h:22
json_tokener_error_parse_object_key_name
Definition:
json_tokener.h:27
json_object.h
json_tokener_free
void json_tokener_free(struct json_tokener *tok)
Definition:
json_tokener.c:66
printbuf
Definition:
printbuf.h:17
json_tokener_error_parse_array
Definition:
json_tokener.h:26
JSON_TOKENER_MAX_DEPTH
#define JSON_TOKENER_MAX_DEPTH
Definition:
json_tokener.h:67
json_tokener_state_eatws
Definition:
json_tokener.h:35
json_tokener_srec::obj_field_name
char * obj_field_name
Definition:
json_tokener.h:64
json_tokener_state_string
Definition:
json_tokener.h:43
json_tokener_state_object_value_add
Definition:
json_tokener.h:55
json_tokener_error_parse_eof
Definition:
json_tokener.h:21
json_tokener_state_boolean
Definition:
json_tokener.h:46
json_tokener_error
json_tokener_error
Definition:
json_tokener.h:17
json_tokener_state_object_value
Definition:
json_tokener.h:54
json_tokener_state_object_field
Definition:
json_tokener.h:52
json_tokener_reset
void json_tokener_reset(struct json_tokener *tok)
Definition:
json_tokener.c:83
json_tokener_srec::current
struct json_object * current
Definition:
json_tokener.h:63
json_tokener_parse_ex
struct json_object * json_tokener_parse_ex(struct json_tokener *tok, const char *str, int len)
Definition:
json_tokener.c:133
json_tokener::quote_char
char quote_char
Definition:
json_tokener.h:76
json_tokener
Definition:
json_tokener.h:69
json_tokener::str
char * str
Definition:
json_tokener.h:71
state
#define state
Definition:
json_tokener.c:128
json_tokener_state_comment
Definition:
json_tokener.h:40
json_tokener_srec::obj
struct json_object * obj
Definition:
json_tokener.h:62
json_tokener_state_number
Definition:
json_tokener.h:47
json_tokener_state_array_add
Definition:
json_tokener.h:49
json_tokener_error_parse_comment
Definition:
json_tokener.h:31
json_tokener_state_array_sep
Definition:
json_tokener.h:50
json_tokener_state_start
Definition:
json_tokener.h:36
json_tokener_new
struct json_tokener * json_tokener_new(void)
Definition:
json_tokener.c:58
json_tokener_state_null
Definition:
json_tokener.h:38
json_tokener::st_pos
int st_pos
Definition:
json_tokener.h:73
json_tokener_continue
Definition:
json_tokener.h:19
json_tokener_state_string_escape
Definition:
json_tokener.h:44
json_tokener_srec
Definition:
json_tokener.h:59
json_tokener_error_parse_null
Definition:
json_tokener.h:23
json_tokener_parse
struct json_object * json_tokener_parse(const char *str)
Definition:
json_tokener.c:92
json_tokener::ucs_char
unsigned int ucs_char
Definition:
json_tokener.h:75
json_tokener::pb
struct printbuf * pb
Definition:
json_tokener.h:72
json_tokener_error_parse_number
Definition:
json_tokener.h:25
json_tokener_state_comment_start
Definition:
json_tokener.h:39
json_tokener_state_comment_eol
Definition:
json_tokener.h:41
json_tokener_state_object_field_end
Definition:
json_tokener.h:53
json_tokener_state_object_field_start
Definition:
json_tokener.h:51
json_tokener_state_escape_unicode
Definition:
json_tokener.h:45
json_tokener_srec::saved_state
enum json_tokener_state state saved_state
Definition:
json_tokener.h:61
json_tokener_error_parse_object_value_sep
Definition:
json_tokener.h:29
json_tokener_success
Definition:
json_tokener.h:18
json_tokener_error_depth
Definition:
json_tokener.h:20
json_tokener_errors
const char * json_tokener_errors[]
Definition:
json_tokener.c:40
json_object
Definition:
json_object_private.h:21
json_tokener_error_parse_boolean
Definition:
json_tokener.h:24
json_tokener_error_parse_object_key_sep
Definition:
json_tokener.h:28
json_tokener_state
json_tokener_state
Definition:
json_tokener.h:34
json_tokener_error_parse_string
Definition:
json_tokener.h:30
json_tokener_state_array
Definition:
json_tokener.h:48
csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23