actube/src/cw/mlist_get.c

13 lines
249 B
C
Raw Normal View History

#include "mlist.h"
struct mlistelem * mlist_get(mlist_t list, const void *data){
struct mlistelem * elem;
mlist_foreach(elem,list){
void *tdata = mlistelem_dataptr(elem);
if (list->cmp(tdata,data)==0){
return tdata;
}
}
return NULL;
}