dbus/glib dbus-gidl.c, 1.10, 1.11 dbus-gidl.h, 1.7, 1.8 dbus-gparser.c, 1.9, 1.10

Havoc Pennington hp at freedesktop.org
Sat Feb 12 12:27:47 PST 2005


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

Modified Files:
	dbus-gidl.c dbus-gidl.h dbus-gparser.c 
Log Message:
2005-02-12  Havoc Pennington  <hp at redhat.com>

	* tools/dbus-tree-view.c (info_set_func_text): display more
	details on args

	* bus/driver.c (bus_driver_handle_list_services): list the bus
	driver

	* glib/dbus-gparser.c (parse_arg): generate an arg name if none is supplied

	* glib/dbus-gidl.c (signal_info_get_n_args): new function
	(method_info_get_n_args): new function



Index: dbus-gidl.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gidl.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- dbus-gidl.c	30 Jan 2005 05:18:44 -0000	1.10
+++ dbus-gidl.c	12 Feb 2005 20:27:45 -0000	1.11
@@ -459,6 +459,12 @@
   return info->args;
 }
 
+int
+method_info_get_n_args (MethodInfo *info)
+{
+  return g_slist_length (info->args);
+}
+
 static int
 args_sort_by_direction (const void *a,
                         const void *b)
@@ -532,6 +538,12 @@
   return info->args;
 }
 
+int
+signal_info_get_n_args (SignalInfo *info)
+{
+  return g_slist_length (info->args);
+}
+
 void
 signal_info_add_arg (SignalInfo    *info,
                      ArgInfo       *arg)

Index: dbus-gidl.h
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gidl.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- dbus-gidl.h	30 Jan 2005 05:18:44 -0000	1.7
+++ dbus-gidl.h	12 Feb 2005 20:27:45 -0000	1.8
@@ -106,6 +106,7 @@
 GSList*             method_info_get_args          (MethodInfo          *info);
 void                method_info_add_arg           (MethodInfo          *info,
                                                    ArgInfo             *arg);
+int                 method_info_get_n_args        (MethodInfo          *info);
 SignalInfo*         signal_info_new               (const char          *name);
 SignalInfo*         signal_info_ref               (SignalInfo          *info);
 void                signal_info_unref             (SignalInfo          *info);
@@ -113,6 +114,7 @@
 GSList*             signal_info_get_args          (SignalInfo          *info);
 void                signal_info_add_arg           (SignalInfo          *info,
                                                    ArgInfo             *arg);
+int                 signal_info_get_n_args        (SignalInfo          *info);
 PropertyInfo*       property_info_new             (const char          *name,
                                                    int                  type,
                                                    PropertyAccessFlags  access);

Index: dbus-gparser.c
===================================================================
RCS file: /cvs/dbus/dbus/glib/dbus-gparser.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- dbus-gparser.c	30 Jan 2005 07:44:08 -0000	1.9
+++ dbus-gparser.c	12 Feb 2005 20:27:45 -0000	1.10
@@ -620,6 +620,7 @@
   ArgDirection dir;
   int t;
   ArgInfo *arg;
+  char *generated_name;
   
   if (!(parser->method || parser->signal) ||
       parser->node_stack == NULL ||
@@ -689,8 +690,16 @@
   t = type_from_string (type, element_name, error);
   if (t == DBUS_TYPE_INVALID)
     return FALSE;
+
+  generated_name = NULL;
+  if (name == NULL)
+    generated_name = g_strdup_printf ("arg%d",
+                                      parser->method ?
+                                      method_info_get_n_args (parser->method) :
+                                      signal_info_get_n_args (parser->signal));
+                                      
   
-  arg = arg_info_new (name, dir, t);
+  arg = arg_info_new (name ? name : generated_name, dir, t);
   if (parser->method)
     method_info_add_arg (parser->method, arg);
   else if (parser->signal)
@@ -698,6 +707,8 @@
   else
     g_assert_not_reached ();
 
+  g_free (generated_name);
+  
   arg_info_unref (arg);
 
   parser->arg = arg;



More information about the dbus-commit mailing list