diff options
| author | Michael Albinus | 2012-05-09 23:13:43 +0200 |
|---|---|---|
| committer | Michael Albinus | 2012-05-09 23:13:43 +0200 |
| commit | 5cb6795418c32b8077e3818680a65cba00ea66b6 (patch) | |
| tree | 35f26af48d17b26ff71f58bc90780580c4ddb8c2 /src | |
| parent | b263a6b03bd58b811ac4f99aae7f37a0279528a9 (diff) | |
| download | emacs-5cb6795418c32b8077e3818680a65cba00ea66b6.tar.gz emacs-5cb6795418c32b8077e3818680a65cba00ea66b6.zip | |
* dbusbind.c (xd_registered_buses): New internal Lisp object.
Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
(syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
Initialize xd_registered_buses.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/dbusbind.c | 27 |
2 files changed, 21 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e51d23435d1..07d85cbf5c8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-05-09 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * dbusbind.c (xd_registered_buses): New internal Lisp object. | ||
| 4 | Rename all occurences of Vdbus_registered_buses to xd_registered_buses. | ||
| 5 | (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses. | ||
| 6 | Initialize xd_registered_buses. | ||
| 7 | |||
| 1 | 2012-05-09 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2012-05-09 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | Untag more efficiently if USE_LSB_TAG. | 10 | Untag more efficiently if USE_LSB_TAG. |
diff --git a/src/dbusbind.c b/src/dbusbind.c index 87a3b935094..62923b462b5 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -64,6 +64,11 @@ static Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry; | |||
| 64 | static Lisp_Object QCdbus_registered_serial, QCdbus_registered_method; | 64 | static Lisp_Object QCdbus_registered_serial, QCdbus_registered_method; |
| 65 | static Lisp_Object QCdbus_registered_signal; | 65 | static Lisp_Object QCdbus_registered_signal; |
| 66 | 66 | ||
| 67 | /* Alist of D-Bus buses we are polling for messages. | ||
| 68 | The key is the symbol or string of the bus, and the value is the | ||
| 69 | connection address. */ | ||
| 70 | static Lisp_Object xd_registered_buses; | ||
| 71 | |||
| 67 | /* Whether we are reading a D-Bus event. */ | 72 | /* Whether we are reading a D-Bus event. */ |
| 68 | static int xd_in_read_queued_messages = 0; | 73 | static int xd_in_read_queued_messages = 0; |
| 69 | 74 | ||
| @@ -903,7 +908,7 @@ xd_get_connection_address (Lisp_Object bus) | |||
| 903 | DBusConnection *connection; | 908 | DBusConnection *connection; |
| 904 | Lisp_Object val; | 909 | Lisp_Object val; |
| 905 | 910 | ||
| 906 | val = CDR_SAFE (Fassoc (bus, Vdbus_registered_buses)); | 911 | val = CDR_SAFE (Fassoc (bus, xd_registered_buses)); |
| 907 | if (NILP (val)) | 912 | if (NILP (val)) |
| 908 | XD_SIGNAL2 (build_string ("No connection to bus"), bus); | 913 | XD_SIGNAL2 (build_string ("No connection to bus"), bus); |
| 909 | else | 914 | else |
| @@ -1003,7 +1008,7 @@ xd_close_bus (Lisp_Object bus) | |||
| 1003 | Lisp_Object val; | 1008 | Lisp_Object val; |
| 1004 | 1009 | ||
| 1005 | /* Check whether we are connected. */ | 1010 | /* Check whether we are connected. */ |
| 1006 | val = Fassoc (bus, Vdbus_registered_buses); | 1011 | val = Fassoc (bus, xd_registered_buses); |
| 1007 | if (NILP (val)) | 1012 | if (NILP (val)) |
| 1008 | return; | 1013 | return; |
| 1009 | 1014 | ||
| @@ -1022,7 +1027,7 @@ xd_close_bus (Lisp_Object bus) | |||
| 1022 | dbus_connection_unref (connection); | 1027 | dbus_connection_unref (connection); |
| 1023 | 1028 | ||
| 1024 | /* Remove bus from list of registered buses. */ | 1029 | /* Remove bus from list of registered buses. */ |
| 1025 | Vdbus_registered_buses = Fdelete (val, Vdbus_registered_buses); | 1030 | xd_registered_buses = Fdelete (val, xd_registered_buses); |
| 1026 | 1031 | ||
| 1027 | /* Return. */ | 1032 | /* Return. */ |
| 1028 | return; | 1033 | return; |
| @@ -1115,7 +1120,7 @@ this connection to those buses. */) | |||
| 1115 | 1120 | ||
| 1116 | /* Add bus to list of registered buses. */ | 1121 | /* Add bus to list of registered buses. */ |
| 1117 | XSETFASTINT (val, (intptr_t) connection); | 1122 | XSETFASTINT (val, (intptr_t) connection); |
| 1118 | Vdbus_registered_buses = Fcons (Fcons (bus, val), Vdbus_registered_buses); | 1123 | xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses); |
| 1119 | 1124 | ||
| 1120 | /* We do not want to abort. */ | 1125 | /* We do not want to abort. */ |
| 1121 | putenv ((char *) "DBUS_FATAL_WARNINGS=0"); | 1126 | putenv ((char *) "DBUS_FATAL_WARNINGS=0"); |
| @@ -1608,7 +1613,7 @@ xd_read_message (Lisp_Object bus) | |||
| 1608 | static void | 1613 | static void |
| 1609 | xd_read_queued_messages (int fd, void *data, int for_read) | 1614 | xd_read_queued_messages (int fd, void *data, int for_read) |
| 1610 | { | 1615 | { |
| 1611 | Lisp_Object busp = Vdbus_registered_buses; | 1616 | Lisp_Object busp = xd_registered_buses; |
| 1612 | Lisp_Object bus = Qnil; | 1617 | Lisp_Object bus = Qnil; |
| 1613 | Lisp_Object key; | 1618 | Lisp_Object key; |
| 1614 | 1619 | ||
| @@ -1728,14 +1733,6 @@ syms_of_dbusbind (void) | |||
| 1728 | doc: /* Message type of a signal message. */); | 1733 | doc: /* Message type of a signal message. */); |
| 1729 | Vdbus_message_type_signal = make_number (DBUS_MESSAGE_TYPE_SIGNAL); | 1734 | Vdbus_message_type_signal = make_number (DBUS_MESSAGE_TYPE_SIGNAL); |
| 1730 | 1735 | ||
| 1731 | DEFVAR_LISP ("dbus-registered-buses", | ||
| 1732 | Vdbus_registered_buses, | ||
| 1733 | doc: /* Alist of D-Bus buses we are polling for messages. | ||
| 1734 | |||
| 1735 | The key is the symbol or string of the bus, and the value is the | ||
| 1736 | connection address. */); | ||
| 1737 | Vdbus_registered_buses = Qnil; | ||
| 1738 | |||
| 1739 | DEFVAR_LISP ("dbus-registered-objects-table", | 1736 | DEFVAR_LISP ("dbus-registered-objects-table", |
| 1740 | Vdbus_registered_objects_table, | 1737 | Vdbus_registered_objects_table, |
| 1741 | doc: /* Hash table of registered functions for D-Bus. | 1738 | doc: /* Hash table of registered functions for D-Bus. |
| @@ -1789,6 +1786,10 @@ be called when the D-Bus reply message arrives. */); | |||
| 1789 | Vdbus_debug = Qnil; | 1786 | Vdbus_debug = Qnil; |
| 1790 | #endif | 1787 | #endif |
| 1791 | 1788 | ||
| 1789 | /* Initialize internal objects. */ | ||
| 1790 | xd_registered_buses = Qnil; | ||
| 1791 | staticpro (&xd_registered_buses); | ||
| 1792 | |||
| 1792 | Fprovide (intern_c_string ("dbusbind"), Qnil); | 1793 | Fprovide (intern_c_string ("dbusbind"), Qnil); |
| 1793 | 1794 | ||
| 1794 | } | 1795 | } |