diff options
author | Joe Shaw <joe@novell.com> | 2005-01-25 19:47:12 +0000 |
---|---|---|
committer | John Palmieri <johnp@remedyz.boston.redhat.com> | 2006-06-28 08:15:40 -0400 |
commit | 94ec32a3e7f46d9327d855666df0c944b987d334 (patch) | |
tree | 0e90fa3ab026636525e8f9e57ec37905174bd22b /mono/Service.cs | |
parent | c8701f129fdc6f6c2a223e3f08b50de4d6dc91df (diff) |
2005-01-25 Joe Shaw <joeshaw@novell.com>
* Land the mono binding changes to conform to the new APIs.
* mono/Makefile.am: Remove Custom.cs, DBusType/Custom.cs,
DBusType/Dict.cs, and DBusType/Nil.cs from the build.
* mono/Arguments.cs (GetCodeAsString): Added. Returns the dbus
type code as a string.
(InitAppending): Rename dbus_message_append_iter_init() to
dbus_message_iter_init_append().
* mono/BusDriver.cs: Rename ServiceEventHandler to
NameOwnerChangedHandler. Rename GetServiceOwner to GetOwner.
Rename ServiceOwnerChanged to NameOwnerChanged.
* mono/Connection.cs: Rename BaseService to UniqueName, and the
underlying C call.
* mono/Custom.cs: Removed. The CUSTOM type has been removed.
* mono/Service.cs: Rename Exists to HasOwner, internally rename
dbus_bus_acquire_service() to dbus_bus_request_name().
* mono/DBusType/Array.cs (ctor): Use Type.GetElementType() instead
of Type.UnderlyingSystemType to get the correct element type for
the array.
(ctor): Update code for new APIs: use dbus_message_iter_recurse(),
dbus_message_get_{element|arg}_type() instead of
dbus_message_iter_init_array_iterator().
(Append): Replace dbus_message_iter_append_array() with
dbus_message_iter_open_container() and
dbus_message_iter_close_container().
* mono/DBusType/Custom.cs, mono/DBusType/Nil.cs: Removed. These
types have been removed.
* mono/DBusType/*.cs: Replace calls of
dbus_message_iter_get_[type]() to dbus_message_iter_get_basic(),
but specify the type in the DllImport extern declaration. Ditto
for dbus_message_iter_append_[type]() ->
dbus_message_iter_append_basic().
* mono/example/BusListener.cs: Update for ServiceEventHandler ->
NameOwnerChangedHandler.
Diffstat (limited to 'mono/Service.cs')
-rw-r--r-- | mono/Service.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mono/Service.cs b/mono/Service.cs index 35a2584..5f6ff4c 100644 --- a/mono/Service.cs +++ b/mono/Service.cs @@ -38,7 +38,7 @@ namespace DBus // This isn't used for now uint flags = 0; - if (dbus_bus_acquire_service(connection.RawConnection, name, flags, ref error) == -1) { + if (dbus_bus_request_name (connection.RawConnection, name, flags, ref error) == -1) { throw new DBusException(error); } @@ -47,12 +47,12 @@ namespace DBus this.local = true; } - public static bool Exists(Connection connection, string name) + public static bool HasOwner(Connection connection, string name) { Error error = new Error(); error.Init(); - if (dbus_bus_service_exists(connection.RawConnection, + if (dbus_bus_name_has_owner(connection.RawConnection, name, ref error)) { return true; @@ -66,10 +66,10 @@ namespace DBus public static Service Get(Connection connection, string name) { - if (Exists(connection, name)) { + if (HasOwner(connection, name)) { return new Service(name, connection); } else { - throw new ApplicationException("Service '" + name + "' does not exist."); + throw new ApplicationException("Name '" + name + "' does not exist."); } } @@ -184,12 +184,12 @@ namespace DBus } [DllImport("dbus-1")] - private extern static int dbus_bus_acquire_service(IntPtr rawConnection, - string serviceName, - uint flags, ref Error error); + private extern static int dbus_bus_request_name(IntPtr rawConnection, + string serviceName, + uint flags, ref Error error); [DllImport("dbus-1")] - private extern static bool dbus_bus_service_exists(IntPtr rawConnection, + private extern static bool dbus_bus_name_has_owner(IntPtr rawConnection, string serviceName, ref Error error); |