Update path to xapp descriptor. Add schema parser library
[ric-app/mc.git] / schemaparser / json.h
diff --git a/schemaparser/json.h b/schemaparser/json.h
new file mode 100644 (file)
index 0000000..3af6665
--- /dev/null
@@ -0,0 +1,45 @@
+// Distributed under the MIT license. Copyright (c) 2010, Ivan Vashchaev
+
+
+
+#ifndef JSON_H
+#define JSON_H
+
+#include "block_allocator.h"
+
+namespace mc_json{
+
+enum json_type
+{
+       JSON_NULL,
+       JSON_OBJECT,
+       JSON_ARRAY,
+       JSON_STRING,
+       JSON_INT,
+       JSON_FLOAT,
+       JSON_BOOL,
+};
+
+struct json_value
+{
+       json_value *parent;
+       json_value *next_sibling;
+       json_value *first_child;
+       json_value *last_child;
+
+       char *name;
+       union
+       {
+               char *string_value;
+               int int_value;
+               float float_value;
+       };
+
+       json_type type;
+};
+
+json_value *json_parse(char *source, char **error_pos, const char **error_desc, int *error_line, block_allocator *allocator);
+
+}
+
+#endif