Deploy to GitHub pages

This commit is contained in:
github-actions[bot] 2023-03-13 00:20:19 +00:00 • committed by GitHub
commit 2ef2c469d1
850 changed files with 332608 additions and 0 deletions

412
compiler/ic/rodfiles.html Normal file
View file

@ -0,0 +1,412 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>compiler/ic/rodfiles</title>
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="../nimdoc.out.css">
<!-- JS -->
<script type="text/javascript" src="../dochack.js"></script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">compiler/ic/rodfiles</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme:&nbsp;</label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple">
<li><a id="indexLink" href="../theindex.html">Index</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput" onkeyup="search()"/>
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li><a class="reference" id="overview_toc" href="#overview">Overview</a></li>
<ul class="simple"><li><a class="reference" id="overview-a-basic-but-wrong-example-of-the-lifecyclecolon_toc" href="#overview-a-basic-but-wrong-example-of-the-lifecyclecolon">A basic but &quot;wrong&quot; example of the lifecycle:</a></li>
<ul class="simple"><li><a class="reference" id="a-basic-but-wrong-example-of-the-lifecyclecolon-issues-with-the-example_toc" href="#a-basic-but-wrong-example-of-the-lifecyclecolon-issues-with-the-example">Issues with the Example</a></li>
</ul></ul><li><a class="reference" id="api-notes_toc" href="#api-notes">API Notes</a></li>
<ul class="simple"><li><a class="reference" id="api-notes-valid-inputs-for-rod-files_toc" href="#api-notes-valid-inputs-for-rod-files">Valid inputs for Rod files</a></li>
<li><a class="reference" id="api-notes-note-on-error-handling-style_toc" href="#api-notes-note-on-error-handling-style">Note on error handling style</a></li>
<li><a class="reference" id="api-notes-misc_toc" href="#api-notes-misc">Misc</a></li>
</ul><li>
<details open>
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#RodFile" title="RodFile = object
f*: File
currentSection*: RodSection
err*: RodFileError">RodFile</a></li>
<li><a class="reference" href="#RodFileError" title="RodFileError = enum
ok, tooBig, cannotOpen, ioFailure, wrongHeader, wrongSection, configMismatch,
includeFileChanged">RodFileError</a></li>
<li><a class="reference" href="#RodSection" title="RodSection = enum
versionSection, configSection, stringsSection, checkSumsSection, depsSection,
numbersSection, exportsSection, hiddenSection, reexportsSection,
compilerProcsSection, trmacrosSection, convertersSection, methodsSection,
pureEnumsSection, toReplaySection, topLevelSection, bodiesSection,
symsSection, typesSection, typeInstCacheSection, procInstCacheSection,
attachedOpsSection, methodsPerTypeSection, enumToStringProcsSection,
typeInfoSection, backendFlagsSection, aliveSymsSection">RodSection</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">close
<li><a class="reference" href="#close%2CRodFile" title="close(f: var RodFile)">close(f: var RodFile)</a></li>
</ul>
<ul class="simple nested-toc-section">create
<li><a class="reference" href="#create%2Cstring" title="create(filename: string): RodFile">create(filename: string): RodFile</a></li>
</ul>
<ul class="simple nested-toc-section">loadHeader
<li><a class="reference" href="#loadHeader%2CRodFile" title="loadHeader(f: var RodFile)">loadHeader(f: var RodFile)</a></li>
</ul>
<ul class="simple nested-toc-section">loadPrim
<li><a class="reference" href="#loadPrim%2CRodFile%2Cstring" title="loadPrim(f: var RodFile; s: var string)">loadPrim(f: var RodFile; s: var string)</a></li>
<li><a class="reference" href="#loadPrim%2CRodFile%2CT" title="loadPrim[T](f: var RodFile; x: var T)">loadPrim[T](f: var RodFile; x: var T)</a></li>
</ul>
<ul class="simple nested-toc-section">loadSection
<li><a class="reference" href="#loadSection%2CRodFile%2CRodSection" title="loadSection(f: var RodFile; expected: RodSection)">loadSection(f: var RodFile; expected: RodSection)</a></li>
</ul>
<ul class="simple nested-toc-section">loadSeq
<li><a class="reference" href="#loadSeq%2CRodFile%2Cseq%5BT%5D" title="loadSeq[T](f: var RodFile; s: var seq[T])">loadSeq[T](f: var RodFile; s: var seq[T])</a></li>
</ul>
<ul class="simple nested-toc-section">open
<li><a class="reference" href="#open%2Cstring" title="open(filename: string): RodFile">open(filename: string): RodFile</a></li>
</ul>
<ul class="simple nested-toc-section">storeHeader
<li><a class="reference" href="#storeHeader%2CRodFile" title="storeHeader(f: var RodFile)">storeHeader(f: var RodFile)</a></li>
</ul>
<ul class="simple nested-toc-section">storePrim
<li><a class="reference" href="#storePrim%2CRodFile%2Cstring" title="storePrim(f: var RodFile; s: string)">storePrim(f: var RodFile; s: string)</a></li>
<li><a class="reference" href="#storePrim%2CRodFile%2CT" title="storePrim[T](f: var RodFile; x: T)">storePrim[T](f: var RodFile; x: T)</a></li>
</ul>
<ul class="simple nested-toc-section">storeSection
<li><a class="reference" href="#storeSection%2CRodFile%2CRodSection" title="storeSection(f: var RodFile; s: RodSection)">storeSection(f: var RodFile; s: RodSection)</a></li>
</ul>
<ul class="simple nested-toc-section">storeSeq
<li><a class="reference" href="#storeSeq%2CRodFile%2Cseq%5BT%5D" title="storeSeq[T](f: var RodFile; s: seq[T])">storeSeq[T](f: var RodFile; s: seq[T])</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
<div id="tocRoot"></div>
<p class="module-desc"><p>Low level binary format used by the compiler to store and load various AST and related data.</p>
<p>NB: this is incredibly low level and if you're interested in how the compiler works and less a storage format, you're probably looking for the <tt class="docutils literal"><span class="pre"><span class="Identifier">ic</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Identifier">packed_ast</span></span></tt> modules to understand the logical format.</p>
<h1><a class="toc-backref" id="overview" href="#overview">Overview</a></h1><p><tt class="docutils literal"><span class="pre"><span class="Identifier">RodFile</span></span></tt> represents a Rod File (versioned binary format), and the associated data for common interactions such as IO and error tracking (<tt class="docutils literal"><span class="pre"><span class="Identifier">RodFileError</span></span></tt>). The file format broken up into sections (<tt class="docutils literal"><span class="pre"><span class="Identifier">RodSection</span></span></tt>) and preceded by a header (see: <tt class="docutils literal"><span class="pre"><span class="Identifier">cookie</span></span></tt>). The precise layout, section ordering and data following the section are determined by the user. See <tt class="docutils literal"><span class="pre"><span class="Identifier">ic</span><span class="Operator">.</span><span class="Identifier">loadRodFile</span></span></tt>.</p>
<h2><a class="toc-backref" id="overview-a-basic-but-wrong-example-of-the-lifecyclecolon" href="#overview-a-basic-but-wrong-example-of-the-lifecyclecolon">A basic but &quot;wrong&quot; example of the lifecycle:</a></h2><ol class="simple"><li><tt class="docutils literal"><span class="pre"><span class="Identifier">create</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Identifier">open</span></span></tt> - create a new one or open an existing</li>
<li><tt class="docutils literal"><span class="pre"><span class="Identifier">storeHeader</span></span></tt> - header info</li>
<li><tt class="docutils literal"><span class="pre"><span class="Identifier">storePrim</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Identifier">storeSeq</span></span></tt> - save your stuff</li>
<li><tt class="docutils literal"><span class="pre"><span class="Identifier">close</span></span></tt> - and we're done</li>
</ol>
<p>Now read the bits below to understand what's missing.</p>
<h3><a class="toc-backref" id="a-basic-but-wrong-example-of-the-lifecyclecolon-issues-with-the-example" href="#a-basic-but-wrong-example-of-the-lifecyclecolon-issues-with-the-example">Issues with the Example</a></h3><p>Missing Sections: This is a low level API, so headers and sections need to be stored and loaded by the user, see <tt class="docutils literal"><span class="pre"><span class="Identifier">storeHeader</span></span></tt> &amp; <tt class="docutils literal"><span class="pre"><span class="Identifier">loadHeader</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">storeSection</span></span></tt> &amp; <tt class="docutils literal"><span class="pre"><span class="Identifier">loadSection</span></span></tt>, respectively.</p>
<p>No Error Handling: The API is centered around IO and prone to error, each operation checks or sets the <tt class="docutils literal"><span class="pre"><span class="Identifier">RodFile</span><span class="Operator">.</span><span class="Identifier">err</span></span></tt> field. A user of this API needs to handle these appropriately.</p>
<h1><a class="toc-backref" id="api-notes" href="#api-notes">API Notes</a></h1>
<h2><a class="toc-backref" id="api-notes-valid-inputs-for-rod-files" href="#api-notes-valid-inputs-for-rod-files">Valid inputs for Rod files</a></h2><p>ASTs, hopes, dreams, and anything as long as it and any children it may have support <tt class="docutils literal"><span class="pre"><span class="Identifier">copyMem</span></span></tt>. This means anything that is not a pointer and that does not contain a pointer. At a glance these are:</p>
<ul class="simple"><li>string</li>
<li>objects &amp; tuples (fields are recursed)</li>
<li>sequences AKA <tt class="docutils literal"><span class="pre"><span class="Identifier">seq</span><span class="Punctuation">[</span><span class="Identifier">T</span><span class="Punctuation">]</span></span></tt></li>
</ul>
<h2><a class="toc-backref" id="api-notes-note-on-error-handling-style" href="#api-notes-note-on-error-handling-style">Note on error handling style</a></h2><p>A flag based approach is used where operations no-op in case of a preexisting error and set the flag if they encounter one.</p>
<h2><a class="toc-backref" id="api-notes-misc" href="#api-notes-misc">Misc</a></h2><ul class="simple"><li>'Prim' is short for 'primitive', as in a non-sequence type</li>
</ul>
</p>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="RodFile">
<dt><pre><a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">f</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">File</span>
<span class="Identifier">currentSection</span><span class="Operator">*</span><span class="Other">:</span> <a href="rodfiles.html#RodSection"><span class="Identifier">RodSection</span></a>
<span class="Identifier">err</span><span class="Operator">*</span><span class="Other">:</span> <a href="rodfiles.html#RodFileError"><span class="Identifier">RodFileError</span></a>
</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L105" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L105" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="RodFileError">
<dt><pre><a href="rodfiles.html#RodFileError"><span class="Identifier">RodFileError</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">ok</span><span class="Other">,</span> <span class="Identifier">tooBig</span><span class="Other">,</span> <span class="Identifier">cannotOpen</span><span class="Other">,</span> <span class="Identifier">ioFailure</span><span class="Other">,</span> <span class="Identifier">wrongHeader</span><span class="Other">,</span> <span class="Identifier">wrongSection</span><span class="Other">,</span> <span class="Identifier">configMismatch</span><span class="Other">,</span>
<span class="Identifier">includeFileChanged</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L101" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L101" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="RodSection">
<dt><pre><a href="rodfiles.html#RodSection"><span class="Identifier">RodSection</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">versionSection</span><span class="Other">,</span> <span class="Identifier">configSection</span><span class="Other">,</span> <span class="Identifier">stringsSection</span><span class="Other">,</span> <span class="Identifier">checkSumsSection</span><span class="Other">,</span> <span class="Identifier">depsSection</span><span class="Other">,</span>
<span class="Identifier">numbersSection</span><span class="Other">,</span> <span class="Identifier">exportsSection</span><span class="Other">,</span> <span class="Identifier">hiddenSection</span><span class="Other">,</span> <span class="Identifier">reexportsSection</span><span class="Other">,</span>
<span class="Identifier">compilerProcsSection</span><span class="Other">,</span> <span class="Identifier">trmacrosSection</span><span class="Other">,</span> <span class="Identifier">convertersSection</span><span class="Other">,</span> <span class="Identifier">methodsSection</span><span class="Other">,</span>
<span class="Identifier">pureEnumsSection</span><span class="Other">,</span> <span class="Identifier">toReplaySection</span><span class="Other">,</span> <span class="Identifier">topLevelSection</span><span class="Other">,</span> <span class="Identifier">bodiesSection</span><span class="Other">,</span>
<span class="Identifier">symsSection</span><span class="Other">,</span> <span class="Identifier">typesSection</span><span class="Other">,</span> <span class="Identifier">typeInstCacheSection</span><span class="Other">,</span> <span class="Identifier">procInstCacheSection</span><span class="Other">,</span>
<span class="Identifier">attachedOpsSection</span><span class="Other">,</span> <span class="Identifier">methodsPerTypeSection</span><span class="Other">,</span> <span class="Identifier">enumToStringProcsSection</span><span class="Other">,</span>
<span class="Identifier">typeInfoSection</span><span class="Other">,</span> <span class="Identifier">backendFlagsSection</span><span class="Other">,</span> <span class="Identifier">aliveSymsSection</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L72" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L72" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="close-procs-all">
<div id="close,RodFile">
<dt><pre><span class="Keyword">proc</span> <a href="#close%2CRodFile"><span class="Identifier">close</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L244" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L244" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="create-procs-all">
<div id="create,string">
<dt><pre><span class="Keyword">proc</span> <a href="#create%2Cstring"><span class="Identifier">create</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
create the file and open it for writing
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L239" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L239" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadHeader-procs-all">
<div id="loadHeader,RodFile">
<dt><pre><span class="Keyword">proc</span> <a href="#loadHeader%2CRodFile"><span class="Identifier">loadHeader</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Loads the header which is described by <tt class="docutils literal"><span class="pre"><span class="Identifier">cookie</span></span></tt>.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L215" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L215" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadPrim-procs-all">
<div id="loadPrim,RodFile,string">
<dt><pre><span class="Keyword">proc</span> <a href="#loadPrim%2CRodFile%2Cstring"><span class="Identifier">loadPrim</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Read a string, the length was stored as a prefix
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L168" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L168" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="loadPrim,RodFile,T">
<dt><pre><span class="Keyword">proc</span> <a href="#loadPrim%2CRodFile%2CT"><span class="Identifier">loadPrim</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">T</span><span class="Other">)</span></pre></dt>
<dd>
Load a non-sequence/string <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt>.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L180" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L180" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadSection-procs-all">
<div id="loadSection,RodFile,RodSection">
<dt><pre><span class="Keyword">proc</span> <a href="#loadSection%2CRodFile%2CRodSection"><span class="Identifier">loadSection</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">expected</span><span class="Other">:</span> <a href="rodfiles.html#RodSection"><span class="Identifier">RodSection</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
read the bytes value of s, sets and error if the section is incorrect.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L231" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L231" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadSeq-procs-all">
<div id="loadSeq,RodFile,seq[T]">
<dt><pre><span class="Keyword">proc</span> <a href="#loadSeq%2CRodFile%2Cseq%5BT%5D"><span class="Identifier">loadSeq</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
<tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt> must be compatible with <tt class="docutils literal"><span class="pre"><span class="Identifier">copyMem</span></span></tt>, see <tt class="docutils literal"><span class="pre"><span class="Identifier">loadPrim</span></span></tt>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L198" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L198" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="open-procs-all">
<div id="open,string">
<dt><pre><span class="Keyword">proc</span> <a href="#open%2Cstring"><span class="Identifier">open</span></a><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
open the file for reading
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L246" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L246" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="storeHeader-procs-all">
<div id="storeHeader,RodFile">
<dt><pre><span class="Keyword">proc</span> <a href="#storeHeader%2CRodFile"><span class="Identifier">storeHeader</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
stores the header which is described by <tt class="docutils literal"><span class="pre"><span class="Identifier">cookie</span></span></tt>.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L209" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L209" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="storePrim-procs-all">
<div id="storePrim,RodFile,string">
<dt><pre><span class="Keyword">proc</span> <a href="#storePrim%2CRodFile%2Cstring"><span class="Identifier">storePrim</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Stores a string. The len is prefixed to allow for later retreival.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L120" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L120" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="storePrim,RodFile,T">
<dt><pre><span class="Keyword">proc</span> <a href="#storePrim%2CRodFile%2CT"><span class="Identifier">storePrim</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">x</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span></pre></dt>
<dd>
Stores a non-sequence/string <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt>. If <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt> doesn't support <tt class="docutils literal"><span class="pre"><span class="Identifier">copyMem</span></span></tt> and is an object or tuple then the fields are written -- the user from context will need to know which <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt> to load.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L135" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L135" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="storeSection-procs-all">
<div id="storeSection,RodFile,RodSection">
<dt><pre><span class="Keyword">proc</span> <a href="#storeSection%2CRodFile%2CRodSection"><span class="Identifier">storeSection</span></a><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <a href="rodfiles.html#RodSection"><span class="Identifier">RodSection</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
update <tt class="docutils literal"><span class="pre"><span class="Identifier">currentSection</span></span></tt> and writes the bytes value of s.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L224" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L224" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="storeSeq-procs-all">
<div id="storeSeq,RodFile,seq[T]">
<dt><pre><span class="Keyword">proc</span> <a href="#storeSeq%2CRodFile%2Cseq%5BT%5D"><span class="Identifier">storeSeq</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">f</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="rodfiles.html#RodFile"><span class="Identifier">RodFile</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
<dd>
Stores a sequence of <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt>s, with the len as a prefix for later retrieval.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ic/rodfiles.nim#L155" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ic/rodfiles.nim#L155" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2023-03-13 00:20:13 UTC</small>
</div>
</div>
</div>
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
</body>
</html>