diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-05-07 11:57:07 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-05-07 11:57:07 -0600 |
commit | 9adb64786e6aa8f5f0fca39a67e96c495058fd1e (patch) | |
tree | afb42b751972e2a806d717c8ba1eae1554785859 /libdimension/dimension | |
parent | adb8a2cd0d7bf835f987fa6a6202545cb7336956 (diff) | |
download | dimension-9adb64786e6aa8f5f0fca39a67e96c495058fd1e.tar.xz |
New dmnsn_array_from_list() function.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r-- | libdimension/dimension/list.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libdimension/dimension/list.h b/libdimension/dimension/list.h index 0b68e91..ae2aab5 100644 --- a/libdimension/dimension/list.h +++ b/libdimension/dimension/list.h @@ -76,39 +76,41 @@ dmnsn_new_list(size_t obj_size) return list; } -/* Construction from arrays */ -dmnsn_list *dmnsn_list_from_array(const dmnsn_array *array); +/* Construction to/from arrays */ +dmnsn_list *dmnsn_list_from_array(const dmnsn_array *array); +dmnsn_array *dmnsn_array_from_list(const dmnsn_list *list); + /* Delete a list */ void dmnsn_delete_list(dmnsn_list *list); DMNSN_INLINE dmnsn_list_iterator * -dmnsn_list_first(dmnsn_list *list) +dmnsn_list_first(const dmnsn_list *list) { return list->first; } DMNSN_INLINE dmnsn_list_iterator * -dmnsn_list_last(dmnsn_list *list) +dmnsn_list_last(const dmnsn_list *list) { return list->last; } DMNSN_INLINE dmnsn_list_iterator * -dmnsn_list_prev(dmnsn_list_iterator *i) +dmnsn_list_prev(const dmnsn_list_iterator *i) { dmnsn_assert(i, "NULL list iterator."); return i->prev; } DMNSN_INLINE dmnsn_list_iterator * -dmnsn_list_next(dmnsn_list_iterator *i) +dmnsn_list_next(const dmnsn_list_iterator *i) { dmnsn_assert(i, "NULL list iterator."); return i->next; } DMNSN_INLINE size_t -dmnsn_list_size(dmnsn_list *list) +dmnsn_list_size(const dmnsn_list *list) { return list->length; } |