]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add more tlist-specific functions
authorAlan T. DeKok <aland@freeradius.org>
Fri, 25 Mar 2022 18:50:26 +0000 (14:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 25 Mar 2022 18:50:47 +0000 (14:50 -0400)
src/lib/util/tlist.h

index 62f9eea854a968bd809e9f2216d86ef62fa8a148..6164a3448c5746561f80a5b42ebe4abb67d432b7 100644 (file)
@@ -1018,6 +1018,21 @@ DIAG_OFF(unused-function) \
 \
        static inline   void _name ## _sort(FR_TLIST_HEAD(_name) *list, fr_cmp_t cmp) \
                {               fr_tlist_sort(&list->head, cmp); } \
+\
+       static inline FR_TLIST_HEAD(_name) *_name ## _parent(_element_type *ptr) \
+               {               return (FR_TLIST_HEAD(_name) *) (ptr->_element_entry->list_head); } \
+\
+       static inline FR_TLIST_HEAD(_name) *_name ## _children(_element_type *ptr) \
+               {               return (FR_TLIST_HEAD(_name) *) (ptr->_element_entry->children); } \
+\
+       static inline void _name ## _init_children(_element_type *ptr, FR_TLIST_HEAD(_name) *children) \
+               {               fr_tlist_init_children(ptr->_element_entry, &children->head); } \
+\
+       static inline void _name ## _add_children(_element_type *ptr, FR_TLIST_HEAD(_name) *children) \
+               {               return fr_tlist_add_children(ptr->_element_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) }
 DIAG_ON(unused-function)