<div dir="ltr"><div>Oh at first I thought that we need to print pointers to the <b>payload structure</b> themselves, that's why I was confused, since I have no way of knowing what structure is embedded in the list, but now I see that we need to print just the <b>link </b>pointers.</div><div>Thank you.<br></div><div><div><div><div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Georgii Ekserdzhian</div></div></div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">ср, 30 ÑÐµÐ½Ñ‚. 2020 Ð³. Ð² 09:42, Vojtech Horky <<a href="mailto:horky@d3s.mff.cuni.cz">horky@d3s.mff.cuni.cz</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello.<br>
<br>
Dne 30. 09. 20 v 9:34 Georgii Ekserdzhian napsal(a):<br>
> Good morning,<br>
> I'm working on a %pL placeholder and I encountered some problems.<br>
> So I get a pointer to a list. I turn it's pointer into a string, that's <br>
> fine.<br>
> Now I need to get pointers to the items in that list.<br>
> I need to iterate them first.<br>
> That is done either by list_foreach() or I can do it just by jumping <br>
> pointers to links and getting a pointer to each item with list_item().<br>
> Both list_foreach() and list_item() require a type of a payload and a <br>
> name of a link variable.<br>
> In test cases it's a paw_t, but I suppose we need to make this work on <br>
> any structure.<br>
> I'm not sure how to make this generic.<br>
<br>
Your reasoning is completely correct.<br>
<br>
For this special case, we expect that you will iterate through the <br>
prev/next pointers manually because there is no way how to pass <br>
information about the actual payload type into your printf.<br>
<br>
For other cases, the list_foreach() is the right approach as you usually <br>
know the payload type.<br>
<br>
Cheers,<br>
- VH<br>
_______________________________________________<br>
NSWI004 mailing list<br>
<a href="mailto:NSWI004@d3s.mff.cuni.cz" target="_blank">NSWI004@d3s.mff.cuni.cz</a><br>
<a href="https://d3s.mff.cuni.cz/mailman/listinfo/nswi004" rel="noreferrer" target="_blank">https://d3s.mff.cuni.cz/mailman/listinfo/nswi004</a><br>
</blockquote></div>