Fix: update the correct pre-built script to cmake-sonar.sh
[ric-app/mc.git] / schemaparser / json.h
1 // Distributed under the MIT license. Copyright (c) 2010, Ivan Vashchaev
2
3
4
5 #ifndef JSON_H
6 #define JSON_H
7
8 #include "block_allocator.h"
9
10 namespace mc_json{
11
12 enum json_type
13 {
14         JSON_NULL,
15         JSON_OBJECT,
16         JSON_ARRAY,
17         JSON_STRING,
18         JSON_INT,
19         JSON_FLOAT,
20         JSON_BOOL,
21 };
22
23 struct json_value
24 {
25         json_value *parent;
26         json_value *next_sibling;
27         json_value *first_child;
28         json_value *last_child;
29
30         char *name;
31         union
32         {
33                 char *string_value;
34                 int int_value;
35                 float float_value;
36         };
37
38         json_type type;
39 };
40
41 json_value *json_parse(char *source, char **error_pos, const char **error_desc, int *error_line, block_allocator *allocator);
42
43 }
44
45 #endif