-static int name_compare_links(const void *n1, const void *n2)
-{
- char name1[80], name2[80];
- strcpy(name1, SD_link_get_name(*((SD_link_t *) n1)));
- strcpy(name2, SD_link_get_name(*((SD_link_t *) n2)));
-
- return strcmp(name1, name2);
-}
-
-static const char *node_name(xbt_node_t n)
-{
- return xbt_graph_node_get_data(n);
-}
-
-static const char *edge_name(xbt_edge_t n)
-{
- return xbt_graph_edge_get_data(n);
-}
-
-static xbt_node_t xbt_graph_search_node (xbt_graph_t graph, void *data, int (*compare_function)(const char *, const char *))
-{
- unsigned int cursor = 0;
- void *tmp = NULL;
-
- xbt_dynar_t dynar = xbt_graph_get_nodes (graph);
- xbt_dynar_foreach(dynar, cursor, tmp) {
- xbt_node_t node = (xbt_node_t)tmp;
- if (!compare_function (data, xbt_graph_node_get_data (node))) return node;
- }
- return NULL;
-}
-
-static xbt_edge_t xbt_graph_search_edge (xbt_graph_t graph, xbt_node_t n1, xbt_node_t n2)
-{
- unsigned int cursor = 0;
- void *tmp = NULL;
- xbt_dynar_t dynar = xbt_graph_get_edges (graph);
- xbt_dynar_foreach(dynar, cursor, tmp) {
- xbt_edge_t edge = (xbt_edge_t)tmp;
- if (( xbt_graph_edge_get_source(edge) == n1 &&
- xbt_graph_edge_get_target(edge) == n2) ||
- ( xbt_graph_edge_get_source(edge) == n2 &&
- xbt_graph_edge_get_target(edge) == n1)){
- return edge;
- }
- }
- return NULL;
-}
-