Added quantiling UDAFs
[com/gs-lite.git] / src / lib / gscpaux / json.h
1 // Distributed under the MIT license. Copyright (c) 2010, Ivan Vashchaev\r
2 \r
3 #ifndef JSON_H\r
4 #define JSON_H\r
5 \r
6 #include "block_allocator.h"\r
7 \r
8 enum json_type\r
9 {\r
10         JSON_NULL,\r
11         JSON_OBJECT,\r
12         JSON_ARRAY,\r
13         JSON_STRING,\r
14         JSON_INT,\r
15         JSON_FLOAT,\r
16         JSON_BOOL,\r
17 };\r
18 \r
19 struct json_value\r
20 {\r
21         json_value *parent;\r
22         json_value *next_sibling;\r
23         json_value *first_child;\r
24         json_value *last_child;\r
25 \r
26         char *name;\r
27         union\r
28         {\r
29                 char *string_value;\r
30                 int int_value;\r
31                 float float_value;\r
32         };\r
33 \r
34         json_type type;\r
35 };\r
36 \r
37 json_value *json_parse(char *source, char **error_pos, const char **error_desc, int *error_line, block_allocator *allocator);\r
38 \r
39 #endif\r