diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/eina_graph_bfs.c | 12 | ||||
-rw-r--r-- | src/lib/eina_graph_bfs.h | 10 | ||||
-rw-r--r-- | src/lib/eina_graph_dfs.c | 6 | ||||
-rw-r--r-- | src/lib/eina_graph_dfs.h | 6 | ||||
-rw-r--r-- | src/tests/eina_graph_suite.c | 30 |
5 files changed, 32 insertions, 32 deletions
diff --git a/src/lib/eina_graph_bfs.c b/src/lib/eina_graph_bfs.c index a7ce983..c2f2f63 100644 --- a/src/lib/eina_graph_bfs.c +++ b/src/lib/eina_graph_bfs.c @@ -106,7 +106,7 @@ _eina_graph_bfs_walk(_Eina_Graph *_g, _Eina_Graph_BFS *_bfs, } EAPI Eina_List * -eina_graph_bfs_shortest_path(Eina_Graph *g, unsigned int s, unsigned int d) +eina_graph_bfs_shortest_path_get(Eina_Graph *g, unsigned int s, unsigned int d) { Eina_List *path; Eina_Graph_BFS *bfs; @@ -116,7 +116,7 @@ eina_graph_bfs_shortest_path(Eina_Graph *g, unsigned int s, unsigned int d) if (!bfs) return NULL; _eina_graph_bfs_walk(_g, (_Eina_Graph_BFS *)bfs, s, d); - path = eina_graph_bfs_path_to(bfs, d); + path = eina_graph_bfs_path_get(bfs, d); eina_graph_bfs_free(bfs); @@ -148,7 +148,7 @@ eina_graph_bfs_free(Eina_Graph_BFS *bfs) } EAPI unsigned int -eina_graph_bfs_source(Eina_Graph_BFS *bfs) +eina_graph_bfs_source_get(Eina_Graph_BFS *bfs) { _Eina_Graph_BFS *_bfs = (_Eina_Graph_BFS *) bfs; @@ -156,7 +156,7 @@ eina_graph_bfs_source(Eina_Graph_BFS *bfs) } EAPI Eina_Bool -eina_graph_bfs_has_path_to(Eina_Graph_BFS *bfs, unsigned int v) +eina_graph_bfs_path_exists(Eina_Graph_BFS *bfs, unsigned int v) { _Eina_Graph_BFS *_bfs = (_Eina_Graph_BFS *) bfs; @@ -170,7 +170,7 @@ eina_graph_bfs_has_path_to(Eina_Graph_BFS *bfs, unsigned int v) } EAPI Eina_List * -eina_graph_bfs_path_to(Eina_Graph_BFS *bfs, unsigned int v) +eina_graph_bfs_path_get(Eina_Graph_BFS *bfs, unsigned int v) { unsigned int w = v; Eina_List *path = NULL; @@ -196,7 +196,7 @@ eina_graph_bfs_path_to(Eina_Graph_BFS *bfs, unsigned int v) } EAPI unsigned int -eina_graph_bfs_dist_to(Eina_Graph_BFS *bfs, unsigned int v) +eina_graph_bfs_dist_get(Eina_Graph_BFS *bfs, unsigned int v) { _Eina_Graph_BFS *_bfs = (_Eina_Graph_BFS *) bfs; diff --git a/src/lib/eina_graph_bfs.h b/src/lib/eina_graph_bfs.h index f367cf4..21e5336 100644 --- a/src/lib/eina_graph_bfs.h +++ b/src/lib/eina_graph_bfs.h @@ -49,7 +49,7 @@ typedef struct _Eina_Graph_BFS_Opaque Eina_Graph_BFS; * NULL if v is not reachable. */ EAPI Eina_List * -eina_graph_bfs_shortest_path(Eina_Graph *g, unsigned int s, unsigned int d); +eina_graph_bfs_shortest_path_get(Eina_Graph *g, unsigned int s, unsigned int d); /** * returns a Breadth First Search of the given graph. @@ -78,7 +78,7 @@ eina_graph_bfs_free(Eina_Graph_BFS *bfs); * @return the source vertex of the BFS. */ EAPI unsigned int -eina_graph_bfs_source(Eina_Graph_BFS *bfs); +eina_graph_bfs_source_get(Eina_Graph_BFS *bfs); /** * is there a path from the source to the given vertex. @@ -89,7 +89,7 @@ eina_graph_bfs_source(Eina_Graph_BFS *bfs); * @return EINA_TRUE if the vertex is reachable from the source. */ EAPI Eina_Bool -eina_graph_bfs_has_path_to(Eina_Graph_BFS *bfs, unsigned int v); +eina_graph_bfs_path_exists(Eina_Graph_BFS *bfs, unsigned int v); /* * return the path to reach the given vertex from the source. @@ -103,7 +103,7 @@ eina_graph_bfs_has_path_to(Eina_Graph_BFS *bfs, unsigned int v); * NULL if v is not reachable. */ EAPI Eina_List * -eina_graph_bfs_path_to(Eina_Graph_BFS *bfs, unsigned int v); +eina_graph_bfs_path_get(Eina_Graph_BFS *bfs, unsigned int v); /* * return the distance from the source to the given vertex. @@ -115,6 +115,6 @@ eina_graph_bfs_path_to(Eina_Graph_BFS *bfs, unsigned int v); * UINT_MAX in not reachable. */ EAPI unsigned int -eina_graph_bfs_dist_to(Eina_Graph_BFS *bfs, unsigned int v); +eina_graph_bfs_dist_get(Eina_Graph_BFS *bfs, unsigned int v); #endif /* _EINA_GRAPH_BFS_H */ diff --git a/src/lib/eina_graph_dfs.c b/src/lib/eina_graph_dfs.c index f958d41..3488185 100644 --- a/src/lib/eina_graph_dfs.c +++ b/src/lib/eina_graph_dfs.c @@ -134,7 +134,7 @@ eina_graph_dfs_free(Eina_Graph_DFS *dfs) } EAPI unsigned int -eina_graph_dfs_source(Eina_Graph_DFS *dfs) +eina_graph_dfs_source_get(Eina_Graph_DFS *dfs) { _Eina_Graph_DFS *_dfs = (_Eina_Graph_DFS *) dfs; @@ -142,7 +142,7 @@ eina_graph_dfs_source(Eina_Graph_DFS *dfs) } EAPI Eina_Bool -eina_graph_dfs_has_path_to(Eina_Graph_DFS *dfs, unsigned int v) +eina_graph_dfs_path_exists(Eina_Graph_DFS *dfs, unsigned int v) { _Eina_Graph_DFS *_dfs = (_Eina_Graph_DFS *) dfs; @@ -156,7 +156,7 @@ eina_graph_dfs_has_path_to(Eina_Graph_DFS *dfs, unsigned int v) } EAPI Eina_List * -eina_graph_dfs_path_to(Eina_Graph_DFS *dfs, unsigned int v) +eina_graph_dfs_path_get(Eina_Graph_DFS *dfs, unsigned int v) { unsigned int w = v; Eina_List *path = NULL; diff --git a/src/lib/eina_graph_dfs.h b/src/lib/eina_graph_dfs.h index 1de0ac7..09a770c 100644 --- a/src/lib/eina_graph_dfs.h +++ b/src/lib/eina_graph_dfs.h @@ -66,7 +66,7 @@ eina_graph_dfs_free(Eina_Graph_DFS *dfs); * @return the source vertex of the DFS. */ EAPI unsigned int -eina_graph_dfs_source(Eina_Graph_DFS *dfs); +eina_graph_dfs_source_get(Eina_Graph_DFS *dfs); /** * is there a path from the source to the given vertex. @@ -77,7 +77,7 @@ eina_graph_dfs_source(Eina_Graph_DFS *dfs); * @return EINA_TRUE if the vertex is reachable from the source. */ EAPI Eina_Bool -eina_graph_dfs_has_path_to(Eina_Graph_DFS *dfs, unsigned int v); +eina_graph_dfs_path_exists(Eina_Graph_DFS *dfs, unsigned int v); /* * return the path to reach the given vertex from the source. @@ -91,6 +91,6 @@ eina_graph_dfs_has_path_to(Eina_Graph_DFS *dfs, unsigned int v); * NULL if v is not reachable. */ EAPI Eina_List * -eina_graph_dfs_path_to(Eina_Graph_DFS *dfs, unsigned int v); +eina_graph_dfs_path_get(Eina_Graph_DFS *dfs, unsigned int v); #endif /* _EINA_GRAPH_DFS_H */ diff --git a/src/tests/eina_graph_suite.c b/src/tests/eina_graph_suite.c index dd1d852..ff4822d 100644 --- a/src/tests/eina_graph_suite.c +++ b/src/tests/eina_graph_suite.c @@ -39,14 +39,14 @@ static void _bfs_tests(unsigned int vertices[], unsigned int n) _feed_graph(g); bfs = eina_graph_bfs_new(g, 0); - ck_assert(eina_graph_bfs_source(bfs) == 0); - ck_assert(eina_graph_bfs_has_path_to(bfs, 12) == EINA_FALSE); - ck_assert(eina_graph_bfs_path_to(bfs, 12) == NULL); - ck_assert(eina_graph_bfs_path_to(bfs, 15) == NULL); - ck_assert(eina_graph_bfs_dist_to(bfs, 15) == UINT_MAX); - ck_assert(eina_graph_bfs_has_path_to(bfs, 3) == EINA_TRUE); - ck_assert(eina_graph_bfs_dist_to(bfs, 3) == 2); - path = eina_graph_bfs_path_to(bfs, 3); + ck_assert(eina_graph_bfs_source_get(bfs) == 0); + ck_assert(eina_graph_bfs_path_exists(bfs, 12) == EINA_FALSE); + ck_assert(eina_graph_bfs_path_get(bfs, 12) == NULL); + ck_assert(eina_graph_bfs_path_get(bfs, 15) == NULL); + ck_assert(eina_graph_bfs_dist_get(bfs, 15) == UINT_MAX); + ck_assert(eina_graph_bfs_path_exists(bfs, 3) == EINA_TRUE); + ck_assert(eina_graph_bfs_dist_get(bfs, 3) == 2); + path = eina_graph_bfs_path_get(bfs, 3); ck_assert(path != NULL); ck_assert(eina_list_count(path) == n); i = 0; @@ -58,7 +58,7 @@ static void _bfs_tests(unsigned int vertices[], unsigned int n) path = NULL; eina_graph_bfs_free(bfs); - path = eina_graph_bfs_shortest_path(g, 0, 3); + path = eina_graph_bfs_shortest_path_get(g, 0, 3); ck_assert(path != NULL); ck_assert(eina_list_count(path) == n); i = 0; @@ -96,12 +96,12 @@ static void _dfs_tests(Eina_Bool r, unsigned int vertices[], unsigned int n) _feed_graph(g); dfs = eina_graph_dfs_new(g, 0, r); - ck_assert(eina_graph_dfs_source(dfs) == 0); - ck_assert(eina_graph_dfs_has_path_to(dfs, 12) == EINA_FALSE); - ck_assert(eina_graph_dfs_path_to(dfs, 12) == NULL); - ck_assert(eina_graph_dfs_path_to(dfs, 15) == NULL); - ck_assert(eina_graph_dfs_has_path_to(dfs, 3) == EINA_TRUE); - path = eina_graph_dfs_path_to(dfs, 3); + ck_assert(eina_graph_dfs_source_get(dfs) == 0); + ck_assert(eina_graph_dfs_path_exists(dfs, 12) == EINA_FALSE); + ck_assert(eina_graph_dfs_path_get(dfs, 12) == NULL); + ck_assert(eina_graph_dfs_path_get(dfs, 15) == NULL); + ck_assert(eina_graph_dfs_path_exists(dfs, 3) == EINA_TRUE); + path = eina_graph_dfs_path_get(dfs, 3); ck_assert(path != NULL); ck_assert(eina_list_count(path) == n); i = 0; |