diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2013-02-07 15:27:02 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2013-02-07 15:27:02 +0100 |
commit | 38c7420e1e74d7742e43c52e2c0d30268ef0956b (patch) | |
tree | b5795a966f34531e6885fc587b447eebd185fd8a /ufo/ufo-graph.c | |
parent | 3d00f52b84c2d97965b5b973bfcf1a5a3958e5e7 (diff) |
Export UfoEdge and add ufo_graph_get_edges()
Diffstat (limited to 'ufo/ufo-graph.c')
-rw-r--r-- | ufo/ufo-graph.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/ufo/ufo-graph.c b/ufo/ufo-graph.c index fe6644d..826f13f 100644 --- a/ufo/ufo-graph.c +++ b/ufo/ufo-graph.c @@ -31,12 +31,6 @@ G_DEFINE_TYPE (UfoGraph, ufo_graph, G_TYPE_OBJECT) #define UFO_GRAPH_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), UFO_TYPE_GRAPH, UfoGraphPrivate)) -typedef struct { - UfoNode *source; - UfoNode *target; - gpointer label; -} UfoEdge; - struct _UfoGraphPrivate { GList *node_types; GList *nodes; @@ -220,6 +214,22 @@ ufo_graph_get_num_edges (UfoGraph *graph) } /** + * ufo_graph_get_edges: + * @graph: A #UfoGraph + * + * Get all edges contained in @graph. + * + * Returns: (element-type UfoEdge): a list of #UfoEdge elements or %NULL on + * error. Release the list with g_list_free(). + */ +GList * +ufo_graph_get_edges (UfoGraph *graph) +{ + g_return_val_if_fail (UFO_IS_GRAPH (graph), NULL); + return g_list_copy (graph->priv->edges); +} + +/** * ufo_graph_get_nodes: * @graph: A #UfoGraph * |