#include "mem.h"
list2_t* list_new (void) {
- return (safe_calloc (sizeof (list2_t), 1));
+ return (safe_calloc (1, sizeof (list2_t)));
}
-void list_del (list2_t** l, void (*edel) (void**)) {
+void list_del (list2_t** l, list_del_t* del) {
size_t i = 0;
if (!l || !*l)
return;
- if (*edel)
+ if (del)
for (i = 0; i < (*l)->length; i++)
- edel (&(*l)->data[i]);
+ del (&(*l)->data[i]);
FREE(&(*l)->data);
FREE(l);
}
return (ret);
}
-int _list_lookup (list2_t* l, int (*cmp) (const void*, const void*), const void* p) {
+int list_lookup (list2_t* l, int (*cmp) (const void*, const void*), const void* p) {
int i = 0;
if (list_empty(l) || !*cmp)
return (-1);