ucx/cx/list.h

changeset 748
49a284f61e8c
parent 747
efbd59642577
child 750
4d7a2238c5ac
equal deleted inserted replaced
747:efbd59642577 748:49a284f61e8c
134 ); 134 );
135 135
136 /** 136 /**
137 * Member function for finding an element. 137 * Member function for finding an element.
138 */ 138 */
139 size_t (*find)( 139 ssize_t (*find)(
140 struct cx_list_s const *list, 140 struct cx_list_s const *list,
141 void const *elem 141 void const *elem
142 ); 142 );
143 143
144 /** 144 /**
567 * 567 *
568 * Determining equality is performed by the list's comparator function. 568 * Determining equality is performed by the list's comparator function.
569 * 569 *
570 * @param list the list 570 * @param list the list
571 * @param elem the element to find 571 * @param elem the element to find
572 * @return the index of the element or \c (size+1) if the element is not found 572 * @return the index of the element or a negative
573 */ 573 * value when the element is not found
574 __attribute__((__nonnull__)) 574 */
575 static inline size_t cxListFind( 575 __attribute__((__nonnull__))
576 static inline ssize_t cxListFind(
576 CxList const *list, 577 CxList const *list,
577 void const *elem 578 void const *elem
578 ) { 579 ) {
579 return list->cl->find(list, elem); 580 return list->cl->find(list, elem);
580 } 581 }

mercurial