<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jun 3, 2024, at 5:30 AM, Marco Antoniotti <marcoxa@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><p><defanged_div dir="ltr"></defanged_div></p><p><defanged_div>Hi</defanged_div></p><defanged_div><p><defanged_div><br></defanged_div></p><defanged_div><p><defanged_div>Thank you for supporting this tool for so many years.</defanged_div></p><defanged_div><p><defanged_div><br></defanged_div></p><defanged_div><p><defanged_div>I have a few questions regarding the actual semantics of magic(5) rules.</defanged_div></p><defanged_div><p><defanged_div><br></defanged_div></p><defanged_div><p><defanged_div>Let me call "group" a set of tests starting at a 0 level test.</defanged_div></p><defanged_div><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></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></div></blockquote>Yes, unless -k is specified the first "group" matched that prints something "succeeds".<br><blockquote type="cite"><div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><ol start="2"><li>I understood that "name" and "use" rules can span magic(5) boundaries. Is that correct?</li></ol></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></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><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><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></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></div></blockquote>IIRC should be restored to what it was before the USE call.<br><blockquote type="cite"><div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><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></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></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><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><defanged_div><p><defanged_div>I also believe I found a few problems with some of the magic(5) files; I will post them soon.</defanged_div></p><defanged_div><p><defanged_div><br></defanged_div></p><defanged_div><p><defanged_div>That's it for now.</defanged_div></p><defanged_div><p><defanged_div><br></defanged_div></p><defanged_div><p><defanged_div>Thanks<br><br></defanged_div></p><defanged_div><p><defanged_div>Marco<br><br></defanged_div></p><defanged_div><p><defanged_div>PS Yes, I am parsing the magic(5) files. Don't ask! It's a rabbit hole.</defanged_div></p></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></defanged_div></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></body></html>