Sat, 16 Apr 2022 20:44:47 +0200
make cxListMemoryMgmt a linkable symbol
src/cx/list.h | file | annotate | diff | comparison | revisions | |
src/list.c | file | annotate | diff | comparison | revisions |
--- a/src/cx/list.h Sat Apr 16 20:17:01 2022 +0200 +++ b/src/cx/list.h Sat Apr 16 20:44:47 2022 +0200 @@ -203,18 +203,13 @@ * if the content destructor did not do that or no content destructor exists */ __attribute__((__nonnull__(1))) -static inline void cxListMemoryMgmt( +void cxListMemoryMgmt( CxList *list, cx_destructor_func list_destructor, cx_destructor_func content_destructor, bool list_autofree, bool content_autofree -) { - if (list_destructor != NULL) list->list_destructor = list_destructor; - list->content_destructor = content_destructor; - list->autofree = list_autofree; - list->autofree_contents = content_autofree; -} +); /** * Adds an item to the end of the list.
--- a/src/list.c Sat Apr 16 20:17:01 2022 +0200 +++ b/src/list.c Sat Apr 16 20:44:47 2022 +0200 @@ -57,3 +57,16 @@ return list->list_destructor(list); } } + +void cxListMemoryMgmt( + CxList *list, + cx_destructor_func list_destructor, + cx_destructor_func content_destructor, + bool list_autofree, + bool content_autofree +) { + if (list_destructor != NULL) list->list_destructor = list_destructor; + list->content_destructor = content_destructor; + list->autofree = list_autofree; + list->autofree_contents = content_autofree; +}