1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 18:14:21 +03:00
inform7/docs/bytecode-module/2-tw.html
Graham Nelson 1268a0f40e Colonised
2020-04-14 17:56:54 +01:00

377 lines
75 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>The Warehouse</title>
<meta name="viewport" content="width=device-width initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="../inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>
<body>
<nav role="navigation">
<h1><a href="../index.html">
<img src="../docs-src/Figures/Inform.png" height=72">
</a></h1>
<ul><li><a href="../compiler.html">compiler tools</a></li>
<li><a href="../other.html">other tools</a></li>
<li><a href="../extensions.html">extensions and kits</a></li>
<li><a href="../units.html">unit test tools</a></li>
</ul><h2>Compiler Webs</h2><ul>
<li><a href="../inbuild/index.html">inbuild</a></li>
<li><a href="../inform7/index.html">inform7</a></li>
<li><a href="../inter/index.html">inter</a></li>
</ul><h2>Inbuild Modules</h2><ul>
<li><a href="../supervisor-module/index.html">supervisor</a></li>
</ul><h2>Inform7 Modules</h2><ul>
<li><a href="../core-module/index.html">core</a></li>
<li><a href="../inflections-module/index.html">inflections</a></li>
<li><a href="../linguistics-module/index.html">linguistics</a></li>
<li><a href="../kinds-module/index.html">kinds</a></li>
<li><a href="../if-module/index.html">if</a></li>
<li><a href="../multimedia-module/index.html">multimedia</a></li>
<li><a href="../problems-module/index.html">problems</a></li>
<li><a href="../index-module/index.html">index</a></li>
</ul><h2>Inter Modules</h2><ul>
<li><a href="index.html"><span class="selectedlink">bytecode</span></a></li>
<li><a href="../building-module/index.html">building</a></li>
<li><a href="../codegen-module/index.html">codegen</a></li>
</ul><h2>Shared Modules</h2><ul>
<li><a href="../arch-module/index.html">arch</a></li>
<li><a href="../syntax-module/index.html">syntax</a></li>
<li><a href="../words-module/index.html">words</a></li>
<li><a href="../html-module/index.html">html</a></li>
<li><a href="../../../inweb/docs/foundation-module/index.html">foundation</a></li>
</ul>
</nav>
<main role="main">
<!--Weave of 'The Warehouse' generated by 7-->
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Inter Modules</a></li><li><a href="index.html">bytecode</a></li><li><a href="index.html#2">Chapter 2: Interoperability</a></li><li><b>The Warehouse</b></li></ul><p class="purpose">To manage the memory storage of inter code.</p>
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. </b></p>
<pre class="display">
<span class="reserved">typedef</span><span class="plain"> </span><span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_warehouse</span><span class="plain"> {</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="identifier">filename</span><span class="plain"> *</span><span class="identifier">origin_file</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">first_room</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">size</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">capacity</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_resource_holder</span><span class="plain"> *</span><span class="identifier">stored_resources</span><span class="plain">;</span>
<span class="identifier">MEMORY_MANAGEMENT</span>
<span class="plain">} </span><span class="reserved">inter_warehouse</span><span class="plain">;</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The structure inter_warehouse is accessed in 2/in, 2/st, 2/cnn, 2/trn, 3/iibf and here.</p>
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. </b></p>
<pre class="definitions">
<span class="definitionkeyword">enum</span> <span class="constant">NO_IRSRC</span><span class="definitionkeyword"> from </span><span class="constant">0</span>
<span class="definitionkeyword">enum</span> <span class="constant">STRING_IRSRC</span>
<span class="definitionkeyword">enum</span> <span class="constant">SYMBOLS_TABLE_IRSRC</span>
<span class="definitionkeyword">enum</span> <span class="constant">FRAME_LIST_IRSRC</span>
<span class="definitionkeyword">enum</span> <span class="constant">PACKAGE_IRSRC</span>
<span class="definitionkeyword">enum</span> <span class="constant">REF_IRSRC</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">inter_resource_holder</span><span class="plain"> {</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">irsrc</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_package</span><span class="plain"> *</span><span class="identifier">owning_package</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_symbols_table</span><span class="plain"> *</span><span class="identifier">stored_symbols_table</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_node_list</span><span class="plain"> *</span><span class="identifier">stored_frame_list</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_package</span><span class="plain"> *</span><span class="identifier">stored_package</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="identifier">text_stream</span><span class="plain"> *</span><span class="identifier">stored_text_stream</span><span class="plain">;</span>
<span class="reserved">void</span><span class="plain"> *</span><span class="identifier">stored_ref</span><span class="plain">;</span>
<span class="plain">} </span><span class="reserved">inter_resource_holder</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">inter_warehouse_room</span><span class="plain"> {</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">owning_warehouse</span><span class="plain">;</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">index_offset</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">size</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">capacity</span><span class="plain">;</span>
<span class="constant">inter_t</span><span class="plain"> *</span><span class="identifier">bytecode</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">next_room</span><span class="plain">;</span>
<span class="identifier">MEMORY_MANAGEMENT</span>
<span class="plain">} </span><span class="reserved">inter_warehouse_room</span><span class="plain">;</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The structure inter_resource_holder is accessed in 2/st, 2/pck, 2/trn, 3/iibf and here.</p>
<p class="endnote">The structure inter_warehouse_room is accessed in 2/in, 2/st, 2/cnn, 2/trn, 3/iibf and here.</p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b></p>
<pre class="display">
<span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">the_only_warehouse</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::new<button class="popup" onclick="togglePopup('usagePopup73')">...<span class="popuptext" id="usagePopup73">Usage of <b>Inter::Warehouse::new</b>:<br>Inter Trees - <a href="2-it.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">the_only_warehouse</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) {</span>
<span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain"> = </span><span class="identifier">CREATE</span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">origin_file</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">first_room</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::new_room</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">4096</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">size</span><span class="plain"> = </span><span class="constant">1</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">capacity</span><span class="plain"> = </span><span class="constant">0</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">the_only_warehouse</span><span class="plain"> = </span><span class="identifier">warehouse</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">the_only_warehouse</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::new_room<button class="popup" onclick="togglePopup('usagePopup74')">...<span class="popuptext" id="usagePopup74">Usage of <b>Inter::Warehouse::new_room</b>:<br>Inter Nodes - <a href="2-in.html#SP5">&#167;5</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">owner</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">capacity</span><span class="plain">, </span><span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">prec</span><span class="plain">) {</span>
<span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">IS</span><span class="plain"> = </span><span class="identifier">CREATE</span><span class="plain">(</span><span class="reserved">inter_warehouse_room</span><span class="plain">);</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">owning_warehouse</span><span class="plain"> = </span><span class="identifier">owner</span><span class="plain">;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">index_offset</span><span class="plain"> = (</span><span class="identifier">prec</span><span class="plain">)?(</span><span class="identifier">prec</span><span class="plain">-&gt;</span><span class="identifier">index_offset</span><span class="plain"> + (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">prec</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">):0;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> = </span><span class="constant">0</span><span class="plain">;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain"> = </span><span class="identifier">capacity</span><span class="plain">;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">bytecode</span><span class="plain"> = (</span><span class="constant">inter_t</span><span class="plain"> *)</span>
<span class="identifier">Memory::I7_calloc</span><span class="plain">(</span><span class="identifier">capacity</span><span class="plain">, </span><span class="reserved">sizeof</span><span class="plain">(</span><span class="constant">inter_t</span><span class="plain">), </span><span class="constant">INTER_BYTECODE_MREASON</span><span class="plain">);</span>
<span class="identifier">LOGIF</span><span class="plain">(</span><span class="identifier">INTER_MEMORY</span><span class="plain">, </span><span class="string">"Created repository %d segment %d with capacity %d\n"</span><span class="plain">,</span>
<span class="identifier">owner</span><span class="plain">-&gt;</span><span class="identifier">allocation_id</span><span class="plain">, </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="identifier">allocation_id</span><span class="plain">, </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">);</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">IS</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">warehouse_floor_space</span><span class="plain"> {</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">repo_segment</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">index</span><span class="plain">;</span>
<span class="constant">inter_t</span><span class="plain"> *</span><span class="identifier">data</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">extent</span><span class="plain">;</span>
<span class="plain">} </span><span class="reserved">warehouse_floor_space</span><span class="plain">;</span>
<span class="reserved">warehouse_floor_space</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::find_room_in_room<button class="popup" onclick="togglePopup('usagePopup75')">...<span class="popuptext" id="usagePopup75">Usage of <b>Inter::Warehouse::find_room_in_room</b>:<br>Inter Nodes - <a href="2-in.html#SP5">&#167;5</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">IS</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> &lt; </span><span class="constant">0</span><span class="plain">) || (</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> &gt; </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">)) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"bad segment"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">next_room</span><span class="plain"> != </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"nonfinal segment"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> + </span><span class="identifier">n</span><span class="plain"> + </span><span class="constant">PREFRAME_SIZE</span><span class="plain"> &gt; </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">) {</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">next_size</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::enlarge_size</a></span><span class="plain">(</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">, </span><span class="identifier">n</span><span class="plain"> + </span><span class="constant">PREFRAME_SIZE</span><span class="plain">);</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain"> = </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">next_room</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::new_room</a></span><span class="plain">(</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">owning_warehouse</span><span class="plain">, </span><span class="identifier">next_size</span><span class="plain">, </span><span class="identifier">IS</span><span class="plain">);</span>
<span class="identifier">IS</span><span class="plain"> = </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">next_room</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">at</span><span class="plain"> = </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">, </span><span class="identifier">this_piece</span><span class="plain"> = </span><span class="constant">PREFRAME_SIZE</span><span class="plain"> + </span><span class="identifier">n</span><span class="plain">;</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">i</span><span class="plain">=0; </span><span class="identifier">i</span><span class="plain">&lt;</span><span class="identifier">this_piece</span><span class="plain">; </span><span class="identifier">i</span><span class="plain">++) </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">bytecode</span><span class="plain">[</span><span class="identifier">at</span><span class="plain"> + </span><span class="identifier">i</span><span class="plain">] = </span><span class="constant">0</span><span class="plain">;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">bytecode</span><span class="plain">[</span><span class="identifier">at</span><span class="plain"> + </span><span class="constant">PREFRAME_SKIP_AMOUNT</span><span class="plain">] = (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">this_piece</span><span class="plain">;</span>
<span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> += </span><span class="identifier">this_piece</span><span class="plain">;</span>
<span class="reserved">warehouse_floor_space</span><span class="plain"> </span><span class="identifier">W</span><span class="plain">;</span>
<span class="identifier">W</span><span class="plain">.</span><span class="element">repo_segment</span><span class="plain"> = </span><span class="identifier">IS</span><span class="plain">; </span><span class="identifier">W</span><span class="plain">.</span><span class="element">index</span><span class="plain"> = </span><span class="identifier">at</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">IS</span><span class="plain">) &amp;&amp; (</span><span class="identifier">at</span><span class="plain"> &gt;= </span><span class="constant">0</span><span class="plain">) &amp;&amp; (</span><span class="identifier">at</span><span class="plain"> &lt; </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">)) {</span>
<span class="identifier">W</span><span class="plain">.</span><span class="element">data</span><span class="plain"> = &amp;(</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">bytecode</span><span class="plain">[</span><span class="identifier">at</span><span class="plain"> + </span><span class="constant">PREFRAME_SIZE</span><span class="plain">]);</span>
<span class="identifier">W</span><span class="plain">.</span><span class="element">extent</span><span class="plain"> = ((</span><span class="reserved">int</span><span class="plain">) </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">bytecode</span><span class="plain">[</span><span class="identifier">at</span><span class="plain"> + </span><span class="constant">PREFRAME_SKIP_AMOUNT</span><span class="plain">]) - </span><span class="constant">PREFRAME_SIZE</span><span class="plain">;</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">W</span><span class="plain">.</span><span class="element">data</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">; </span><span class="identifier">W</span><span class="plain">.</span><span class="element">extent</span><span class="plain"> = </span><span class="constant">0</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">W</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::enlarge_size<button class="popup" onclick="togglePopup('usagePopup76')">...<span class="popuptext" id="usagePopup76">Usage of <b>Inter::Warehouse::enlarge_size</b>:<br>Inter Nodes - <a href="2-in.html#SP5">&#167;5</a></span></button></span><span class="plain">(</span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">at_least</span><span class="plain">) {</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">next_size</span><span class="plain"> = </span><span class="constant">2</span><span class="plain">*</span><span class="identifier">n</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">next_size</span><span class="plain"> &lt; </span><span class="constant">128</span><span class="plain">) </span><span class="identifier">next_size</span><span class="plain"> = </span><span class="constant">128</span><span class="plain">;</span>
<span class="reserved">while</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> + </span><span class="identifier">at_least</span><span class="plain"> &gt; </span><span class="identifier">next_size</span><span class="plain">) </span><span class="identifier">next_size</span><span class="plain"> = </span><span class="constant">2</span><span class="plain">*</span><span class="identifier">next_size</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">next_size</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">inter_tree_node</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::find_room<button class="popup" onclick="togglePopup('usagePopup77')">...<span class="popuptext" id="usagePopup77">Usage of <b>Inter::Warehouse::find_room</b>:<br>Inter Nodes - <a href="2-in.html#SP4">&#167;4</a><br>Inter in Binary Files - <a href="3-iibf.html#SP1_6">&#167;1.6</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="reserved">inter_tree</span><span class="plain"> *</span><span class="identifier">I</span><span class="plain">,</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">, </span><span class="reserved">inter_error_location</span><span class="plain"> *</span><span class="identifier">eloc</span><span class="plain">, </span><span class="reserved">inter_package</span><span class="plain"> *</span><span class="identifier">owner</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"no warehouse"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">I</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"no tree supplied"</span><span class="plain">);</span>
<span class="reserved">inter_warehouse_room</span><span class="plain"> *</span><span class="identifier">IS</span><span class="plain"> = </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">first_room</span><span class="plain">;</span>
<span class="reserved">while</span><span class="plain"> (</span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="identifier">next_room</span><span class="plain">) </span><span class="identifier">IS</span><span class="plain"> = </span><span class="identifier">IS</span><span class="plain">-&gt;</span><span class="element">next_room</span><span class="plain">;</span>
<span class="reserved">warehouse_floor_space</span><span class="plain"> </span><span class="identifier">W</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::find_room_in_room</a></span><span class="plain">(</span><span class="identifier">IS</span><span class="plain">, </span><span class="identifier">n</span><span class="plain">);</span>
<span class="reserved">inter_tree_node</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain"> = </span><span class="functiontext"><a href="2-in.html#SP1">Inter::Node::new</a></span><span class="plain">(</span><span class="identifier">I</span><span class="plain">, </span><span class="identifier">W</span><span class="plain">);</span>
<span class="functiontext"><a href="2-in.html#SP3">Inter::Node::set_metadata</a></span><span class="plain">(</span><span class="identifier">F</span><span class="plain">, </span><span class="constant">PREFRAME_ORIGIN</span><span class="plain">, </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::store_origin</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="identifier">eloc</span><span class="plain">));</span>
<span class="functiontext"><a href="2-in.html#SP6">Inter::Node::attach_package</a></span><span class="plain">(</span><span class="identifier">F</span><span class="plain">, </span><span class="identifier">owner</span><span class="plain">);</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">F</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::create_resource<button class="popup" onclick="togglePopup('usagePopup78')">...<span class="popuptext" id="usagePopup78">Usage of <b>Inter::Warehouse::create_resource</b>:<br>Inter in Binary Files - <a href="3-iibf.html#SP1_4">&#167;1.4</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> &gt;= </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">) {</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">new_size</span><span class="plain"> = </span><span class="constant">128</span><span class="plain">;</span>
<span class="reserved">while</span><span class="plain"> (</span><span class="identifier">new_size</span><span class="plain"> &lt; </span><span class="constant">2</span><span class="plain">*</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">) </span><span class="identifier">new_size</span><span class="plain"> = </span><span class="constant">2</span><span class="plain">*</span><span class="identifier">new_size</span><span class="plain">;</span>
<span class="identifier">LOGIF</span><span class="plain">(</span><span class="identifier">INTER_MEMORY</span><span class="plain">, </span><span class="string">"Giving warehouse %d frame list of size %d (up from %d)\n"</span><span class="plain">,</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">allocation_id</span><span class="plain">, </span><span class="identifier">new_size</span><span class="plain">, </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">);</span>
<span class="reserved">inter_resource_holder</span><span class="plain"> *</span><span class="identifier">storage</span><span class="plain"> = (</span><span class="reserved">inter_resource_holder</span><span class="plain"> *) </span><span class="identifier">Memory::I7_calloc</span><span class="plain">(</span><span class="identifier">new_size</span><span class="plain">, </span><span class="reserved">sizeof</span><span class="plain">(</span><span class="reserved">inter_resource_holder</span><span class="plain">), </span><span class="constant">INTER_LINKS_MREASON</span><span class="plain">);</span>
<span class="reserved">inter_resource_holder</span><span class="plain"> *</span><span class="identifier">old</span><span class="plain"> = </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">;</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">i</span><span class="plain">=0; </span><span class="identifier">i</span><span class="plain">&lt;</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">; </span><span class="identifier">i</span><span class="plain">++) </span><span class="identifier">storage</span><span class="plain">[</span><span class="identifier">i</span><span class="plain">] = </span><span class="identifier">old</span><span class="plain">[</span><span class="identifier">i</span><span class="plain">];</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain"> &gt; </span><span class="constant">0</span><span class="plain">)</span>
<span class="identifier">Memory::I7_free</span><span class="plain">(</span><span class="identifier">old</span><span class="plain">, </span><span class="constant">INTER_LINKS_MREASON</span><span class="plain">, </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">capacity</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain"> = </span><span class="identifier">storage</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">capacity</span><span class="plain"> = </span><span class="identifier">new_size</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain"> ++;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> = </span><span class="constant">NO_IRSRC</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">owning_package</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_symbols_table</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_ref</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_package</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_text_stream</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_frame_list</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::store_origin<button class="popup" onclick="togglePopup('usagePopup79')">...<span class="popuptext" id="usagePopup79">Usage of <b>Inter::Warehouse::store_origin</b>:<br>none</span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="reserved">inter_error_location</span><span class="plain"> *</span><span class="identifier">eloc</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">eloc</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">eloc</span><span class="plain">-&gt;</span><span class="identifier">error_interb</span><span class="plain">) {</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">origin_file</span><span class="plain"> = </span><span class="identifier">eloc</span><span class="plain">-&gt;</span><span class="element">error_interb</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> (</span><span class="constant">inter_t</span><span class="plain">) (</span><span class="constant">0x10000000</span><span class="plain"> + </span><span class="identifier">eloc</span><span class="plain">-&gt;</span><span class="element">error_offset</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">eloc</span><span class="plain">-&gt;</span><span class="identifier">error_tfp</span><span class="plain">) {</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">origin_file</span><span class="plain"> = </span><span class="identifier">eloc</span><span class="plain">-&gt;</span><span class="element">error_tfp</span><span class="plain">-&gt;</span><span class="identifier">text_file_filename</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> (</span><span class="constant">inter_t</span><span class="plain">) (</span><span class="identifier">eloc</span><span class="plain">-&gt;</span><span class="element">error_tfp</span><span class="plain">-&gt;</span><span class="identifier">line_count</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="constant">0</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">inter_error_stash</span><span class="plain"> {</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">inter_error_location</span><span class="plain"> </span><span class="identifier">stashed_eloc</span><span class="plain">;</span>
<span class="reserved">struct</span><span class="plain"> </span><span class="identifier">text_file_position</span><span class="plain"> </span><span class="identifier">stashed_tfp</span><span class="plain">;</span>
<span class="identifier">MEMORY_MANAGEMENT</span>
<span class="plain">} </span><span class="reserved">inter_error_stash</span><span class="plain">;</span>
<span class="reserved">inter_error_location</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::retrieve_origin<button class="popup" onclick="togglePopup('usagePopup80')">...<span class="popuptext" id="usagePopup80">Usage of <b>Inter::Warehouse::retrieve_origin</b>:<br>Inter Nodes - <a href="2-in.html#SP6">&#167;6</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">C</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">warehouse</span><span class="plain">) &amp;&amp; (</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">origin_file</span><span class="plain">)) {</span>
<span class="reserved">inter_error_stash</span><span class="plain"> *</span><span class="identifier">stash</span><span class="plain"> = </span><span class="identifier">CREATE</span><span class="plain">(</span><span class="reserved">inter_error_stash</span><span class="plain">);</span>
<span class="identifier">stash</span><span class="plain">-&gt;</span><span class="element">stashed_tfp</span><span class="plain"> = </span><span class="identifier">TextFiles::nowhere</span><span class="plain">();</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">C</span><span class="plain"> &lt; </span><span class="constant">0x10000000</span><span class="plain">) {</span>
<span class="identifier">text_file_position</span><span class="plain"> *</span><span class="identifier">tfp</span><span class="plain"> = &amp;(</span><span class="identifier">stash</span><span class="plain">-&gt;</span><span class="element">stashed_tfp</span><span class="plain">);</span>
<span class="identifier">tfp</span><span class="plain">-&gt;</span><span class="identifier">text_file_filename</span><span class="plain"> = </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">origin_file</span><span class="plain">;</span>
<span class="identifier">tfp</span><span class="plain">-&gt;</span><span class="identifier">line_count</span><span class="plain"> = (</span><span class="reserved">int</span><span class="plain">) </span><span class="identifier">C</span><span class="plain">;</span>
<span class="identifier">stash</span><span class="plain">-&gt;</span><span class="element">stashed_eloc</span><span class="plain"> = </span><span class="functiontext"><a href="3-ie.html#SP1">Inter::Errors::file_location</a></span><span class="plain">(</span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">tfp</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">stash</span><span class="plain">-&gt;</span><span class="element">stashed_eloc</span><span class="plain"> = </span><span class="functiontext"><a href="3-ie.html#SP1">Inter::Errors::interb_location</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">origin_file</span><span class="plain">, (</span><span class="identifier">size_t</span><span class="plain">) (</span><span class="identifier">C</span><span class="plain"> - </span><span class="constant">0x10000000</span><span class="plain">));</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> &amp;(</span><span class="identifier">stash</span><span class="plain">-&gt;</span><span class="element">stashed_eloc</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">inter_symbols_table</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::get_symbols_table<button class="popup" onclick="togglePopup('usagePopup81')">...<span class="popuptext" id="usagePopup81">Usage of <b>Inter::Warehouse::get_symbols_table</b>:<br>Inter Trees - <a href="2-it.html#SP2">&#167;2</a><br>Inter Nodes - <a href="2-in.html#SP3">&#167;3</a><br>Inter in Binary Files - <a href="3-iibf.html#SP1_4_3">&#167;1.4.3</a>, <a href="3-iibf.html#SP1_5">&#167;1.5</a><br>The Package Construct - <a href="4-tpc3.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> == </span><span class="constant">0</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_symbols_table</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::create_symbols_table<button class="popup" onclick="togglePopup('usagePopup82')">...<span class="popuptext" id="usagePopup82">Usage of <b>Inter::Warehouse::create_symbols_table</b>:<br>Inter Trees - <a href="2-it.html#SP2">&#167;2</a><br>The Package Construct - <a href="4-tpc3.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">) {</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::create_resource</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_symbols_table</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) {</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> = </span><span class="constant">SYMBOLS_TABLE_IRSRC</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_symbols_table</span><span class="plain"> = </span><span class="functiontext"><a href="2-st.html#SP2">Inter::SymbolsTables::new</a></span><span class="plain">();</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_symbols_table</span><span class="plain">-&gt;</span><span class="element">n_index</span><span class="plain"> = (</span><span class="reserved">int</span><span class="plain">) </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::attribute_resource<button class="popup" onclick="togglePopup('usagePopup83')">...<span class="popuptext" id="usagePopup83">Usage of <b>Inter::Warehouse::attribute_resource</b>:<br>Inter Trees - <a href="2-it.html#SP2">&#167;2</a><br>The Package Construct - <a href="4-tpc3.html#SP2">&#167;2</a><br>The Kind Construct - <a href="4-tkc.html#SP2">&#167;2</a><br>The Instance Construct - <a href="4-tic.html#SP2">&#167;2</a><br>The Property Construct - <a href="4-tpc4.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">, </span><span class="reserved">inter_package</span><span class="plain"> *</span><span class="identifier">owner</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"out of range"</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">owning_package</span><span class="plain"> = </span><span class="identifier">owner</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="identifier">text_stream</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::get_text<button class="popup" onclick="togglePopup('usagePopup84')">...<span class="popuptext" id="usagePopup84">Usage of <b>Inter::Warehouse::get_text</b>:<br>Inter Nodes - <a href="2-in.html#SP3">&#167;3</a><br>Packages - <a href="2-pck.html#SP3">&#167;3</a><br>Symbols - <a href="2-sym.html#SP4">&#167;4</a><br>Transmigration - <a href="2-trn.html#SP1_2">&#167;1.2</a><br>Definition - <a href="3-dfn.html#SP3">&#167;3</a>, <a href="3-dfn.html#SP4">&#167;4</a><br>Inter Data Types - <a href="3-idt.html#SP3">&#167;3</a><br>The Metadata Construct - <a href="4-tmc.html#SP2">&#167;2</a><br>The Pragma Construct - <a href="4-tpc.html#SP2">&#167;2</a><br>The Link Construct - <a href="4-tlc.html#SP2">&#167;2</a><br>The Append Construct - <a href="4-tac.html#SP2">&#167;2</a><br>The Constant Construct - <a href="4-tcc2.html#SP2">&#167;2</a><br>The Splat Construct - <a href="5-tsc.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_text_stream</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::create_text<button class="popup" onclick="togglePopup('usagePopup85')">...<span class="popuptext" id="usagePopup85">Usage of <b>Inter::Warehouse::create_text</b>:<br>Symbols - <a href="2-sym.html#SP4">&#167;4</a><br>Transmigration - <a href="2-trn.html#SP1_2">&#167;1.2</a><br>Definition - <a href="3-dfn.html#SP3">&#167;3</a>, <a href="3-dfn.html#SP4">&#167;4</a><br>Inter Data Types - <a href="3-idt.html#SP3">&#167;3</a><br>The Metadata Construct - <a href="4-tmc.html#SP2">&#167;2</a><br>The Pragma Construct - <a href="4-tpc.html#SP2">&#167;2</a><br>The Link Construct - <a href="4-tlc.html#SP2">&#167;2</a><br>The Append Construct - <a href="4-tac.html#SP2">&#167;2</a><br>The Constant Construct - <a href="4-tcc2.html#SP2">&#167;2</a><br>The Splat Construct - <a href="5-tsc.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="reserved">inter_package</span><span class="plain"> *</span><span class="identifier">owner</span><span class="plain">) {</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::create_resource</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_text_stream</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) {</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> = </span><span class="constant">STRING_IRSRC</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_text_stream</span><span class="plain"> = </span><span class="identifier">Str::new</span><span class="plain">();</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">owning_package</span><span class="plain"> = </span><span class="identifier">owner</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">inter_package</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::get_package<button class="popup" onclick="togglePopup('usagePopup86')">...<span class="popuptext" id="usagePopup86">Usage of <b>Inter::Warehouse::get_package</b>:<br>Inter Trees - <a href="2-it.html#SP2">&#167;2</a><br>Inter Nodes - <a href="2-in.html#SP3">&#167;3</a><br>Inter in Binary Files - <a href="3-iibf.html#SP1_4_3">&#167;1.4.3</a>, <a href="3-iibf.html#SP1_6">&#167;1.6</a><br>The Package Construct - <a href="4-tpc3.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> == </span><span class="constant">0</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_package</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::create_package<button class="popup" onclick="togglePopup('usagePopup87')">...<span class="popuptext" id="usagePopup87">Usage of <b>Inter::Warehouse::create_package</b>:<br>Inter Trees - <a href="2-it.html#SP2">&#167;2</a><br>The Package Construct - <a href="4-tpc3.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="reserved">inter_tree</span><span class="plain"> *</span><span class="identifier">I</span><span class="plain">) {</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::create_resource</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_package</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) {</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> = </span><span class="constant">PACKAGE_IRSRC</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_package</span><span class="plain"> = </span><span class="functiontext"><a href="2-pck.html#SP3">Inter::Packages::new</a></span><span class="plain">(</span><span class="identifier">I</span><span class="plain">, </span><span class="identifier">n</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">owning_package</span><span class="plain"> =</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_package</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">void</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::get_ref<button class="popup" onclick="togglePopup('usagePopup88')">...<span class="popuptext" id="usagePopup88">Usage of <b>Inter::Warehouse::get_ref</b>:<br>Inter Nodes - <a href="2-in.html#SP3">&#167;3</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_ref</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::create_ref<button class="popup" onclick="togglePopup('usagePopup89')">...<span class="popuptext" id="usagePopup89">Usage of <b>Inter::Warehouse::create_ref</b>:<br>none</span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">) {</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::create_resource</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> = </span><span class="constant">REF_IRSRC</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_ref</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">inter_node_list</span><span class="plain"> *</span><span class="functiontext">Inter::Warehouse::get_frame_list<button class="popup" onclick="togglePopup('usagePopup90')">...<span class="popuptext" id="usagePopup90">Usage of <b>Inter::Warehouse::get_frame_list</b>:<br>Inter Nodes - <a href="2-in.html#SP3">&#167;3</a><br>The PropertyValue Construct - <a href="4-tpc5.html#SP2">&#167;2</a><br>The Permission Construct - <a href="4-tpc6.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">N</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">warehouse</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = (</span><span class="reserved">int</span><span class="plain">) </span><span class="identifier">N</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_frame_list</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::create_frame_list<button class="popup" onclick="togglePopup('usagePopup91')">...<span class="popuptext" id="usagePopup91">Usage of <b>Inter::Warehouse::create_frame_list</b>:<br>The Kind Construct - <a href="4-tkc.html#SP2">&#167;2</a><br>The Instance Construct - <a href="4-tic.html#SP2">&#167;2</a><br>The Property Construct - <a href="4-tpc4.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">) {</span>
<span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain"> = </span><span class="functiontext"><a href="#SP3">Inter::Warehouse::create_resource</a></span><span class="plain">(</span><span class="identifier">warehouse</span><span class="plain">);</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> = </span><span class="constant">FRAME_LIST_IRSRC</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_frame_list</span><span class="plain"> = </span><span class="functiontext"><a href="2-inl.html#SP2">Inter::Lists::new</a></span><span class="plain">();</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::set_ref<button class="popup" onclick="togglePopup('usagePopup92')">...<span class="popuptext" id="usagePopup92">Usage of <b>Inter::Warehouse::set_ref</b>:<br>none</span></button></span><span class="plain">(</span><span class="reserved">inter_warehouse</span><span class="plain"> *</span><span class="identifier">warehouse</span><span class="plain">, </span><span class="constant">inter_t</span><span class="plain"> </span><span class="identifier">n</span><span class="plain">, </span><span class="reserved">void</span><span class="plain"> *</span><span class="identifier">ref</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">n</span><span class="plain"> &gt;= (</span><span class="constant">inter_t</span><span class="plain">) </span><span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">) </span><span class="reserved">return</span><span class="plain">;</span>
<span class="identifier">warehouse</span><span class="plain">-&gt;</span><span class="identifier">stored_resources</span><span class="plain">[</span><span class="identifier">n</span><span class="plain">].</span><span class="element">stored_ref</span><span class="plain"> = </span><span class="identifier">ref</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Inter::Warehouse::wipe<button class="popup" onclick="togglePopup('usagePopup93')">...<span class="popuptext" id="usagePopup93">Usage of <b>Inter::Warehouse::wipe</b>:<br>none</span></button></span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">the_only_warehouse</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="reserved">return</span><span class="plain">;</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">i</span><span class="plain">=0; </span><span class="identifier">i</span><span class="plain">&lt;</span><span class="identifier">the_only_warehouse</span><span class="plain">-&gt;</span><span class="element">size</span><span class="plain">; </span><span class="identifier">i</span><span class="plain">++) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">the_only_warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">i</span><span class="plain">].</span><span class="element">irsrc</span><span class="plain"> == </span><span class="constant">STRING_IRSRC</span><span class="plain">) {</span>
<span class="identifier">text_stream</span><span class="plain"> *</span><span class="identifier">T</span><span class="plain"> = </span><span class="identifier">the_only_warehouse</span><span class="plain">-&gt;</span><span class="element">stored_resources</span><span class="plain">[</span><span class="identifier">i</span><span class="plain">].</span><span class="element">stored_text_stream</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">T</span><span class="plain">) {</span>
<span class="identifier">Str::clear</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">);</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">T</span><span class="plain">, </span><span class="string">"XYZZY-%d"</span><span class="plain">, </span><span class="identifier">i</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The structure warehouse_floor_space is accessed in 2/it, 2/bkm, 2/in, 2/st, 2/pck, 2/sym, 2/trn, 3/dfn, 3/iibf, 3/iitf, 3/vi, 3/idt, 4/tmc, 4/tvc, 4/tpc, 4/tlc, 4/tac, 4/tpc2, 4/tpc3, 4/tkc, 4/tdc, 4/tvc2, 4/tcc2, 4/trc, 4/tic, 4/tpc4, 4/tpc5, 4/tpc6, 4/tpc7, 5/tlc, 5/tlc2, 5/tic, 5/trc, 5/tvc, 5/tlc3, 5/tcc, 5/tec, 5/trc2, 5/tcc2, 5/tsc and here.</p>
<p class="endnote">The structure inter_error_stash is private to this section.</p>
<hr class="tocbar">
<ul class="toc"><li><a href="2-in.html">Back to 'Inter Nodes'</a></li><li><a href="2-inl.html">Continue with 'Inter Node Lists'</a></li></ul><hr class="tocbar">
<!--End of weave-->
<script>
function togglePopup(material_id) {
var popup = document.getElementById(material_id);
popup.classList.toggle("show");
}
</script>
<link href="Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
</main>
</body>
</html>