/* dbusbind.c -- Elisp bindings for D-Bus. */
/*
- * Time-stamp: <Sunday Jan 29, 2012 00:09:35 steve>
+ * Time-stamp: <Sunday Jan 29, 2012 17:41:26 steve>
* Created: <2012-01-03>
* Maintainer: Steve Youngs <steve@sxemacs.org>
* Homepage: http://www.sxemacs.org/
static int
xd_find_watch_fd (DBusWatch *watch)
{
-#if HAVE_DBUS_WATCH_GET_UNIX_FD
- /* TODO: Reverse these on Win32, which prefers the opposite. */
int fd = dbus_watch_get_unix_fd (watch);
- if (fd == -1)
+ if (fd == -1) {
fd = dbus_watch_get_socket (watch);
-#else
- int fd = dbus_watch_get_fd (watch);
-#endif
+ }
return fd;
}
(bus))
{
DBusConnection *connection;
- void *busp;
+ void *busp = NULL;
/* Check parameter. */
if (SYMBOLP (bus))
RETURN_UNGCPRO (result);
}
-DEFUN("dbus-method-return-internal", Fdbus_method_return_internal,
- 3, MANY, 0, /*
+DEFUN("dbus-method-return-internal", Fdbus_method_return_internal, 3, MANY, 0, /*
Return for message SERIAL on the D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el.
-usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS)
+usage: \(dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS\)
*/
(int nargs, Lisp_Object *args))
{
DBusConnection *connection;
DBusMessage *dmessage;
DBusMessageIter iter;
- dbus_uint32_t serial;
+ dbus_uint32_t serial = 0;
unsigned int ui_serial, dtype;
int i;
char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
return Qt;
}
-DEFUN("dbus-method-error-internal", Fdbus_method_error_internal,
- 3, MANY, 0, /*
+DEFUN("dbus-method-error-internal", Fdbus_method_error_internal, 3, MANY, 0, /*
Return error message for message SERIAL on the D-Bus BUS.
This is an internal function, it shall not be used outside dbus.el.
DBusConnection *connection;
DBusMessage *dmessage;
DBusMessageIter iter;
- dbus_uint32_t serial;
+ dbus_uint32_t serial = 0;
unsigned int ui_serial, dtype;
int i;
char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
default:
/* This should not happen. */
XD_SIGNAL2 (build_string ("Could not register service"), service);
+ return Qnil;
}
}
*/
/*
- * Time-stamp: <Sunday Jan 29, 2012 00:09:59 steve>
+ * Time-stamp: <Sunday Jan 29, 2012 17:45:16 steve>
* Created: <2012-01-22>
* Author: Steve Youngs <steve@sxemacs.org>
* Maintainer: Steve Youngs <steve@sxemacs.org>
#define SREF(string, index) (SDATA (string)[index] + 0)
#define SSET(string, index, new) (SDATA (string)[index] = (new))
#define SCHARS(string) (XSTRING (string)->size + 0)
-#define SBYTES(string) (XSTRING_LENGTH (XSTRING (string)) + 0)
+#define SBYTES(string) (XSTRING_LENGTH (string + 0))
/* Avoid "differ in sign" warnings. */
#define SSDATA(x) ((char *) SDATA (x))
#define XD_ERROR(error) \
do { \
/* Remove the trailing newline. */ \
- char const *mess = error.message; \
- char const *nl = strchr (mess, '\n'); \
- Lisp_Object err = make_string (mess, nl ? nl - mess : strlen (mess)); \
+ const char *mess = error.message; \
+ const char *nl = strchr (mess, '\n'); \
+ Lisp_Object err = make_string \
+ ((const Bufbyte *)mess, \
+ nl ? nl - mess : strlen (mess)); \
dbus_error_free (&error); \
XD_SIGNAL1 (err); \
} while (0)
while (0)
+void syms_of_dbusbind(void);
-#endif
+#endif /* _DBUSBIND_H */