82 bool ptrlist_reinsert_last(PtrList **ptrlist, void *ptr) |
88 bool ptrlist_reinsert_last(PtrList **ptrlist, void *ptr) |
83 { |
89 { |
84 PtrList *node=ptrlist_find_node(*ptrlist, ptr); |
90 PtrList *node=ptrlist_find_node(*ptrlist, ptr); |
85 |
91 |
86 if(node==NULL) |
92 if(node==NULL) |
87 return FALSE; |
93 return ptrlist_insert_last(ptrlist, ptr); |
88 |
94 |
89 UNLINK_ITEM(*ptrlist, node, next, prev); |
95 UNLINK_ITEM(*ptrlist, node, next, prev); |
90 LINK_ITEM_LAST(*ptrlist, node, next, prev); |
96 LINK_ITEM_LAST(*ptrlist, node, next, prev); |
91 |
97 |
92 return TRUE; |
98 return TRUE; |
96 bool ptrlist_reinsert_first(PtrList **ptrlist, void *ptr) |
102 bool ptrlist_reinsert_first(PtrList **ptrlist, void *ptr) |
97 { |
103 { |
98 PtrList *node=ptrlist_find_node(*ptrlist, ptr); |
104 PtrList *node=ptrlist_find_node(*ptrlist, ptr); |
99 |
105 |
100 if(node==NULL) |
106 if(node==NULL) |
101 return FALSE; |
107 return ptrlist_insert_first(ptrlist, ptr); |
102 |
108 |
103 UNLINK_ITEM(*ptrlist, node, next, prev); |
109 UNLINK_ITEM(*ptrlist, node, next, prev); |
104 LINK_ITEM_FIRST(*ptrlist, node, next, prev); |
110 LINK_ITEM_FIRST(*ptrlist, node, next, prev); |
105 |
111 |
106 return TRUE; |
112 return TRUE; |