dbus/glib dbus-gvalue.h, 1.6, 1.7 dbus-gvalue.c, 1.20, 1.21 dbus-gvalue-utils.h, 1.3, 1.4 dbus-gvalue-utils.c, 1.5, 1.6 dbus-gsignature.h, NONE, 1.1 dbus-gsignature.c, NONE, 1.1 dbus-gproxy.c, 1.39, 1.40 dbus-gobject.c, 1.46, 1.47 dbus-gmain.c, 1.45, 1.46 dbus-binding-tool-glib.c, 1.20, 1.21 Makefile.am, 1.25, 1.26

Colin Walters walters at freedesktop.org
Fri Aug 5 01:49:32 EST 2005


Update of /cvs/dbus/dbus/glib
In directory gabe:/tmp/cvs-serv1490/glib

Modified Files:
	dbus-gvalue.h dbus-gvalue.c dbus-gvalue-utils.h 
	dbus-gvalue-utils.c dbus-gproxy.c dbus-gobject.c dbus-gmain.c 
	dbus-binding-tool-glib.c Makefile.am 
Added Files:
	dbus-gsignature.h dbus-gsignature.c 
Log Message:
2005-08-04  Colin Walters  <walters at verbum.org>

	* glib/dbus-gvalue-utils.h (_dbus_g_type_specialized_builtins_init)
	(dbus_g_type_is_fixed, dbus_g_type_fixed_get_size)
	(dbus_gvalue_set_from_pointer, dbus_g_hash_table_value_foreach)
	(dbus_g_hash_table_insert_values, dbus_g_hash_table_insert_steal_values)
	(dbus_gtype_is_valid_hash_key, dbus_gtype_is_valid_hash_value)
	(dbus_g_hash_func_from_gtype, dbus_g_hash_free_from_gtype)
	(dbus_g_hash_equal_from_gtype, dbus_gvalue_stor, dbus_gvalue_take):
	* glib/dbus-gvalue.h (dbus_g_value_types_init)
	(dbus_gvalue_demarshal, dbus_gvalue_demarshal_variant)
	(dbus_gvalue_demarshal_message, dbus_gvalue_marshal):
	
	Prefix name with _ to ensure they're not exported.  All callers
	updated.

	* glib/dbus-gvalue.c (typecode_to_gtype)
	(dbus_typecode_maps_to_basic, basic_typecode_to_gtype)
	(signature_iter_to_g_type_dict)
	(signature_iter_to_g_type_array)
	(dbus_gtype_from_signature_iter, dbus_gtype_from_signature)
	(dbus_gtypes_from_arg_signature):
	Move to dbus-gsignature.c.

	* glib/dbus-binding-tool-glib.c (dbus_binding_tool_output_glib_server): Call
	dbus_g_type_specialized_builtins_init instead of dbus_g_value_types_init.
	(dbus_binding_tool_output_glib_client): Ditto.

	* glib/Makefile.am (DBUS_GLIB_INTERNALS): Add dbus-gsignature.c
	and dbus-gsignature.h

	* test/glib/test-service-glib.c (my_object_rec_arrays): Delete
	unused variable.


Index: dbus-gvalue.h
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dbus-gvalue.h	8 Jul 2005 16:25:36 -0000	1.6
+++ dbus-gvalue.h	4 Aug 2005 15:49:30 -0000	1.7
@@ -14,36 +14,27 @@
   DBusGProxy         *proxy;
 } DBusGValueMarshalCtx;
 
-void           dbus_g_value_types_init        (void);
-
-GType          dbus_gtype_from_signature      (const char              *signature,
-					       gboolean                 is_client);
-
-GType          dbus_gtype_from_signature_iter (DBusSignatureIter       *sigiter,
-					       gboolean                 is_client);
-
-char *         dbus_gtype_to_signature        (GType                    type);
+void           _dbus_g_value_types_init        (void);
 
-GArray *       dbus_gtypes_from_arg_signature (const char              *signature,
-					       gboolean                 is_client);
+char *         _dbus_gtype_to_signature        (GType                    type);
 
-gboolean       dbus_gvalue_demarshal          (DBusGValueMarshalCtx    *context,
+gboolean       _dbus_gvalue_demarshal          (DBusGValueMarshalCtx    *context,
 					       DBusMessageIter         *iter,
 					       GValue                  *value,
 					       GError                 **error);
 
-gboolean       dbus_gvalue_demarshal_variant  (DBusGValueMarshalCtx    *context,
+gboolean       _dbus_gvalue_demarshal_variant  (DBusGValueMarshalCtx    *context,
 					       DBusMessageIter         *iter,
 					       GValue                  *value,
 					       GError                 **error);
 
-GValueArray *  dbus_gvalue_demarshal_message  (DBusGValueMarshalCtx    *context,
+GValueArray *  _dbus_gvalue_demarshal_message  (DBusGValueMarshalCtx    *context,
 					       DBusMessage             *message,
 					       guint                    n_params,
 					       const GType             *types, 
 					       GError                 **error);
 
-gboolean       dbus_gvalue_marshal            (DBusMessageIter         *iter,
+gboolean       _dbus_gvalue_marshal            (DBusMessageIter         *iter,
 					       const GValue            *value);
 
 G_END_DECLS

Index: dbus-gvalue.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dbus-gvalue.c	1 Aug 2005 16:07:19 -0000	1.20
+++ dbus-gvalue.c	4 Aug 2005 15:49:30 -0000	1.21
@@ -25,6 +25,7 @@
 #include "config.h"
 #include "dbus-gtest.h"
 #include "dbus-gvalue.h"
+#include "dbus-gsignature.h"
 #include "dbus-gobject.h"
 #include "dbus-gvalue-utils.h"
 #include "dbus/dbus-glib.h"
@@ -140,52 +141,14 @@
   g_type_set_qdata (type, dbus_g_type_metadata_data_quark (), (gpointer) data);
 }
 
-#define MAP_BASIC(d_t, g_t)                     \
-    case DBUS_TYPE_##d_t:                       \
-      return G_TYPE_##g_t;
-static GType
-typecode_to_gtype (int type)
-{
-  switch (type)
-    {
-      MAP_BASIC (BOOLEAN, BOOLEAN);
-      MAP_BASIC (BYTE,    UCHAR);
-      MAP_BASIC (INT16,   INT);
-      MAP_BASIC (INT32,   INT);
-      MAP_BASIC (UINT16,  UINT);
-      MAP_BASIC (UINT32,  UINT);
-      MAP_BASIC (INT64,   INT64);
-      MAP_BASIC (UINT64,  UINT64);
-      MAP_BASIC (DOUBLE,  DOUBLE);
-      MAP_BASIC (STRING,  STRING);
-    default:
-      return G_TYPE_INVALID;
-    }
-}
-#undef MAP_BASIC
-
-static gboolean
-dbus_typecode_maps_to_basic (int typecode)
-{
-  return typecode_to_gtype (typecode) != G_TYPE_INVALID;
-}
-
-static GType
-basic_typecode_to_gtype (int typecode)
-{
-  g_assert (dbus_type_is_basic (typecode));
-  g_assert (dbus_typecode_maps_to_basic (typecode));
-  return typecode_to_gtype (typecode);
-}
-
 static void
 register_basic (int typecode, const DBusGTypeMarshalData *typedata)
 {
-  set_type_metadata (basic_typecode_to_gtype (typecode), typedata);
+  set_type_metadata (_dbus_gtype_from_basic_typecode (typecode), typedata);
 }
 
 void
-dbus_g_value_types_init (void)
+_dbus_g_value_types_init (void)
 {
   static gboolean types_initialized;
 
@@ -198,8 +161,7 @@
     return;
 
   dbus_g_type_specialized_init ();
-  dbus_g_type_specialized_builtins_init ();
-  
+  _dbus_g_type_specialized_builtins_init ();
 
   /* Register basic types */
   {
@@ -384,109 +346,8 @@
   return type_id;
 }
 
-static GType
-signature_iter_to_g_type_dict (const DBusSignatureIter *subiter, gboolean is_client)
-{
-  DBusSignatureIter iter;
-  GType key_gtype;
-  GType value_gtype;
-
-  g_assert (dbus_signature_iter_get_current_type (subiter) == DBUS_TYPE_DICT_ENTRY);
-
-  dbus_signature_iter_recurse (subiter, &iter);
-
-  key_gtype = dbus_gtype_from_signature_iter (&iter, is_client); 
-  if (key_gtype == G_TYPE_INVALID)
-    return G_TYPE_INVALID;
-
-  dbus_signature_iter_next (&iter);
-  value_gtype = dbus_gtype_from_signature_iter (&iter, is_client);
-  if (value_gtype == G_TYPE_INVALID)
-    return G_TYPE_INVALID;
-
-  if (!dbus_gtype_is_valid_hash_key (key_gtype)
-      || !dbus_gtype_is_valid_hash_value (value_gtype))
-    /* Later we need to return DBUS_TYPE_G_VALUE */
-    return G_TYPE_INVALID; 
-
-  return dbus_g_type_get_map ("GHashTable", key_gtype, value_gtype);
-}
-
-static GType
-signature_iter_to_g_type_array (DBusSignatureIter *iter, gboolean is_client)
-{
-  GType elt_gtype;
-
-  elt_gtype = dbus_gtype_from_signature_iter (iter, is_client);
-  if (elt_gtype == G_TYPE_INVALID)
-    return G_TYPE_INVALID;
-
-  if (elt_gtype == G_TYPE_OBJECT)
-    return DBUS_TYPE_G_OBJECT_ARRAY;
-  if (elt_gtype == G_TYPE_STRING)
-    return G_TYPE_STRV;
-  if (dbus_g_type_is_fixed (elt_gtype))
-    return dbus_g_type_get_collection ("GArray", elt_gtype);
-  else if (g_type_is_a (elt_gtype, G_TYPE_OBJECT)
-	   || g_type_is_a (elt_gtype, G_TYPE_BOXED))
-    return dbus_g_type_get_collection ("GPtrArray", elt_gtype);
-
-  /* Later we need to return DBUS_TYPE_G_VALUE */
-  return G_TYPE_INVALID; 
-}
-
-GType
-dbus_gtype_from_signature_iter (DBusSignatureIter *iter, gboolean is_client)
-{
-  int current_type;
-
-  current_type = dbus_signature_iter_get_current_type (iter);
-  /* TODO: handle type 0? */
-  if (dbus_typecode_maps_to_basic (current_type))
-    return basic_typecode_to_gtype (current_type);
-  else if (current_type == DBUS_TYPE_OBJECT_PATH)
-    return DBUS_TYPE_G_OBJECT_PATH;
-  else
-    {
-      DBusSignatureIter subiter;
-
-      g_assert (dbus_type_is_container (current_type));
-
-      if (current_type == DBUS_TYPE_VARIANT)
-	return G_TYPE_VALUE;
-      if (current_type == DBUS_TYPE_STRUCT)
-	return G_TYPE_VALUE_ARRAY;
-      
-      dbus_signature_iter_recurse (iter, &subiter);
-
-      if (current_type == DBUS_TYPE_ARRAY)
-	{
-	  int elt_type = dbus_signature_iter_get_current_type (&subiter);
-	  if (elt_type == DBUS_TYPE_DICT_ENTRY)
-	    return signature_iter_to_g_type_dict (&subiter, is_client);
-	  else 
-	    return signature_iter_to_g_type_array (&subiter, is_client);
-	}
-      else
-	{
-	  g_assert_not_reached ();
-	  return G_TYPE_INVALID;
-	}
-    }
-}
-
-GType
-dbus_gtype_from_signature (const char *signature, gboolean is_client)
-{
-  DBusSignatureIter iter;
-
-  dbus_signature_iter_init (&iter, signature);
-
-  return dbus_gtype_from_signature_iter (&iter, is_client);
-}
-
 char *
-dbus_gtype_to_signature (GType gtype)
+_dbus_gtype_to_signature (GType gtype)
 {
   char *ret;
   DBusGTypeMarshalData *typedata;
@@ -497,7 +358,7 @@
       char *subsig;
 
       elt_gtype = dbus_g_type_get_collection_specialization (gtype);
-      subsig = dbus_gtype_to_signature (elt_gtype);
+      subsig = _dbus_gtype_to_signature (elt_gtype);
       ret = g_strconcat (DBUS_TYPE_ARRAY_AS_STRING, subsig, NULL);
       g_free (subsig);
     }
@@ -510,8 +371,8 @@
 
       key_gtype = dbus_g_type_get_map_key_specialization (gtype);
       val_gtype = dbus_g_type_get_map_value_specialization (gtype);
-      key_subsig = dbus_gtype_to_signature (key_gtype);
-      val_subsig = dbus_gtype_to_signature (val_gtype);
+      key_subsig = _dbus_gtype_to_signature (key_gtype);
+      val_subsig = _dbus_gtype_to_signature (val_gtype);
       ret = g_strconcat (DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING, key_subsig, val_subsig, DBUS_DICT_ENTRY_END_CHAR_AS_STRING, NULL);
       g_free (key_subsig);
       g_free (val_subsig);
@@ -552,31 +413,9 @@
       return g_string_free (str, FALSE);
     }
   else
-    return dbus_gtype_to_signature (gtype);
-}
-
-GArray *
-dbus_gtypes_from_arg_signature (const char *argsig, gboolean is_client)
-{
-  GArray *ret;
-  int current_type;
-  DBusSignatureIter sigiter;
-
-  ret = g_array_new (FALSE, FALSE, sizeof (GType));
-
-  dbus_signature_iter_init (&sigiter, argsig);
-  while ((current_type = dbus_signature_iter_get_current_type (&sigiter)) != DBUS_TYPE_INVALID)
-    {
-      GType curtype;
-
-      curtype = dbus_gtype_from_signature_iter (&sigiter, is_client);
-      g_array_append_val (ret, curtype);
-      dbus_signature_iter_next (&sigiter);
-    }
-  return ret;
+    return _dbus_gtype_to_signature (gtype);
 }
 
-
 static gboolean
 demarshal_basic (DBusGValueMarshalCtx      *context,
 		 DBusMessageIter           *iter,
@@ -681,12 +520,12 @@
   dbus_message_iter_recurse (iter, &subiter);
   sig = dbus_message_iter_get_signature (&subiter);
 
-  variant_type = dbus_gtype_from_signature (sig, context->proxy != NULL);
+  variant_type = _dbus_gtype_from_signature (sig, context->proxy != NULL);
   if (variant_type != G_TYPE_INVALID)
     {
       g_value_init (value, variant_type);
 
-      if (!dbus_gvalue_demarshal (context, &subiter, value, error))
+      if (!_dbus_gvalue_demarshal (context, &subiter, value, error))
 	{
 	  dbus_free (sig);
 	  return FALSE;
@@ -898,7 +737,7 @@
       val = g_value_array_get_nth (ret, ret->n_values - 1);
 
       current_sig = dbus_message_iter_get_signature (&subiter);
-      elt_type = dbus_gtype_from_signature (current_sig, TRUE);
+      elt_type = _dbus_gtype_from_signature (current_sig, TRUE);
 
       g_free (current_sig);
       if (elt_type == G_TYPE_INVALID)
@@ -913,7 +752,7 @@
       
       g_value_init (val, elt_type);
 
-      if (!dbus_gvalue_demarshal (context, &subiter, val, error))
+      if (!_dbus_gvalue_demarshal (context, &subiter, val, error))
 	{
 	  g_value_array_free (ret);
 	  return FALSE;
@@ -986,7 +825,7 @@
       dbus_message_iter_recurse (&subiter, &entry_iter);
 
       g_value_init (&key_value, key_gtype);
-      if (!dbus_gvalue_demarshal (context,
+      if (!_dbus_gvalue_demarshal (context,
 				  &entry_iter,
 				  &key_value,
 				  error))
@@ -995,7 +834,7 @@
       dbus_message_iter_next (&entry_iter);
 
       g_value_init (&value_value, value_gtype);
-      if (!dbus_gvalue_demarshal (context,
+      if (!_dbus_gvalue_demarshal (context,
 				  &entry_iter,
 				  &value_value,
 				  error))
@@ -1044,7 +883,7 @@
   coltype = G_VALUE_TYPE (value);
   subtype = dbus_g_type_get_collection_specialization (coltype);
 
-  if (dbus_g_type_is_fixed (subtype))
+  if (_dbus_g_type_is_fixed (subtype))
     return demarshal_collection_array (context, iter, value, error);
   else
     return demarshal_collection_ptrarray (context, iter, value, error);
@@ -1136,9 +975,9 @@
 
   elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value));
   g_assert (elt_gtype != G_TYPE_INVALID);
-  g_assert (dbus_g_type_is_fixed (elt_gtype));
+  g_assert (_dbus_g_type_is_fixed (elt_gtype));
 
-  elt_size = dbus_g_type_fixed_get_size (elt_gtype);
+  elt_size = _dbus_g_type_fixed_get_size (elt_gtype);
   
   ret = g_array_new (FALSE, TRUE, elt_size);
 
@@ -1156,7 +995,7 @@
 }
 
 gboolean
-dbus_gvalue_demarshal (DBusGValueMarshalCtx    *context,
+_dbus_gvalue_demarshal (DBusGValueMarshalCtx    *context,
 		       DBusMessageIter         *iter,
 		       GValue                  *value,
 		       GError                 **error)
@@ -1182,7 +1021,7 @@
 }
 
 gboolean
-dbus_gvalue_demarshal_variant (DBusGValueMarshalCtx    *context,
+_dbus_gvalue_demarshal_variant (DBusGValueMarshalCtx    *context,
 			       DBusMessageIter         *iter,
 			       GValue                  *value,
 			       GError                 **error)
@@ -1191,7 +1030,7 @@
 }
 
 GValueArray *
-dbus_gvalue_demarshal_message  (DBusGValueMarshalCtx    *context,
+_dbus_gvalue_demarshal_message  (DBusGValueMarshalCtx    *context,
 				DBusMessage             *message,
 				guint                    n_types,
 				const GType             *types,
@@ -1225,7 +1064,7 @@
       gtype = types[index]; 
       g_value_init (value, gtype);
 
-      if (!dbus_gvalue_demarshal (context, &iter, value, error))
+      if (!_dbus_gvalue_demarshal (context, &iter, value, error))
 	goto lose;
       dbus_message_iter_next (&iter);
       index++;
@@ -1433,7 +1272,7 @@
 
   for (i = 0; i < array->n_values; i++)
     {
-      if (!dbus_gvalue_marshal (&subiter, g_value_array_get_nth (array, i)))
+      if (!_dbus_gvalue_marshal (&subiter, g_value_array_get_nth (array, i)))
 	return FALSE;
     }
 
@@ -1527,10 +1366,10 @@
 					 &subiter))
     goto lose;
 
-  if (!dbus_gvalue_marshal (&subiter, key))
+  if (!_dbus_gvalue_marshal (&subiter, key))
     goto lose;
 
-  if (!dbus_gvalue_marshal (&subiter, value))
+  if (!_dbus_gvalue_marshal (&subiter, value))
     goto lose;
 
   if (!dbus_message_iter_close_container (hashdata->iter, &subiter))
@@ -1561,17 +1400,17 @@
   ret = FALSE;
 
   key_type = dbus_g_type_get_map_key_specialization (gtype);
-  g_assert (dbus_gtype_is_valid_hash_key (key_type));
+  g_assert (_dbus_gtype_is_valid_hash_key (key_type));
   value_type = dbus_g_type_get_map_value_specialization (gtype);
-  g_assert (dbus_gtype_is_valid_hash_value (value_type));
+  g_assert (_dbus_gtype_is_valid_hash_value (value_type));
 
-  key_sig = dbus_gtype_to_signature (key_type);
+  key_sig = _dbus_gtype_to_signature (key_type);
   if (!key_sig)
     {
       g_warning ("Cannot marshal type \"%s\" in map\n", g_type_name (key_type));
       return FALSE;
     }
-  value_sig = dbus_gtype_to_signature (value_type);
+  value_sig = _dbus_gtype_to_signature (value_type);
   if (!value_sig)
     {
       g_free (key_sig);
@@ -1701,7 +1540,7 @@
   coltype = G_VALUE_TYPE (value);
   subtype = dbus_g_type_get_collection_specialization (coltype);
 
-  if (dbus_g_type_is_fixed (subtype))
+  if (_dbus_g_type_is_fixed (subtype))
     return marshal_collection_array (iter, value);
   else
     return marshal_collection_ptrarray (iter, value);
@@ -1723,7 +1562,7 @@
   if (!data.marshaller)
     return FALSE;
 
-  elt_sig = dbus_gtype_to_signature (elt_gtype);
+  elt_sig = _dbus_gtype_to_signature (elt_gtype);
   if (!elt_sig)
     {
       g_warning ("Cannot marshal type \"%s\" in collection\n", g_type_name (elt_gtype));
@@ -1765,15 +1604,15 @@
   char *subsignature_str;
 
   elt_gtype = dbus_g_type_get_collection_specialization (G_VALUE_TYPE (value));
-  g_assert (dbus_g_type_is_fixed (elt_gtype));
-  subsignature_str = dbus_gtype_to_signature (elt_gtype);
+  g_assert (_dbus_g_type_is_fixed (elt_gtype));
+  subsignature_str = _dbus_gtype_to_signature (elt_gtype);
   if (!subsignature_str)
     {
       g_warning ("Cannot marshal type \"%s\" in collection\n", g_type_name (elt_gtype));
       return FALSE;
     }
   
-  elt_size = dbus_g_type_fixed_get_size (elt_gtype);
+  elt_size = _dbus_g_type_fixed_get_size (elt_gtype);
 
   array = g_value_get_boxed (value);
 
@@ -1803,7 +1642,7 @@
 }
 
 gboolean
-dbus_gvalue_marshal (DBusMessageIter         *iter,
+_dbus_gvalue_marshal (DBusMessageIter         *iter,
 		     const GValue       *value)
 {
   GType gtype;
@@ -1823,7 +1662,7 @@
 assert_type_maps_to (GType gtype, const char *expected_sig)
 {
   char *sig;
-  sig = dbus_gtype_to_signature (gtype);
+  sig = _dbus_gtype_to_signature (gtype);
   g_assert (sig != NULL);
   g_assert (!strcmp (expected_sig, sig));
   g_free (sig);
@@ -1832,7 +1671,7 @@
 static void
 assert_signature_maps_to (const char *sig, GType expected_gtype)
 {
-  g_assert (dbus_gtype_from_signature (sig, TRUE) == expected_gtype);
+  g_assert (_dbus_gtype_from_signature (sig, TRUE) == expected_gtype);
 }
 
 static void
@@ -1850,7 +1689,7 @@
 gboolean
 _dbus_gvalue_test (const char *test_data_dir)
 {
-  dbus_g_value_types_init ();
+  _dbus_g_value_types_init ();
   
   assert_bidirectional_mapping (G_TYPE_STRING, DBUS_TYPE_STRING_AS_STRING);
   assert_bidirectional_mapping (G_TYPE_UCHAR, DBUS_TYPE_BYTE_AS_STRING);

Index: dbus-gvalue-utils.h
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue-utils.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- dbus-gvalue-utils.h	10 Jul 2005 22:54:18 -0000	1.3
+++ dbus-gvalue-utils.h	4 Aug 2005 15:49:30 -0000	1.4
@@ -29,39 +29,39 @@
 
 G_BEGIN_DECLS
 
-void           dbus_g_type_specialized_builtins_init (void);
+void          _dbus_g_type_specialized_builtins_init (void);
 
-gboolean       dbus_g_type_is_fixed                  (GType gtype); 
-guint          dbus_g_type_fixed_get_size            (GType gtype); 
+gboolean       _dbus_g_type_is_fixed                  (GType gtype); 
+guint          _dbus_g_type_fixed_get_size            (GType gtype); 
 
-gboolean       dbus_gvalue_set_from_pointer          (GValue *value,
+gboolean       _dbus_gvalue_set_from_pointer          (GValue *value,
 						      gconstpointer storage);
 
 typedef void (*DBusGHashValueForeachFunc) (GValue * key, GValue *val, gpointer data);
 
-void           dbus_g_hash_table_value_foreach       (GHashTable                *table,
+void           _dbus_g_hash_table_value_foreach       (GHashTable                *table,
 						      GType                      hash_type,
 						      DBusGHashValueForeachFunc  func,
 						      gpointer                   data);
 
-void           dbus_g_hash_table_insert_values       (GHashTable                *table,
+void           _dbus_g_hash_table_insert_values       (GHashTable                *table,
 						      GValue                    *key_val,
 						      GValue                    *value_val);
-void           dbus_g_hash_table_insert_steal_values (GHashTable *table,
+void           _dbus_g_hash_table_insert_steal_values (GHashTable *table,
 						      GValue     *key_val,
 						      GValue     *value_val);
 
-gboolean       dbus_gtype_is_valid_hash_key          (GType type);
-gboolean       dbus_gtype_is_valid_hash_value        (GType type);
+gboolean       _dbus_gtype_is_valid_hash_key          (GType type);
+gboolean       _dbus_gtype_is_valid_hash_value        (GType type);
 
-GHashFunc      dbus_g_hash_func_from_gtype           (GType gtype);
-GEqualFunc     dbus_g_hash_equal_from_gtype          (GType gtype);
-GDestroyNotify dbus_g_hash_free_from_gtype           (GType gtype);
+GHashFunc      _dbus_g_hash_func_from_gtype           (GType gtype);
+GEqualFunc     _dbus_g_hash_equal_from_gtype          (GType gtype);
+GDestroyNotify _dbus_g_hash_free_from_gtype           (GType gtype);
 
-gboolean       dbus_gvalue_store                     (GValue          *value,
+gboolean       _dbus_gvalue_store                     (GValue          *value,
 						      gpointer         storage);
 
-gboolean       dbus_gvalue_take                      (GValue          *value,
+gboolean       _dbus_gvalue_take                      (GValue          *value,
 						      GTypeCValue     *cvalue);
 
 gboolean       _dbus_gtype_can_signal_error          (GType                    gtype);

Index: dbus-gvalue-utils.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gvalue-utils.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dbus-gvalue-utils.c	1 Aug 2005 16:07:19 -0000	1.5
+++ dbus-gvalue-utils.c	4 Aug 2005 15:49:30 -0000	1.6
@@ -59,20 +59,20 @@
 }
 
 gboolean
-dbus_g_type_is_fixed (GType type)
+_dbus_g_type_is_fixed (GType type)
 {
   return fixed_type_get_size (type) > 0;
 }
 
 guint
-dbus_g_type_fixed_get_size (GType type)
+_dbus_g_type_fixed_get_size (GType type)
 {
-  g_assert (dbus_g_type_is_fixed (type));
+  g_assert (_dbus_g_type_is_fixed (type));
   return fixed_type_get_size (type);
 }
 
 gboolean
-dbus_gvalue_store (GValue          *value,
+_dbus_gvalue_store (GValue          *value,
 		   gpointer        storage)
 {
   /* FIXME - can we use the GValue lcopy_value method
@@ -128,7 +128,7 @@
 }
 
 gboolean
-dbus_gvalue_set_from_pointer (GValue          *value,
+_dbus_gvalue_set_from_pointer (GValue          *value,
 			      gconstpointer    storage)
 {
   /* FIXME - is there a better way to do this? */
@@ -182,7 +182,7 @@
 }
 
 gboolean
-dbus_gvalue_take (GValue          *value,
+_dbus_gvalue_take (GValue          *value,
 		  GTypeCValue     *cvalue)
 {
   GType g_type;
@@ -313,21 +313,21 @@
 }
 
 gboolean
-dbus_gtype_is_valid_hash_key (GType type)
+_dbus_gtype_is_valid_hash_key (GType type)
 {
   GHashFunc func;
   return hash_func_from_gtype (type, &func);
 }
 
 gboolean
-dbus_gtype_is_valid_hash_value (GType type)
+_dbus_gtype_is_valid_hash_value (GType type)
 {
   GDestroyNotify func;
   return hash_free_from_gtype (type, &func);
 }
 
 GHashFunc
-dbus_g_hash_func_from_gtype (GType gtype)
+_dbus_g_hash_func_from_gtype (GType gtype)
 {
   GHashFunc func;
   gboolean ret;
@@ -337,9 +337,9 @@
 }
 
 GEqualFunc
-dbus_g_hash_equal_from_gtype (GType gtype)
+_dbus_g_hash_equal_from_gtype (GType gtype)
 {
-  g_assert (dbus_gtype_is_valid_hash_key (gtype));
+  g_assert (_dbus_gtype_is_valid_hash_key (gtype));
 
   switch (gtype)
     {
@@ -358,7 +358,7 @@
 }
 
 GDestroyNotify
-dbus_g_hash_free_from_gtype (GType gtype)
+_dbus_g_hash_free_from_gtype (GType gtype)
 {
   GDestroyNotify func;
   gboolean ret;
@@ -490,7 +490,7 @@
 }
 
 void
-dbus_g_hash_table_insert_steal_values (GHashTable *table,
+_dbus_g_hash_table_insert_steal_values (GHashTable *table,
 				       GValue     *key_val,
 				       GValue     *value_val)
 {
@@ -510,7 +510,7 @@
   GHashTable *table;
 
   table = g_value_get_boxed (ctx->val);
-  dbus_g_hash_table_insert_steal_values (table, key, val);
+  _dbus_g_hash_table_insert_steal_values (table, key, val);
 }
 
 static gpointer
@@ -523,10 +523,10 @@
   key_gtype = dbus_g_type_get_map_key_specialization (type);
   value_gtype = dbus_g_type_get_map_value_specialization (type);
 
-  ret = g_hash_table_new_full (dbus_g_hash_func_from_gtype (key_gtype),
-			       dbus_g_hash_equal_from_gtype (key_gtype),
-			       dbus_g_hash_free_from_gtype (key_gtype),
-			       dbus_g_hash_free_from_gtype (value_gtype));
+  ret = g_hash_table_new_full (_dbus_g_hash_func_from_gtype (key_gtype),
+			       _dbus_g_hash_equal_from_gtype (key_gtype),
+			       _dbus_g_hash_free_from_gtype (key_gtype),
+			       _dbus_g_hash_free_from_gtype (value_gtype));
   return ret;
 }
 
@@ -543,7 +543,7 @@
   g_value_init (&value_copy, G_VALUE_TYPE (value_val));
   g_value_copy (value_val, &value_copy);
   
-  dbus_g_hash_table_insert_steal_values (table, &key_copy, &value_copy);
+  _dbus_g_hash_table_insert_steal_values (table, &key_copy, &value_copy);
 }
 
 static void
@@ -587,7 +587,7 @@
   elt_type = dbus_g_type_get_collection_specialization (type);
   g_assert (elt_type != G_TYPE_INVALID);
 
-  elt_size = dbus_g_type_fixed_get_size (elt_type);
+  elt_size = _dbus_g_type_fixed_get_size (elt_type);
 
   /* These are "safe" defaults */ 
   zero_terminated = TRUE; /* ((struct _DBusGRealArray*) garray)->zero_terminated; */
@@ -626,7 +626,7 @@
   GArray *array = instance;
 
   elt_type = dbus_g_type_get_collection_specialization (type);
-  if (!dbus_g_type_is_fixed (elt_type))
+  if (!_dbus_g_type_is_fixed (elt_type))
     return FALSE;
 
   *values = array->data;
@@ -841,7 +841,7 @@
 }
 
 void
-dbus_g_type_specialized_builtins_init (void)
+_dbus_g_type_specialized_builtins_init (void)
 {
   static const DBusGTypeSpecializedCollectionVtable array_vtable = {
     {
@@ -967,7 +967,7 @@
   GType type;
 
   dbus_g_type_specialized_init ();
-  dbus_g_type_specialized_builtins_init ();
+ _dbus_g_type_specialized_builtins_init ();
 
   type = dbus_g_type_get_collection ("GArray", G_TYPE_UINT);
   g_assert (dbus_g_type_is_collection (type));

--- NEW FILE: dbus-gsignature.h ---
#ifndef DBUS_GOBJECT_SIGNATURE_H
#define DBUS_GOBJECT_SIGNATURE_H

#include <dbus/dbus.h>
#include <dbus/dbus-signature.h>
#include <glib.h>

GType          _dbus_gtype_from_basic_typecode (int typecode);

GType          _dbus_gtype_from_signature      (const char              *signature,
					       gboolean                 is_client);

GType          _dbus_gtype_from_signature_iter (DBusSignatureIter       *sigiter,
					       gboolean                 is_client);

GArray *       _dbus_gtypes_from_arg_signature (const char              *signature,
						gboolean                 is_client);

#endif

--- NEW FILE: dbus-gsignature.c ---
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-gsignature.c Mapping from dbus type signatures to GType
 *
 * Copyright (C) 2005 Red Hat, Inc.
 *
 * Licensed under the Academic Free License version 2.1
 * 
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#include "config.h"
#include "dbus-gtest.h"
#include "dbus-gsignature.h"
#include "dbus-gvalue-utils.h"
#include <string.h>
#include <glib.h>

#define MAP_BASIC(d_t, g_t)                     \
    case DBUS_TYPE_##d_t:                       \
      return G_TYPE_##g_t;
static GType
typecode_to_gtype (int type)
{
  switch (type)
    {
      MAP_BASIC (BOOLEAN, BOOLEAN);
      MAP_BASIC (BYTE,    UCHAR);
      MAP_BASIC (INT16,   INT);
      MAP_BASIC (INT32,   INT);
      MAP_BASIC (UINT16,  UINT);
      MAP_BASIC (UINT32,  UINT);
      MAP_BASIC (INT64,   INT64);
      MAP_BASIC (UINT64,  UINT64);
      MAP_BASIC (DOUBLE,  DOUBLE);
      MAP_BASIC (STRING,  STRING);
    default:
      return G_TYPE_INVALID;
    }
}
#undef MAP_BASIC

static gboolean
dbus_typecode_maps_to_basic (int typecode)
{
  return typecode_to_gtype (typecode) != G_TYPE_INVALID;
}

GType
_dbus_gtype_from_basic_typecode (int typecode)
{
  g_assert (dbus_type_is_basic (typecode));
  g_assert (dbus_typecode_maps_to_basic (typecode));
  return typecode_to_gtype (typecode);
}

static GType
signature_iter_to_g_type_dict (const DBusSignatureIter *subiter, gboolean is_client)
{
  DBusSignatureIter iter;
  GType key_gtype;
  GType value_gtype;

  g_assert (dbus_signature_iter_get_current_type (subiter) == DBUS_TYPE_DICT_ENTRY);

  dbus_signature_iter_recurse (subiter, &iter);

  key_gtype = _dbus_gtype_from_signature_iter (&iter, is_client); 
  if (key_gtype == G_TYPE_INVALID)
    return G_TYPE_INVALID;

  dbus_signature_iter_next (&iter);
  value_gtype = _dbus_gtype_from_signature_iter (&iter, is_client);
  if (value_gtype == G_TYPE_INVALID)
    return G_TYPE_INVALID;

  if (!_dbus_gtype_is_valid_hash_key (key_gtype)
      || !_dbus_gtype_is_valid_hash_value (value_gtype))
    /* Later we need to return DBUS_TYPE_G_VALUE */
    return G_TYPE_INVALID; 

  return dbus_g_type_get_map ("GHashTable", key_gtype, value_gtype);
}

static GType
signature_iter_to_g_type_array (DBusSignatureIter *iter, gboolean is_client)
{
  GType elt_gtype;

  elt_gtype = _dbus_gtype_from_signature_iter (iter, is_client);
  if (elt_gtype == G_TYPE_INVALID)
    return G_TYPE_INVALID;

  if (elt_gtype == G_TYPE_OBJECT)
    return DBUS_TYPE_G_OBJECT_ARRAY;
  if (elt_gtype == G_TYPE_STRING)
    return G_TYPE_STRV;
  if (_dbus_g_type_is_fixed (elt_gtype))
    return dbus_g_type_get_collection ("GArray", elt_gtype);
  else if (g_type_is_a (elt_gtype, G_TYPE_OBJECT)
	   || g_type_is_a (elt_gtype, G_TYPE_BOXED))
    return dbus_g_type_get_collection ("GPtrArray", elt_gtype);

  /* Later we need to return DBUS_TYPE_G_VALUE */
  return G_TYPE_INVALID; 
}

GType
_dbus_gtype_from_signature_iter (DBusSignatureIter *iter, gboolean is_client)
{
  int current_type;

  current_type = dbus_signature_iter_get_current_type (iter);
  /* TODO: handle type 0? */
  if (dbus_typecode_maps_to_basic (current_type))
    return _dbus_gtype_from_basic_typecode (current_type);
  else if (current_type == DBUS_TYPE_OBJECT_PATH)
    return DBUS_TYPE_G_OBJECT_PATH;
  else
    {
      DBusSignatureIter subiter;

      g_assert (dbus_type_is_container (current_type));

      if (current_type == DBUS_TYPE_VARIANT)
	return G_TYPE_VALUE;
      if (current_type == DBUS_TYPE_STRUCT)
	return G_TYPE_VALUE_ARRAY;
      
      dbus_signature_iter_recurse (iter, &subiter);

      if (current_type == DBUS_TYPE_ARRAY)
	{
	  int elt_type = dbus_signature_iter_get_current_type (&subiter);
	  if (elt_type == DBUS_TYPE_DICT_ENTRY)
	    return signature_iter_to_g_type_dict (&subiter, is_client);
	  else 
	    return signature_iter_to_g_type_array (&subiter, is_client);
	}
      else
	{
	  g_assert_not_reached ();
	  return G_TYPE_INVALID;
	}
    }
}

GType
_dbus_gtype_from_signature (const char *signature, gboolean is_client)
{
  DBusSignatureIter iter;

  dbus_signature_iter_init (&iter, signature);

  return _dbus_gtype_from_signature_iter (&iter, is_client);
}

GArray *
_dbus_gtypes_from_arg_signature (const char *argsig, gboolean is_client)
{
  GArray *ret;
  int current_type;
  DBusSignatureIter sigiter;

  ret = g_array_new (FALSE, FALSE, sizeof (GType));

  dbus_signature_iter_init (&sigiter, argsig);
  while ((current_type = dbus_signature_iter_get_current_type (&sigiter)) != DBUS_TYPE_INVALID)
    {
      GType curtype;

      curtype = _dbus_gtype_from_signature_iter (&sigiter, is_client);
      g_array_append_val (ret, curtype);
      dbus_signature_iter_next (&sigiter);
    }
  return ret;
}

Index: dbus-gproxy.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gproxy.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- dbus-gproxy.c	31 Jul 2005 02:09:15 -0000	1.39
+++ dbus-gproxy.c	4 Aug 2005 15:49:30 -0000	1.40
@@ -25,6 +25,7 @@
 #include <dbus/dbus-glib-lowlevel.h>
 #include <dbus/dbus-signature.h>
 #include "dbus-gutils.h"
+#include "dbus-gsignature.h"
 #include "dbus-gvalue.h"
 #include "dbus-gvalue-utils.h"
 #include "dbus-gobject.h"
@@ -1551,7 +1552,7 @@
     context.proxy = proxy;
 
     types = (const GType*) gsignature->data;
-    value_array = dbus_gvalue_demarshal_message (&context, message,
+    value_array = _dbus_gvalue_demarshal_message (&context, message,
 						 gsignature->len, types, NULL);
   }
 
@@ -1603,7 +1604,7 @@
       if (gsignature == NULL)
 	goto out;
       
-      msg_gsignature = dbus_gtypes_from_arg_signature (dbus_message_get_signature (message),
+      msg_gsignature = _dbus_gtypes_from_arg_signature (dbus_message_get_signature (message),
 						       TRUE);
       for (i = 0; i < gsignature->len; i++)
 	{
@@ -2019,7 +2020,7 @@
 
       gvalue = g_value_array_get_nth (args, i);
 
-      if (!dbus_gvalue_marshal (&msgiter, gvalue))
+      if (!_dbus_gvalue_marshal (&msgiter, gvalue))
 	g_assert_not_reached ();
     }
   return message;
@@ -2143,7 +2144,7 @@
 	  if (arg_type == DBUS_TYPE_VARIANT
 	      && g_type_is_a (valtype, G_TYPE_VALUE))
 	    {
-	      if (!dbus_gvalue_demarshal_variant (&context, &msgiter, (GValue*) return_storage, NULL))
+	      if (!_dbus_gvalue_demarshal_variant (&context, &msgiter, (GValue*) return_storage, NULL))
 		{
 		  g_set_error (error,
 			       DBUS_GERROR,
@@ -2157,11 +2158,11 @@
 	    {
 	      g_value_init (&gvalue, valtype);
 
-	      if (!dbus_gvalue_demarshal (&context, &msgiter, &gvalue, error))
+	      if (!_dbus_gvalue_demarshal (&context, &msgiter, &gvalue, error))
 		goto out;
 
 	      /* Anything that can be demarshaled must be storable */
-	      if (!dbus_gvalue_store (&gvalue, (gpointer*) return_storage))
+	      if (!_dbus_gvalue_store (&gvalue, (gpointer*) return_storage))
 		g_assert_not_reached ();
 	      /* Ownership of the value passes to the client, don't unset */
 	    }

Index: dbus-gobject.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gobject.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- dbus-gobject.c	3 Aug 2005 23:21:49 -0000	1.46
+++ dbus-gobject.c	4 Aug 2005 15:49:30 -0000	1.47
@@ -29,6 +29,7 @@
 #include "dbus-gtest.h"
 #include "dbus-gutils.h"
 #include "dbus-gobject.h"
+#include "dbus-gsignature.h"
 #include "dbus-gvalue.h"
 #include "dbus-gmarshal.h"
 #include "dbus-gvalue-utils.h"
@@ -421,7 +422,7 @@
 
       for (arg = 0; arg < query.n_params; arg++)
 	{
-	  char *dbus_type = dbus_gtype_to_signature (query.param_types[arg]);
+	  char *dbus_type = _dbus_gtype_to_signature (query.param_types[arg]);
 
 	  g_assert (dbus_type != NULL);
 
@@ -453,7 +454,7 @@
       g_assert (spec != NULL);
       g_free (s);
       
-      dbus_type = dbus_gtype_to_signature (G_PARAM_SPEC_VALUE_TYPE (spec));
+      dbus_type = _dbus_gtype_to_signature (G_PARAM_SPEC_VALUE_TYPE (spec));
       g_assert (dbus_type != NULL);
       
       can_set = ((spec->flags & G_PARAM_WRITABLE) != 0 &&
@@ -658,7 +659,7 @@
   context.proxy = NULL;
 
   g_value_init (&value, pspec->value_type);
-  if (dbus_gvalue_demarshal (&context, &sub, &value, NULL))
+  if (_dbus_gvalue_demarshal (&context, &sub, &value, NULL))
     {
       g_object_set_property (object,
                              pspec->name,
@@ -706,7 +707,7 @@
 
   dbus_message_iter_init_append (message, &iter);
 
-  if (!dbus_gvalue_marshal (&iter, &value))
+  if (!_dbus_gvalue_marshal (&iter, &value))
     {
       dbus_message_unref (ret);
       ret = dbus_message_new_error (message,
@@ -937,11 +938,11 @@
     context.gconnection = DBUS_G_CONNECTION_FROM_CONNECTION (connection);
     context.proxy = NULL;
 
-    types_array = dbus_gtypes_from_arg_signature (in_signature, FALSE);
+    types_array = _dbus_gtypes_from_arg_signature (in_signature, FALSE);
     n_params = types_array->len;
     types = (const GType*) types_array->data;
 
-    value_array = dbus_gvalue_demarshal_message (&context, message, n_params, types, &error);
+    value_array = _dbus_gvalue_demarshal_message (&context, message, n_params, types, &error);
     if (value_array == NULL)
       {
 	g_free (in_signature); 
@@ -1014,7 +1015,7 @@
 
 	      /* Initialize our return GValue with the specified type */
 	      dbus_signature_iter_init (&tmp_sigiter, argsig);
-	      g_value_init (&return_value, dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE));
+	      g_value_init (&return_value, _dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE));
 	    }
 	  else
 	    {
@@ -1070,7 +1071,7 @@
 	    continue;
 
 	  dbus_signature_iter_init (&tmp_sigiter, argsig);
-	  current_gtype = dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE);
+	  current_gtype = _dbus_gtype_from_signature_iter (&tmp_sigiter, FALSE);
 
 	  g_value_init (&value, G_TYPE_POINTER);
 
@@ -1130,7 +1131,7 @@
       /* First, append the return value, unless it's synthetic */
       if (have_retval && !retval_is_synthetic)
 	{
-	  if (!dbus_gvalue_marshal (&iter, &return_value))
+	  if (!_dbus_gvalue_marshal (&iter, &return_value))
 	    goto nomem;
 	  if (!retval_is_constant)
 	    g_value_unset (&return_value);
@@ -1168,10 +1169,10 @@
 
 	  dbus_signature_iter_init (&argsigiter, arg_signature);
 	  
-	  g_value_init (&gvalue, dbus_gtype_from_signature_iter (&argsigiter, FALSE));
+	  g_value_init (&gvalue, _dbus_gtype_from_signature_iter (&argsigiter, FALSE));
 	  if (G_VALUE_TYPE (&gvalue) != G_TYPE_VALUE)
 	    {
-	      if (!dbus_gvalue_take (&gvalue,
+	      if (!_dbus_gvalue_take (&gvalue,
 				     &(g_array_index (out_param_values, GTypeCValue, out_param_pos))))
 		g_assert_not_reached ();
 	      out_param_pos++;
@@ -1182,10 +1183,10 @@
 	      out_param_gvalue_pos++;
 	    }
 	      
-	  if (!dbus_gvalue_marshal (&iter, &gvalue))
+	  if (!_dbus_gvalue_marshal (&iter, &gvalue))
 	    goto nomem;
 	  /* Here we actually free the allocated value; we
-	   * took ownership of it with dbus_gvalue_take, unless
+	   * took ownership of it with _dbus_gvalue_take, unless
 	   * an annotation has specified this value as constant.
 	   */
 	  if (!constval)
@@ -1404,7 +1405,7 @@
   /* First argument is the object itself, and we can't marshall that */
   for (i = 1; i < n_param_values; i++)
     {
-      if (!dbus_gvalue_marshal (&iter,
+      if (!_dbus_gvalue_marshal (&iter,
 				(GValue *) (&(param_values[i]))))
 	{
 	  g_warning ("failed to marshal parameter %d for signal %s",
@@ -1536,7 +1537,7 @@
 {
   g_return_if_fail (G_TYPE_IS_CLASSED (object_type));
 
-  dbus_g_value_types_init ();
+  _dbus_g_value_types_init ();
 
   g_type_set_qdata (object_type,
 		    dbus_g_object_type_dbus_metadata_quark (),
@@ -1874,7 +1875,7 @@
 
   reply = dbus_message_new_method_return (dbus_g_message_get_message (context->message));
   out_sig = method_output_signature_from_object_info (context->object, context->method);
-  argsig = dbus_gtypes_from_arg_signature (out_sig, FALSE);
+  argsig = _dbus_gtypes_from_arg_signature (out_sig, FALSE);
 
   dbus_message_iter_init_append (reply, &iter);
 
@@ -1891,7 +1892,7 @@
 	  g_warning(error);
 	  g_free (error);
 	}
-      dbus_gvalue_marshal (&iter, &value);
+      _dbus_gvalue_marshal (&iter, &value);
     }
   va_end (args);
 

Index: dbus-gmain.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gmain.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- dbus-gmain.c	2 Jul 2005 06:05:23 -0000	1.45
+++ dbus-gmain.c	4 Aug 2005 15:49:30 -0000	1.46
@@ -30,6 +30,7 @@
 #include "dbus-gvalue.h"
 #include "dbus-gobject.h"
 #include "dbus-gvalue-utils.h"
+#include "dbus-gsignature.h"
 #include <string.h>
 
 #include <libintl.h>
@@ -714,7 +715,7 @@
 
   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
 
-  dbus_g_value_types_init ();
+  _dbus_g_value_types_init ();
   
   dbus_error_init (&derror);
 
@@ -744,30 +745,30 @@
 gboolean
 _dbus_gmain_test (const char *test_data_dir)
 {
+  GType type;
   GType rectype;
-  GType gtype;
 
   g_type_init ();
-  dbus_g_value_types_init ();
+  _dbus_g_value_types_init ();
 
   rectype = dbus_g_type_get_collection ("GArray", G_TYPE_UINT);
   g_assert (rectype != G_TYPE_INVALID);
   g_assert (!strcmp (g_type_name (rectype), "GArray+guint"));
 
-  gtype = dbus_gtype_from_signature ("au", TRUE);
-  g_assert (gtype == rectype);
+  type = _dbus_gtype_from_signature ("au", TRUE);
+  g_assert (type == rectype);
 
   rectype = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING);
   g_assert (rectype != G_TYPE_INVALID);
   g_assert (!strcmp (g_type_name (rectype), "GHashTable+gchararray+gchararray"));
 
-  gtype = dbus_gtype_from_signature ("a{ss}", TRUE);
-  g_assert (gtype == rectype);
+  type = _dbus_gtype_from_signature ("a{ss}", TRUE);
+  g_assert (type == rectype);
 
-  gtype = dbus_gtype_from_signature ("o", FALSE);
-  g_assert (gtype == DBUS_TYPE_G_OBJECT_PATH);
-  gtype = dbus_gtype_from_signature ("o", TRUE);
-  g_assert (gtype == DBUS_TYPE_G_OBJECT_PATH);
+  type = _dbus_gtype_from_signature ("o", FALSE);
+  g_assert (type == DBUS_TYPE_G_OBJECT_PATH);
+  type = _dbus_gtype_from_signature ("o", TRUE);
+  g_assert (type == DBUS_TYPE_G_OBJECT_PATH);
   
   return TRUE;
 }

Index: dbus-binding-tool-glib.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-binding-tool-glib.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dbus-binding-tool-glib.c	11 Jul 2005 16:12:49 -0000	1.20
+++ dbus-binding-tool-glib.c	4 Aug 2005 15:49:30 -0000	1.21
@@ -23,10 +23,12 @@
  */
 
 #include <config.h>
+#include "dbus/dbus-glib.h"
 #include "dbus-gidl.h"
 #include "dbus-gparser.h"
 #include "dbus-gutils.h"
-#include "dbus-gvalue.h"
+#include "dbus-gtype-specialized.h"
+#include "dbus-gsignature.h"
 #include "dbus-gvalue-utils.h"
 #include "dbus-glib-tool.h"
 #include "dbus-binding-tool-glib.h"
@@ -146,7 +148,7 @@
 	  if (returnval_annotation != NULL)
 	    {
 	      arg_type = arg_info_get_type (arg);
-	      retval_type = dbus_gtype_from_signature (arg_type, FALSE);
+	      retval_type = _dbus_gtype_from_signature (arg_type, FALSE);
 	      if (retval_type == G_TYPE_INVALID)
 		goto invalid_type;
 	      found_retval = TRUE;
@@ -173,7 +175,7 @@
 	  GType gtype;
 	  
 	  arg_type = arg_info_get_type (arg);
-	  gtype = dbus_gtype_from_signature (arg_type, FALSE);
+	  gtype = _dbus_gtype_from_signature (arg_type, FALSE);
 	  if (gtype == G_TYPE_INVALID)
 	    goto invalid_type;
 	  
@@ -196,7 +198,7 @@
 	    {
 	      GType gtype;
 	      arg_type = arg_info_get_type (arg);
-	      gtype = dbus_gtype_from_signature (arg_type, FALSE);
+	      gtype = _dbus_gtype_from_signature (arg_type, FALSE);
 	      if (gtype == G_TYPE_INVALID)
 		goto invalid_type;
 	      /* We actually just need a pointer for the return value
@@ -658,7 +660,7 @@
 		    g_string_append_c (object_introspection_data_blob, 'R');
 		  else if (!strcmp ("error", returnval_annotation))
 		    {
-		      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+		      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
 		      if (!_dbus_gtype_can_signal_error (gtype))
 			{
 			  g_set_error (error,
@@ -769,7 +771,8 @@
 
   memset (&data, 0, sizeof (data));
 
-  dbus_g_value_types_init ();
+  dbus_g_type_specialized_init ();
+  _dbus_g_type_specialized_builtins_init ();
 
   data.prefix = prefix;
   data.generated = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, NULL);
@@ -917,7 +920,7 @@
 
       direction = arg_info_get_direction (arg);
 
-      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
       if (gtype == G_TYPE_INVALID)
 	{
 	  g_set_error (error,
@@ -1056,7 +1059,7 @@
       if (direction != arg_info_get_direction (arg))
 	continue;
 
-      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
       g_assert (gtype != G_TYPE_INVALID);
       type_lookup = dbus_g_type_get_lookup_function (gtype);
       g_assert (type_lookup != NULL);
@@ -1098,7 +1101,7 @@
       GType gtype;
 
       arg = args->data;
-      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
       if (gtype == G_TYPE_INVALID)
 	return FALSE;
     }
@@ -1144,7 +1147,7 @@
 
       dir = arg_info_get_direction (arg);
 
-      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
       type_str = dbus_g_type_get_c_name (gtype);
 
       if (!type_str)
@@ -1220,7 +1223,7 @@
       
       WRITE_OR_LOSE (", ");
 
-      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
       type_str = dbus_g_type_get_c_name (gtype);
       /* Variants are special...*/
       if (gtype == G_TYPE_VALUE)
@@ -1293,7 +1296,7 @@
       if (dir != direction)
         continue;
 
-      gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+      gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
       type_lookup = dbus_g_type_get_lookup_function (gtype);
 
       if (!write_printf_to_iochannel ("%s, &%s_%s, ", channel, error, type_lookup, direction == ARG_IN ? "IN" : "OUT", arg_info_get_name (arg)))
@@ -1326,14 +1329,14 @@
 	
 	if (arg_info_get_direction (arg) != ARG_OUT)
 	  continue;
-	gtype = dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
+	gtype = _dbus_gtype_from_signature (arg_info_get_type (arg), TRUE);
 	if (gtype != G_TYPE_VALUE && (g_type_is_a (gtype, G_TYPE_BOXED)
 	     || g_type_is_a (gtype, G_TYPE_OBJECT)
 	     || g_type_is_a (gtype, G_TYPE_POINTER)))
 	  type_suffix = "*";
 	else
 	  type_suffix = "";
-	type_str = dbus_g_type_get_c_name (dbus_gtype_from_signature (arg_info_get_type (arg), TRUE));
+	type_str = dbus_g_type_get_c_name (_dbus_gtype_from_signature (arg_info_get_type (arg), TRUE));
 	if (!write_printf_to_iochannel ("%s %sOUT_%s, ", channel, error, type_str, type_suffix, arg_info_get_name (arg)))
 	  goto io_lose;
       }
@@ -1508,13 +1511,14 @@
   DBusBindingToolCData data;
   gboolean ret;
 
-  dbus_g_value_types_init ();
-
   memset (&data, 0, sizeof (data));
   
   data.channel = channel;
   data.ignore_unsupported = ignore_unsupported;
 
+  dbus_g_type_specialized_init ();
+  _dbus_g_type_specialized_builtins_init ();
+
   WRITE_OR_LOSE ("/* Generated by dbus-binding-tool; do not edit! */\n\n");
   WRITE_OR_LOSE ("#include <glib/gtypes.h>\n");
   WRITE_OR_LOSE ("#include <glib/gerror.h>\n");

Index: Makefile.am
===================================================================
RCS file: /cvs/dbus/dbus/glib/Makefile.am,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Makefile.am	15 Jul 2005 20:28:05 -0000	1.25
+++ Makefile.am	4 Aug 2005 15:49:30 -0000	1.26
@@ -15,6 +15,9 @@
 	dbus-gtype-specialized.c	        \
 	dbus-gutils.c				\
 	dbus-gutils.h				\
+	dbus-gsignature.c			\
+	dbus-gsignature.h			\
+	dbus-gvalue.h				\
 	dbus-gvalue-utils.c			\
 	dbus-gvalue-utils.h
 
@@ -29,9 +32,9 @@
 	dbus-gproxy.c				\
 	dbus-gtest.c				\
 	dbus-gtest.h				\
-	dbus-gthread.c				\
 	dbus-gvalue.c				\
 	dbus-gvalue.h				\
+	dbus-gthread.c				\
 	$(DBUS_GLIB_INTERNALS)
 
 libdbus_glib_HEADERS =                  \



More information about the dbus-commit mailing list