diff options
Diffstat (limited to 'libdimension/list.c')
-rw-r--r-- | libdimension/list.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libdimension/list.c b/libdimension/list.c index 5b03209..0c01e68 100644 --- a/libdimension/list.c +++ b/libdimension/list.c @@ -32,6 +32,21 @@ dmnsn_list_from_array(const dmnsn_array *array) return list; } +dmnsn_array * +dmnsn_array_from_list(const dmnsn_list *list) +{ + dmnsn_array *array = dmnsn_new_array(list->obj_size); + + for (dmnsn_list_iterator *i = dmnsn_list_first(list); + i != NULL; + i = dmnsn_list_next(i)) + { + dmnsn_array_push(array, i->ptr); + } + + return array; +} + void dmnsn_delete_list(dmnsn_list *list) { |