/* Elisp bindings for D-Bus.
- Copyright (C) 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#ifdef HAVE_DBUS
#include <stdio.h>
#include <dbus/dbus.h>
-#include <setjmp.h>
+
#include "lisp.h"
#include "frame.h"
#include "termhooks.h"
#define DBUS_NUM_MESSAGE_TYPES 5
#endif
+
+/* Some platforms define the symbol "interface", but we want to use it
+ * as a variable name below. */
+
+#ifdef interface
+#undef interface
+#endif
+
\f
/* Subroutines. */
static Lisp_Object Qdbus_init_bus;
static Lisp_Object xd_registered_buses;
/* Whether we are reading a D-Bus event. */
-static int xd_in_read_queued_messages = 0;
+static bool xd_in_read_queued_messages = 0;
\f
/* We use "xd_" and "XD_" as prefix for all internal symbols, because
} \
} while (0)
-#if (HAVE_DBUS_VALIDATE_BUS_NAME || HAVE_DBUS_VALIDATE_PATH \
- || XD_DBUS_VALIDATE_OBJECT || HAVE_DBUS_VALIDATE_MEMBER)
+#if (HAVE_DBUS_VALIDATE_BUS_NAME || HAVE_DBUS_VALIDATE_PATH \
+ || HAVE_DBUS_VALIDATE_INTERFACE || HAVE_DBUS_VALIDATE_MEMBER)
#define XD_DBUS_VALIDATE_OBJECT(object, func) \
do { \
if (!NILP (object)) \
}
/* Prototype. */
-static void
-xd_read_queued_messages (int fd, void *data, int for_read);
+static void xd_read_queued_messages (int fd, void *data);
/* Start monitoring WATCH for possible I/O. */
static dbus_bool_t
return;
/* Unset session environment. */
+#if 0
if (XSYMBOL (QCdbus_session_bus) == data)
{
- // XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS");
- // unsetenv ("DBUS_SESSION_BUS_ADDRESS");
+ XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS");
+ unsetenv ("DBUS_SESSION_BUS_ADDRESS");
}
+#endif
if (flags & DBUS_WATCH_WRITABLE)
delete_write_fd (fd);
/* Callback called when something is ready to read or write. */
static void
-xd_read_queued_messages (int fd, void *data, int for_read)
+xd_read_queued_messages (int fd, void *data)
{
Lisp_Object busp = xd_registered_buses;
Lisp_Object bus = Qnil;