static Lisp_Object QCdbus_type_double, QCdbus_type_string;
static Lisp_Object QCdbus_type_object_path, QCdbus_type_signature;
#ifdef DBUS_TYPE_UNIX_FD
-Lisp_Object QCdbus_type_unix_fd;
+static Lisp_Object QCdbus_type_unix_fd;
#endif
static Lisp_Object QCdbus_type_array, QCdbus_type_variant;
static Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry;
return;
/* Unset session environment. */
- if (SYMBOLP (QCdbus_session_bus) && XSYMBOL (QCdbus_session_bus) == data)
+ if (XSYMBOL (QCdbus_session_bus) == data)
{
XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS");
unsetenv ("DBUS_SESSION_BUS_ADDRESS");
(Lisp_Object bus)
{
DBusConnection *connection;
+ void *busp;
- CHECK_SYMBOL (bus);
+ /* Check parameter. */
+ if (SYMBOLP (bus))
+ busp = XSYMBOL (bus);
+ else if (STRINGP (bus))
+ busp = XSTRING (bus);
+ else
+ wrong_type_argument (intern ("D-Bus"), bus);
/* Open a connection to the bus. */
connection = xd_initialize (bus, TRUE);
xd_add_watch,
xd_remove_watch,
xd_toggle_watch,
- XSYMBOL (bus), NULL))
+ busp, NULL))
XD_SIGNAL1 (build_string ("Cannot add watch functions"));
/* Add bus to list of registered buses. */
CHECK_STRING (interface);
CHECK_STRING (method);
if (!NILP (handler) && !FUNCTIONP (handler))
- wrong_type_argument (intern ("functionp"), handler);
+ wrong_type_argument (Qinvalid_function, handler);
GCPRO6 (bus, service, path, interface, method, handler);
XD_DEBUG_MESSAGE ("%s %s %s %s",
EVENT_INIT (event);
event.kind = DBUS_EVENT;
event.frame_or_window = Qnil;
- event.arg = Fcons (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))),
- args);
+ event.arg
+ = Fcons (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))), args);
break;
}
value = CDR_SAFE (value);
if (data != NULL)
while (!NILP (busp))
{
- if (SYMBOLP (CAR_SAFE (busp)) && XSYMBOL (CAR_SAFE (busp)) == data)
+ if ((SYMBOLP (CAR_SAFE (busp)) && XSYMBOL (CAR_SAFE (busp)) == data)
+ || (STRINGP (CAR_SAFE (busp)) && XSTRING (CAR_SAFE (busp)) == data))
bus = CAR_SAFE (busp);
busp = CDR_SAFE (busp);
}
CHECK_STRING (interface);
CHECK_STRING (signal);
if (!FUNCTIONP (handler))
- wrong_type_argument (intern ("functionp"), handler);
+ wrong_type_argument (Qinvalid_function, handler);
GCPRO6 (bus, service, path, interface, signal, handler);
/* Retrieve unique name of service. If service is a known name, we
CHECK_STRING (interface);
CHECK_STRING (method);
if (!FUNCTIONP (handler))
- wrong_type_argument (intern ("functionp"), handler);
+ wrong_type_argument (Qinvalid_function, handler);
/* TODO: We must check for a valid service name, otherwise there is
a segmentation fault. */
staticpro (&Qdbus_call_method);
defsubr (&Sdbus_call_method);
- Qdbus_call_method_asynchronously = intern_c_string ("dbus-call-method-asynchronously");
+ Qdbus_call_method_asynchronously
+ = intern_c_string ("dbus-call-method-asynchronously");
staticpro (&Qdbus_call_method_asynchronously);
defsubr (&Sdbus_call_method_asynchronously);
- Qdbus_method_return_internal = intern_c_string ("dbus-method-return-internal");
+ Qdbus_method_return_internal
+ = intern_c_string ("dbus-method-return-internal");
staticpro (&Qdbus_method_return_internal);
defsubr (&Sdbus_method_return_internal);
QCdbus_session_bus = intern_c_string (":session");
staticpro (&QCdbus_session_bus);
- QCdbus_request_name_allow_replacement = intern_c_string (":allow-replacement");
+ QCdbus_request_name_allow_replacement
+ = intern_c_string (":allow-replacement");
staticpro (&QCdbus_request_name_allow_replacement);
QCdbus_request_name_replace_existing = intern_c_string (":replace-existing");