diff options
| author | Michael Albinus | 2008-02-06 20:54:19 +0000 |
|---|---|---|
| committer | Michael Albinus | 2008-02-06 20:54:19 +0000 |
| commit | 4ba11bcb85896ea1201edb4f03b7b0a30c93334b (patch) | |
| tree | 7557fdb306a0854b42c783f3a81d2b1423d16d4a | |
| parent | a9f31e3df9023b8ee7447f4a4b7fd53b091ca5aa (diff) | |
| download | emacs-4ba11bcb85896ea1201edb4f03b7b0a30c93334b.tar.gz emacs-4ba11bcb85896ea1201edb4f03b7b0a30c93334b.zip | |
* net/dbus.el (dbus-interface-peer): New defconst.
(dbus-ping): New defun.
| -rw-r--r-- | lisp/net/dbus.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 6ecd0065606..4390f305b66 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -47,7 +47,11 @@ | |||
| 47 | (defconst dbus-interface-dbus "org.freedesktop.DBus" | 47 | (defconst dbus-interface-dbus "org.freedesktop.DBus" |
| 48 | "The interface exported by the object with `dbus-service-dbus' and `dbus-path-dbus'.") | 48 | "The interface exported by the object with `dbus-service-dbus' and `dbus-path-dbus'.") |
| 49 | 49 | ||
| 50 | (defconst dbus-interface-introspectable "org.freedesktop.DBus.Introspectable" | 50 | (defconst dbus-interface-peer (concat dbus-interface-dbus ".Peer") |
| 51 | "The interface for peer objects.") | ||
| 52 | |||
| 53 | (defconst dbus-interface-introspectable | ||
| 54 | (concat dbus-interface-dbus ".Introspectable") | ||
| 51 | "The interface supported by introspectable objects.") | 55 | "The interface supported by introspectable objects.") |
| 52 | 56 | ||
| 53 | (defmacro dbus-ignore-errors (&rest body) | 57 | (defmacro dbus-ignore-errors (&rest body) |
| @@ -319,6 +323,15 @@ The result is either a string, or nil if there is no name owner." | |||
| 319 | bus dbus-service-dbus dbus-path-dbus | 323 | bus dbus-service-dbus dbus-path-dbus |
| 320 | dbus-interface-dbus "GetNameOwner" service))) | 324 | dbus-interface-dbus "GetNameOwner" service))) |
| 321 | 325 | ||
| 326 | (defun dbus-ping (bus service) | ||
| 327 | "Check whether SERVICE is registered for D-Bus BUS." | ||
| 328 | ;; "Ping" raises a D-Bus error if SERVICE does not exist. | ||
| 329 | ;; Otherwise, it returns silently with `nil'. | ||
| 330 | (condition-case nil | ||
| 331 | (not | ||
| 332 | (dbus-call-method bus service dbus-path-dbus dbus-interface-peer "Ping")) | ||
| 333 | (dbus-error nil))) | ||
| 334 | |||
| 322 | (defun dbus-introspect (bus service path) | 335 | (defun dbus-introspect (bus service path) |
| 323 | "Return the introspection data of SERVICE in D-Bus BUS at object path PATH. | 336 | "Return the introspection data of SERVICE in D-Bus BUS at object path PATH. |
| 324 | The data are in XML format. | 337 | The data are in XML format. |