summaryrefslogtreecommitdiff
path: root/json-glib/json-utils.h
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2015-06-09 12:23:12 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2015-06-09 12:58:22 +0100
commitb6546a62362bafcb0aa2d97175a15c4218cc6023 (patch)
tree914bf7da79e86f7bea7bd6e4a36181fc4dbf7895 /json-glib/json-utils.h
parent445a787757eb08afeee61a6c5fdbd6622c43d0af (diff)
downloadjson-glib-b6546a62362bafcb0aa2d97175a15c4218cc6023.tar.gz
Add simple JSON/string utilities
Wrap JsonParser and JsonGenerator in simple, easy to call functions that manage the objects for you.
Diffstat (limited to 'json-glib/json-utils.h')
-rw-r--r--json-glib/json-utils.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/json-glib/json-utils.h b/json-glib/json-utils.h
new file mode 100644
index 0000000..e709ecd
--- /dev/null
+++ b/json-glib/json-utils.h
@@ -0,0 +1,40 @@
+/* json-utils.h - JSON utility API
+ *
+ * This file is part of JSON-GLib
+ * Copyright 2015 Emmanuele Bassi
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __JSON_UTILS_H__
+#define __JSON_UTILS_H__
+
+#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
+#error "Only <json-glib/json-glib.h> can be included directly."
+#endif
+
+#include <json-glib/json-types.h>
+
+G_BEGIN_DECLS
+
+JSON_AVAILABLE_IN_1_2
+JsonNode * json_from_string (const char *str,
+ GError **error);
+JSON_AVAILABLE_IN_1_2
+char * json_to_string (JsonNode *node,
+ gboolean pretty);
+
+G_END_DECLS
+
+#endif /* __JSON_UTILS_H__ */