summaryrefslogtreecommitdiffstats
path: root/glib/dbus-gidl.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2004-06-01 03:02:26 +0000
committerHavoc Pennington <hp@redhat.com>2004-06-01 03:02:26 +0000
commite12863aae85dc131fcdd552edd6b32bd15702e12 (patch)
treeed7c53b2388c7136069043f3fa72f64927c95b6f /glib/dbus-gidl.c
parent23e9d3d5040f51870f212ea70a94c9913c90e66b (diff)
2004-05-31 Havoc Pennington <hp@redhat.com>
* glib/dbus-gidl.c (method_info_add_arg): keep args sorted with "in" before "out" * glib/dbus-gobject.c (dbus_type_to_string): move to dbus-gutils.c * glib/dbus-glib-tool.c (main): set up to have a --self-test option that runs the tests, and start filling in some code including for starters just dumping the interfaces to stdout * glib/Makefile.am (INCLUDES): define DBUS_LOCALEDIR * test/data/valid-introspection-files/lots-of-types.xml: test of an example introspection file * glib/dbus-gparser.c (parser_check_doctype): doctype should be "node" (I think...)
Diffstat (limited to 'glib/dbus-gidl.c')
-rw-r--r--glib/dbus-gidl.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/glib/dbus-gidl.c b/glib/dbus-gidl.c
index 2605df01..7db25c86 100644
--- a/glib/dbus-gidl.c
+++ b/glib/dbus-gidl.c
@@ -403,12 +403,33 @@ method_info_get_args (MethodInfo *info)
return info->args;
}
+static int
+args_sort_by_direction (const void *a,
+ const void *b)
+{
+ const ArgInfo *arg_a = a;
+ const ArgInfo *arg_b = b;
+
+ if (arg_a->direction == arg_b->direction)
+ return 0;
+ else if (arg_a->direction == ARG_IN)
+ return -1; /* in is less than out */
+ else
+ return 1;
+}
+
void
method_info_add_arg (MethodInfo *info,
ArgInfo *arg)
{
arg_info_ref (arg);
info->args = g_slist_append (info->args, arg);
+
+ /* Keep "in" args sorted before "out" and otherwise maintain
+ * stable order (g_slist_sort is stable, at least in sufficiently
+ * new glib)
+ */
+ info->args = g_slist_sort (info->args, args_sort_by_direction);
}
SignalInfo*
@@ -459,8 +480,12 @@ void
signal_info_add_arg (SignalInfo *info,
ArgInfo *arg)
{
+ g_assert (arg->direction == ARG_OUT);
+
arg_info_ref (arg);
info->args = g_slist_append (info->args, arg);
+
+ /* signal args don't need sorting since only "out" is allowed */
}
ArgInfo*