diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-12-06 15:19:35 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-12-06 15:19:35 +0100 |
commit | bd715870e1a688073d0a23b7f75bf2a6635f7a2b (patch) | |
tree | 9f1ea1570e5edea4bdd9200f00815d71335bb284 /src/lib/eina_graph_main.c | |
parent | ca99540270f229485e64caed4aa949e129ddf1d8 (diff) | |
download | eina_graph-bd715870e1a688073d0a23b7f75bf2a6635f7a2b.zip eina_graph-bd715870e1a688073d0a23b7f75bf2a6635f7a2b.tar.gz |
add Eina_Graph: unweighted undirected graph
Diffstat (limited to 'src/lib/eina_graph_main.c')
-rw-r--r-- | src/lib/eina_graph_main.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/eina_graph_main.c b/src/lib/eina_graph_main.c index bd8be47..6eac08d 100644 --- a/src/lib/eina_graph_main.c +++ b/src/lib/eina_graph_main.c @@ -90,3 +90,20 @@ eina_graph_shutdown(void) return _eina_graph_init_count; } + +Eina_Bool +_eina_graph_adjacents_grow(Eina_Graph_Adjacents *adjs, unsigned int step) +{ + unsigned int *tmp; + unsigned int total; + + total = adjs->total + step; + tmp = realloc(adjs->data, sizeof (unsigned int) * total); + if (EINA_UNLIKELY(!tmp)) return EINA_FALSE; + + adjs->total = total; + adjs->data = tmp; + + return EINA_TRUE; +} + |