Implement ladish_graph_remove_port()

This commit is contained in:
Nedko Arnaudov 2009-09-20 16:28:05 +03:00
parent 74e3346655
commit 303c07d6e6
2 changed files with 21 additions and 1 deletions

View File

@ -34,6 +34,7 @@ struct ladish_graph_port
{
struct list_head siblings_client;
struct list_head siblings_graph;
struct ladish_graph_client * client_ptr;
char * name;
uint32_t type;
uint32_t flags;
@ -658,6 +659,7 @@ ladish_graph_add_port(
port_ptr->port = port_handle;
graph_ptr->graph_version++;
port_ptr->client_ptr = client_ptr;
list_add_tail(&port_ptr->siblings_client, &client_ptr->ports);
list_add_tail(&port_ptr->siblings_graph, &graph_ptr->ports);
@ -715,6 +717,25 @@ ladish_port_handle ladish_graph_find_port_by_id(ladish_graph_handle graph_handle
return NULL;
}
void
ladish_graph_remove_port(
ladish_graph_handle graph_handle,
ladish_port_handle port)
{
struct list_head * node_ptr;
struct ladish_graph_port * port_ptr;
list_for_each(node_ptr, &graph_ptr->ports)
{
port_ptr = list_entry(node_ptr, struct ladish_graph_port, siblings_graph);
if (port_ptr->port == port)
{
ladish_graph_remove_port_internal(graph_ptr, port_ptr->client_ptr, port_ptr, false);
return;
}
}
}
bool
ladish_graph_iterate_nodes(
ladish_graph_handle graph_handle,

View File

@ -57,7 +57,6 @@ ladish_graph_add_port(
void
ladish_graph_remove_port(
ladish_graph_handle graph_handle,
ladish_client_handle client_handle,
ladish_port_handle port_handle);
ladish_client_handle ladish_graph_find_client_by_id(ladish_graph_handle graph_handle, uint64_t client_id);