adium 3787:d2e2842de122: Backout the libjson changes in the prev...

commits at adium.im commits at adium.im
Mon Mar 28 21:02:15 UTC 2011


details:	http://hg.adium.im/adium/rev/d2e2842de122
revision:	3787:d2e2842de122
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Mon Mar 28 23:00:00 2011 +0200

Backout the libjson changes in the previous commit.

I hadn't tested it well enough, the libpurple build still needs them.

diffs (truncated from 1083 to 1000 lines):

diff -r b3ef94a6ec7f -r d2e2842de122 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Mon Mar 28 22:03:03 2011 +0200
+++ b/Adium.xcodeproj/project.pbxproj	Mon Mar 28 23:00:00 2011 +0200
@@ -162,6 +162,9 @@
 		11879C0B0F6FF4C400CACFB1 /* AITwitterAccountOAuthSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 11879C0A0F6FF4C400CACFB1 /* AITwitterAccountOAuthSetup.m */; };
 		11879DF80F6FFC0B00CACFB1 /* OAuthConsumer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 11879DF70F6FFC0B00CACFB1 /* OAuthConsumer.framework */; };
 		11879E0A0F6FFC1000CACFB1 /* OAuthConsumer.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 11879DF70F6FFC0B00CACFB1 /* OAuthConsumer.framework */; };
+		118A44500FEEA828008153C0 /* libjson-glib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 118A444F0FEEA828008153C0 /* libjson-glib.framework */; };
+		118A44510FEEA828008153C0 /* libjson-glib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 118A444F0FEEA828008153C0 /* libjson-glib.framework */; };
+		118A44540FEEA82E008153C0 /* libjson-glib.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 118A444F0FEEA828008153C0 /* libjson-glib.framework */; };
 		1192E6D90FD3056F003CAEF5 /* AIAnnoyingIRCMessagesHiderPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 1192E6B10FD30307003CAEF5 /* AIAnnoyingIRCMessagesHiderPlugin.h */; };
 		1192E6DA0FD30578003CAEF5 /* AIAnnoyingIRCMessagesHiderPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 1192E6B20FD30307003CAEF5 /* AIAnnoyingIRCMessagesHiderPlugin.m */; };
 		1197F6710FCF8D180032F19B /* AITwitterStatusFollowup.m in Sources */ = {isa = PBXBuildFile; fileRef = 1197F6700FCF8D180032F19B /* AITwitterStatusFollowup.m */; };
@@ -1738,6 +1741,7 @@
 				34B89479102BCDB4000ABB8E /* libgstinterfaces.framework in Copy Frameworks */,
 				34B8947A102BCDB4000ABB8E /* libgstfarsight.framework in Copy Frameworks */,
 				34B8947B102BCDB4000ABB8E /* libgstbase.framework in Copy Frameworks */,
+				118A44540FEEA82E008153C0 /* libjson-glib.framework in Copy Frameworks */,
 				633404710F9C18EF003C77A9 /* AIUtilities.framework in Copy Frameworks */,
 				639DF9D80F97E678003C9A32 /* AdiumLibpurple.framework in Copy Frameworks */,
 				11879E0A0F6FFC1000CACFB1 /* OAuthConsumer.framework in Copy Frameworks */,
@@ -4884,6 +4888,7 @@
 				811035180CDE783800EC6038 /* SecurityInterface.framework in Frameworks */,
 				633405990F9C2C00003C77A9 /* AIUtilities.framework in Frameworks */,
 				3485D8EB09EB446900232CC4 /* Adium.framework in Frameworks */,
+				118A44500FEEA828008153C0 /* libjson-glib.framework in Frameworks */,
 				34B8936C102BCDAB000ABB8E /* libgstreamer.framework in Frameworks */,
 				34B8936D102BCDAB000ABB8E /* libgstinterfaces.framework in Frameworks */,
 				34B8936E102BCDAB000ABB8E /* libgstfarsight.framework in Frameworks */,
@@ -4946,6 +4951,7 @@
 				340C1ABF0BD58FAB00D09235 /* Security.framework in Frameworks */,
 				31E0CD810C5EEF5200271DB1 /* CoreAudio.framework in Frameworks */,
 				11879DF80F6FFC0B00CACFB1 /* OAuthConsumer.framework in Frameworks */,
+				118A44510FEEA828008153C0 /* libjson-glib.framework in Frameworks */,
 				34C846AF101E515900140B4B /* QTKit.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
diff -r b3ef94a6ec7f -r d2e2842de122 Dependencies/build.sh
--- a/Dependencies/build.sh	Mon Mar 28 22:03:03 2011 +0200
+++ b/Dependencies/build.sh	Mon Mar 28 23:00:00 2011 +0200
@@ -207,6 +207,7 @@
 	   build_meanwhile $@
 
     	build_intltool $@
+	build_jsonglib $@
 
     	build_gstreamer $@
     	build_farsight $@
diff -r b3ef94a6ec7f -r d2e2842de122 Dependencies/phases/build_dependencies.sh
--- a/Dependencies/phases/build_dependencies.sh	Mon Mar 28 22:03:03 2011 +0200
+++ b/Dependencies/phases/build_dependencies.sh	Mon Mar 28 23:00:00 2011 +0200
@@ -202,4 +202,39 @@
 	log make install
 	
 	quiet popd
-}
\ No newline at end of file
+}
+
+##
+# json-glib
+#
+JSON_GLIB_VERSION=1.0
+build_jsonglib() {
+	prereq "json-glib-0.9.2" \
+		"http://ftp.gnome.org/pub/GNOME/sources/json-glib/0.9/json-glib-0.9.2.tar.gz"
+	
+	quiet pushd "$ROOTDIR/source/json-glib-0.9.2"
+	
+	if needsconfigure $@; then
+	(
+		status "Configuring json-glib"
+		export CFLAGS="$ARCH_CFLAGS"
+		export LDFLAGS="$ARCH_LDFLAGS"
+		export GLIB_LIBS="$ROOTDIR/build/lib"
+		export GLIB_CFLAGS="-I$ROOTDIR/build/include/glib-2.0 \
+			-I$ROOTDIR/build/lib/glib-2.0/include"
+		log ./configure \
+				--prefix="$ROOTDIR/build" \
+				--disable-dependency-tracking
+	)
+	fi
+	
+	status "Building and installing json-glib"
+	log make -j $NUMBER_OF_CORES
+	log make install
+	
+	# C'mon, why do you make me do this?
+	log ln -fs "$ROOTDIR/build/include/json-glib-1.0/json-glib" \
+		"$ROOTDIR/build/include/json-glib"
+	
+	quiet popd
+}
diff -r b3ef94a6ec7f -r d2e2842de122 Dependencies/phases/build_purple.sh
--- a/Dependencies/phases/build_purple.sh	Mon Mar 28 22:03:03 2011 +0200
+++ b/Dependencies/phases/build_purple.sh	Mon Mar 28 23:00:00 2011 +0200
@@ -123,7 +123,7 @@
 				$KERBEROS"
 		xconfigure "$BASE_CFLAGS -I/usr/include/kerberosIV -DHAVE_SSL \
 			        -DHAVE_OPENSSL -fno-common -DHAVE_ZLIB" \
-			"$BASE_LDFLAGS -lsasl2 -lz" \
+			"$BASE_LDFLAGS -lsasl2 -ljson-glib-1.0 -lz" \
 			"${CONFIG_CMD}" \
 			"${ROOTDIR}/source/im.pidgin.adium/libpurple/purple.h" \
 			"${ROOTDIR}/source/im.pidgin.adium/config.h"
diff -r b3ef94a6ec7f -r d2e2842de122 Dependencies/phases/make_frameworks.sh
--- a/Dependencies/phases/make_frameworks.sh	Mon Mar 28 22:03:03 2011 +0200
+++ b/Dependencies/phases/make_frameworks.sh	Mon Mar 28 23:00:00 2011 +0200
@@ -55,6 +55,13 @@
 		quiet mkdir "${meanwhileDir}" || true
 		touch "${meanwhileDir}/no_headers_here.txt"
 		
+		#json-glib
+		status "Staging json-glib headers"
+		local jsonDir="${ROOTDIR}/build/lib/include/libjson-glib-${JSON_GLIB_VERSION}.0"
+		quiet rm -r "${jsonDir}" || true
+		quiet mkdir "${jsonDir}" || true
+		log cp -R "${ROOTDIR}/build/include/json-glib-${JSON_GLIB_VERSION}/json-glib" "${jsonDir}"
+		
 		## VV stuff
 		
 		#gstreamer
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Headers
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Headers	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,1 @@
+Versions/1.0.0/Headers
\ No newline at end of file
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Resources
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Resources	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,1 @@
+Versions/1.0.0/Resources
\ No newline at end of file
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-enum-types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-enum-types.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,28 @@
+
+/* Generated data (by glib-mkenums) */
+
+#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
+#error "Only <json-glib/json-glib.h> can be included directly."
+#endif
+
+#ifndef __JSON_ENUM_TYPES_H__
+#define __JSON_ENUM_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* enumerations from "../json-glib/json-parser.h" */
+GType json_parser_error_get_type (void) G_GNUC_CONST;
+#define JSON_TYPE_PARSER_ERROR (json_parser_error_get_type())
+
+/* enumerations from "../json-glib/json-types.h" */
+GType json_node_type_get_type (void) G_GNUC_CONST;
+#define JSON_TYPE_NODE_TYPE (json_node_type_get_type())
+
+G_END_DECLS
+
+#endif /* !__JSON_ENUM_TYPES_H__ */
+
+/* Generated data ends here */
+
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-generator.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-generator.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,90 @@
+/* json-generator.h - JSON streams generator
+ * 
+ * This file is part of JSON-GLib
+ * Copyright (C) 2007  OpenedHand Ltd.
+ * Copyright (C) 2009  Intel Corp.
+ *
+ * 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/>.
+ *
+ * Author:
+ *   Emmanuele Bassi  <ebassi at linux.intel.com>
+ */
+
+#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
+#error "Only <json-glib/json-glib.h> can be included directly."
+#endif
+
+#ifndef __JSON_GENERATOR_H__
+#define __JSON_GENERATOR_H__
+
+#include <json-glib/json-types.h>
+
+G_BEGIN_DECLS
+
+#define JSON_TYPE_GENERATOR             (json_generator_get_type ())
+#define JSON_GENERATOR(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_GENERATOR, JsonGenerator))
+#define JSON_IS_GENERATOR(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_GENERATOR))
+#define JSON_GENERATOR_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), JSON_TYPE_GENERATOR, JsonGeneratorClass))
+#define JSON_IS_GENERATOR_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), JSON_TYPE_GENERATOR))
+#define JSON_GENERATOR_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), JSON_TYPE_GENERATOR, JsonGeneratorClass))
+
+typedef struct _JsonGenerator           JsonGenerator;
+typedef struct _JsonGeneratorPrivate    JsonGeneratorPrivate;
+typedef struct _JsonGeneratorClass      JsonGeneratorClass;
+
+/**
+ * JsonGenerator:
+ *
+ * JSON data streams generator. The contents of the #JsonGenerator structure
+ * are private and should only be accessed via the provided API.
+ */
+struct _JsonGenerator
+{
+  /*< private >*/
+  GObject parent_instance;
+
+  JsonGeneratorPrivate *priv;
+};
+
+/**
+ * JsonGeneratorClass:
+ *
+ * #JsonGenerator class
+ */
+struct _JsonGeneratorClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+
+  /* padding, for future expansion */
+  void (* _json_reserved1) (void);
+  void (* _json_reserved2) (void);
+  void (* _json_reserved3) (void);
+  void (* _json_reserved4) (void);
+};
+
+GType json_generator_get_type (void) G_GNUC_CONST;
+
+JsonGenerator *json_generator_new (void);
+gchar *        json_generator_to_data  (JsonGenerator  *generator,
+                                        gsize          *length);
+gboolean       json_generator_to_file  (JsonGenerator  *generator,
+                                        const gchar    *filename,
+                                        GError        **error);
+void           json_generator_set_root (JsonGenerator  *generator,
+                                        JsonNode       *node);
+
+G_END_DECLS
+
+#endif /* __JSON_GENERATOR_H__ */
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-glib.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-glib.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,39 @@
+/* json-glib.h: Main header
+ *
+ * This file is part of JSON-GLib
+ * Copyright (C) 2007  OpenedHand Ltd.
+ * Copyright (C) 2009  Intel Corp.
+ *
+ * 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/>.
+ *
+ * Author:
+ *   Emmanuele Bassi  <ebassi at linux.intel.com>
+ */
+
+#ifndef __JSON_GLIB_H__
+#define __JSON_GLIB_H__
+
+#define __JSON_GLIB_INSIDE__
+
+#include <json-glib/json-types.h>
+#include <json-glib/json-generator.h>
+#include <json-glib/json-parser.h>
+#include <json-glib/json-version.h>
+#include <json-glib/json-enum-types.h>
+
+#include <json-glib/json-gobject.h>
+
+#undef __JSON_GLIB_INSIDE__
+
+#endif /* __JSON_GLIB_H__ */
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-gobject.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-gobject.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,154 @@
+/* json-gobject.h - JSON GObject integration
+ * 
+ * This file is part of JSON-GLib
+ * Copyright (C) 2007  OpenedHand Ltd.
+ * Copyright (C) 2009  Intel Corp.
+ *
+ * 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/>.
+ *
+ * Author:
+ *   Emmanuele Bassi  <ebassi at linux.intel.com>
+ */
+
+#ifndef __JSON_GOBJECT_H__
+#define __JSON_GOBJECT_H__
+
+#include <json-glib/json-types.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define JSON_TYPE_SERIALIZABLE                  (json_serializable_get_type ())
+#define JSON_SERIALIZABLE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_SERIALIZABLE, JsonSerializable))
+#define JSON_IS_SERIALIZABLE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_SERIALIZABLE))
+#define JSON_SERIALIZABLE_GET_IFACE(obj)        (G_TYPE_INSTANCE_GET_INTERFACE ((obj), JSON_TYPE_SERIALIZABLE, JsonSerializableIface))
+
+typedef struct _JsonSerializable        JsonSerializable; /* dummy */
+typedef struct _JsonSerializableIface   JsonSerializableIface;
+
+/**
+ * JsonSerializableIface:
+ * @serialize_property: virtual function for serializing a #GObject property
+ *   into a #JsonNode
+ * @deserialize_property: virtual function for deserializing a #JsonNode
+ *   into a #GObject property
+ *
+ * Interface that allows serializing and deserializing #GObject<!-- -->s
+ * with properties storing complex data types. The json_serialize_gobject()
+ * function will check if the passed #GObject implements this interface,
+ * so it can also be used to override the default property serialization
+ * sequence.
+ */
+struct _JsonSerializableIface
+{
+  /*< private >*/
+  GTypeInterface g_iface;
+
+  /*< public >*/
+  JsonNode *(* serialize_property)   (JsonSerializable *serializable,
+                                      const gchar      *property_name,
+                                      const GValue     *value,
+                                      GParamSpec       *pspec);
+  gboolean  (* deserialize_property) (JsonSerializable *serializable,
+                                      const gchar      *property_name,
+                                      GValue           *value,
+                                      GParamSpec       *pspec,
+                                      JsonNode         *property_node);
+};
+
+GType     json_serializable_get_type (void) G_GNUC_CONST;
+
+JsonNode *json_serializable_serialize_property           (JsonSerializable *serializable,
+                                                          const gchar      *property_name,
+                                                          const GValue     *value,
+                                                          GParamSpec       *pspec);
+gboolean  json_serializable_deserialize_property         (JsonSerializable *serializable,
+                                                          const gchar      *property_name,
+                                                          GValue           *value,
+                                                          GParamSpec       *pspec,
+                                                          JsonNode         *property_node);
+
+JsonNode *json_serializable_default_serialize_property   (JsonSerializable *serializable,
+                                                          const gchar      *property_name,
+                                                          const GValue     *value,
+                                                          GParamSpec       *pspec);
+gboolean  json_serializable_default_deserialize_property (JsonSerializable *serializable,
+                                                          const gchar      *property_name,
+                                                          GValue           *value,
+                                                          GParamSpec       *pspec,
+                                                          JsonNode         *property_node);
+
+/**
+ * JsonBoxedSerializeFunc:
+ * @boxed: a #GBoxed
+ *
+ * Serializes the passed #GBoxed and stores it inside a #JsonNode
+ *
+ * Return value: the newly created #JsonNode
+ *
+ * Since: 0.10
+ */
+typedef JsonNode *(* JsonBoxedSerializeFunc) (gconstpointer boxed);
+
+/**
+ * JsonBoxedDeserializeFunc:
+ * @node: a #JsonNode
+ *
+ * Deserializes the contents of the passed #JsonNode into a #GBoxed
+ *
+ * Return value: the newly created boxed type
+ *
+ * Since: 0.10
+ */
+typedef gpointer (* JsonBoxedDeserializeFunc) (JsonNode *node);
+
+void      json_boxed_register_serialize_func   (GType                    gboxed_type,
+                                                JsonNodeType             node_type,
+                                                JsonBoxedSerializeFunc   serialize_func);
+void      json_boxed_register_deserialize_func (GType                    gboxed_type,
+                                                JsonNodeType             node_type,
+                                                JsonBoxedDeserializeFunc deserialize_func);
+gboolean  json_boxed_can_serialize             (GType                    gboxed_type,
+                                                JsonNodeType            *node_type);
+gboolean  json_boxed_can_deserialize           (GType                    gboxed_type,
+                                                JsonNodeType             node_type);
+JsonNode *json_boxed_serialize                 (GType                    gboxed_type,
+                                                gconstpointer            boxed);
+gpointer  json_boxed_deserialize               (GType                    gboxed_type,
+                                                JsonNode                *node);
+
+JsonNode *json_gobject_serialize               (GObject                 *gobject);
+GObject * json_gobject_deserialize             (GType                    gtype,
+                                                JsonNode                *node);
+
+GObject * json_gobject_from_data               (GType                    gtype,
+                                                const gchar             *data,
+                                                gssize                   length,
+                                                GError                 **error);
+gchar *   json_gobject_to_data                 (GObject                 *gobject,
+                                                gsize                   *length);
+
+#ifndef JSON_DISABLE_DEPRECATED
+GObject * json_construct_gobject               (GType                    gtype,
+                                                const gchar             *data,
+                                                gsize                    length,
+                                                GError                 **error) G_GNUC_DEPRECATED;
+gchar *   json_serialize_gobject               (GObject                 *gobject,
+                                                gsize                   *length) G_GNUC_MALLOC G_GNUC_DEPRECATED;
+#endif /* JSON_DISABLE_DEPRECATED */
+
+
+G_END_DECLS
+
+#endif /* __JSON_GOBJECT_H__ */
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-parser.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-parser.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,150 @@
+/* json-parser.h - JSON streams parser
+ * 
+ * This file is part of JSON-GLib
+ * Copyright (C) 2007  OpenedHand Ltd.
+ * Copyright (C) 2009  Intel Corp.
+ *
+ * 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/>.
+ *
+ * Author:
+ *   Emmanuele Bassi  <ebassi at linux.intel.com>
+ */
+
+#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
+#error "Only <json-glib/json-glib.h> can be included directly."
+#endif
+
+#ifndef __JSON_PARSER_H__
+#define __JSON_PARSER_H__
+
+#include <glib-object.h>
+#include "json-types.h"
+
+G_BEGIN_DECLS
+
+#define JSON_TYPE_PARSER                (json_parser_get_type ())
+#define JSON_PARSER(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_PARSER, JsonParser))
+#define JSON_IS_PARSER(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_PARSER))
+#define JSON_PARSER_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), JSON_TYPE_PARSER, JsonParserClass))
+#define JSON_IS_PARSER_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), JSON_TYPE_PARSER))
+#define JSON_PARSER_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), JSON_TYPE_PARSER, JsonParserClass))
+
+#define JSON_PARSER_ERROR               (json_parser_error_quark ())
+
+typedef struct _JsonParser              JsonParser;
+typedef struct _JsonParserPrivate       JsonParserPrivate;
+typedef struct _JsonParserClass         JsonParserClass;
+
+/**
+ * JsonParserError:
+ * @JSON_PARSER_ERROR_PARSE: parse error
+ * @JSON_PARSER_ERROR_UNKNOWN: unknown error
+ *
+ * Error enumeration for #JsonParser
+ */
+typedef enum {
+  JSON_PARSER_ERROR_PARSE,
+  
+  JSON_PARSER_ERROR_UNKNOWN
+} JsonParserError;
+
+/**
+ * JsonParser:
+ * 
+ * JSON data streams parser. The contents of the #JsonParser structure are
+ * private and should only be accessed via the provided API.
+ */
+struct _JsonParser
+{
+  /*< private >*/
+  GObject parent_instance;
+
+  JsonParserPrivate *priv;
+};
+
+/**
+ * JsonParserClass:
+ * @parse_start: class handler for the JsonParser::parse-start signal
+ * @object_start: class handler for the JsonParser::object-start signal
+ * @object_member: class handler for the JsonParser::object-member signal
+ * @object_end: class handler for the JsonParser::object-end signal
+ * @array_start: class handler for the JsonParser::array-start signal
+ * @array_element: class handler for the JsonParser::array-element signal
+ * @array_end: class handler for the JsonParser::array-end signal
+ * @parse_end: class handler for the JsonParser::parse-end signal
+ * @error: class handler for the JsonParser::error signal
+ *
+ * #JsonParser class.
+ */
+struct _JsonParserClass
+{
+  /*< private >*/
+  GObjectClass parent_class;
+
+  /*< public  >*/
+  void (* parse_start)   (JsonParser   *parser);
+
+  void (* object_start)  (JsonParser   *parser);
+  void (* object_member) (JsonParser   *parser,
+                          JsonObject   *object,
+                          const gchar  *member_name);
+  void (* object_end)    (JsonParser   *parser,
+                          JsonObject   *object);
+
+  void (* array_start)   (JsonParser   *parser);
+  void (* array_element) (JsonParser   *parser,
+                          JsonArray    *array,
+                          gint          index_);
+  void (* array_end)     (JsonParser   *parser,
+                          JsonArray    *array);
+
+  void (* parse_end)     (JsonParser   *parser);
+  
+  void (* error)         (JsonParser   *parser,
+                          const GError *error);
+
+  /*< private >*/
+  /* padding for future expansion */
+  void (* _json_reserved1) (void);
+  void (* _json_reserved2) (void);
+  void (* _json_reserved3) (void);
+  void (* _json_reserved4) (void);
+  void (* _json_reserved5) (void);
+  void (* _json_reserved6) (void);
+  void (* _json_reserved7) (void);
+  void (* _json_reserved8) (void);
+};
+
+GQuark      json_parser_error_quark      (void);
+GType       json_parser_get_type         (void) G_GNUC_CONST;
+
+JsonParser *json_parser_new              (void);
+gboolean    json_parser_load_from_file   (JsonParser   *parser,
+                                          const gchar  *filename,
+                                          GError      **error);
+gboolean    json_parser_load_from_data   (JsonParser   *parser,
+                                          const gchar  *data,
+                                          gssize        length,
+                                          GError      **error);
+
+JsonNode *  json_parser_get_root         (JsonParser   *parser);
+
+guint       json_parser_get_current_line (JsonParser   *parser);
+guint       json_parser_get_current_pos  (JsonParser   *parser);
+gboolean    json_parser_has_assignment   (JsonParser   *parser,
+                                          gchar       **variable_name);
+
+G_END_DECLS
+
+#endif /* __JSON_PARSER_H__ */
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-types.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,335 @@
+/* json-types.h - JSON data types
+ * 
+ * This file is part of JSON-GLib
+ * Copyright (C) 2007  OpenedHand Ltd.
+ * Copyright (C) 2009  Intel Corp.
+ *
+ * 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/>.
+ *
+ * Author:
+ *   Emmanuele Bassi  <ebassi at linux.intel.com>
+ */
+
+#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
+#error "Only <json-glib/json-glib.h> can be included directly."
+#endif
+
+#ifndef __JSON_TYPES_H__
+#define __JSON_TYPES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/**
+ * JSON_NODE_TYPE:
+ * @node: a #JsonNode
+ *
+ * Evaluates to the #JsonNodeType contained by @node
+ */
+#define JSON_NODE_TYPE(node)    (json_node_get_node_type ((node)))
+
+/**
+ * JSON_NODE_HOLDS:
+ * @node: a #JsonNode
+ * @t: a #JsonNodeType
+ *
+ * Evaluates to %TRUE if the @node holds type @t
+ *
+ * Since: 0.10
+ */
+#define JSON_NODE_HOLDS(node,t)         (json_node_get_node_type ((node)) == (t))
+
+/**
+ * JSON_NODE_HOLDS_VALUE:
+ * @node: a #JsonNode
+ *
+ * Evaluates to %TRUE if @node holds a %JSON_NODE_VALUE
+ *
+ * Since: 0.10
+ */
+#define JSON_NODE_HOLDS_VALUE(node)     (JSON_NODE_HOLDS ((node), JSON_NODE_VALUE))
+
+/**
+ * JSON_NODE_HOLDS_OBJECT:
+ * @node: a #JsonNode
+ *
+ * Evaluates to %TRUE if @node holds a %JSON_NODE_OBJECT
+ *
+ * Since: 0.10
+ */
+#define JSON_NODE_HOLDS_OBJECT(node)    (JSON_NODE_HOLDS ((node), JSON_NODE_OBJECT))
+
+/**
+ * JSON_NODE_HOLDS_ARRAY:
+ * @node: a #JsonNode
+ *
+ * Evaluates to %TRUE if @node holds a %JSON_NODE_ARRAY
+ *
+ * Since: 0.10
+ */
+#define JSON_NODE_HOLDS_ARRAY(node)     (JSON_NODE_HOLDS ((node), JSON_NODE_ARRAY))
+
+/**
+ * JSON_NODE_HOLDS_NULL:
+ * @node: a #JsonNode
+ *
+ * Evaluates to %TRUE if @node holds a %JSON_NODE_NULL
+ *
+ * Since: 0.10
+ */
+#define JSON_NODE_HOLDS_NULL(node)      (JSON_NODE_HOLDS ((node), JSON_NODE_NULL))
+
+#define JSON_TYPE_NODE          (json_node_get_type ())
+#define JSON_TYPE_OBJECT        (json_object_get_type ())
+#define JSON_TYPE_ARRAY         (json_array_get_type ())
+
+/**
+ * JsonNode:
+ * @type: the type of node
+ *
+ * A generic container of JSON data types. The contents of the #JsonNode
+ * structure are private and should only be accessed via the provided
+ * functions and never directly.
+ */
+typedef struct _JsonNode        JsonNode;
+
+/**
+ * JsonObject:
+ *
+ * A JSON object type. The contents of the #JsonObject structure are private
+ * and should only be accessed by the provided API
+ */
+typedef struct _JsonObject      JsonObject;
+
+/**
+ * JsonArray:
+ *
+ * A JSON array type. The contents of the #JsonArray structure are private
+ * and should only be accessed by the provided API
+ */
+typedef struct _JsonArray       JsonArray;
+
+/**
+ * JsonNodeType:
+ * @JSON_NODE_OBJECT: The node contains a #JsonObject
+ * @JSON_NODE_ARRAY: The node contains a #JsonArray
+ * @JSON_NODE_VALUE: The node contains a fundamental type
+ * @JSON_NODE_NULL: Special type, for nodes containing null
+ *
+ * Indicates the content of a #JsonNode.
+ */
+typedef enum {
+  JSON_NODE_OBJECT,
+  JSON_NODE_ARRAY,
+  JSON_NODE_VALUE,
+  JSON_NODE_NULL
+} JsonNodeType;
+
+/**
+ * JsonObjectForeach:
+ * @object: the iterated #JsonObject
+ * @member_name: the name of the member
+ * @member_node: a #JsonNode containing the @member_name value
+ * @user_data: data passed to the function
+ *
+ * The function to be passed to json_object_foreach_member(). You
+ * should not add or remove members to and from @object within
+ * this function. It is safe to change the value of @member_node.
+ *
+ * Since: 0.8
+ */
+typedef void (* JsonObjectForeach) (JsonObject  *object,
+                                    const gchar *member_name,
+                                    JsonNode    *member_node,
+                                    gpointer     user_data);
+
+/**
+ * JsonArrayForeach:
+ * @array: the iterated #JsonArray
+ * @index_: the index of the element
+ * @element_node: a #JsonNode containing the value at @index_
+ * @user_data: data passed to the function
+ *
+ * The function to be passed to json_array_foreach_element(). You
+ * should not add or remove elements to and from @array within
+ * this function. It is safe to change the value of @element_node.
+ *
+ * Since: 0.8
+ */
+typedef void (* JsonArrayForeach) (JsonArray  *array,
+                                   guint       index_,
+                                   JsonNode   *element_node,
+                                   gpointer    user_data);
+
+/*
+ * JsonNode
+ */
+GType                 json_node_get_type        (void) G_GNUC_CONST;
+JsonNode *            json_node_new             (JsonNodeType  type);
+JsonNode *            json_node_copy            (JsonNode     *node);
+void                  json_node_free            (JsonNode     *node);
+JsonNodeType          json_node_get_node_type   (JsonNode     *node);
+GType                 json_node_get_value_type  (JsonNode     *node);
+void                  json_node_set_parent      (JsonNode     *node,
+                                                 JsonNode     *parent);
+JsonNode *            json_node_get_parent      (JsonNode     *node);
+G_CONST_RETURN gchar *json_node_type_name       (JsonNode     *node);
+
+void                  json_node_set_object      (JsonNode     *node,
+                                                 JsonObject   *object);
+void                  json_node_take_object     (JsonNode     *node,
+                                                 JsonObject   *object);
+JsonObject *          json_node_get_object      (JsonNode     *node);
+JsonObject *          json_node_dup_object      (JsonNode     *node);
+void                  json_node_set_array       (JsonNode     *node,
+                                                 JsonArray    *array);
+void                  json_node_take_array      (JsonNode     *node,
+                                                 JsonArray    *array);
+JsonArray *           json_node_get_array       (JsonNode     *node);
+JsonArray *           json_node_dup_array       (JsonNode     *node);
+void                  json_node_set_value       (JsonNode     *node,
+                                                 const GValue *value);
+void                  json_node_get_value       (JsonNode     *node,
+                                                 GValue       *value);
+void                  json_node_set_string      (JsonNode     *node,
+                                                 const gchar  *value);
+G_CONST_RETURN gchar *json_node_get_string      (JsonNode     *node);
+gchar *               json_node_dup_string      (JsonNode     *node);
+void                  json_node_set_int         (JsonNode     *node,
+                                                 gint64        value);
+gint64                json_node_get_int         (JsonNode     *node);
+void                  json_node_set_double      (JsonNode     *node,
+                                                 gdouble       value);
+gdouble               json_node_get_double      (JsonNode     *node);
+void                  json_node_set_boolean     (JsonNode     *node,
+                                                 gboolean      value);
+gboolean              json_node_get_boolean     (JsonNode     *node);
+gboolean              json_node_is_null         (JsonNode     *node);
+
+/*
+ * JsonObject
+ */
+GType                 json_object_get_type           (void) G_GNUC_CONST;
+JsonObject *          json_object_new                (void);
+JsonObject *          json_object_ref                (JsonObject  *object);
+void                  json_object_unref              (JsonObject  *object);
+
+#ifndef JSON_DISABLE_DEPRECATED
+void                  json_object_add_member         (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      JsonNode    *node) G_GNUC_DEPRECATED;
+#endif /* JSON_DISABLE_DEPRECATED */
+
+void                  json_object_set_member         (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      JsonNode    *node);
+void                  json_object_set_int_member     (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      gint64       value);
+void                  json_object_set_double_member  (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      gdouble      value);
+void                  json_object_set_boolean_member (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      gboolean     value);
+void                  json_object_set_string_member  (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      const gchar *value);
+void                  json_object_set_null_member    (JsonObject  *object,
+                                                      const gchar *member_name);
+void                  json_object_set_array_member   (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      JsonArray   *value);
+void                  json_object_set_object_member  (JsonObject  *object,
+                                                      const gchar *member_name,
+                                                      JsonObject  *value);
+GList *               json_object_get_members        (JsonObject  *object);
+JsonNode *            json_object_get_member         (JsonObject  *object,
+                                                      const gchar *member_name);
+JsonNode *            json_object_dup_member         (JsonObject  *object,
+                                                      const gchar *member_name);
+gint64                json_object_get_int_member     (JsonObject  *object,
+                                                      const gchar *member_name);
+gdouble               json_object_get_double_member  (JsonObject  *object,
+                                                      const gchar *member_name);
+gboolean              json_object_get_boolean_member (JsonObject  *object,
+                                                      const gchar *member_name);
+G_CONST_RETURN gchar *json_object_get_string_member  (JsonObject  *object,
+                                                      const gchar *member_name);
+gboolean              json_object_get_null_member    (JsonObject  *object,
+                                                      const gchar *member_name);
+JsonArray *           json_object_get_array_member   (JsonObject  *object,
+                                                      const gchar *member_name);
+JsonObject *          json_object_get_object_member  (JsonObject  *object,
+                                                      const gchar *member_name);
+gboolean              json_object_has_member         (JsonObject  *object,
+                                                      const gchar *member_name);
+void                  json_object_remove_member      (JsonObject  *object,
+                                                      const gchar *member_name);
+GList *               json_object_get_values         (JsonObject  *object);
+guint                 json_object_get_size           (JsonObject  *object);
+void                  json_object_foreach_member     (JsonObject  *object,
+                                                      JsonObjectForeach func,
+                                                      gpointer     data);
+
+GType                 json_array_get_type            (void) G_GNUC_CONST;
+JsonArray *           json_array_new                 (void);
+JsonArray *           json_array_sized_new           (guint        n_elements);
+JsonArray *           json_array_ref                 (JsonArray   *array);
+void                  json_array_unref               (JsonArray   *array);
+void                  json_array_add_element         (JsonArray   *array,
+                                                      JsonNode    *node);
+void                  json_array_add_int_element     (JsonArray   *array,
+                                                      gint64       value);
+void                  json_array_add_double_element  (JsonArray   *array,
+                                                      gdouble      value);
+void                  json_array_add_boolean_element (JsonArray   *array,
+                                                      gboolean     value);
+void                  json_array_add_string_element  (JsonArray   *array,
+                                                      const gchar *value);
+void                  json_array_add_null_element    (JsonArray   *array);
+void                  json_array_add_array_element   (JsonArray   *array,
+                                                      JsonArray   *value);
+void                  json_array_add_object_element  (JsonArray   *array,
+                                                      JsonObject  *value);
+GList *               json_array_get_elements        (JsonArray   *array);
+JsonNode *            json_array_get_element         (JsonArray   *array,
+                                                      guint        index_);
+gint64                json_array_get_int_element     (JsonArray   *array,
+                                                      guint        index_);
+gdouble               json_array_get_double_element  (JsonArray   *array,
+                                                      guint        index_);
+gboolean              json_array_get_boolean_element (JsonArray   *array,
+                                                      guint        index_);
+G_CONST_RETURN gchar *json_array_get_string_element  (JsonArray   *array,
+                                                      guint        index_);
+gboolean              json_array_get_null_element    (JsonArray   *array,
+                                                      guint        index_);
+JsonArray *           json_array_get_array_element   (JsonArray   *array,
+                                                      guint        index_);
+JsonObject *          json_array_get_object_element  (JsonArray   *array,
+                                                      guint        index_);
+JsonNode *            json_array_dup_element         (JsonArray   *array,
+                                                      guint        index_);
+void                  json_array_remove_element      (JsonArray   *array,
+                                                      guint        index_);
+guint                 json_array_get_length          (JsonArray   *array);
+void                  json_array_foreach_element     (JsonArray   *array,
+                                                      JsonArrayForeach func,
+                                                      gpointer     data);
+
+G_END_DECLS
+
+#endif /* __JSON_TYPES_H__ */
diff -r b3ef94a6ec7f -r d2e2842de122 Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-version.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Frameworks/libjson-glib.framework/Versions/1.0.0/Headers/json-version.h	Mon Mar 28 23:00:00 2011 +0200
@@ -0,0 +1,100 @@
+/* json-version.h - JSON-GLib versioning information
+ * 
+ * This file is part of JSON-GLib
+ * Copyright (C) 2007  OpenedHand Ltd.
+ * Copyright (C) 2009  Intel Corp.
+ *
+ * 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/>.
+ *
+ * Author:
+ *   Emmanuele Bassi  <ebassi at linux.intel.com>
+ */
+
+#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
+#error "Only <json-glib/json-glib.h> can be included directly."
+#endif
+
+#ifndef __JSON_VERSION_H__
+#define __JSON_VERSION_H__
+
+/**
+ * SECTION:json-version
+ * @short_description: JSON-GLib version checking
+ *
+ * JSON-GLib provides macros to check the version of the library
+ * at compile-time
+ */
+
+/**
+ * JSON_MAJOR_VERSION:
+ *
+ * Json major version component (e.g. 1 if %JSON_VERSION is 1.2.3)




More information about the commits mailing list