X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/52b410c60aebeb769ec9580af25ca50df2a44751..62e170072e6000b30c37792227dc34e71a31d797:/src/dbusbind.c diff --git a/src/dbusbind.c b/src/dbusbind.c index 4852739d8e..54e92cce16 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -1,5 +1,5 @@ /* Elisp bindings for D-Bus. - Copyright (C) 2007-2014 Free Software Foundation, Inc. + Copyright (C) 2007-2015 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -41,37 +41,6 @@ along with GNU Emacs. If not, see . */ #endif -/* Subroutines. */ -static Lisp_Object Qdbus__init_bus; -static Lisp_Object Qdbus_get_unique_name; -static Lisp_Object Qdbus_message_internal; - -/* D-Bus error symbol. */ -static Lisp_Object Qdbus_error; - -/* Lisp symbols of the system and session buses. */ -static Lisp_Object QCdbus_system_bus, QCdbus_session_bus; - -/* Lisp symbol for method call timeout. */ -static Lisp_Object QCdbus_timeout; - -/* Lisp symbols of D-Bus types. */ -static Lisp_Object QCdbus_type_byte, QCdbus_type_boolean; -static Lisp_Object QCdbus_type_int16, QCdbus_type_uint16; -static Lisp_Object QCdbus_type_int32, QCdbus_type_uint32; -static Lisp_Object QCdbus_type_int64, QCdbus_type_uint64; -static Lisp_Object QCdbus_type_double, QCdbus_type_string; -static Lisp_Object QCdbus_type_object_path, QCdbus_type_signature; -#ifdef DBUS_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; - -/* Lisp symbols of objects in `dbus-registered-objects-table'. */ -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. */ @@ -357,7 +326,7 @@ xd_signature_cat (char *signature, char const *x) ptrdiff_t xlen = strlen (x); if (DBUS_MAXIMUM_SIGNATURE_LENGTH - xlen <= siglen) string_overflow (); - strcat (signature, x); + strcpy (signature + siglen, x); } /* Compute SIGNATURE of OBJECT. It must have a form that it can be @@ -1755,15 +1724,21 @@ syms_of_dbusbind (void) DEFSYM (Qdbus_message_internal, "dbus-message-internal"); defsubr (&Sdbus_message_internal); + /* D-Bus error symbol. */ DEFSYM (Qdbus_error, "dbus-error"); Fput (Qdbus_error, Qerror_conditions, list2 (Qdbus_error, Qerror)); Fput (Qdbus_error, Qerror_message, build_pure_c_string ("D-Bus error")); + /* Lisp symbols of the system and session buses. */ DEFSYM (QCdbus_system_bus, ":system"); DEFSYM (QCdbus_session_bus, ":session"); + + /* Lisp symbol for method call timeout. */ DEFSYM (QCdbus_timeout, ":timeout"); + + /* Lisp symbols of D-Bus types. */ DEFSYM (QCdbus_type_byte, ":byte"); DEFSYM (QCdbus_type_boolean, ":boolean"); DEFSYM (QCdbus_type_int16, ":int16"); @@ -1783,6 +1758,8 @@ syms_of_dbusbind (void) DEFSYM (QCdbus_type_variant, ":variant"); DEFSYM (QCdbus_type_struct, ":struct"); DEFSYM (QCdbus_type_dict_entry, ":dict-entry"); + + /* Lisp symbols of objects in `dbus-registered-objects-table'. */ DEFSYM (QCdbus_registered_serial, ":serial"); DEFSYM (QCdbus_registered_method, ":method"); DEFSYM (QCdbus_registered_signal, ":signal"); @@ -1872,12 +1849,7 @@ string denoting the bus address. SERIAL is the serial number of the non-blocking method call, a reply is expected. Both arguments must not be nil. The value in the hash table is HANDLER, the function to be called when the D-Bus reply message arrives. */); - { - Lisp_Object args[2]; - args[0] = QCtest; - args[1] = Qequal; - Vdbus_registered_objects_table = Fmake_hash_table (2, args); - } + Vdbus_registered_objects_table = CALLN (Fmake_hash_table, QCtest, Qequal); DEFVAR_LISP ("dbus-debug", Vdbus_debug, doc: /* If non-nil, debug messages of D-Bus bindings are raised. */);