diff options
Diffstat (limited to 'src/lib/eina_graph_private.h')
-rw-r--r-- | src/lib/eina_graph_private.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/eina_graph_private.h b/src/lib/eina_graph_private.h index 526e4e4..1c4ea86 100644 --- a/src/lib/eina_graph_private.h +++ b/src/lib/eina_graph_private.h @@ -90,6 +90,25 @@ eina_graph_adjacents_push(_Eina_Graph_Adjacents *adjs, unsigned int v, unsigned return EINA_TRUE; } +static inline Eina_Bool +eina_array_push_uint(Eina_Array *array, unsigned int v) +{ + if (EINA_UNLIKELY((array->count + 1) > array->total)) + if (!eina_array_grow(array)) + return EINA_FALSE; + + array->data[array->count++] = (void*) (uintptr_t) v; + + return EINA_TRUE; +} + +static inline unsigned int +eina_array_top_uint_get(const Eina_Array *array) +{ + return (unsigned int) (uintptr_t) + eina_array_data_get(array,eina_array_count_get(array) - 1 ); +} + /*+ * To cast a vertex number into Eina_List data. */ |