aboutsummaryrefslogtreecommitdiffstats
path: root/facebook/facebook-json.h
diff options
context:
space:
mode:
authorjgeboski <jgeboski@gmail.com>2015-01-01 16:21:43 -0500
committerjgeboski <jgeboski@gmail.com>2015-01-03 14:40:48 -0500
commitaaf01c2b00420fd7e28b80c1a3c419f074b2b542 (patch)
treec22ccc9533d6850d8c22e4c5d3c9d52e0bda41d7 /facebook/facebook-json.h
parentc33c1ed33b5ab7eea97402a498e4c101f6d43202 (diff)
downloadbitlbee-facebook-aaf01c2b00420fd7e28b80c1a3c419f074b2b542.tar.gz
bitlbee-facebook-aaf01c2b00420fd7e28b80c1a3c419f074b2b542.tar.bz2
bitlbee-facebook-aaf01c2b00420fd7e28b80c1a3c419f074b2b542.tar.xz
Implemented user authentication
Diffstat (limited to 'facebook/facebook-json.h')
-rw-r--r--facebook/facebook-json.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/facebook/facebook-json.h b/facebook/facebook-json.h
new file mode 100644
index 0000000..1720137
--- /dev/null
+++ b/facebook/facebook-json.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2014 James Geboski <jgeboski@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** @file **/
+
+#ifndef _FACEBOOK_JSON_H
+#define _FACEBOOK_JSON_H
+
+#include <glib.h>
+#include <json_util.h>
+
+
+/** The #GError codes of the JSON parser. **/
+typedef enum fb_json_error fb_json_error_t;
+
+
+/**
+ * The #GError codes of JSON parser.
+ **/
+enum fb_json_error
+{
+ FB_JSON_ERROR_PARSER
+};
+
+
+#define FB_JSON_ERROR fb_json_error_quark()
+
+GQuark fb_json_error_quark(void);
+
+json_value *fb_json_new(const gchar *data, gsize length, GError **err);
+
+gchar *fb_json_valstr(const json_value *json);
+
+json_value *fb_json_val(const json_value *json, const gchar *name,
+ json_type type);
+
+gboolean fb_json_val_chk(const json_value *json, const gchar *name,
+ json_type type, json_value **val);
+
+json_value *fb_json_array(const json_value *json, const gchar *name);
+
+gboolean fb_json_array_chk(const json_value *json, const gchar *name,
+ json_value **val);
+
+gboolean fb_json_bool(const json_value *json, const gchar *name);
+
+gboolean fb_json_bool_chk(const json_value *json, const gchar *name,
+ gboolean *val);
+
+gint64 fb_json_int(const json_value *json, const gchar *name);
+
+gboolean fb_json_int_chk(const json_value *json, const gchar *name,
+ gint64 *val);
+
+const gchar *fb_json_str(const json_value *json, const gchar *name);
+
+gboolean fb_json_str_chk(const json_value *json, const gchar *name,
+ const gchar **val);
+
+#endif /* _FACEBOOK_JSON_H */