mirror of
https://github.com/ganelson/inform.git
synced 2024-06-26 04:00:43 +03:00
Redrafted Chapter 4 of inbuild module
This commit is contained in:
parent
8f2dea78de
commit
4c05cacf9b
|
@ -126,14 +126,22 @@ out of turn.
|
|||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">extension_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">kit_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">language_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">pipeline_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">project_bundle_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">project_file_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">template_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Inbuild::startup</span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="functiontext">KitManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">ExtensionManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">TemplateManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">KitManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">LanguageManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">PipelineManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">ProjectBundleManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">ProjectFileManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">PipelineManager::start</span><span class="plain">();</span>
|
||||
<span class="functiontext">TemplateManager::start</span><span class="plain">();</span>
|
||||
|
||||
<span class="functiontext">InterSkill::create</span><span class="plain">();</span>
|
||||
<span class="functiontext">Inform7Skill::create</span><span class="plain">();</span>
|
||||
|
|
|
@ -138,9 +138,9 @@ claiming. If you are a manager, do not call this...
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Copies::new_in_file is used in 4/em (<a href="4-em.html#SP5">§5</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/pm (<a href="4-pm.html#SP4">§4</a>).</p>
|
||||
<p class="endnote">The function Copies::new_in_file is used in 4/em (<a href="4-em.html#SP4">§4</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/pm (<a href="4-pm.html#SP3">§3</a>).</p>
|
||||
|
||||
<p class="endnote">The function Copies::new_in_path is used in 4/km (<a href="4-km.html#SP3">§3</a>), 4/lm (<a href="4-lm.html#SP4">§4</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>).</p>
|
||||
<p class="endnote">The function Copies::new_in_path is used in 4/km (<a href="4-km.html#SP3">§3</a>), 4/lm (<a href="4-lm.html#SP3">§3</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. </b>And then probably follow up by calling this, to attach a pointer to some
|
||||
additional data specific to your genre:
|
||||
|
@ -155,7 +155,7 @@ additional data specific to your genre:
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Copies::set_content is used in 4/lm (<a href="4-lm.html#SP4">§4</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>), 4/pm (<a href="4-pm.html#SP4">§4</a>), 5/kts (<a href="5-kts.html#SP1">§1</a>), 5/es (<a href="5-es.html#SP1">§1</a>).</p>
|
||||
<p class="endnote">The function Copies::set_content is used in 4/lm (<a href="4-lm.html#SP3">§3</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>), 4/pm (<a href="4-pm.html#SP3">§3</a>), 5/kts (<a href="5-kts.html#SP1">§1</a>), 5/es (<a href="5-es.html#SP1">§1</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. List of errors. </b>When copies are found to be malformed, error messages are attached to them
|
||||
for later reporting. These are stored in a list.
|
||||
|
@ -223,7 +223,7 @@ for later reporting. These are stored in a list.
|
|||
|
||||
<p class="endnote">The function Copies::source_text_has_been_read is used in 6/inc (<a href="6-inc.html#SP6">§6</a>).</p>
|
||||
|
||||
<p class="endnote">The function Copies::get_source_text is used in 1/ic (<a href="1-ic.html#SP9">§9</a>), 4/em (<a href="4-em.html#SP9">§9</a>), 5/ed2 (<a href="5-ed2.html#SP3_1">§3.1</a>), 6/inc (<a href="6-inc.html#SP6_1">§6.1</a>).</p>
|
||||
<p class="endnote">The function Copies::get_source_text is used in 1/ic (<a href="1-ic.html#SP9">§9</a>), 4/em (<a href="4-em.html#SP8">§8</a>), 5/ed2 (<a href="5-ed2.html#SP3_1">§3.1</a>), 6/inc (<a href="6-inc.html#SP6_1">§6.1</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP8"></a><b>§8. Going operational. </b></p>
|
||||
|
||||
|
@ -367,7 +367,7 @@ its main task: building an Inform project.
|
|||
|
||||
<p class="endnote">The function Copies::copy_to is used in 3/bg (<a href="3-bg.html#SP9_1">§9.1</a>).</p>
|
||||
|
||||
<p class="endnote">The function Copies::overwrite_error is used in 4/km (<a href="4-km.html#SP6">§6</a>), 4/em (<a href="4-em.html#SP8">§8</a>), 4/lm (<a href="4-lm.html#SP7">§7</a>), 4/tm (<a href="4-tm.html#SP6">§6</a>), 4/pm (<a href="4-pm.html#SP7">§7</a>).</p>
|
||||
<p class="endnote">The function Copies::overwrite_error is used in 4/km (<a href="4-km.html#SP6">§6</a>), 4/em (<a href="4-em.html#SP7">§7</a>), 4/lm (<a href="4-lm.html#SP6">§6</a>), 4/tm (<a href="4-tm.html#SP6">§6</a>), 4/pm (<a href="4-pm.html#SP6">§6</a>).</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><a href="2-edt.html">Back to 'Editions'</a></li><li><a href="2-ce.html">Continue with 'Copy Errors'</a></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -99,7 +99,7 @@ might work with all VMs, while version 8 required a 32-bit architecture.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Editions::new is used in 4/km (<a href="4-km.html#SP3">§3</a>), 4/em (<a href="4-em.html#SP5">§5</a>), 4/lm (<a href="4-lm.html#SP4">§4</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>), 4/pm (<a href="4-pm.html#SP5">§5</a>), 5/es (<a href="5-es.html#SP1">§1</a>).</p>
|
||||
<p class="endnote">The function Editions::new is used in 4/km (<a href="4-km.html#SP3">§3</a>), 4/em (<a href="4-em.html#SP4">§4</a>), 4/lm (<a href="4-lm.html#SP3">§3</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>), 4/pm (<a href="4-pm.html#SP4">§4</a>), 5/es (<a href="5-es.html#SP1">§1</a>).</p>
|
||||
|
||||
<p class="endnote">The function Editions::write is used in <a href="#SP3">§3</a>, 2/cps (<a href="2-cps.html#SP6">§6</a>).</p>
|
||||
|
||||
|
@ -130,7 +130,7 @@ contributes only the un-filename-extended leafname <code class="display"><span c
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Editions::write_canonical_leaf is used in 4/km (<a href="4-km.html#SP6">§6</a>), 4/em (<a href="4-em.html#SP8">§8</a>), 4/lm (<a href="4-lm.html#SP7">§7</a>), 4/tm (<a href="4-tm.html#SP6">§6</a>), 4/pm (<a href="4-pm.html#SP7">§7</a>).</p>
|
||||
<p class="endnote">The function Editions::write_canonical_leaf is used in 4/km (<a href="4-km.html#SP6">§6</a>), 4/em (<a href="4-em.html#SP7">§7</a>), 4/lm (<a href="4-lm.html#SP6">§6</a>), 4/tm (<a href="4-tm.html#SP6">§6</a>), 4/pm (<a href="4-pm.html#SP6">§6</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>The <code class="display"><span class="extract">-inspect</span></code> command of Inbuild uses the following.
|
||||
</p>
|
||||
|
|
|
@ -100,7 +100,7 @@ the instance <code class="display"><span class="extract">kit_genre</span></code>
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Genres::new is used in 4/km (<a href="4-km.html#SP1">§1</a>), 4/em (<a href="4-em.html#SP3">§3</a>), 4/lm (<a href="4-lm.html#SP2">§2</a>), 4/pbm (<a href="4-pbm.html#SP1">§1</a>), 4/pfm (<a href="4-pfm.html#SP1">§1</a>), 4/tm (<a href="4-tm.html#SP1">§1</a>), 4/pm (<a href="4-pm.html#SP2">§2</a>).</p>
|
||||
<p class="endnote">The function Genres::new is used in 4/km (<a href="4-km.html#SP1">§1</a>), 4/em (<a href="4-em.html#SP2">§2</a>), 4/lm (<a href="4-lm.html#SP1">§1</a>), 4/pbm (<a href="4-pbm.html#SP1">§1</a>), 4/pfm (<a href="4-pfm.html#SP1">§1</a>), 4/tm (<a href="4-tm.html#SP1">§1</a>), 4/pm (<a href="4-pm.html#SP1">§1</a>).</p>
|
||||
|
||||
<p class="endnote">The function Genres::name is used in 2/cps (<a href="2-cps.html#SP9">§9</a>).</p>
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ we create one of these for each hit:
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Nests::add_search_result is used in 4/km (<a href="4-km.html#SP5">§5</a>), 4/em (<a href="4-em.html#SP7">§7</a>), 4/lm (<a href="4-lm.html#SP6">§6</a>), 4/tm (<a href="4-tm.html#SP5">§5</a>), 4/pm (<a href="4-pm.html#SP6">§6</a>).</p>
|
||||
<p class="endnote">The function Nests::add_search_result is used in 4/km (<a href="4-km.html#SP5">§5</a>), 4/em (<a href="4-em.html#SP6">§6</a>), 4/lm (<a href="4-lm.html#SP5">§5</a>), 4/tm (<a href="4-tm.html#SP5">§5</a>), 4/pm (<a href="4-pm.html#SP5">§5</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP7"></a><b>§7. </b>And here is our search engine, such as it is. For each nest, we ask each
|
||||
genre's manager to look for copies of that genre:
|
||||
|
|
|
@ -314,7 +314,7 @@ a requirement, then so will all other copies of it.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Requirements::meets is used in 4/km (<a href="4-km.html#SP5">§5</a>), 4/em (<a href="4-em.html#SP7">§7</a>), 4/lm (<a href="4-lm.html#SP6">§6</a>), 4/tm (<a href="4-tm.html#SP5">§5</a>), 4/pm (<a href="4-pm.html#SP6">§6</a>), 5/kts (<a href="5-kts.html#SP2">§2</a>), 5/es (<a href="5-es.html#SP4">§4</a>), 5/ed2 (<a href="5-ed2.html#SP4">§4</a>), 6/inc (<a href="6-inc.html#SP6">§6</a>).</p>
|
||||
<p class="endnote">The function Requirements::meets is used in 4/km (<a href="4-km.html#SP5">§5</a>), 4/em (<a href="4-em.html#SP6">§6</a>), 4/lm (<a href="4-lm.html#SP5">§5</a>), 4/tm (<a href="4-tm.html#SP5">§5</a>), 4/pm (<a href="4-pm.html#SP5">§5</a>), 5/kts (<a href="5-kts.html#SP2">§2</a>), 5/es (<a href="5-es.html#SP4">§4</a>), 5/ed2 (<a href="5-ed2.html#SP4">§4</a>), 6/inc (<a href="6-inc.html#SP6">§6</a>).</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><a href="2-ce.html">Back to 'Copy Errors'</a></li><li><a href="2-nst.html">Continue with 'Nests'</a></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -112,9 +112,9 @@ not subsequently altered.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Works::new is used in <a href="#SP10">§10</a>, 2/rqr (<a href="2-rqr.html#SP2">§2</a>), 3/is (<a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a>), 4/em (<a href="4-em.html#SP5">§5</a>), 4/lm (<a href="4-lm.html#SP4">§4</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>), 5/kts (<a href="5-kts.html#SP1">§1</a>), 5/es (<a href="5-es.html#SP1">§1</a>), 5/ed (<a href="5-ed.html#SP10">§10</a>), 5/ls (<a href="5-ls.html#SP7">§7</a>), 6/hdn (<a href="6-hdn.html#SP13_3">§13.3</a>), 6/inc (<a href="6-inc.html#SP5_1">§5.1</a>).</p>
|
||||
<p class="endnote">The function Works::new is used in <a href="#SP10">§10</a>, 2/rqr (<a href="2-rqr.html#SP2">§2</a>), 3/is (<a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a>), 4/em (<a href="4-em.html#SP4">§4</a>), 4/lm (<a href="4-lm.html#SP3">§3</a>), 4/pbm (<a href="4-pbm.html#SP2">§2</a>), 4/pfm (<a href="4-pfm.html#SP2">§2</a>), 4/tm (<a href="4-tm.html#SP3">§3</a>), 5/kts (<a href="5-kts.html#SP1">§1</a>), 5/es (<a href="5-es.html#SP1">§1</a>), 5/ed (<a href="5-ed.html#SP10">§10</a>), 5/ls (<a href="5-ls.html#SP7">§7</a>), 6/hdn (<a href="6-hdn.html#SP13_3">§13.3</a>), 6/inc (<a href="6-inc.html#SP5_1">§5.1</a>).</p>
|
||||
|
||||
<p class="endnote">The function Works::new_raw is used in 4/km (<a href="4-km.html#SP3">§3</a>), 4/pm (<a href="4-pm.html#SP5">§5</a>).</p>
|
||||
<p class="endnote">The function Works::new_raw is used in 4/km (<a href="4-km.html#SP3">§3</a>), 4/pm (<a href="4-pm.html#SP4">§4</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>Though it is probably the case that the author name and title supplied are
|
||||
already of normalised casing, we do not want to rely on that. Works intending
|
||||
|
@ -390,7 +390,7 @@ single function testing if a work refers to them.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Works::is_standard_rules is used in <a href="#SP6">§6</a>, <a href="#SP7">§7</a>, 4/em (<a href="4-em.html#SP5">§5</a>), 5/ed2 (<a href="5-ed2.html#SP3_2_1">§3.2.1</a>).</p>
|
||||
<p class="endnote">The function Works::is_standard_rules is used in <a href="#SP6">§6</a>, <a href="#SP7">§7</a>, 4/em (<a href="4-em.html#SP4">§4</a>), 5/ed2 (<a href="5-ed2.html#SP3_2_1">§3.2.1</a>).</p>
|
||||
|
||||
<p class="endnote">The function Works::is_basic_inform is used in <a href="#SP7">§7</a>.</p>
|
||||
|
||||
|
@ -464,7 +464,7 @@ indeed, the typical number will be 0 or 1.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Works::add_to_database is used in <a href="#SP10">§10</a>, 4/km (<a href="4-km.html#SP4">§4</a>), 4/em (<a href="4-em.html#SP6">§6</a>), 4/lm (<a href="4-lm.html#SP5">§5</a>), 4/pbm (<a href="4-pbm.html#SP3">§3</a>), 4/pfm (<a href="4-pfm.html#SP3">§3</a>), 4/tm (<a href="4-tm.html#SP4">§4</a>), 4/pm (<a href="4-pm.html#SP5">§5</a>), 5/es (<a href="5-es.html#SP1">§1</a>), 5/ed (<a href="5-ed.html#SP10">§10</a>), 5/ec (<a href="5-ec.html#SP3_2">§3.2</a>), 6/hdn (<a href="6-hdn.html#SP13_3">§13.3</a>), 6/inc (<a href="6-inc.html#SP5_1">§5.1</a>).</p>
|
||||
<p class="endnote">The function Works::add_to_database is used in <a href="#SP10">§10</a>, 4/km (<a href="4-km.html#SP4">§4</a>), 4/em (<a href="4-em.html#SP5">§5</a>), 4/lm (<a href="4-lm.html#SP4">§4</a>), 4/pbm (<a href="4-pbm.html#SP3">§3</a>), 4/pfm (<a href="4-pfm.html#SP3">§3</a>), 4/tm (<a href="4-tm.html#SP4">§4</a>), 4/pm (<a href="4-pm.html#SP4">§4</a>), 5/es (<a href="5-es.html#SP1">§1</a>), 5/ed (<a href="5-ed.html#SP10">§10</a>), 5/ec (<a href="5-ec.html#SP3_2">§3.2</a>), 6/hdn (<a href="6-hdn.html#SP13_3">§13.3</a>), 6/inc (<a href="6-inc.html#SP5_1">§5.1</a>).</p>
|
||||
|
||||
<p class="endnote">The structure inbuild_work_database_entry is accessed in 2/edt, 2/cps, 2/rqr, 3/bg, 3/is2, 4/km, 4/em, 4/lm, 4/pbm, 4/pfm, 4/tm, 4/pm, 5/kts, 5/es, 5/ed, 5/ed2, 5/ec, 5/ps, 5/ls, 6/hdn, 6/inc and here.</p>
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ that shell commands return 0 to indicate happiness.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function BuildSteps::shell is used in <a href="#SP5_1">§5.1</a>, 4/em (<a href="4-em.html#SP8">§8</a>), 4/pm (<a href="4-pm.html#SP7">§7</a>).</p>
|
||||
<p class="endnote">The function BuildSteps::shell is used in <a href="#SP5_1">§5.1</a>, 4/em (<a href="4-em.html#SP7">§7</a>), 4/pm (<a href="4-pm.html#SP6">§6</a>).</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><a href="3-bs.html">Back to 'Build Scripts'</a></li><li><a href="3-is.html">Continue with 'Inter Skill'</a></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -59,27 +59,16 @@
|
|||
<!--Weave of '4/em' generated by 7-->
|
||||
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../compiler.html">Compiler Modules</a></li><li><a href="index.html">inbuild</a></li><li><a href="index.html#4">Chapter 4: Managing Genres of Work</a></li><li><b>Extension Manager</b></li></ul><p class="purpose">An Inform 7 extension.</p>
|
||||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP6">§6. Claiming</a></li><li><a href="#SP7">§7. Searching</a></li><li><a href="#SP8">§8. Copying</a></li><li><a href="#SP9">§9. Build graph</a></li><li><a href="#SP10">§10. Source text</a></li></ul><hr class="tocbar">
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP5">§5. Claiming</a></li><li><a href="#SP6">§6. Searching</a></li><li><a href="#SP7">§7. Copying</a></li><li><a href="#SP8">§8. Build graph</a></li><li><a href="#SP9">§9. Source text</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">extension_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b>An extension has a title and an author name, each of which is limited in
|
||||
length to one character less than the following constants:
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">extension_genre</span></code> can be summarised as follows. Copies consist of single
|
||||
files. These are recognised by having the filename extension <code class="display"><span class="extract">.i7x</span></code>. They are
|
||||
stored in nests, in <code class="display"><span class="extract">N/Extensions/Author/Title-vVersion.i7x</span></code>. Their build
|
||||
graphs are a single vertex with no build edges, but with use edges to any
|
||||
further extensions which they Include.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="definitions">
|
||||
<span class="definitionkeyword">define</span> <span class="constant">MAX_EXTENSION_TITLE_LENGTH</span><span class="plain"> 51</span>
|
||||
<span class="definitionkeyword">define</span> <span class="constant">MAX_EXTENSION_AUTHOR_LENGTH</span><span class="plain"> 51</span>
|
||||
</pre>
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b></p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
|
@ -104,7 +93,7 @@ length to one character less than the following constants:
|
|||
|
||||
<p class="endnote">The function ExtensionManager::write_work appears nowhere else.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. </b>Extensions live in their namesake subdirectory of a nest:
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>Extensions live in their namesake subdirectory of a nest:
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -117,9 +106,9 @@ length to one character less than the following constants:
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::path_within_nest is used in <a href="#SP7">§7</a>, <a href="#SP8">§8</a>, 5/ec (<a href="5-ec.html#SP1">§1</a>, <a href="5-ec.html#SP6_7_4_3">§6.7.4.3</a>).</p>
|
||||
<p class="endnote">The function ExtensionManager::path_within_nest is used in <a href="#SP6">§6</a>, <a href="#SP7">§7</a>, 5/ec (<a href="5-ec.html#SP1">§1</a>, <a href="5-ec.html#SP6_7_4_3">§6.7.4.3</a>).</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. </b>Extension copies are annotated with a structure called an <code class="display"><span class="extract">inform_extension</span></code>,
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. </b>Extension copies are annotated with a structure called an <code class="display"><span class="extract">inform_extension</span></code>,
|
||||
which stores data about extensions used by the Inform compiler.
|
||||
</p>
|
||||
|
||||
|
@ -159,11 +148,11 @@ which stores data about extensions used by the Inform compiler.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::from_copy is used in <a href="#SP9">§9</a>, <a href="#SP10">§10</a>, 5/es (<a href="5-es.html#SP5">§5</a>), 5/ed2 (<a href="5-ed2.html#SP4">§4</a>), 5/ec (<a href="5-ec.html#SP2">§2</a>), 6/st (<a href="6-st.html#SP11">§11</a>), 6/inc (<a href="6-inc.html#SP6_1">§6.1</a>).</p>
|
||||
<p class="endnote">The function ExtensionManager::from_copy is used in <a href="#SP8">§8</a>, <a href="#SP9">§9</a>, 5/es (<a href="5-es.html#SP5">§5</a>), 5/ed2 (<a href="5-ed2.html#SP4">§4</a>), 5/ec (<a href="5-ec.html#SP2">§2</a>), 6/st (<a href="6-st.html#SP11">§11</a>), 6/inc (<a href="6-inc.html#SP6_1">§6.1</a>).</p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::new_copy is used in <a href="#SP6">§6</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::new_copy is used in <a href="#SP5">§5</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Claiming. </b>Here <code class="display"><span class="extract">arg</span></code> is a textual form of a filename or pathname, such as may have been
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Claiming. </b>Here <code class="display"><span class="extract">arg</span></code> is a textual form of a filename or pathname, such as may have been
|
||||
supplied at the command line; <code class="display"><span class="extract">ext</span></code> is a substring of it, and is its extension
|
||||
(e.g., <code class="display"><span class="extract">jpg</span></code> if <code class="display"><span class="extract">arg</span></code> is <code class="display"><span class="extract">Geraniums.jpg</span></code>), or is empty if there isn't one;
|
||||
<code class="display"><span class="extract">directory_status</span></code> is true if we know for some reason that this is a directory
|
||||
|
@ -196,11 +185,11 @@ So we'll open it and look.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::claim_as_copy is used in <a href="#SP3">§3</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::claim_as_copy is used in <a href="#SP2">§2</a>.</p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::claim_file_as_copy is used in <a href="#SP7">§7</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::claim_file_as_copy is used in <a href="#SP6">§6</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP7"></a><b>§7. Searching. </b>Here we look through a nest to find all extensions matching the supplied
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Searching. </b>Here we look through a nest to find all extensions matching the supplied
|
||||
requirements.
|
||||
</p>
|
||||
|
||||
|
@ -261,13 +250,13 @@ so we'll quietly allow for it.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::search_nest_for is used in <a href="#SP3">§3</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::search_nest_for is used in <a href="#SP2">§2</a>.</p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::search_nest_for_r appears nowhere else.</p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::search_nest_for_single_file appears nowhere else.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP8"></a><b>§8. Copying. </b>Now the task is to copy an extension into place in a nest. This is easy,
|
||||
<p class="inwebparagraph"><a id="SP7"></a><b>§7. Copying. </b>Now the task is to copy an extension into place in a nest. This is easy,
|
||||
since an extension is a single file; to sync, we just overwrite.
|
||||
</p>
|
||||
|
||||
|
@ -310,9 +299,9 @@ since an extension is a single file; to sync, we just overwrite.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::copy_to_nest is used in <a href="#SP3">§3</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::copy_to_nest is used in <a href="#SP2">§2</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9"></a><b>§9. Build graph. </b>As far as building goes, the build graph for an extension is just a single node:
|
||||
<p class="inwebparagraph"><a id="SP8"></a><b>§8. Build graph. </b>As far as building goes, the build graph for an extension is just a single vertex:
|
||||
you don't need to build an extension at all. But it may well have use edges,
|
||||
thanks to including other extensions, and because of that we have to read the
|
||||
source text before we can do anything with the graph.
|
||||
|
@ -325,6 +314,9 @@ be read in as source text; and some of those might not be compatible with
|
|||
the current VM settings.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph">We therefore generate the build graph only on demand.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">ExtensionManager::building_soon</span><span class="plain">(</span><span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">gen</span><span class="plain">, </span><span class="reserved">inbuild_copy</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain">, </span><span class="reserved">build_vertex</span><span class="plain"> **</span><span class="identifier">V</span><span class="plain">) {</span>
|
||||
|
@ -343,11 +335,11 @@ the current VM settings.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::building_soon is used in <a href="#SP3">§3</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::building_soon is used in <a href="#SP2">§2</a>.</p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::ensure_graphed appears nowhere else.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP10"></a><b>§10. Source text. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP9"></a><b>§9. Source text. </b></p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
|
@ -358,7 +350,7 @@ the current VM settings.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function ExtensionManager::read_source_text_for is used in <a href="#SP3">§3</a>.</p>
|
||||
<p class="endnote">The function ExtensionManager::read_source_text_for is used in <a href="#SP2">§2</a>.</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><a href="4-km.html">Back to 'Kit Manager'</a></li><li><a href="4-lm.html">Continue with 'Language Manager'</a></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -61,11 +61,18 @@
|
|||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP4">§4. Claiming</a></li><li><a href="#SP5">§5. Searching</a></li><li><a href="#SP6">§6. Copying</a></li><li><a href="#SP7">§7. Build graph</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">kit_genre</span></code> can be summarised as follows. Kits consist of directories,
|
||||
containing metadata in <code class="display"><span class="extract">D/kit_metadata.txt</span></code>, but which are also valid Inweb
|
||||
webs of Inform 6 source text. They are recognised by having directory names
|
||||
ending in <code class="display"><span class="extract">Kit</span></code>, and by having a metadata file in place. They are stored in
|
||||
nests, in <code class="display"><span class="extract">N/Inter/Title-vVersion</span></code>. Their build graphs are quite extensive,
|
||||
with build edges to Inter binaries for each architecture with which they
|
||||
are compatible, and use edges to extensions or other kits as laid out in
|
||||
the metadata file.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">kit_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">KitManager::start</span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="identifier">kit_genre</span><span class="plain"> = </span><span class="functiontext">Genres::new</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"kit"</span><span class="plain">, </span><span class="identifier">TRUE</span><span class="plain">);</span>
|
||||
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">kit_genre</span><span class="plain">, </span><span class="constant">GENRE_WRITE_WORK_MTID</span><span class="plain">, </span><span class="functiontext">KitManager::write_work</span><span class="plain">);</span>
|
||||
|
@ -217,7 +224,7 @@ requirements.
|
|||
|
||||
<p class="endnote">The function KitManager::search_nest_for is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Copying. </b>Now the task is to copy a kit into place in a nest. Since a kit is a folder,
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Copying. </b>Now the task is to copy a kit into place in a nest. Since a kit is a directory,
|
||||
we need to <code class="display"><span class="extract">rsync</span></code> it.
|
||||
</p>
|
||||
|
||||
|
@ -280,23 +287,6 @@ we need to <code class="display"><span class="extract">rsync</span></code> it.
|
|||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">KitManager::go_operational</span><span class="plain">(</span><span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">G</span><span class="plain">, </span><span class="reserved">inbuild_copy</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain">) {</span>
|
||||
<span class="functiontext">Kits::construct_graph</span><span class="plain">(</span><span class="functiontext">KitManager::from_copy</span><span class="plain">(</span><span class="identifier">C</span><span class="plain">));</span>
|
||||
<span class="plain">}</span>
|
||||
|
||||
<span class="reserved">typedef</span><span class="plain"> </span><span class="reserved">struct</span><span class="plain"> </span><span class="reserved">kit_contents_section_state</span><span class="plain"> {</span>
|
||||
<span class="reserved">struct</span><span class="plain"> </span><span class="identifier">linked_list</span><span class="plain"> *</span><span class="identifier">sects</span><span class="plain">; </span> <span class="comment">of <code class="display"><span class="extract">text_stream</span></code></span>
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">active</span><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">kit_contents_section_state</span><span class="plain">;</span>
|
||||
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">KitManager::read_contents</span><span class="plain">(</span><span class="identifier">text_stream</span><span class="plain"> *</span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">text_file_position</span><span class="plain"> *</span><span class="identifier">tfp</span><span class="plain">, </span><span class="reserved">void</span><span class="plain"> *</span><span class="identifier">state</span><span class="plain">) {</span>
|
||||
<span class="reserved">kit_contents_section_state</span><span class="plain"> *</span><span class="identifier">CSS</span><span class="plain"> = (</span><span class="reserved">kit_contents_section_state</span><span class="plain"> *) </span><span class="identifier">state</span><span class="plain">;</span>
|
||||
<span class="identifier">match_results</span><span class="plain"> </span><span class="identifier">mr</span><span class="plain"> = </span><span class="identifier">Regexp::create_mr</span><span class="plain">();</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">Regexp::match</span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Sections"</span><span class="plain">))</span>
|
||||
<span class="identifier">CSS</span><span class="plain">-</span><span class="element">>active</span><span class="plain"> = </span><span class="identifier">TRUE</span><span class="plain">;</span>
|
||||
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">Regexp::match</span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">L</span><span class="string">" (%c+)"</span><span class="plain">)) && (</span><span class="identifier">CSS</span><span class="plain">-</span><span class="element">>active</span><span class="plain">)) {</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="identifier">exp</span><span class="plain">[0], </span><span class="string">".i6t"</span><span class="plain">);</span>
|
||||
<span class="identifier">ADD_TO_LINKED_LIST</span><span class="plain">(</span><span class="identifier">Str::duplicate</span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="identifier">exp</span><span class="plain">[0]), </span><span class="identifier">text_stream</span><span class="plain">, </span><span class="identifier">CSS</span><span class="plain">-</span><span class="element">>sects</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="identifier">Regexp::dispose_of</span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
@ -305,10 +295,6 @@ we need to <code class="display"><span class="extract">rsync</span></code> it.
|
|||
|
||||
<p class="endnote">The function KitManager::go_operational is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<p class="endnote">The function KitManager::read_contents is used in 5/kts (<a href="5-kts.html#SP2">§2</a>).</p>
|
||||
|
||||
<p class="endnote">The structure kit_contents_section_state is accessed in 5/kts and here.</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><i>(This section begins Chapter 4: Managing Genres of Work.)</i></li><li><a href="4-em.html">Continue with 'Extension Manager'</a></li></ul><hr class="tocbar">
|
||||
<!--End of weave-->
|
||||
|
|
|
@ -59,18 +59,14 @@
|
|||
<!--Weave of '4/lm' generated by 7-->
|
||||
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../compiler.html">Compiler Modules</a></li><li><a href="index.html">inbuild</a></li><li><a href="index.html#4">Chapter 4: Managing Genres of Work</a></li><li><b>Language Manager</b></li></ul><p class="purpose">A language is a combination of Inter code with an Inform 7 extension.</p>
|
||||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP5">§5. Claiming</a></li><li><a href="#SP6">§6. Searching</a></li><li><a href="#SP7">§7. Copying</a></li></ul><hr class="tocbar">
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP4">§4. Claiming</a></li><li><a href="#SP5">§5. Searching</a></li><li><a href="#SP6">§6. Copying</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">language_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">language_genre</span></code> can be summarised as follows. Language definitions
|
||||
consist of directories, containing metadata in <code class="display"><span class="extract">D/about.txt</span></code>. They are
|
||||
recognised by having this metadata file in place. They are stored in
|
||||
nests, in <code class="display"><span class="extract">N/Languages/Title-vVersion</span></code>. Their build graphs are single
|
||||
vertices with no build or use edges.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
|
@ -93,7 +89,7 @@
|
|||
|
||||
<p class="endnote">The function LanguageManager::write_work appears nowhere else.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>Languages live in the <code class="display"><span class="extract">Inter</span></code> subdirectory of a nest:
|
||||
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b>Languages live in the <code class="display"><span class="extract">Inter</span></code> subdirectory of a nest:
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -106,9 +102,9 @@
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function LanguageManager::path_within_nest is used in <a href="#SP6">§6</a>, <a href="#SP7">§7</a>.</p>
|
||||
<p class="endnote">The function LanguageManager::path_within_nest is used in <a href="#SP5">§5</a>, <a href="#SP6">§6</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. </b>Language copies are annotated with a structure called an <code class="display"><span class="extract">inform_language</span></code>,
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>Language copies are annotated with a structure called an <code class="display"><span class="extract">inform_language</span></code>,
|
||||
which stores data about extensions used by the Inform compiler.
|
||||
</p>
|
||||
|
||||
|
@ -148,9 +144,9 @@ which stores data about extensions used by the Inform compiler.
|
|||
|
||||
<p class="endnote">The function LanguageManager::from_copy is used in 5/ls (<a href="5-ls.html#SP7">§7</a>).</p>
|
||||
|
||||
<p class="endnote">The function LanguageManager::new_copy is used in <a href="#SP5">§5</a>.</p>
|
||||
<p class="endnote">The function LanguageManager::new_copy is used in <a href="#SP4">§4</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Claiming. </b>Here <code class="display"><span class="extract">arg</span></code> is a textual form of a filename or pathname, such as may have been
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. Claiming. </b>Here <code class="display"><span class="extract">arg</span></code> is a textual form of a filename or pathname, such as may have been
|
||||
supplied at the command line; <code class="display"><span class="extract">ext</span></code> is a substring of it, and is its extension
|
||||
(e.g., <code class="display"><span class="extract">jpg</span></code> if <code class="display"><span class="extract">arg</span></code> is <code class="display"><span class="extract">Geraniums.jpg</span></code>), or is empty if there isn't one;
|
||||
<code class="display"><span class="extract">directory_status</span></code> is true if we know for some reason that this is a directory
|
||||
|
@ -193,11 +189,11 @@ a valid metadata file. The name should be in English text, without accents.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function LanguageManager::claim_as_copy is used in <a href="#SP2">§2</a>.</p>
|
||||
<p class="endnote">The function LanguageManager::claim_as_copy is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<p class="endnote">The function LanguageManager::claim_folder_as_copy is used in <a href="#SP6">§6</a>.</p>
|
||||
<p class="endnote">The function LanguageManager::claim_folder_as_copy is used in <a href="#SP5">§5</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Searching. </b>Here we look through a nest to find all languages matching the supplied
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Searching. </b>Here we look through a nest to find all languages matching the supplied
|
||||
requirements.
|
||||
</p>
|
||||
|
||||
|
@ -227,9 +223,9 @@ requirements.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function LanguageManager::search_nest_for is used in <a href="#SP2">§2</a>.</p>
|
||||
<p class="endnote">The function LanguageManager::search_nest_for is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP7"></a><b>§7. Copying. </b>Now the task is to copy a language into place in a nest. Since a language is a folder,
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Copying. </b>Now the task is to copy a language into place in a nest. Since a language is a folder,
|
||||
we need to <code class="display"><span class="extract">rsync</span></code> it.
|
||||
</p>
|
||||
|
||||
|
@ -279,7 +275,7 @@ we need to <code class="display"><span class="extract">rsync</span></code> it.
|
|||
|
||||
<p class="endnote">The function LanguageManager::pathname_in_nest appears nowhere else.</p>
|
||||
|
||||
<p class="endnote">The function LanguageManager::copy_to_nest is used in <a href="#SP2">§2</a>.</p>
|
||||
<p class="endnote">The function LanguageManager::copy_to_nest is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><a href="4-em.html">Back to 'Extension Manager'</a></li><li><a href="4-pbm.html">Continue with 'Project Bundle Manager'</a></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -61,11 +61,23 @@
|
|||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP3">§3. Claiming</a></li><li><a href="#SP4">§4. Searching</a></li><li><a href="#SP5">§5. Copying</a></li><li><a href="#SP6">§6. Build graph</a></li><li><a href="#SP7">§7. Source text</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">project_bundle_genre</span></code> can be summarised as follows. Copies consist of
|
||||
directories, which are Inform project bundles: for example,
|
||||
<code class="display"><span class="extract">Counterfeit Monkey.inform</span></code> might be such a bundle. They are recognised by
|
||||
being directories and having names ending in <code class="display"><span class="extract">.inform</span></code>. They cannot be
|
||||
stored in nests. Their build graphs are extensive, having "upstream" vertices
|
||||
representing possible ways to build or release them, and having numerous
|
||||
"downstream" vertices as well: build edges run out to the extensions, kits
|
||||
and language definitions that they need.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph">Note that <code class="display"><span class="extract">project_bundle_genre</span></code> and <code class="display"><span class="extract">project_file_genre</span></code> are managed
|
||||
differently, but share the same annotation data structure <code class="display"><span class="extract">inform_project</span></code>.
|
||||
However it is stored in the file system, a project is a project.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">project_bundle_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">ProjectBundleManager::start</span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="identifier">project_bundle_genre</span><span class="plain"> = </span><span class="functiontext">Genres::new</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"projectbundle"</span><span class="plain">, </span><span class="identifier">FALSE</span><span class="plain">);</span>
|
||||
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">project_bundle_genre</span><span class="plain">, </span><span class="constant">GENRE_WRITE_WORK_MTID</span><span class="plain">, </span><span class="functiontext">ProjectBundleManager::write_work</span><span class="plain">);</span>
|
||||
|
|
|
@ -61,11 +61,21 @@
|
|||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP3">§3. Claiming</a></li><li><a href="#SP4">§4. Searching</a></li><li><a href="#SP5">§5. Copying</a></li><li><a href="#SP6">§6. Build graph</a></li><li><a href="#SP7">§7. Source text</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">project_file_genre</span></code> can be summarised as follows. Copies consist of
|
||||
single files. These are recognised by having the filename extension <code class="display"><span class="extract">.txt</span></code>,
|
||||
<code class="display"><span class="extract">.ni</span></code> or <code class="display"><span class="extract">.i7</span></code>. They cannot be stored in nests. Their build graphs are
|
||||
extensive, having "upstream" vertices representing possible ways to build or
|
||||
release them, and having numerous "downstream" vertices as well: build edges
|
||||
run out to the extensions, kits and language definitions that they need.
|
||||
</p>
|
||||
|
||||
<p class="inwebparagraph">Note that <code class="display"><span class="extract">project_bundle_genre</span></code> and <code class="display"><span class="extract">project_file_genre</span></code> are managed
|
||||
differently, but share the same annotation data structure <code class="display"><span class="extract">inform_project</span></code>.
|
||||
However it is stored in the file system, a project is a project.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">project_file_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">ProjectFileManager::start</span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="identifier">project_file_genre</span><span class="plain"> = </span><span class="functiontext">Genres::new</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"projectfile"</span><span class="plain">, </span><span class="identifier">FALSE</span><span class="plain">);</span>
|
||||
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">project_file_genre</span><span class="plain">, </span><span class="constant">GENRE_WRITE_WORK_MTID</span><span class="plain">, </span><span class="functiontext">ProjectFileManager::write_work</span><span class="plain">);</span>
|
||||
|
|
|
@ -59,18 +59,13 @@
|
|||
<!--Weave of '4/pm' generated by 7-->
|
||||
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../compiler.html">Compiler Modules</a></li><li><a href="index.html">inbuild</a></li><li><a href="index.html#4">Chapter 4: Managing Genres of Work</a></li><li><b>Pipeline Manager</b></li></ul><p class="purpose">An Inform 7 pipeline.</p>
|
||||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP5">§5. Claiming</a></li><li><a href="#SP6">§6. Searching</a></li><li><a href="#SP7">§7. Copying</a></li></ul><hr class="tocbar">
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP4">§4. Claiming</a></li><li><a href="#SP5">§5. Searching</a></li><li><a href="#SP6">§6. Copying</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">pipeline_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">pipeline_genre</span></code> can be summarised as follows. Copies consist of single
|
||||
files. These are recognised by having the filename extension <code class="display"><span class="extract">.interpipeline</span></code>.
|
||||
They are stored in nests, in <code class="display"><span class="extract">N/Pipelines/Title-vVersion.i7x</span></code>. Their build
|
||||
graphs are single vertices with no build or use edges.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
|
@ -93,7 +88,7 @@
|
|||
|
||||
<p class="endnote">The function PipelineManager::write_work appears nowhere else.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>Pipelines live in their namesake subdirectory of a nest:
|
||||
<p class="inwebparagraph"><a id="SP2"></a><b>§2. </b>Pipelines live in their namesake subdirectory of a nest:
|
||||
</p>
|
||||
|
||||
|
||||
|
@ -106,9 +101,9 @@
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function PipelineManager::path_within_nest is used in <a href="#SP6">§6</a>, <a href="#SP7">§7</a>.</p>
|
||||
<p class="endnote">The function PipelineManager::path_within_nest is used in <a href="#SP5">§5</a>, <a href="#SP6">§6</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. </b>Pipeline copies are annotated with a structure called an <code class="display"><span class="extract">inform_pipeline</span></code>,
|
||||
<p class="inwebparagraph"><a id="SP3"></a><b>§3. </b>Pipeline copies are annotated with a structure called an <code class="display"><span class="extract">inform_pipeline</span></code>,
|
||||
which stores data about pipelines used by the Inform compiler.
|
||||
</p>
|
||||
|
||||
|
@ -134,9 +129,9 @@ which stores data about pipelines used by the Inform compiler.
|
|||
|
||||
<p class="endnote">The function PipelineManager::from_copy appears nowhere else.</p>
|
||||
|
||||
<p class="endnote">The function PipelineManager::new_copy is used in <a href="#SP5">§5</a>.</p>
|
||||
<p class="endnote">The function PipelineManager::new_copy is used in <a href="#SP4">§4</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Claiming. </b>Here <code class="display"><span class="extract">arg</span></code> is a textual form of a filename or pathname, such as may have been
|
||||
<p class="inwebparagraph"><a id="SP4"></a><b>§4. Claiming. </b>Here <code class="display"><span class="extract">arg</span></code> is a textual form of a filename or pathname, such as may have been
|
||||
supplied at the command line; <code class="display"><span class="extract">ext</span></code> is a substring of it, and is its extension
|
||||
(e.g., <code class="display"><span class="extract">jpg</span></code> if <code class="display"><span class="extract">arg</span></code> is <code class="display"><span class="extract">Geraniums.jpg</span></code>), or is empty if there isn't one;
|
||||
<code class="display"><span class="extract">directory_status</span></code> is true if we know for some reason that this is a directory
|
||||
|
@ -172,11 +167,11 @@ not a file, false if we know the reverse, and otherwise not applicable.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function PipelineManager::claim_as_copy is used in <a href="#SP2">§2</a>.</p>
|
||||
<p class="endnote">The function PipelineManager::claim_as_copy is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<p class="endnote">The function PipelineManager::claim_file_as_copy is used in <a href="#SP6">§6</a>.</p>
|
||||
<p class="endnote">The function PipelineManager::claim_file_as_copy is used in <a href="#SP5">§5</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Searching. </b>Here we look through a nest to find all pipelines matching the supplied
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. Searching. </b>Here we look through a nest to find all pipelines matching the supplied
|
||||
requirements.
|
||||
</p>
|
||||
|
||||
|
@ -206,9 +201,9 @@ requirements.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function PipelineManager::search_nest_for is used in <a href="#SP2">§2</a>.</p>
|
||||
<p class="endnote">The function PipelineManager::search_nest_for is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP7"></a><b>§7. Copying. </b>Now the task is to copy a pipeline into place in a nest. This is easy,
|
||||
<p class="inwebparagraph"><a id="SP6"></a><b>§6. Copying. </b>Now the task is to copy a pipeline into place in a nest. This is easy,
|
||||
since a pipeline is a single file; to sync, we just overwrite.
|
||||
</p>
|
||||
|
||||
|
@ -255,7 +250,7 @@ since a pipeline is a single file; to sync, we just overwrite.
|
|||
|
||||
<p class="endnote">The function PipelineManager::filename_in_nest appears nowhere else.</p>
|
||||
|
||||
<p class="endnote">The function PipelineManager::copy_to_nest is used in <a href="#SP2">§2</a>.</p>
|
||||
<p class="endnote">The function PipelineManager::copy_to_nest is used in <a href="#SP1">§1</a>.</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><a href="4-tm.html">Back to 'Template Manager'</a></li><li><i>(This section ends Chapter 4: Managing Genres of Work.)</i></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -61,11 +61,15 @@
|
|||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Genre definition</a></li><li><a href="#SP4">§4. Claiming</a></li><li><a href="#SP5">§5. Searching</a></li><li><a href="#SP6">§6. Copying</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Genre definition. </b>The <code class="display"><span class="extract">template_genre</span></code> can be summarised as follows. Website templates
|
||||
are directories. They are recognised by containing either a metadata file
|
||||
called <code class="display"><span class="extract">(manifest).txt</span></code> or <code class="display"><span class="extract">index.html</span></code>, or both. They are stored in
|
||||
nests, in <code class="display"><span class="extract">N/Templates/Title-vVersion</span></code>. Their build graphs are single
|
||||
vertices with no build or use edges.
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">inbuild_genre</span><span class="plain"> *</span><span class="identifier">template_genre</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">TemplateManager::start</span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="identifier">template_genre</span><span class="plain"> = </span><span class="functiontext">Genres::new</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"template"</span><span class="plain">, </span><span class="identifier">TRUE</span><span class="plain">);</span>
|
||||
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">template_genre</span><span class="plain">, </span><span class="constant">GENRE_WRITE_WORK_MTID</span><span class="plain">, </span><span class="functiontext">TemplateManager::write_work</span><span class="plain">);</span>
|
||||
|
|
|
@ -59,9 +59,16 @@
|
|||
<!--Weave of '5/es' generated by 7-->
|
||||
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../compiler.html">Compiler Modules</a></li><li><a href="index.html">inbuild</a></li><li><a href="index.html#5">Chapter 5: Services for the Inform Compiler</a></li><li><b>Extension Services</b></li></ul><p class="purpose">An Inform 7 extension.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. </b>An extension has a title and an author name, each of which is limited in
|
||||
length to one character less than the following constants:
|
||||
</p>
|
||||
|
||||
|
||||
<pre class="definitions">
|
||||
<span class="definitionkeyword">define</span> <span class="constant">MAX_EXTENSION_TITLE_LENGTH</span><span class="plain"> 51</span>
|
||||
<span class="definitionkeyword">define</span> <span class="constant">MAX_EXTENSION_AUTHOR_LENGTH</span><span class="plain"> 51</span>
|
||||
</pre>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">typedef</span><span class="plain"> </span><span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inform_extension</span><span class="plain"> {</span>
|
||||
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inbuild_copy</span><span class="plain"> *</span><span class="identifier">as_copy</span><span class="plain">;</span>
|
||||
|
@ -131,7 +138,7 @@
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Extensions::scan is used in 4/em (<a href="4-em.html#SP5">§5</a>).</p>
|
||||
<p class="endnote">The function Extensions::scan is used in 4/em (<a href="4-em.html#SP4">§4</a>).</p>
|
||||
|
||||
<p class="endnote">The structure inform_extension is accessed in 1/ic, 3/bg, 3/ib, 3/is2, 3/is3, 4/em, 4/lm, 4/pbm, 4/pfm, 4/tm, 4/pm, 5/kts, 5/ed, 5/ed2, 5/ts, 5/ps, 5/ls, 5/ps2, 6/hdn, 6/inc and here.</p>
|
||||
|
||||
|
@ -472,7 +479,7 @@ the main source text:
|
|||
|
||||
<p class="endnote">The function Extensions::is_standard appears nowhere else.</p>
|
||||
|
||||
<p class="endnote">The function Extensions::make_standard is used in 4/em (<a href="4-em.html#SP5">§5</a>).</p>
|
||||
<p class="endnote">The function Extensions::make_standard is used in 4/em (<a href="4-em.html#SP4">§4</a>).</p>
|
||||
|
||||
<p class="endnote">The function Extensions::must_satisfy is used in 5/ed2 (<a href="5-ed2.html#SP4">§4</a>), 6/inc (<a href="6-inc.html#SP6">§6</a>).</p>
|
||||
|
||||
|
@ -512,7 +519,7 @@ the main source text:
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Extensions::read_source_text_for is used in 4/em (<a href="4-em.html#SP10">§10</a>).</p>
|
||||
<p class="endnote">The function Extensions::read_source_text_for is used in 4/em (<a href="4-em.html#SP9">§9</a>).</p>
|
||||
|
||||
<p class="endnote">The function Extensions::corresponding_to is used in 6/hdn (<a href="6-hdn.html#SP19">§19</a>).</p>
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ If there are S sections then the graph has S+5 vertices and 4(S+1) edges.
|
|||
<span class="reserved">kit_contents_section_state</span><span class="plain"> </span><span class="identifier">CSS</span><span class="plain">;</span>
|
||||
<span class="identifier">CSS</span><span class="element">.active</span><span class="plain"> = </span><span class="identifier">FALSE</span><span class="plain">;</span>
|
||||
<span class="identifier">CSS</span><span class="element">.sects</span><span class="plain"> = </span><span class="identifier">NEW_LINKED_LIST</span><span class="plain">(</span><span class="identifier">text_stream</span><span class="plain">);</span>
|
||||
<span class="identifier">TextFiles::read</span><span class="plain">(</span><span class="identifier">contents_page</span><span class="plain">, </span><span class="identifier">FALSE</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">FALSE</span><span class="plain">, </span><span class="functiontext">KitManager::read_contents</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, (</span><span class="reserved">void</span><span class="plain"> *) &</span><span class="identifier">CSS</span><span class="plain">);</span>
|
||||
<span class="identifier">TextFiles::read</span><span class="plain">(</span><span class="identifier">contents_page</span><span class="plain">, </span><span class="identifier">FALSE</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">FALSE</span><span class="plain">, </span><span class="functiontext">Kits::read_contents</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, (</span><span class="reserved">void</span><span class="plain"> *) &</span><span class="identifier">CSS</span><span class="plain">);</span>
|
||||
<span class="identifier">text_stream</span><span class="plain"> *</span><span class="identifier">segment</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">segment</span><span class="plain">, </span><span class="identifier">text_stream</span><span class="plain">, </span><span class="identifier">CSS</span><span class="element">.sects</span><span class="plain">) {</span>
|
||||
<span class="identifier">filename</span><span class="plain"> *</span><span class="identifier">SF</span><span class="plain"> = </span><span class="identifier">Filenames::in_folder</span><span class="plain">(</span>
|
||||
|
@ -343,12 +343,33 @@ If there are S sections then the graph has S+5 vertices and 4(S+1) edges.
|
|||
<span class="plain">}</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="plain">}</span>
|
||||
|
||||
<span class="reserved">typedef</span><span class="plain"> </span><span class="reserved">struct</span><span class="plain"> </span><span class="reserved">kit_contents_section_state</span><span class="plain"> {</span>
|
||||
<span class="reserved">struct</span><span class="plain"> </span><span class="identifier">linked_list</span><span class="plain"> *</span><span class="identifier">sects</span><span class="plain">; </span> <span class="comment">of <code class="display"><span class="extract">text_stream</span></code></span>
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">active</span><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">kit_contents_section_state</span><span class="plain">;</span>
|
||||
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Kits::read_contents</span><span class="plain">(</span><span class="identifier">text_stream</span><span class="plain"> *</span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">text_file_position</span><span class="plain"> *</span><span class="identifier">tfp</span><span class="plain">, </span><span class="reserved">void</span><span class="plain"> *</span><span class="identifier">state</span><span class="plain">) {</span>
|
||||
<span class="reserved">kit_contents_section_state</span><span class="plain"> *</span><span class="identifier">CSS</span><span class="plain"> = (</span><span class="reserved">kit_contents_section_state</span><span class="plain"> *) </span><span class="identifier">state</span><span class="plain">;</span>
|
||||
<span class="identifier">match_results</span><span class="plain"> </span><span class="identifier">mr</span><span class="plain"> = </span><span class="identifier">Regexp::create_mr</span><span class="plain">();</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">Regexp::match</span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Sections"</span><span class="plain">))</span>
|
||||
<span class="identifier">CSS</span><span class="plain">-</span><span class="element">>active</span><span class="plain"> = </span><span class="identifier">TRUE</span><span class="plain">;</span>
|
||||
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">Regexp::match</span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="identifier">L</span><span class="string">" (%c+)"</span><span class="plain">)) && (</span><span class="identifier">CSS</span><span class="plain">-</span><span class="element">>active</span><span class="plain">)) {</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="identifier">exp</span><span class="plain">[0], </span><span class="string">".i6t"</span><span class="plain">);</span>
|
||||
<span class="identifier">ADD_TO_LINKED_LIST</span><span class="plain">(</span><span class="identifier">Str::duplicate</span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="identifier">exp</span><span class="plain">[0]), </span><span class="identifier">text_stream</span><span class="plain">, </span><span class="identifier">CSS</span><span class="plain">-</span><span class="element">>sects</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="identifier">Regexp::dispose_of</span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Kits::construct_graph is used in 4/km (<a href="4-km.html#SP7">§7</a>).</p>
|
||||
|
||||
<p class="endnote">The function Kits::read_contents appears nowhere else.</p>
|
||||
|
||||
<p class="endnote">The structure kit_contents_section_state is private to this section.</p>
|
||||
|
||||
<hr class="tocbar">
|
||||
<ul class="toc"><li><i>(This section begins Chapter 5: Services for the Inform Compiler.)</i></li><li><a href="5-es.html">Continue with 'Extension Services'</a></li></ul><hr class="tocbar">
|
||||
<!--End of weave-->
|
||||
|
|
|
@ -108,7 +108,7 @@ of the following structure.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Languages::new_il is used in 4/lm (<a href="4-lm.html#SP4">§4</a>).</p>
|
||||
<p class="endnote">The function Languages::new_il is used in 4/lm (<a href="4-lm.html#SP3">§3</a>).</p>
|
||||
|
||||
<p class="endnote">The function Languages::path_to_bundle appears nowhere else.</p>
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Pipelines::new_ip is used in 4/pm (<a href="4-pm.html#SP4">§4</a>).</p>
|
||||
<p class="endnote">The function Pipelines::new_ip is used in 4/pm (<a href="4-pm.html#SP3">§3</a>).</p>
|
||||
|
||||
<p class="endnote">The structure inform_pipeline is accessed in 1/ic, 2/edt, 2/rqr, 2/nst, 3/bg, 3/ib, 3/is2, 3/is3, 4/em, 4/lm, 4/pbm, 4/pfm, 4/tm, 4/pm, 5/kts, 5/es, 5/ed, 5/ed2, 5/ec, 5/ts, 5/ps, 5/ls, 6/hdn, 6/inc, 6/vmg and here.</p>
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ guaranteed to be no INCLUDE nodes remaining in the parse tree.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">The function Inclusions::traverse is used in 4/em (<a href="4-em.html#SP9">§9</a>), 5/ps (<a href="5-ps.html#SP4">§4</a>).</p>
|
||||
<p class="endnote">The function Inclusions::traverse is used in 4/em (<a href="4-em.html#SP8">§8</a>), 5/ps (<a href="5-ps.html#SP4">§4</a>).</p>
|
||||
|
||||
<p class="endnote">The function Inclusions::spawned_from_vertex is used in <a href="#SP1_1">§1.1</a>, <a href="#SP6_1">§6.1</a>.</p>
|
||||
|
||||
|
|
|
@ -48,14 +48,22 @@ void Inbuild::enter_phase(int p) {
|
|||
The following is called when the |inbuild| module starts up.
|
||||
|
||||
=
|
||||
inbuild_genre *extension_genre = NULL;
|
||||
inbuild_genre *kit_genre = NULL;
|
||||
inbuild_genre *language_genre = NULL;
|
||||
inbuild_genre *pipeline_genre = NULL;
|
||||
inbuild_genre *project_bundle_genre = NULL;
|
||||
inbuild_genre *project_file_genre = NULL;
|
||||
inbuild_genre *template_genre = NULL;
|
||||
|
||||
void Inbuild::startup(void) {
|
||||
KitManager::start();
|
||||
ExtensionManager::start();
|
||||
TemplateManager::start();
|
||||
KitManager::start();
|
||||
LanguageManager::start();
|
||||
PipelineManager::start();
|
||||
ProjectBundleManager::start();
|
||||
ProjectFileManager::start();
|
||||
PipelineManager::start();
|
||||
TemplateManager::start();
|
||||
|
||||
InterSkill::create();
|
||||
Inform7Skill::create();
|
||||
|
|
|
@ -3,15 +3,11 @@
|
|||
An Inform 7 extension.
|
||||
|
||||
@h Genre definition.
|
||||
|
||||
= (early code)
|
||||
inbuild_genre *extension_genre = NULL;
|
||||
|
||||
@ An extension has a title and an author name, each of which is limited in
|
||||
length to one character less than the following constants:
|
||||
|
||||
@d MAX_EXTENSION_TITLE_LENGTH 51
|
||||
@d MAX_EXTENSION_AUTHOR_LENGTH 51
|
||||
The |extension_genre| can be summarised as follows. Copies consist of single
|
||||
files. These are recognised by having the filename extension |.i7x|. They are
|
||||
stored in nests, in |N/Extensions/Author/Title-vVersion.i7x|. Their build
|
||||
graphs are a single vertex with no build edges, but with use edges to any
|
||||
further extensions which they Include.
|
||||
|
||||
@ =
|
||||
void ExtensionManager::start(void) {
|
||||
|
@ -194,7 +190,7 @@ void ExtensionManager::copy_to_nest(inbuild_genre *gen, inbuild_copy *C, inbuild
|
|||
}
|
||||
|
||||
@h Build graph.
|
||||
As far as building goes, the build graph for an extension is just a single node:
|
||||
As far as building goes, the build graph for an extension is just a single vertex:
|
||||
you don't need to build an extension at all. But it may well have use edges,
|
||||
thanks to including other extensions, and because of that we have to read the
|
||||
source text before we can do anything with the graph.
|
||||
|
@ -205,6 +201,8 @@ extraneous extensions, discovered only when scanning some directory, would
|
|||
be read in as source text; and some of those might not be compatible with
|
||||
the current VM settings.
|
||||
|
||||
We therefore generate the build graph only on demand.
|
||||
|
||||
=
|
||||
void ExtensionManager::building_soon(inbuild_genre *gen, inbuild_copy *C, build_vertex **V) {
|
||||
ExtensionManager::ensure_graphed(C);
|
||||
|
|
|
@ -3,9 +3,16 @@
|
|||
A kit is a combination of Inter code with an Inform 7 extension.
|
||||
|
||||
@h Genre definition.
|
||||
The |kit_genre| can be summarised as follows. Kits consist of directories,
|
||||
containing metadata in |D/kit_metadata.txt|, but which are also valid Inweb
|
||||
webs of Inform 6 source text. They are recognised by having directory names
|
||||
ending in |Kit|, and by having a metadata file in place. They are stored in
|
||||
nests, in |N/Inter/Title-vVersion|. Their build graphs are quite extensive,
|
||||
with build edges to Inter binaries for each architecture with which they
|
||||
are compatible, and use edges to extensions or other kits as laid out in
|
||||
the metadata file.
|
||||
|
||||
=
|
||||
inbuild_genre *kit_genre = NULL;
|
||||
void KitManager::start(void) {
|
||||
kit_genre = Genres::new(I"kit", TRUE);
|
||||
METHOD_ADD(kit_genre, GENRE_WRITE_WORK_MTID, KitManager::write_work);
|
||||
|
@ -120,7 +127,7 @@ void KitManager::search_nest_for(inbuild_genre *gen, inbuild_nest *N,
|
|||
}
|
||||
|
||||
@h Copying.
|
||||
Now the task is to copy a kit into place in a nest. Since a kit is a folder,
|
||||
Now the task is to copy a kit into place in a nest. Since a kit is a directory,
|
||||
we need to |rsync| it.
|
||||
|
||||
=
|
||||
|
@ -173,20 +180,3 @@ void KitManager::building_soon(inbuild_genre *gen, inbuild_copy *C, build_vertex
|
|||
void KitManager::go_operational(inbuild_genre *G, inbuild_copy *C) {
|
||||
Kits::construct_graph(KitManager::from_copy(C));
|
||||
}
|
||||
|
||||
typedef struct kit_contents_section_state {
|
||||
struct linked_list *sects; /* of |text_stream| */
|
||||
int active;
|
||||
} kit_contents_section_state;
|
||||
|
||||
void KitManager::read_contents(text_stream *text, text_file_position *tfp, void *state) {
|
||||
kit_contents_section_state *CSS = (kit_contents_section_state *) state;
|
||||
match_results mr = Regexp::create_mr();
|
||||
if (Regexp::match(&mr, text, L"Sections"))
|
||||
CSS->active = TRUE;
|
||||
if ((Regexp::match(&mr, text, L" (%c+)")) && (CSS->active)) {
|
||||
WRITE_TO(mr.exp[0], ".i6t");
|
||||
ADD_TO_LINKED_LIST(Str::duplicate(mr.exp[0]), text_stream, CSS->sects);
|
||||
}
|
||||
Regexp::dispose_of(&mr);
|
||||
}
|
||||
|
|
|
@ -3,11 +3,13 @@
|
|||
A language is a combination of Inter code with an Inform 7 extension.
|
||||
|
||||
@h Genre definition.
|
||||
The |language_genre| can be summarised as follows. Language definitions
|
||||
consist of directories, containing metadata in |D/about.txt|. They are
|
||||
recognised by having this metadata file in place. They are stored in
|
||||
nests, in |N/Languages/Title-vVersion|. Their build graphs are single
|
||||
vertices with no build or use edges.
|
||||
|
||||
= (early code)
|
||||
inbuild_genre *language_genre = NULL;
|
||||
|
||||
@ =
|
||||
=
|
||||
void LanguageManager::start(void) {
|
||||
language_genre = Genres::new(I"language", TRUE);
|
||||
METHOD_ADD(language_genre, GENRE_WRITE_WORK_MTID, LanguageManager::write_work);
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
An Inform 7 pipeline.
|
||||
|
||||
@h Genre definition.
|
||||
The |pipeline_genre| can be summarised as follows. Copies consist of single
|
||||
files. These are recognised by having the filename extension |.interpipeline|.
|
||||
They are stored in nests, in |N/Pipelines/Title-vVersion.i7x|. Their build
|
||||
graphs are single vertices with no build or use edges.
|
||||
|
||||
= (early code)
|
||||
inbuild_genre *pipeline_genre = NULL;
|
||||
|
||||
@ =
|
||||
=
|
||||
void PipelineManager::start(void) {
|
||||
pipeline_genre = Genres::new(I"pipeline", TRUE);
|
||||
METHOD_ADD(pipeline_genre, GENRE_WRITE_WORK_MTID, PipelineManager::write_work);
|
||||
|
|
|
@ -3,9 +3,20 @@
|
|||
A project bundle is a folder holding an Inform 7 work. The app creates these.
|
||||
|
||||
@h Genre definition.
|
||||
The |project_bundle_genre| can be summarised as follows. Copies consist of
|
||||
directories, which are Inform project bundles: for example,
|
||||
|Counterfeit Monkey.inform| might be such a bundle. They are recognised by
|
||||
being directories and having names ending in |.inform|. They cannot be
|
||||
stored in nests. Their build graphs are extensive, having "upstream" vertices
|
||||
representing possible ways to build or release them, and having numerous
|
||||
"downstream" vertices as well: build edges run out to the extensions, kits
|
||||
and language definitions that they need.
|
||||
|
||||
Note that |project_bundle_genre| and |project_file_genre| are managed
|
||||
differently, but share the same annotation data structure |inform_project|.
|
||||
However it is stored in the file system, a project is a project.
|
||||
|
||||
=
|
||||
inbuild_genre *project_bundle_genre = NULL;
|
||||
void ProjectBundleManager::start(void) {
|
||||
project_bundle_genre = Genres::new(I"projectbundle", FALSE);
|
||||
METHOD_ADD(project_bundle_genre, GENRE_WRITE_WORK_MTID, ProjectBundleManager::write_work);
|
||||
|
|
|
@ -3,9 +3,18 @@
|
|||
A project file is a plain text file of Inform 7 source text.
|
||||
|
||||
@h Genre definition.
|
||||
The |project_file_genre| can be summarised as follows. Copies consist of
|
||||
single files. These are recognised by having the filename extension |.txt|,
|
||||
|.ni| or |.i7|. They cannot be stored in nests. Their build graphs are
|
||||
extensive, having "upstream" vertices representing possible ways to build or
|
||||
release them, and having numerous "downstream" vertices as well: build edges
|
||||
run out to the extensions, kits and language definitions that they need.
|
||||
|
||||
Note that |project_bundle_genre| and |project_file_genre| are managed
|
||||
differently, but share the same annotation data structure |inform_project|.
|
||||
However it is stored in the file system, a project is a project.
|
||||
|
||||
=
|
||||
inbuild_genre *project_file_genre = NULL;
|
||||
void ProjectFileManager::start(void) {
|
||||
project_file_genre = Genres::new(I"projectfile", FALSE);
|
||||
METHOD_ADD(project_file_genre, GENRE_WRITE_WORK_MTID, ProjectFileManager::write_work);
|
||||
|
|
|
@ -3,9 +3,13 @@
|
|||
A template is the outline for a website presenting an Inform work.
|
||||
|
||||
@h Genre definition.
|
||||
The |template_genre| can be summarised as follows. Website templates
|
||||
are directories. They are recognised by containing either a metadata file
|
||||
called |(manifest).txt| or |index.html|, or both. They are stored in
|
||||
nests, in |N/Templates/Title-vVersion|. Their build graphs are single
|
||||
vertices with no build or use edges.
|
||||
|
||||
=
|
||||
inbuild_genre *template_genre = NULL;
|
||||
void TemplateManager::start(void) {
|
||||
template_genre = Genres::new(I"template", TRUE);
|
||||
METHOD_ADD(template_genre, GENRE_WRITE_WORK_MTID, TemplateManager::write_work);
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
|
||||
An Inform 7 extension.
|
||||
|
||||
@
|
||||
@ An extension has a title and an author name, each of which is limited in
|
||||
length to one character less than the following constants:
|
||||
|
||||
@d MAX_EXTENSION_TITLE_LENGTH 51
|
||||
@d MAX_EXTENSION_AUTHOR_LENGTH 51
|
||||
|
||||
=
|
||||
typedef struct inform_extension {
|
||||
|
|
|
@ -225,7 +225,7 @@ void Kits::construct_graph(inform_kit *K) {
|
|||
kit_contents_section_state CSS;
|
||||
CSS.active = FALSE;
|
||||
CSS.sects = NEW_LINKED_LIST(text_stream);
|
||||
TextFiles::read(contents_page, FALSE, NULL, FALSE, KitManager::read_contents, NULL, (void *) &CSS);
|
||||
TextFiles::read(contents_page, FALSE, NULL, FALSE, Kits::read_contents, NULL, (void *) &CSS);
|
||||
text_stream *segment;
|
||||
LOOP_OVER_LINKED_LIST(segment, text_stream, CSS.sects) {
|
||||
filename *SF = Filenames::in_folder(
|
||||
|
@ -252,3 +252,20 @@ void Kits::construct_graph(inform_kit *K) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct kit_contents_section_state {
|
||||
struct linked_list *sects; /* of |text_stream| */
|
||||
int active;
|
||||
} kit_contents_section_state;
|
||||
|
||||
void Kits::read_contents(text_stream *text, text_file_position *tfp, void *state) {
|
||||
kit_contents_section_state *CSS = (kit_contents_section_state *) state;
|
||||
match_results mr = Regexp::create_mr();
|
||||
if (Regexp::match(&mr, text, L"Sections"))
|
||||
CSS->active = TRUE;
|
||||
if ((Regexp::match(&mr, text, L" (%c+)")) && (CSS->active)) {
|
||||
WRITE_TO(mr.exp[0], ".i6t");
|
||||
ADD_TO_LINKED_LIST(Str::duplicate(mr.exp[0]), text_stream, CSS->sects);
|
||||
}
|
||||
Regexp::dispose_of(&mr);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue