[NSWI004] Getting a pointer to the item with a link.

Georgii Ekserdzhian gxrjan at gmail.com
Wed Sep 30 09:34:44 CEST 2020


Good morning,
I'm working on a %pL placeholder and I encountered some problems.
So I get a pointer to a list. I turn it's pointer into a string, that's
fine.
Now I need to get pointers to the items in that list.
I need to iterate them first.
That is done either by list_foreach() or I can do it just by jumping
pointers to links and getting a pointer to each item with list_item().
Both list_foreach() and list_item() require a type of a payload and a name
of a link variable.
In test cases it's a paw_t, but I suppose we need to make this work on any
structure.
I'm not sure how to make this generic.
What type should I pass to list_foreach() or list_item() to make it so?
Or is there a better way that I don't see?

Georgii Ekserdzhian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://d3s.mff.cuni.cz/pipermail/nswi004/attachments/20200930/e34845f8/attachment.htm>


More information about the NSWI004 mailing list