aboutsummaryrefslogtreecommitdiffstats
path: root/src/dbusbind.c
diff options
context:
space:
mode:
authorPaul Eggert2016-03-27 15:52:03 -0700
committerPaul Eggert2016-03-27 15:53:34 -0700
commitf41f573ee199834e7d5e36ede029c6f47b1c3b09 (patch)
tree998e5b66efd7d13eccb972d830b49fa3539fab4e /src/dbusbind.c
parentbc9cc21d34ae71dc38bd20f224c4b3ac073bcb50 (diff)
downloademacs-f41f573ee199834e7d5e36ede029c6f47b1c3b09.tar.gz
emacs-f41f573ee199834e7d5e36ede029c6f47b1c3b09.zip
Rename C names to match Lisp symbols better
This was inspired by commit e65c3079c65595d95749348366af9811fafff062, which fixed a bug where the C name for a symbol disagreed with the symbol name itself. Fix other instances of disagreements that I found. Although this doesn’t fix a bug, it should make code easier to follow. The remaining disagreements are idiosyncratic: Qminus, Qplus, Qsans__serif, Qbackquote, Qcomma, Qcomma_at, Qcomma_dot. All uses changed. * src/alloc.c (QAutomatic_GC): Rename from Qautomatic_gc. * src/dbusbind.c (QCsystem): Rename from QCdbus_system_bus. (QCsession): Rename from QCdbus_session_bus. (QCtimeout): Rename from QCdbus_timeout. (QCbyte): Rename from QCdbus_type_byte. (QCboolean): Rename from QCdbus_type_boolean. (QCint16): Rename from QCdbus_type_int16. (QCuint16): Rename from QCdbus_type_uint16. (QCint32): Rename from QCdbus_type_int32. (QCuint32): Rename from QCdbus_type_uint32. (QCint64): Rename from QCdbus_type_int64. (QCuint64): Rename from QCdbus_type_uint64. (QCdouble): Rename from QCdbus_type_double. (QCstring): Rename from QCdbus_type_string. (QCobject_path): Rename from QCdbus_type_object_path. (QCsignature): Rename from QCdbus_type_signature. (QCunix_fd): Rename from QCdbus_type_unix_fd. (QCarray): Rename from QCdbus_type_array. (QCvariant): Rename from QCdbus_type_variant. (QCstruct): Rename from QCdbus_type_struct. (QCdict_entry): Rename from QCdbus_type_dict_entry. (QCserial): Rename from QCdbus_registered_serial. (QCmethod): Rename from QCdbus_registered_method. (QCsignal): Rename from QCdbus_registered_signal. * src/emacs-module.c (Qinternal__module_call): Rename from Qinternal_module_call. * src/frame.c (Qwindow__pixel_to_total): Rename from Qwindow_pixel_to_total. * src/gnutls.c (QChostname): Rename from QCgnutls_bootprop_hostname. (QCpriority): Rename from QCgnutls_bootprop_priority. (QCtrustfiles): Rename from QCgnutls_bootprop_trustfiles. (QCkeylist): Rename from QCgnutls_bootprop_keylist. (QCcrlfiles): Rename from QCgnutls_bootprop_crlfiles. (QCmin_prime_bits): Rename from QCgnutls_bootprop_min_prime_bits. (QCloglevel): Rename from QCgnutls_bootprop_loglevel. (QCcomplete_negotiation): Rename from QCgnutls_complete_negotiation. (QCverify_flags): Rename from QCgnutls_bootprop_verify_flags. (QCverify_error): Rename from QCgnutls_bootprop_verify_error. * src/w32fns.c (Qfont_parameter): Rename from Qfont_param. (Qgnutls): Rename from Qgnutls_dll. (Qlibxml2): Rename from Qlibxml2_dll. (Qzlib): Rename from Qzlib_dll. * src/w32select.c (Qutf_16le_dos): Rename from QUNICODE. * src/window.c (Qwindow__resize_root_window): Rename from Qwindow_resize_root_window. (Qwindow__resize_root_window_vertically): Rename from Qwindow_resize_root_window_vertically. (Qwindow__sanitize_window_sizes): Rename from Qwindow_sanitize_window_sizes. (Qwindow__pixel_to_total): Rename from Qwindow_pixel_to_total. * src/xdisp.c (Qredisplay_internal_xC_functionx): Rename from Qredisplay_internal. * src/xfns.c (Qfont_parameter): Rename from Qfont_param. * src/xselect.c (Q_EMACS_TMP_): Rename from QEMACS_TMP.
Diffstat (limited to 'src/dbusbind.c')
-rw-r--r--src/dbusbind.c121
1 files changed, 58 insertions, 63 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c
index d3a32c00341..618176dd452 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -168,25 +168,25 @@ static int
168xd_symbol_to_dbus_type (Lisp_Object object) 168xd_symbol_to_dbus_type (Lisp_Object object)
169{ 169{
170 return 170 return
171 ((EQ (object, QCdbus_type_byte)) ? DBUS_TYPE_BYTE 171 (EQ (object, QCbyte) ? DBUS_TYPE_BYTE
172 : (EQ (object, QCdbus_type_boolean)) ? DBUS_TYPE_BOOLEAN 172 : EQ (object, QCboolean) ? DBUS_TYPE_BOOLEAN
173 : (EQ (object, QCdbus_type_int16)) ? DBUS_TYPE_INT16 173 : EQ (object, QCint16) ? DBUS_TYPE_INT16
174 : (EQ (object, QCdbus_type_uint16)) ? DBUS_TYPE_UINT16 174 : EQ (object, QCuint16) ? DBUS_TYPE_UINT16
175 : (EQ (object, QCdbus_type_int32)) ? DBUS_TYPE_INT32 175 : EQ (object, QCint32) ? DBUS_TYPE_INT32
176 : (EQ (object, QCdbus_type_uint32)) ? DBUS_TYPE_UINT32 176 : EQ (object, QCuint32) ? DBUS_TYPE_UINT32
177 : (EQ (object, QCdbus_type_int64)) ? DBUS_TYPE_INT64 177 : EQ (object, QCint64) ? DBUS_TYPE_INT64
178 : (EQ (object, QCdbus_type_uint64)) ? DBUS_TYPE_UINT64 178 : EQ (object, QCuint64) ? DBUS_TYPE_UINT64
179 : (EQ (object, QCdbus_type_double)) ? DBUS_TYPE_DOUBLE 179 : EQ (object, QCdouble) ? DBUS_TYPE_DOUBLE
180 : (EQ (object, QCdbus_type_string)) ? DBUS_TYPE_STRING 180 : EQ (object, QCstring) ? DBUS_TYPE_STRING
181 : (EQ (object, QCdbus_type_object_path)) ? DBUS_TYPE_OBJECT_PATH 181 : EQ (object, QCobject_path) ? DBUS_TYPE_OBJECT_PATH
182 : (EQ (object, QCdbus_type_signature)) ? DBUS_TYPE_SIGNATURE 182 : EQ (object, QCsignature) ? DBUS_TYPE_SIGNATURE
183#ifdef DBUS_TYPE_UNIX_FD 183#ifdef DBUS_TYPE_UNIX_FD
184 : (EQ (object, QCdbus_type_unix_fd)) ? DBUS_TYPE_UNIX_FD 184 : EQ (object, QCunix_fd) ? DBUS_TYPE_UNIX_FD
185#endif 185#endif
186 : (EQ (object, QCdbus_type_array)) ? DBUS_TYPE_ARRAY 186 : EQ (object, QCarray) ? DBUS_TYPE_ARRAY
187 : (EQ (object, QCdbus_type_variant)) ? DBUS_TYPE_VARIANT 187 : EQ (object, QCvariant) ? DBUS_TYPE_VARIANT
188 : (EQ (object, QCdbus_type_struct)) ? DBUS_TYPE_STRUCT 188 : EQ (object, QCstruct) ? DBUS_TYPE_STRUCT
189 : (EQ (object, QCdbus_type_dict_entry)) ? DBUS_TYPE_DICT_ENTRY 189 : EQ (object, QCdict_entry) ? DBUS_TYPE_DICT_ENTRY
190 : DBUS_TYPE_INVALID); 190 : DBUS_TYPE_INVALID);
191} 191}
192 192
@@ -257,16 +257,16 @@ XD_OBJECT_TO_STRING (Lisp_Object object)
257 if ((session_bus_address != NULL) \ 257 if ((session_bus_address != NULL) \
258 && (!NILP (Fstring_equal \ 258 && (!NILP (Fstring_equal \
259 (bus, build_string (session_bus_address))))) \ 259 (bus, build_string (session_bus_address))))) \
260 bus = QCdbus_session_bus; \ 260 bus = QCsession; \
261 } \ 261 } \
262 \ 262 \
263 else \ 263 else \
264 { \ 264 { \
265 CHECK_SYMBOL (bus); \ 265 CHECK_SYMBOL (bus); \
266 if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus))) \ 266 if (!(EQ (bus, QCsystem) || EQ (bus, QCsession))) \
267 XD_SIGNAL2 (build_string ("Wrong bus name"), bus); \ 267 XD_SIGNAL2 (build_string ("Wrong bus name"), bus); \
268 /* We do not want to have an autolaunch for the session bus. */ \ 268 /* We do not want to have an autolaunch for the session bus. */ \
269 if (EQ (bus, QCdbus_session_bus) && session_bus_address == NULL) \ 269 if (EQ (bus, QCsession) && session_bus_address == NULL) \
270 XD_SIGNAL2 (build_string ("No connection to bus"), bus); \ 270 XD_SIGNAL2 (build_string ("No connection to bus"), bus); \
271 } \ 271 } \
272 } while (0) 272 } while (0)
@@ -395,7 +395,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object)
395 CHECK_CONS (object); 395 CHECK_CONS (object);
396 396
397 /* Type symbol is optional. */ 397 /* Type symbol is optional. */
398 if (EQ (QCdbus_type_array, CAR_SAFE (elt))) 398 if (EQ (QCarray, CAR_SAFE (elt)))
399 elt = XD_NEXT_VALUE (elt); 399 elt = XD_NEXT_VALUE (elt);
400 400
401 /* If the array is empty, DBUS_TYPE_STRING is the default 401 /* If the array is empty, DBUS_TYPE_STRING is the default
@@ -1009,8 +1009,7 @@ xd_add_watch (DBusWatch *watch, void *data)
1009} 1009}
1010 1010
1011/* Stop monitoring WATCH for possible I/O. 1011/* Stop monitoring WATCH for possible I/O.
1012 DATA is the used bus, either a string or QCdbus_system_bus or 1012 DATA is the used bus, either a string or QCsystem or QCsession. */
1013 QCdbus_session_bus. */
1014static void 1013static void
1015xd_remove_watch (DBusWatch *watch, void *data) 1014xd_remove_watch (DBusWatch *watch, void *data)
1016{ 1015{
@@ -1025,7 +1024,7 @@ xd_remove_watch (DBusWatch *watch, void *data)
1025 /* Unset session environment. */ 1024 /* Unset session environment. */
1026#if 0 1025#if 0
1027 /* This is buggy, since unsetenv is not thread-safe. */ 1026 /* This is buggy, since unsetenv is not thread-safe. */
1028 if (XSYMBOL (QCdbus_session_bus) == data) 1027 if (XSYMBOL (QCsession) == data)
1029 { 1028 {
1030 XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); 1029 XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS");
1031 unsetenv ("DBUS_SESSION_BUS_ADDRESS"); 1030 unsetenv ("DBUS_SESSION_BUS_ADDRESS");
@@ -1147,14 +1146,14 @@ this connection to those buses. */)
1147 connection = dbus_connection_open_private (SSDATA (bus), &derror); 1146 connection = dbus_connection_open_private (SSDATA (bus), &derror);
1148 1147
1149 else 1148 else
1150 if (NILP (private)) 1149 {
1151 connection = dbus_bus_get (EQ (bus, QCdbus_system_bus) 1150 DBusBusType bustype = (EQ (bus, QCsystem)
1152 ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, 1151 ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION);
1153 &derror); 1152 if (NILP (private))
1154 else 1153 connection = dbus_bus_get (bustype, &derror);
1155 connection = dbus_bus_get_private (EQ (bus, QCdbus_system_bus) 1154 else
1156 ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, 1155 connection = dbus_bus_get_private (bustype, &derror);
1157 &derror); 1156 }
1158 1157
1159 if (dbus_error_is_set (&derror)) 1158 if (dbus_error_is_set (&derror))
1160 XD_ERROR (derror); 1159 XD_ERROR (derror);
@@ -1405,7 +1404,7 @@ usage: (dbus-message-internal &rest REST) */)
1405 } 1404 }
1406 1405
1407 /* Check for timeout parameter. */ 1406 /* Check for timeout parameter. */
1408 if ((count+2 <= nargs) && (EQ ((args[count]), QCdbus_timeout))) 1407 if ((count + 2 <= nargs) && EQ (args[count], QCtimeout))
1409 { 1408 {
1410 CHECK_NATNUM (args[count+1]); 1409 CHECK_NATNUM (args[count+1]);
1411 timeout = min (XFASTINT (args[count+1]), INT_MAX); 1410 timeout = min (XFASTINT (args[count+1]), INT_MAX);
@@ -1452,8 +1451,7 @@ usage: (dbus-message-internal &rest REST) */)
1452 1451
1453 /* The result is the key in Vdbus_registered_objects_table. */ 1452 /* The result is the key in Vdbus_registered_objects_table. */
1454 serial = dbus_message_get_serial (dmessage); 1453 serial = dbus_message_get_serial (dmessage);
1455 result = list3 (QCdbus_registered_serial, 1454 result = list3 (QCserial, bus, make_fixnum_or_float (serial));
1456 bus, make_fixnum_or_float (serial));
1457 1455
1458 /* Create a hash table entry. */ 1456 /* Create a hash table entry. */
1459 Fputhash (result, handler, Vdbus_registered_objects_table); 1457 Fputhash (result, handler, Vdbus_registered_objects_table);
@@ -1540,8 +1538,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
1540 || (mtype == DBUS_MESSAGE_TYPE_ERROR)) 1538 || (mtype == DBUS_MESSAGE_TYPE_ERROR))
1541 { 1539 {
1542 /* Search for a registered function of the message. */ 1540 /* Search for a registered function of the message. */
1543 key = list3 (QCdbus_registered_serial, bus, 1541 key = list3 (QCserial, bus, make_fixnum_or_float (serial));
1544 make_fixnum_or_float (serial));
1545 value = Fgethash (key, Vdbus_registered_objects_table, Qnil); 1542 value = Fgethash (key, Vdbus_registered_objects_table, Qnil);
1546 1543
1547 /* There shall be exactly one entry. Construct an event. */ 1544 /* There shall be exactly one entry. Construct an event. */
@@ -1566,9 +1563,7 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
1566 goto cleanup; 1563 goto cleanup;
1567 1564
1568 /* Search for a registered function of the message. */ 1565 /* Search for a registered function of the message. */
1569 key = list4 ((mtype == DBUS_MESSAGE_TYPE_METHOD_CALL) 1566 key = list4 (mtype == DBUS_MESSAGE_TYPE_METHOD_CALL ? QCmethod : QCsignal,
1570 ? QCdbus_registered_method
1571 : QCdbus_registered_signal,
1572 bus, build_string (interface), build_string (member)); 1567 bus, build_string (interface), build_string (member));
1573 value = Fgethash (key, Vdbus_registered_objects_table, Qnil); 1568 value = Fgethash (key, Vdbus_registered_objects_table, Qnil);
1574 1569
@@ -1697,37 +1692,37 @@ syms_of_dbusbind (void)
1697 build_pure_c_string ("D-Bus error")); 1692 build_pure_c_string ("D-Bus error"));
1698 1693
1699 /* Lisp symbols of the system and session buses. */ 1694 /* Lisp symbols of the system and session buses. */
1700 DEFSYM (QCdbus_system_bus, ":system"); 1695 DEFSYM (QCsystem, ":system");
1701 DEFSYM (QCdbus_session_bus, ":session"); 1696 DEFSYM (QCsession, ":session");
1702 1697
1703 /* Lisp symbol for method call timeout. */ 1698 /* Lisp symbol for method call timeout. */
1704 DEFSYM (QCdbus_timeout, ":timeout"); 1699 DEFSYM (QCtimeout, ":timeout");
1705 1700
1706 /* Lisp symbols of D-Bus types. */ 1701 /* Lisp symbols of D-Bus types. */
1707 DEFSYM (QCdbus_type_byte, ":byte"); 1702 DEFSYM (QCbyte, ":byte");
1708 DEFSYM (QCdbus_type_boolean, ":boolean"); 1703 DEFSYM (QCboolean, ":boolean");
1709 DEFSYM (QCdbus_type_int16, ":int16"); 1704 DEFSYM (QCint16, ":int16");
1710 DEFSYM (QCdbus_type_uint16, ":uint16"); 1705 DEFSYM (QCuint16, ":uint16");
1711 DEFSYM (QCdbus_type_int32, ":int32"); 1706 DEFSYM (QCint32, ":int32");
1712 DEFSYM (QCdbus_type_uint32, ":uint32"); 1707 DEFSYM (QCuint32, ":uint32");
1713 DEFSYM (QCdbus_type_int64, ":int64"); 1708 DEFSYM (QCint64, ":int64");
1714 DEFSYM (QCdbus_type_uint64, ":uint64"); 1709 DEFSYM (QCuint64, ":uint64");
1715 DEFSYM (QCdbus_type_double, ":double"); 1710 DEFSYM (QCdouble, ":double");
1716 DEFSYM (QCdbus_type_string, ":string"); 1711 DEFSYM (QCstring, ":string");
1717 DEFSYM (QCdbus_type_object_path, ":object-path"); 1712 DEFSYM (QCobject_path, ":object-path");
1718 DEFSYM (QCdbus_type_signature, ":signature"); 1713 DEFSYM (QCsignature, ":signature");
1719#ifdef DBUS_TYPE_UNIX_FD 1714#ifdef DBUS_TYPE_UNIX_FD
1720 DEFSYM (QCdbus_type_unix_fd, ":unix-fd"); 1715 DEFSYM (QCunix_fd, ":unix-fd");
1721#endif 1716#endif
1722 DEFSYM (QCdbus_type_array, ":array"); 1717 DEFSYM (QCarray, ":array");
1723 DEFSYM (QCdbus_type_variant, ":variant"); 1718 DEFSYM (QCvariant, ":variant");
1724 DEFSYM (QCdbus_type_struct, ":struct"); 1719 DEFSYM (QCstruct, ":struct");
1725 DEFSYM (QCdbus_type_dict_entry, ":dict-entry"); 1720 DEFSYM (QCdict_entry, ":dict-entry");
1726 1721
1727 /* Lisp symbols of objects in `dbus-registered-objects-table'. */ 1722 /* Lisp symbols of objects in `dbus-registered-objects-table'. */
1728 DEFSYM (QCdbus_registered_serial, ":serial"); 1723 DEFSYM (QCserial, ":serial");
1729 DEFSYM (QCdbus_registered_method, ":method"); 1724 DEFSYM (QCmethod, ":method");
1730 DEFSYM (QCdbus_registered_signal, ":signal"); 1725 DEFSYM (QCsignal, ":signal");
1731 1726
1732 DEFVAR_LISP ("dbus-compiled-version", 1727 DEFVAR_LISP ("dbus-compiled-version",
1733 Vdbus_compiled_version, 1728 Vdbus_compiled_version,