diff options
author | 2023-05-10 16:31:53 +0200 | |
---|---|---|
committer | 2023-05-10 16:31:53 +0200 | |
commit | b6f8c43dabd4725b3a74795b85364c1a685ec6eb (patch) | |
tree | b23f6795c6f8b7e4d6b2b9a12cf33e4634c08af4 /src/utils.h | |
parent | ba96d5e14017bd853f929e6bb9799d3a6ad9e813 (diff) | |
download | utils-b6f8c43dabd4725b3a74795b85364c1a685ec6eb.tar.gz utils-b6f8c43dabd4725b3a74795b85364c1a685ec6eb.zip |
Add data size when adding new items to the list
When adding new data to the list, we need exactly how long is the data. So, it's
programer responsibility to calculate the exact size of data to store.
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils.h b/src/utils.h index e21dd2e..6c5db92 100644 --- a/src/utils.h +++ b/src/utils.h @@ -5,6 +5,7 @@ typedef struct list_item_t { void *data; + size_t data_s; struct list_item_t *next; } list_item_t; @@ -19,12 +20,13 @@ typedef struct iterator_t { } iterator_t; list_t clist_create (void); -void clist_add (list_t *, void *); +void clist_add (list_t *, void *, size_t); void clist_add_all (list_t *, list_t *); void clist_remove (list_t *, list_item_t *); iterator_t clist_iterator (list_t *); int clist_iterator_has_next(iterator_t); void *clist_iterator_next (iterator_t *); +list_item_t *clist_iterator_next_item(iterator_t *); char *cutils_version(); |