1.1 --- a/src/cx/list.h Tue Dec 28 17:38:02 2021 +0100 1.2 +++ b/src/cx/list.h Tue Dec 28 17:41:51 2021 +0100 1.3 @@ -114,6 +114,11 @@ 1.4 cx_list_s const *list, 1.5 cx_list_s const *other 1.6 ); 1.7 + 1.8 + /** 1.9 + * Member function for reversing the order of the items. 1.10 + */ 1.11 + void (*reverse)(cx_list_s *list); 1.12 } cx_list_class; 1.13 1.14 /** 1.15 @@ -249,6 +254,15 @@ 1.16 } 1.17 1.18 /** 1.19 + * Reverses the order of the items. 1.20 + * 1.21 + * @param list the list 1.22 + */ 1.23 +static inline void cxListReverse(CxList list) { 1.24 + list->cl->reverse(list); 1.25 +} 1.26 + 1.27 +/** 1.28 * Compares a list to another list of the same type. 1.29 * 1.30 * First, the list sizes are compared. If they match, the lists are compared element-wise.