static Lisp_Object QCdbus_registered_serial, QCdbus_registered_method;
static Lisp_Object QCdbus_registered_signal;
+/* Alist of D-Bus buses we are polling for messages.
+ The key is the symbol or string of the bus, and the value is the
+ connection address. */
+static Lisp_Object xd_registered_buses;
+
/* Whether we are reading a D-Bus event. */
static int xd_in_read_queued_messages = 0;
DBusConnection *connection;
Lisp_Object val;
- val = CDR_SAFE (Fassoc (bus, Vdbus_registered_buses));
+ val = CDR_SAFE (Fassoc (bus, xd_registered_buses));
if (NILP (val))
XD_SIGNAL2 (build_string ("No connection to bus"), bus);
else
Lisp_Object val;
/* Check whether we are connected. */
- val = Fassoc (bus, Vdbus_registered_buses);
+ val = Fassoc (bus, xd_registered_buses);
if (NILP (val))
return;
dbus_connection_unref (connection);
/* Remove bus from list of registered buses. */
- Vdbus_registered_buses = Fdelete (val, Vdbus_registered_buses);
+ xd_registered_buses = Fdelete (val, xd_registered_buses);
/* Return. */
return;
/* Add bus to list of registered buses. */
XSETFASTINT (val, (intptr_t) connection);
- Vdbus_registered_buses = Fcons (Fcons (bus, val), Vdbus_registered_buses);
+ xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses);
/* We do not want to abort. */
putenv ((char *) "DBUS_FATAL_WARNINGS=0");
static void
xd_read_queued_messages (int fd, void *data, int for_read)
{
- Lisp_Object busp = Vdbus_registered_buses;
+ Lisp_Object busp = xd_registered_buses;
Lisp_Object bus = Qnil;
Lisp_Object key;
doc: /* Message type of a signal message. */);
Vdbus_message_type_signal = make_number (DBUS_MESSAGE_TYPE_SIGNAL);
- DEFVAR_LISP ("dbus-registered-buses",
- Vdbus_registered_buses,
- doc: /* Alist of D-Bus buses we are polling for messages.
-
-The key is the symbol or string of the bus, and the value is the
-connection address. */);
- Vdbus_registered_buses = Qnil;
-
DEFVAR_LISP ("dbus-registered-objects-table",
Vdbus_registered_objects_table,
doc: /* Hash table of registered functions for D-Bus.
Vdbus_debug = Qnil;
#endif
+ /* Initialize internal objects. */
+ xd_registered_buses = Qnil;
+ staticpro (&xd_registered_buses);
+
Fprovide (intern_c_string ("dbusbind"), Qnil);
}