AC-Tube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
actube/src/cw/mlist_create.c

26 lines
526 B

#include "mlist.h"
/**
* @brief Create a mlist object
* @param v1
* @param v2
* @param data_size
* @return a pointer to the created object or NULL if something
* wnet wrong.
*/
mlist_t mlist_create(int (*cmp) (const void *v1, const void *v2),
void (*del)(void*),
size_t data_size)
{
struct mlist * l = malloc(sizeof(struct mlist));
if (!l)
return NULL;
/*memset(l, 0, sizeof(struct mlist));*/
l->cmp = cmp;
l->del = del;
l->data_size=data_size;
l->first=NULL;
l->last=NULL;
l->count=0;
return l;
}