]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
update TLIST macro functions
authorAlan T. DeKok <aland@freeradius.org>
Tue, 5 Apr 2022 22:26:46 +0000 (18:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 7 Apr 2022 15:23:36 +0000 (11:23 -0400)
src/lib/util/tlist.h

index d22ec9dbdbc70885f00e675446544ccf3d22f463..5dbb8f801b6645ce4b3b68cb55d250ad93acadb2 100644 (file)
@@ -1030,14 +1030,17 @@ DIAG_OFF(unused-function) \
        static inline FR_TLIST_HEAD(_name) *_name ## _children(_element_type *ptr) \
                {               return (FR_TLIST_HEAD(_name) *) (ptr->_element_entry.entry.children); } \
 \
-       static inline void _name ## _init_children(_element_type *ptr, FR_TLIST_HEAD(_name) *children) \
-               {               fr_tlist_init_children(&ptr->_element_entry.entry, &children->head); } \
+       static inline void _name ## _talloc_init_children(_element_type *ptr, FR_TLIST_HEAD(_name) *children) \
+               {               _name ## _talloc_init(children); ptr->_element_entry.entry.children = &children->head; } \
 \
        static inline void _name ## _add_children(_element_type *ptr, FR_TLIST_HEAD(_name) *children) \
                {               fr_tlist_add_children(&ptr->_element_entry.entry, &children->head); } \
 \
        static inline FR_TLIST_HEAD(_name) * _name ## _remove_children(_element_type *ptr) \
-               {               return (FR_TLIST_HEAD(_name) *) fr_tlist_remove_children(&ptr->_element_entry.entry); }
+               {               return (FR_TLIST_HEAD(_name) *) fr_tlist_remove_children(&ptr->_element_entry.entry); } \
+\
+       static inline void _name ## _set_head(fr_tlist_head_t *list, _element_type *ptr) \
+               {               ptr->_element_entry.entry.list_head = list; }
 DIAG_ON(unused-function)
 
 static inline void *fr_tlist_parent(fr_tlist_head_t *list_head, void const *ptr)