diff options
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; +} + |