gdbus: Remove root node 'name' attribute in introspection
[framework/connectivity/connman.git] / gdbus / object.c
1 /*
2  *
3  *  D-Bus helper library
4  *
5  *  Copyright (C) 2004-2011  Marcel Holtmann <marcel@holtmann.org>
6  *
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27
28 #include <stdio.h>
29 #include <string.h>
30
31 #include <glib.h>
32 #include <dbus/dbus.h>
33
34 #include "gdbus.h"
35
36 #define info(fmt...)
37 #define error(fmt...)
38 #define debug(fmt...)
39
40 struct generic_data {
41         unsigned int refcount;
42         GSList *interfaces;
43         char *introspect;
44 };
45
46 struct interface_data {
47         char *name;
48         const GDBusMethodTable *methods;
49         const GDBusSignalTable *signals;
50         const GDBusPropertyTable *properties;
51         void *user_data;
52         GDBusDestroyFunction destroy;
53 };
54
55 struct security_data {
56         GDBusPendingReply pending;
57         DBusMessage *message;
58         const GDBusMethodTable *method;
59         void *iface_user_data;
60 };
61
62 static void print_arguments(GString *gstr, const char *sig,
63                                                 const char *direction)
64 {
65         int i;
66
67         for (i = 0; sig[i]; i++) {
68                 char type[32];
69                 int struct_level, dict_level;
70                 unsigned int len;
71                 gboolean complete;
72
73                 complete = FALSE;
74                 struct_level = dict_level = 0;
75                 memset(type, 0, sizeof(type));
76
77                 /* Gather enough data to have a single complete type */
78                 for (len = 0; len < (sizeof(type) - 1) && sig[i]; len++, i++) {
79                         switch (sig[i]){
80                         case '(':
81                                 struct_level++;
82                                 break;
83                         case ')':
84                                 struct_level--;
85                                 if (struct_level <= 0 && dict_level <= 0)
86                                         complete = TRUE;
87                                 break;
88                         case '{':
89                                 dict_level++;
90                                 break;
91                         case '}':
92                                 dict_level--;
93                                 if (struct_level <= 0 && dict_level <= 0)
94                                         complete = TRUE;
95                                 break;
96                         case 'a':
97                                 break;
98                         default:
99                                 if (struct_level <= 0 && dict_level <= 0)
100                                         complete = TRUE;
101                                 break;
102                         }
103
104                         type[len] = sig[i];
105
106                         if (complete)
107                                 break;
108                 }
109
110
111                 if (direction)
112                         g_string_append_printf(gstr,
113                                         "\t\t\t<arg type=\"%s\" direction=\"%s\"/>\n",
114                                         type, direction);
115                 else
116                         g_string_append_printf(gstr,
117                                         "\t\t\t<arg type=\"%s\"/>\n",
118                                         type);
119         }
120 }
121
122 static void generate_interface_xml(GString *gstr, struct interface_data *iface)
123 {
124         const GDBusMethodTable *method;
125         const GDBusSignalTable *signal;
126
127         for (method = iface->methods; method && method->name; method++) {
128                 if (!strlen(method->signature) && !strlen(method->reply))
129                         g_string_append_printf(gstr, "\t\t<method name=\"%s\"/>\n",
130                                                                 method->name);
131                 else {
132                         g_string_append_printf(gstr, "\t\t<method name=\"%s\">\n",
133                                                                 method->name);
134                         print_arguments(gstr, method->signature, "in");
135                         print_arguments(gstr, method->reply, "out");
136                         g_string_append_printf(gstr, "\t\t</method>\n");
137                 }
138         }
139
140         for (signal = iface->signals; signal && signal->name; signal++) {
141                 if (!strlen(signal->signature))
142                         g_string_append_printf(gstr, "\t\t<signal name=\"%s\"/>\n",
143                                                                 signal->name);
144                 else {
145                         g_string_append_printf(gstr, "\t\t<signal name=\"%s\">\n",
146                                                                 signal->name);
147                         print_arguments(gstr, signal->signature, NULL);
148                         g_string_append_printf(gstr, "\t\t</signal>\n");
149                 }
150         }
151 }
152
153 static void generate_introspection_xml(DBusConnection *conn,
154                                 struct generic_data *data, const char *path)
155 {
156         GSList *list;
157         GString *gstr;
158         char **children;
159         int i;
160
161         g_free(data->introspect);
162
163         gstr = g_string_new(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE);
164
165         g_string_append_printf(gstr, "<node>\n");
166
167         for (list = data->interfaces; list; list = list->next) {
168                 struct interface_data *iface = list->data;
169
170                 g_string_append_printf(gstr, "\t<interface name=\"%s\">\n",
171                                                                 iface->name);
172
173                 generate_interface_xml(gstr, iface);
174
175                 g_string_append_printf(gstr, "\t</interface>\n");
176         }
177
178         if (!dbus_connection_list_registered(conn, path, &children))
179                 goto done;
180
181         for (i = 0; children[i]; i++)
182                 g_string_append_printf(gstr, "\t<node name=\"%s\"/>\n",
183                                                                 children[i]);
184
185         dbus_free_string_array(children);
186
187 done:
188         g_string_append_printf(gstr, "</node>\n");
189
190         data->introspect = g_string_free(gstr, FALSE);
191 }
192
193 static DBusMessage *introspect(DBusConnection *connection,
194                                 DBusMessage *message, void *user_data)
195 {
196         struct generic_data *data = user_data;
197         DBusMessage *reply;
198
199         if (!dbus_message_has_signature(message, DBUS_TYPE_INVALID_AS_STRING)) {
200                 error("Unexpected signature to introspect call");
201                 return NULL;
202         }
203
204         if (data->introspect == NULL)
205                 generate_introspection_xml(connection, data,
206                                                 dbus_message_get_path(message));
207
208         reply = dbus_message_new_method_return(message);
209         if (reply == NULL)
210                 return NULL;
211
212         dbus_message_append_args(reply, DBUS_TYPE_STRING, &data->introspect,
213                                         DBUS_TYPE_INVALID);
214
215         return reply;
216 }
217
218 static DBusHandlerResult process_message(DBusConnection *connection,
219                         DBusMessage *message, const GDBusMethodTable *method,
220                                                         void *iface_user_data)
221 {
222         DBusMessage *reply;
223
224         reply = method->function(connection, message, iface_user_data);
225
226         if (method->flags & G_DBUS_METHOD_FLAG_NOREPLY) {
227                 if (reply != NULL)
228                         dbus_message_unref(reply);
229                 return DBUS_HANDLER_RESULT_HANDLED;
230         }
231
232         if (method->flags & G_DBUS_METHOD_FLAG_ASYNC) {
233                 if (reply == NULL)
234                         return DBUS_HANDLER_RESULT_HANDLED;
235         }
236
237         if (reply == NULL)
238                 return DBUS_HANDLER_RESULT_NEED_MEMORY;
239
240         dbus_connection_send(connection, reply, NULL);
241         dbus_message_unref(reply);
242
243         return DBUS_HANDLER_RESULT_HANDLED;
244 }
245
246 static GDBusPendingReply next_pending = 1;
247 static GSList *pending_security = NULL;
248
249 static const GDBusSecurityTable *security_table = NULL;
250
251 void g_dbus_pending_success(DBusConnection *connection,
252                                         GDBusPendingReply pending)
253 {
254         GSList *list;
255
256         for (list = pending_security; list; list = list->next) {
257                 struct security_data *secdata = list->data;
258                 DBusHandlerResult result;
259
260                 if (secdata->pending != pending)
261                         continue;
262
263                 pending_security = g_slist_remove(pending_security, secdata);
264
265                 result = process_message(connection, secdata->message,
266                                 secdata->method, secdata->iface_user_data);
267
268                 dbus_message_unref(secdata->message);
269                 g_free(secdata);
270                 return;
271         }
272 }
273
274 void g_dbus_pending_error_valist(DBusConnection *connection,
275                                 GDBusPendingReply pending, const char *name,
276                                         const char *format, va_list args)
277 {
278         GSList *list;
279
280         for (list = pending_security; list; list = list->next) {
281                 struct security_data *secdata = list->data;
282                 DBusMessage *reply;
283
284                 if (secdata->pending != pending)
285                         continue;
286
287                 pending_security = g_slist_remove(pending_security, secdata);
288
289                 reply = g_dbus_create_error_valist(secdata->message,
290                                                         name, format, args);
291                 if (reply != NULL) {
292                         dbus_connection_send(connection, reply, NULL);
293                         dbus_message_unref(reply);
294                 }
295
296                 dbus_message_unref(secdata->message);
297                 g_free(secdata);
298                 return;
299         }
300 }
301
302 void g_dbus_pending_error(DBusConnection *connection,
303                                 GDBusPendingReply pending,
304                                 const char *name, const char *format, ...)
305 {
306         va_list args;
307
308         va_start(args, format);
309
310         g_dbus_pending_error_valist(connection, pending, name, format, args);
311
312         va_end(args);
313 }
314
315 int polkit_check_authorization(DBusConnection *conn,
316                                 const char *action, gboolean interaction,
317                                 void (*function) (dbus_bool_t authorized,
318                                                         void *user_data),
319                                                 void *user_data, int timeout);
320
321 struct builtin_security_data {
322         DBusConnection *conn;
323         GDBusPendingReply pending;
324 };
325
326 static void builtin_security_result(dbus_bool_t authorized, void *user_data)
327 {
328         struct builtin_security_data *data = user_data;
329
330         if (authorized == TRUE)
331                 g_dbus_pending_success(data->conn, data->pending);
332         else
333                 g_dbus_pending_error(data->conn, data->pending,
334                                                 DBUS_ERROR_AUTH_FAILED, NULL);
335
336         g_free(data);
337 }
338
339 static void builtin_security_function(DBusConnection *conn,
340                                                 const char *action,
341                                                 gboolean interaction,
342                                                 GDBusPendingReply pending)
343 {
344         struct builtin_security_data *data;
345
346         data = g_new0(struct builtin_security_data, 1);
347         data->conn = conn;
348         data->pending = pending;
349
350         if (polkit_check_authorization(conn, action, interaction,
351                                 builtin_security_result, data, 30000) < 0)
352                 g_dbus_pending_error(conn, pending, NULL, NULL);
353 }
354
355 static gboolean check_privilege(DBusConnection *conn, DBusMessage *msg,
356                         const GDBusMethodTable *method, void *iface_user_data)
357 {
358         const GDBusSecurityTable *security;
359
360         for (security = security_table; security && security->privilege;
361                                                                 security++) {
362                 struct security_data *secdata;
363                 gboolean interaction;
364
365                 if (security->privilege != method->privilege)
366                         continue;
367
368                 secdata = g_new(struct security_data, 1);
369                 secdata->pending = next_pending++;
370                 secdata->message = dbus_message_ref(msg);
371                 secdata->method = method;
372                 secdata->iface_user_data = iface_user_data;
373
374                 pending_security = g_slist_prepend(pending_security, secdata);
375
376                 if (security->flags & G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION)
377                         interaction = TRUE;
378                 else
379                         interaction = FALSE;
380
381                 if (!(security->flags & G_DBUS_SECURITY_FLAG_BUILTIN) &&
382                                                         security->function)
383                         security->function(conn, security->action,
384                                                 interaction, secdata->pending);
385                 else
386                         builtin_security_function(conn, security->action,
387                                                 interaction, secdata->pending);
388
389                 return TRUE;
390         }
391
392         return FALSE;
393 }
394
395 static void generic_unregister(DBusConnection *connection, void *user_data)
396 {
397         struct generic_data *data = user_data;
398
399         g_free(data->introspect);
400         g_free(data);
401 }
402
403 static struct interface_data *find_interface(GSList *interfaces,
404                                                 const char *name)
405 {
406         GSList *list;
407
408         if (name == NULL)
409                 return NULL;
410
411         for (list = interfaces; list; list = list->next) {
412                 struct interface_data *iface = list->data;
413                 if (!strcmp(name, iface->name))
414                         return iface;
415         }
416
417         return NULL;
418 }
419
420 static DBusHandlerResult generic_message(DBusConnection *connection,
421                                         DBusMessage *message, void *user_data)
422 {
423         struct generic_data *data = user_data;
424         struct interface_data *iface;
425         const GDBusMethodTable *method;
426         const char *interface;
427
428         interface = dbus_message_get_interface(message);
429
430         iface = find_interface(data->interfaces, interface);
431         if (iface == NULL)
432                 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
433
434         for (method = iface->methods; method &&
435                         method->name && method->function; method++) {
436                 if (dbus_message_is_method_call(message, iface->name,
437                                                         method->name) == FALSE)
438                         continue;
439
440                 if (dbus_message_has_signature(message,
441                                                 method->signature) == FALSE)
442                         continue;
443
444                 if (check_privilege(connection, message, method,
445                                                 iface->user_data) == TRUE)
446                         return DBUS_HANDLER_RESULT_HANDLED;
447
448                 return process_message(connection, message, method,
449                                                         iface->user_data);
450         }
451
452         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
453 }
454
455 static DBusObjectPathVTable generic_table = {
456         .unregister_function    = generic_unregister,
457         .message_function       = generic_message,
458 };
459
460 static void invalidate_parent_data(DBusConnection *conn, const char *child_path)
461 {
462         struct generic_data *data = NULL;
463         char *parent_path, *slash;
464
465         parent_path = g_strdup(child_path);
466         slash = strrchr(parent_path, '/');
467         if (slash == NULL)
468                 goto done;
469
470         if (slash == parent_path && parent_path[1] != '\0')
471                 parent_path[1] = '\0';
472         else
473                 *slash = '\0';
474
475         if (!strlen(parent_path))
476                 goto done;
477
478         if (dbus_connection_get_object_path_data(conn, parent_path,
479                                                         (void *) &data) == FALSE) {
480                 goto done;
481         }
482
483         invalidate_parent_data(conn, parent_path);
484
485         if (data == NULL)
486                 goto done;
487
488         g_free(data->introspect);
489         data->introspect = NULL;
490
491 done:
492         g_free(parent_path);
493 }
494
495 static GDBusMethodTable introspect_methods[] = {
496         { "Introspect", "",     "s", introspect },
497         { }
498 };
499
500 static void add_interface(struct generic_data *data, const char *name,
501                                 const GDBusMethodTable *methods,
502                                 const GDBusSignalTable *signals,
503                                 const GDBusPropertyTable *properties,
504                                 void *user_data,
505                                 GDBusDestroyFunction destroy)
506 {
507         struct interface_data *iface;
508
509         iface = g_new0(struct interface_data, 1);
510         iface->name = g_strdup(name);
511         iface->methods = methods;
512         iface->signals = signals;
513         iface->properties = properties;
514         iface->user_data = user_data;
515         iface->destroy = destroy;
516
517         data->interfaces = g_slist_append(data->interfaces, iface);
518 }
519
520 static struct generic_data *object_path_ref(DBusConnection *connection,
521                                                         const char *path)
522 {
523         struct generic_data *data;
524
525         if (dbus_connection_get_object_path_data(connection, path,
526                                                 (void *) &data) == TRUE) {
527                 if (data != NULL) {
528                         data->refcount++;
529                         return data;
530                 }
531         }
532
533         data = g_new0(struct generic_data, 1);
534         data->refcount = 1;
535
536         data->introspect = g_strdup(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<node></node>");
537
538         if (!dbus_connection_register_object_path(connection, path,
539                                                 &generic_table, data)) {
540                 g_free(data->introspect);
541                 g_free(data);
542                 return NULL;
543         }
544
545         invalidate_parent_data(connection, path);
546
547         add_interface(data, DBUS_INTERFACE_INTROSPECTABLE,
548                         introspect_methods, NULL, NULL, data, NULL);
549
550         return data;
551 }
552
553 static gboolean remove_interface(struct generic_data *data, const char *name)
554 {
555         struct interface_data *iface;
556
557         iface = find_interface(data->interfaces, name);
558         if (iface == NULL)
559                 return FALSE;
560
561         data->interfaces = g_slist_remove(data->interfaces, iface);
562
563         if (iface->destroy)
564                 iface->destroy(iface->user_data);
565
566         g_free(iface->name);
567         g_free(iface);
568
569         return TRUE;
570 }
571
572 static void object_path_unref(DBusConnection *connection, const char *path)
573 {
574         struct generic_data *data = NULL;
575
576         if (dbus_connection_get_object_path_data(connection, path,
577                                                 (void *) &data) == FALSE)
578                 return;
579
580         if (data == NULL)
581                 return;
582
583         data->refcount--;
584
585         if (data->refcount > 0)
586                 return;
587
588         remove_interface(data, DBUS_INTERFACE_INTROSPECTABLE);
589
590         invalidate_parent_data(connection, path);
591
592         dbus_connection_unregister_object_path(connection, path);
593 }
594
595 static gboolean check_signal(DBusConnection *conn, const char *path,
596                                 const char *interface, const char *name,
597                                 const char **args)
598 {
599         struct generic_data *data = NULL;
600         struct interface_data *iface;
601         const GDBusSignalTable *signal;
602
603         *args = NULL;
604         if (!dbus_connection_get_object_path_data(conn, path,
605                                         (void *) &data) || data == NULL) {
606                 error("dbus_connection_emit_signal: path %s isn't registered",
607                                 path);
608                 return FALSE;
609         }
610
611         iface = find_interface(data->interfaces, interface);
612         if (iface == NULL) {
613                 error("dbus_connection_emit_signal: %s does not implement %s",
614                                 path, interface);
615                 return FALSE;
616         }
617
618         for (signal = iface->signals; signal && signal->name; signal++) {
619                 if (!strcmp(signal->name, name)) {
620                         *args = signal->signature;
621                         break;
622                 }
623         }
624
625         if (*args == NULL) {
626                 error("No signal named %s on interface %s", name, interface);
627                 return FALSE;
628         }
629
630         return TRUE;
631 }
632
633 static dbus_bool_t emit_signal_valist(DBusConnection *conn,
634                                                 const char *path,
635                                                 const char *interface,
636                                                 const char *name,
637                                                 int first,
638                                                 va_list var_args)
639 {
640         DBusMessage *signal;
641         dbus_bool_t ret;
642         const char *signature, *args;
643
644         if (!check_signal(conn, path, interface, name, &args))
645                 return FALSE;
646
647         signal = dbus_message_new_signal(path, interface, name);
648         if (signal == NULL) {
649                 error("Unable to allocate new %s.%s signal", interface,  name);
650                 return FALSE;
651         }
652
653         ret = dbus_message_append_args_valist(signal, first, var_args);
654         if (!ret)
655                 goto fail;
656
657         signature = dbus_message_get_signature(signal);
658         if (strcmp(args, signature) != 0) {
659                 error("%s.%s: expected signature'%s' but got '%s'",
660                                 interface, name, args, signature);
661                 ret = FALSE;
662                 goto fail;
663         }
664
665         ret = dbus_connection_send(conn, signal, NULL);
666
667 fail:
668         dbus_message_unref(signal);
669
670         return ret;
671 }
672
673 gboolean g_dbus_register_interface(DBusConnection *connection,
674                                         const char *path, const char *name,
675                                         const GDBusMethodTable *methods,
676                                         const GDBusSignalTable *signals,
677                                         const GDBusPropertyTable *properties,
678                                         void *user_data,
679                                         GDBusDestroyFunction destroy)
680 {
681         struct generic_data *data;
682
683         data = object_path_ref(connection, path);
684         if (data == NULL)
685                 return FALSE;
686
687         if (find_interface(data->interfaces, name)) {
688                 object_path_unref(connection, path);
689                 return FALSE;
690         }
691
692         add_interface(data, name, methods, signals,
693                         properties, user_data, destroy);
694
695         g_free(data->introspect);
696         data->introspect = NULL;
697
698         return TRUE;
699 }
700
701 gboolean g_dbus_unregister_interface(DBusConnection *connection,
702                                         const char *path, const char *name)
703 {
704         struct generic_data *data = NULL;
705
706         if (path == NULL)
707                 return FALSE;
708
709         if (dbus_connection_get_object_path_data(connection, path,
710                                                 (void *) &data) == FALSE)
711                 return FALSE;
712
713         if (data == NULL)
714                 return FALSE;
715
716         if (remove_interface(data, name) == FALSE)
717                 return FALSE;
718
719         g_free(data->introspect);
720         data->introspect = NULL;
721
722         object_path_unref(connection, path);
723
724         return TRUE;
725 }
726
727 gboolean g_dbus_register_security(const GDBusSecurityTable *security)
728 {
729         if (security_table != NULL)
730                 return FALSE;
731
732         security_table = security;
733
734         return TRUE;
735 }
736
737 gboolean g_dbus_unregister_security(const GDBusSecurityTable *security)
738 {
739         security_table = NULL;
740
741         return TRUE;
742 }
743
744 DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name,
745                                         const char *format, va_list args)
746 {
747         char str[1024];
748
749         vsnprintf(str, sizeof(str), format, args);
750
751         return dbus_message_new_error(message, name, str);
752 }
753
754 DBusMessage *g_dbus_create_error(DBusMessage *message, const char *name,
755                                                 const char *format, ...)
756 {
757         va_list args;
758         DBusMessage *reply;
759
760         va_start(args, format);
761
762         reply = g_dbus_create_error_valist(message, name, format, args);
763
764         va_end(args);
765
766         return reply;
767 }
768
769 DBusMessage *g_dbus_create_reply_valist(DBusMessage *message,
770                                                 int type, va_list args)
771 {
772         DBusMessage *reply;
773
774         reply = dbus_message_new_method_return(message);
775         if (reply == NULL)
776                 return NULL;
777
778         if (dbus_message_append_args_valist(reply, type, args) == FALSE) {
779                 dbus_message_unref(reply);
780                 return NULL;
781         }
782
783         return reply;
784 }
785
786 DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...)
787 {
788         va_list args;
789         DBusMessage *reply;
790
791         va_start(args, type);
792
793         reply = g_dbus_create_reply_valist(message, type, args);
794
795         va_end(args);
796
797         return reply;
798 }
799
800 gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message)
801 {
802         dbus_bool_t result;
803
804         if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_METHOD_CALL)
805                 dbus_message_set_no_reply(message, TRUE);
806
807         result = dbus_connection_send(connection, message, NULL);
808
809         dbus_message_unref(message);
810
811         return result;
812 }
813
814 gboolean g_dbus_send_reply_valist(DBusConnection *connection,
815                                 DBusMessage *message, int type, va_list args)
816 {
817         DBusMessage *reply;
818
819         reply = dbus_message_new_method_return(message);
820         if (reply == NULL)
821                 return FALSE;
822
823         if (dbus_message_append_args_valist(reply, type, args) == FALSE) {
824                 dbus_message_unref(reply);
825                 return FALSE;
826         }
827
828         return g_dbus_send_message(connection, reply);
829 }
830
831 gboolean g_dbus_send_reply(DBusConnection *connection,
832                                 DBusMessage *message, int type, ...)
833 {
834         va_list args;
835         gboolean result;
836
837         va_start(args, type);
838
839         result = g_dbus_send_reply_valist(connection, message, type, args);
840
841         va_end(args);
842
843         return result;
844 }
845
846 gboolean g_dbus_emit_signal(DBusConnection *connection,
847                                 const char *path, const char *interface,
848                                 const char *name, int type, ...)
849 {
850         va_list args;
851         gboolean result;
852
853         va_start(args, type);
854
855         result = emit_signal_valist(connection, path, interface,
856                                                         name, type, args);
857
858         va_end(args);
859
860         return result;
861 }
862
863 gboolean g_dbus_emit_signal_valist(DBusConnection *connection,
864                                 const char *path, const char *interface,
865                                 const char *name, int type, va_list args)
866 {
867         return emit_signal_valist(connection, path, interface,
868                                                         name, type, args);
869 }