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