diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-18 20:31:20 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2016-09-18 20:31:20 +0000 |
| commit | ba06a3a0dec8b132f3ad81c62f7ec98f95430f11 (patch) | |
| tree | 7e3b367f3fcc3ffbca3d5148152088de1a717e0f /lib/graph.h | |
| parent | 535ef5569adb011209ad4f852da75d4a8fa06c1d (diff) | |
lib: Add edge removal to graph data structure
Ability to remove directed edge between two nodes.
Also ensures that adjacency vectors have no null entries.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/graph.h')
| -rw-r--r-- | lib/graph.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/graph.h b/lib/graph.h index b6a03b938a..8d8aa3823b 100644 --- a/lib/graph.h +++ b/lib/graph.h @@ -64,6 +64,7 @@ graph_new_node (struct graph *graph, void *data, void (*del) (void*)); * If *data and *del are non-null, the following call is made: * (*node->del) (node->data); * + * @param[in] graph the graph this node belongs to * @param[out] node pointer to node to delete */ void @@ -80,8 +81,16 @@ struct graph_node * graph_add_edge (struct graph_node *from, struct graph_node *to); /** - * Deletes a graph. + * Removes a directed edge between two nodes. * + * @param[in] from + * @param[in] to + */ +void +graph_remove_edge (struct graph_node *from, struct graph_node *to); + +/** + * Deletes a graph. * Calls graph_delete_node on each node before freeing the graph struct itself. * * @param graph the graph to delete |
