summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2006-02-15 21:42:54 +0000
committerJohn (J5) Palmieri <johnp@redhat.com>2006-02-15 21:42:54 +0000
commitb1aa8a0baf783a251be6e8021a7881e63b8f9830 (patch)
tree15bd7828198147d24249a5db7208765163059743 /glib
parent9076938fc05fe7f95abb4dc573d29efe54fcef51 (diff)
downloaddbus-b1aa8a0baf783a251be6e8021a7881e63b8f9830.tar.gz
2006-02-15 John (J5) Palmieri <johnp@redhat.com>
* dbus/dbus-glib.h: * glib/dbus-gmain.h: (dbus_g_connection_open): new method for openning a connection to an arbitrary address in the glib bindings * ChangeLog: checkin last entry which doesn't seem to be commited
Diffstat (limited to 'glib')
-rw-r--r--glib/dbus-gmain.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c
index 267f0bfa..d2716103 100644
--- a/glib/dbus-gmain.c
+++ b/glib/dbus-gmain.c
@@ -697,6 +697,43 @@ dbus_server_setup_with_g_main (DBusServer *server,
}
/**
+ * Returns a connection to the given address.
+ *
+ * (Internally, calls dbus_connection_open() then calls
+ * dbus_connection_setup_with_g_main() on the result.)
+ *
+ * @param address address of the connection to open
+ * @param error address where an error can be returned.
+ * @returns a DBusConnection
+ */
+DBusGConnection*
+dbus_g_connection_open (const gchar *address,
+ GError **error)
+{
+ DBusConnection *connection;
+ DBusError derror;
+
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ _dbus_g_value_types_init ();
+
+ dbus_error_init (&derror);
+
+ connection = dbus_connection_open (socket, &derror);
+ if (connection == NULL)
+ {
+ dbus_set_g_error (error, &derror);
+ dbus_error_free (&derror);
+ return NULL;
+ }
+
+ /* does nothing if it's already been done */
+ dbus_connection_setup_with_g_main (connection, NULL);
+
+ return DBUS_G_CONNECTION_FROM_CONNECTION (connection);
+}
+
+/**
* Returns a connection to the given bus. The connection is a global variable
* shared with other callers of this function.
*