Skip to content
Snippets Groups Projects
Commit 27a31498 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

endpoint: add wp_endpoint_unlink API

parent 5d1397cf
No related branches found
No related tags found
No related merge requests found
......@@ -733,6 +733,26 @@ wp_endpoint_get_links (WpEndpoint * self)
return priv->links;
}
/**
* wp_endpoint_unlink:
* @self: the endpoint
*
* Unlinks all the endpoints linked to this endpoint
*/
void
wp_endpoint_unlink (WpEndpoint * self)
{
WpEndpointPrivate *priv;
gint i;
g_return_if_fail (WP_IS_ENDPOINT (self));
priv = wp_endpoint_get_instance_private (self);
for (i = priv->links->len - 1; i >= 0; i--)
wp_endpoint_link_destroy (g_ptr_array_index (priv->links, i));
}
typedef struct _WpEndpointLinkPrivate WpEndpointLinkPrivate;
struct _WpEndpointLinkPrivate
......
......@@ -68,6 +68,7 @@ void wp_endpoint_notify_control_value (WpEndpoint * self, guint32 control_id);
gboolean wp_endpoint_is_linked (WpEndpoint * self);
GPtrArray * wp_endpoint_get_links (WpEndpoint * self);
void wp_endpoint_unlink (WpEndpoint * self);
struct _WpEndpointLinkClass
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment