#include <stdlib.h>
#include "l_list.h"
int main(int argc, char **argv)
{
int *x, *y, *z;
l_list *l;
//create some pointers to numbers
x = malloc(sizeof(int)); *x = 5;
y = malloc(sizeof(int)); *y = 9;
z = malloc(sizeof(int)); *z = 7;
l = l_alloc(); //create a list
//enqueue a few elements to the list
l_enqn(l, x, y, z, z, NULL);
//remove the duplicate z pointer
l_uniquify(l, z);
//example of using map to remove the y element
l_mapt(l, int,
if (*o == 9)
l_map_remove(l);
);
//example of using map to print all elements and then free
l_mapt(l, int,
printf("n = %d\n", *o);
free(o);
);
l_dealloc(l);
return 0;
}