diff options
Diffstat (limited to 'hcid/dbus-service.c')
| -rw-r--r-- | hcid/dbus-service.c | 24 | 
1 files changed, 24 insertions, 0 deletions
| diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index 5a6d8199..4f935ff5 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -877,6 +877,30 @@ void release_services(DBusConnection *conn)  	services = NULL;  } +const char *search_service(DBusConnection *conn, const char *pattern) +{ +	GSList *l = services; +	struct service *service; +	const char *path; + +	while (l) { +		path = l->data; + +		l = l->next; + +		if (!dbus_connection_get_object_path_data(conn, path, (void *) &service)) +			continue; + +		if (!service) +			continue; + +		if (service->ident && !strcmp(service->ident, pattern)) +			return path; +	} + +	return NULL; +} +  void append_available_services(DBusMessageIter *array_iter)  {  	GSList *l; | 
