[ccan] Question on list module

richard -rw- weinberger richard.weinberger at gmail.com
Tue Dec 14 10:09:45 EST 2010


Hi!

I'm using the list module. It is very nice.
But now I'm facing a little problem.
It seems that a list node can (by design) only be a member of one linked list.
In my case i need to have list nodes which are present in many lists.

E.g:
struct _item {
 struct list_node list;
 // lots of data
};
struct _item i1;

list_add(&h1, &i1.list);
list_add(&h2, &i1.list);
...
list_add(&hN, &i1.list);


Does anyone know a trick how to achieve this?
I really don't want to go back to "void *"-style linked lists...

-- 
Thanks,
//richard


More information about the ccan mailing list