+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*-*/
+
#ifndef fooreservehfoo
#define fooreservehfoo
#include <dbus/dbus.h>
#include <inttypes.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct rd_device rd_device;
/* Prototype for a function that is called whenever someone else wants
* the error was caused D-Bus. */
int rd_acquire(
rd_device **d, /* On success a pointer to the newly allocated rd_device object will be filled in here */
- DBusConnection *connection, /* Session bus (when D-Bus learns about user busses we should switchg to user busses) */
+ DBusConnection *connection, /* Session bus (when D-Bus learns about user busses we should switch to user busses) */
const char *device_name, /* The device to lock, e.g. "Audio0" */
const char *application_name, /* A human readable name of the application, e.g. "PulseAudio Sound Server" */
int32_t priority, /* The priority for this application. If unsure use 0 */
* userdata was set. */
void* rd_get_userdata(rd_device *d);
+/* Helper function to get the unique connection name owning a given
+ * name. Returns 0 on success, a negative errno style return value on
+ * error. */
+int rd_dbus_get_name_owner(
+ DBusConnection *connection,
+ const char *name,
+ char **name_owner,
+ DBusError *error);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif