<div dir="ltr"><div>Euxaristw gia tin apantisis sas :)</div><div><br></div><div>Fine for (1).  For (2) and (3), from your answers, I gather that "use" is really a function call that should handle a stack.  Ok.</div><div>For (4) no I do not an example, and from what I see on my Mac there are no cases of more than 1 level down calls.</div><div><br></div><div>All the best</div><div><br></div><div>Marco</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jun 30, 2024 at 5:00 PM Christos Zoulas <<a href="mailto:christos@zoulas.com">christos@zoulas.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br id="m_566766157885879460lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jun 3, 2024, at 5:30 AM, Marco Antoniotti <<a href="mailto:marcoxa@gmail.com" target="_blank">marcoxa@gmail.com</a>> wrote:</div><br><div><p><u></u><u></u></p><p><u></u>Hi<u></u></p><u></u><p><u></u><br><u></u></p><u></u><p><u></u>Thank you for supporting this tool for so many years.<u></u></p><u></u><p><u></u><br><u></u></p><u></u><p><u></u>I have a few questions regarding the actual semantics of magic(5) rules.<u></u></p><u></u><p><u></u><br><u></u></p><u></u><p><u></u>Let me call "group" a set of tests starting at a 0 level test.<u></u></p><u></u><ol><li>My understanding is that each group is checked separately and that, once one of them "succeeds" then the result is printed out and that's it.  I am saying this otherwise the "pdf" specification should print out two equal lines on a vanilla PDF file.  Is that correct?</li></ol><u></u><u></u><u></u><u></u><u></u><u></u><u></u></div></blockquote>Yes, unless -k is specified the first "group" matched that prints something "succeeds".<br><blockquote type="cite"><div><u></u><u></u><u></u><u></u><u></u><u></u><u></u><ol start="2"><li>I understood that "name" and "use" rules can span magic(5) boundaries.  Is that correct?</li></ol><u></u><u></u><u></u><u></u><u></u><u></u><u></u></div></blockquote><div><br></div>That is correct. The program looks for a named rule in all the rules it has loaded so far.<br><blockquote type="cite"><div><u></u><u></u><u></u><u></u><u></u><u></u><u></u><ol start="3"><li>When I use a "use" clause, what is the state of the position in the file (buffer) after its invocation?  Whether it is successful or not?</li></ol><u></u><u></u><u></u><u></u><u></u><u></u><u></u></div></blockquote>IIRC should be restored to what it was before the USE call.<br><blockquote type="cite"><div><u></u><u></u><u></u><u></u><u></u><u></u><u></u><ol start="4"><li>Can I "use" a "name" that then uses another "name" etc.  It does not appear to be the case on Mac OS right now.</li></ol><u></u><u></u><u></u><u></u><u></u><u></u><u></u></div></blockquote><div><br></div>Should be able to. Can you give an example that does not work?</div><div><br><blockquote type="cite"><div><u></u><u></u><u></u><u></u><u></u><u></u><u></u><p><u></u>I also believe I found a few problems with some of the magic(5) files; I will post them soon.<u></u></p><u></u><p><u></u><br><u></u></p><u></u><p><u></u>That's it for now.<u></u></p><u></u><p><u></u><br><u></u></p><u></u><p><u></u>Thanks<br><br><u></u></p><u></u><p><u></u>Marco<br><br><u></u></p><u></u><p><u></u>PS  Yes, I am parsing the magic(5) files.  Don't ask!  It's a rabbit hole.<u></u></p><u></u><u></u><u></u><u></u><u></u><u></u><u></u><u></u><u></u><u></u><u></u><u></u><u></u></div></blockquote><br></div><div>The program has organically grown for a very long time, so there are many weird corner cases.</div><div><br></div><div>christos</div><br></div></blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Marco Antoniotti<br>Somewhere over the Rainbow</div>