2018-03-12 18:01:40 +01:00
|
|
|
#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){
|
2022-07-30 22:59:24 +02:00
|
|
|
return elem;
|
2018-03-12 18:01:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|