summaryrefslogtreecommitdiffstats
path: root/lib/graph.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-09-18 22:31:20 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-09-18 22:31:20 +0200
commitba06a3a0dec8b132f3ad81c62f7ec98f95430f11 (patch)
tree7e3b367f3fcc3ffbca3d5148152088de1a717e0f /lib/graph.h
parentlib: Add support for selectors inside options (diff)
downloadfrr-ba06a3a0dec8b132f3ad81c62f7ec98f95430f11.tar.xz
frr-ba06a3a0dec8b132f3ad81c62f7ec98f95430f11.zip
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.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/graph.h b/lib/graph.h
index b6a03b938..8d8aa3823 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