[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r104144: * dbusbind.c (QCdbus_type_un
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r104144: * dbusbind.c (QCdbus_type_unix_fd): Declare static. |
Date: |
Sat, 07 May 2011 00:12:31 +0200 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 104144
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2011-05-07 00:12:31 +0200
message:
* dbusbind.c (QCdbus_type_unix_fd): Declare static.
(xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
is a constant.
(Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
a string. Handle both cases.
(Fdbus_call_method_asynchronously, Fdbus_register_signal)
(Fdbus_register_method): Use Qinvalid_function.
modified:
src/ChangeLog
src/dbusbind.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-05-06 15:37:11 +0000
+++ b/src/ChangeLog 2011-05-06 22:12:31 +0000
@@ -1,3 +1,13 @@
+2011-05-06 Michael Albinus <address@hidden>
+
+ * dbusbind.c (QCdbus_type_unix_fd): Declare static.
+ (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
+ is a constant.
+ (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
+ a string. Handle both cases.
+ (Fdbus_call_method_asynchronously, Fdbus_register_signal)
+ (Fdbus_register_method): Use Qinvalid_function.
+
2011-05-06 Juanma Barranquero <address@hidden>
* makefile.w32-in: Update dependencies.
=== modified file 'src/dbusbind.c'
--- a/src/dbusbind.c 2011-04-30 01:06:41 +0000
+++ b/src/dbusbind.c 2011-05-06 22:12:31 +0000
@@ -70,7 +70,7 @@
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;
@@ -892,7 +892,7 @@
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");
@@ -919,8 +919,15 @@
(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);
@@ -931,7 +938,7 @@
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. */
@@ -1261,7 +1268,7 @@
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",
@@ -1758,8 +1765,8 @@
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);
@@ -1826,7 +1833,8 @@
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);
}
@@ -2011,7 +2019,7 @@
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
@@ -2132,7 +2140,7 @@
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. */
@@ -2174,11 +2182,13 @@
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);
@@ -2215,7 +2225,8 @@
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");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r104144: * dbusbind.c (QCdbus_type_unix_fd): Declare static.,
Michael Albinus <=