The gtk glib library includes some standard container like linked lists…
/* Compile with cc doubly.c `pkg-config --cflags --libs gtk+-2.0` */
#include <glib.h>
#include <string.h>
#include <stdio.h>
void myfunc(gpointer data, gpointer user_data)
{
printf("value %s\n", (char *)data);
}
int main()
{
GList *list = NULL;
GList *it = NULL;
list = g_list_append(list, "one");
list = g_list_append(list, "two");
list = g_list_append(list, "three");
for (it = list; it != NULL; it = it->next)
printf("looping - %s\n", (char *)it->data);
/* or alternatively */
g_list_foreach(list, (GFunc) myfunc, NULL);
printf("length of list is %d\n", g_list_length(list ));
return 0;
}


