<ulclass="crumbs"><li><ahref="../webs.html">★</a></li><li><ahref="index.html">if</a></li><li><ahref="index.html#2">Chapter 2: Bibliographic Data</a></li><li><b>Interactive Fiction ID</b></li></ul><pclass="purpose">Computes and makes available the IFID (Interactive Fiction ID) number for an Inform-generated work of IF, in compliance with the Treaty of Babel.</p>
<pclass="inwebparagraph"><aid="SP2"></a><b>§2. </b>The Interactive Fiction ID number for an Inform 7-compiled work is the
same as the UUID unique ID generated by the Inform 7 application.
</p>
<pclass="inwebparagraph">UUIDs are not generated here, but by the user interface application: we expect
to read them in the form of the <codeclass="display"><spanclass="extract">uuid.txt</span></code> file placed in the project bundle
by that application. After some agonising, I decided that the Treaty did not
actually oblige me to crash out if this file did not exist: but in such
cases the UUID is empty.
</p>
<preclass="definitions">
<spanclass="definitionkeyword">define</span><spanclass="constant">MAX_UUID_LENGTH</span><spanclass="plain"> 128 </span><spanclass="comment">the UUID is truncated to this if necessary</span>
<spanclass="reserved">if</span><spanclass="plain"> (</span><spanclass="identifier">xf</span><spanclass="plain"> == </span><spanclass="identifier">NULL</span><spanclass="plain">) </span><spanclass="reserved">return</span><spanclass="plain"></span><spanclass="identifier">uuid_text</span><spanclass="plain">; </span><spanclass="comment">the UUID is the empty string if the file is missing</span>
<pclass="endnote">The function PL::Bibliographic::IFID::read_uuid is used in <ahref="#SP3">§3</a>, 2/bd (<ahref="2-bd.html#SP13">§13</a>), 2/ri (<ahref="2-ri.html#SP11_1_1">§11.1.1</a>, <ahref="2-ri.html#SP14_2_5">§14.2.5</a>).</p>
<pclass="inwebparagraph"><aid="SP3"></a><b>§3. </b>The IFID is written into the compiled story file, too, both in order
that it can be printed by the VERSION command and to brand the file so
that it can still be identified even if it loses touch with its iFiction
record. We store the IFID in plain text, with a "magic string" identifier