endpoint: add wp_endpoint_unlink API

This commit is contained in:
Julian Bouzas 2019-07-08 09:53:55 -04:00
parent 5d1397cf56
commit 27a31498c0
2 changed files with 21 additions and 0 deletions

View file

@ -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

View file

@ -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
{