/* Elisp bindings for D-Bus.
- Copyright (C) 2007-2011 Free Software Foundation, Inc.
+ Copyright (C) 2007-2012 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#endif
/* This was a macro. On Solaris 2.11 it was said to compile for
- hours, when optimzation is enabled. So we have transferred it into
+ hours, when optimization is enabled. So we have transferred it into
a function. */
/* Determine the DBusType of a given Lisp symbol. OBJECT must be one
of the predefined D-Bus type symbols. */
connection = xd_initialize (bus, TRUE);
/* Add the watch functions. We pass also the bus as data, in order
- to distinguish between the busses in xd_remove_watch. */
+ to distinguish between the buses in xd_remove_watch. */
if (!dbus_connection_set_watch_functions (connection,
xd_add_watch,
xd_remove_watch,
&& (SBYTES (service) > 0)
&& (strcmp (SSDATA (service), DBUS_SERVICE_DBUS) != 0)
&& (strncmp (SSDATA (service), ":", 1) != 0))
- {
- uname = call2 (intern ("dbus-get-name-owner"), bus, service);
- /* When there is no unique name, we mark it with an empty
- string. */
- if (NILP (uname))
- uname = empty_unibyte_string;
- }
+ uname = call2 (intern ("dbus-get-name-owner"), bus, service);
else
uname = service;
/* Create a hash table entry. */
key = list3 (bus, interface, signal);
- key1 = list4 (uname, service, path, handler);
+ key1 = list5 (uname, service, path, handler, build_string (rule));
value = Fgethash (key, Vdbus_registered_objects_table, Qnil);
if (NILP (Fmember (key1, value)))
PATH is the D-Bus object path SERVICE is registered (See discussion of
DONT-REGISTER-SERVICE below). INTERFACE is the interface offered by
-SERVICE. It must provide METHOD. HANDLER is a Lisp function to be
-called when a method call is received. It must accept the input
-arguments of METHOD. The return value of HANDLER is used for
-composing the returning D-Bus message.
+SERVICE. It must provide METHOD.
+
+HANDLER is a Lisp function to be called when a method call is
+received. It must accept the input arguments of METHOD. The return
+value of HANDLER is used for composing the returning D-Bus message.
+In case HANDLER shall return a reply message with an empty argument
+list, HANDLER must return the symbol `:ignore'.
When DONT-REGISTER-SERVICE is non-nil, the known name SERVICE is not
registered. This means that other D-Bus clients have no way of
noticing the newly registered method. When interfaces are constructed
incrementally by adding single methods or properties at a time,
-DONT-REGISTER-SERVICE can be use to prevent other clients from
+DONT-REGISTER-SERVICE can be used to prevent other clients from
discovering the still incomplete interface.*/)
(Lisp_Object bus, Lisp_Object service, Lisp_Object path,
Lisp_Object interface, Lisp_Object method, Lisp_Object handler,
arrives (methods and signals), or a cons cell containing the value of
the property.
+For signals, there is also a fifth element RULE, which keeps the match
+string the signal is registered with.
+
In the second case, the key in the hash table is the list (BUS
SERIAL). BUS is either a Lisp symbol, `:system' or `:session', or a
string denoting the bus address. SERIAL is the serial number of the