- dbus_message_set_auto_start (msg, TRUE);
-
- /* marshal */
- p = (char *)arg_types;
- {
- DBusMessageIter iter;
-
- dbus_message_iter_init_append (msg, &iter);
- /* special case base-types since we need to walk the stack worse-luck */
- for (;*p != '\0' && *p != '=';) {
- int intarg;
- void *ptrarg;
- double doublearg;
- dbus_int64_t int64arg;
- void *arg = NULL;
-
- switch (*p) {
- case DBUS_TYPE_BYTE:
- case DBUS_TYPE_BOOLEAN:
- case DBUS_TYPE_INT16:
- case DBUS_TYPE_UINT16:
- case DBUS_TYPE_INT32:
- case DBUS_TYPE_UINT32:
- intarg = va_arg (args, int);
- arg = &intarg;
- break;
- case DBUS_TYPE_INT64:
- case DBUS_TYPE_UINT64:
- int64arg = va_arg (args, dbus_int64_t);
- arg = &int64arg;
- break;
- case DBUS_TYPE_DOUBLE:
- doublearg = va_arg (args, double);
- arg = &doublearg;
- break;
- /* ptr types */
- case DBUS_TYPE_STRING:
- case DBUS_TYPE_OBJECT_PATH:
- case DBUS_TYPE_SIGNATURE:
- case DBUS_TYPE_ARRAY:
- case DBUS_TYPE_DICT_ENTRY:
- ptrarg = va_arg (args, void *);
- arg = &ptrarg;
- break;
- case DBUS_STRUCT_BEGIN_CHAR:
- ptrarg = va_arg (args, void *);
- arg = ptrarg;
- break;
-
- case DBUS_TYPE_VARIANT:
- fprintf (stderr, "No variant support yet - very toolkit specific\n");
- ptrarg = va_arg (args, void *);
- arg = &ptrarg;
- break;
- default:
- fprintf (stderr, "Unknown / invalid arg type %c\n", *p);
- break;
- }
- if (arg != NULL)
- dbind_any_marshal (&iter, &p, &arg);
- }
- }