Update documentation

This commit is contained in:
Ganesh Viswanathan 2019-05-08 23:53:01 -05:00
commit 451472ac3e
9 changed files with 32 additions and 14 deletions

View file

@ -1264,7 +1264,7 @@ function main() {
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:17 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:53:00 UTC</small>
</div>
</div>
</div>

View file

@ -1281,8 +1281,9 @@ function main() {
title="cIncludeDir(dir: static string): untyped"><wbr />c<wbr />Include<wbr />Dir<span class="attachedType" style="visibility:hidden"></span></a></li>
<li><a class="reference" href="#cCompile.m%2C%2Cstring%2Cstring"
title="cCompile(path: static string; mode = &quot;c&quot;; exclude = &quot;&quot;): untyped"><wbr />c<wbr />Compile<span class="attachedType" style="visibility:hidden"></span></a></li>
<li><a class="reference" href="#cImport.m%2C"
title="cImport(filename: static string; recurse: static bool = false): untyped"><wbr />c<wbr />Import<span class="attachedType" style="visibility:hidden"></span></a></li>
<li><a class="reference" href="#cImport.m%2C%2Cstring"
title="cImport(filename: static string; recurse: static bool = false;
dynlib: static string = &quot;&quot;): untyped"><wbr />c<wbr />Import<span class="attachedType" style="visibility:hidden"></span></a></li>
</ul>
</li>
@ -1445,11 +1446,26 @@ Add an include directory that is forwarded to the C/C++ compiler using <tt class
<pre class="listing"><span class="Identifier">cCompile</span><span class="Punctuation">(</span><span class="StringLit">&quot;path/to/dir&quot;</span><span class="Punctuation">,</span> <span class="Identifier">exclude</span><span class="Operator">=</span><span class="StringLit">&quot;test2.c&quot;</span><span class="Punctuation">)</span></pre>
</dd>
<a id="cImport.m,"></a>
<dt><pre><span class="Keyword">macro</span> <span class="Identifier">cImport</span><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <span class="Identifier">static</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">recurse</span><span class="Other">:</span> <span class="Identifier">static</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
<a id="cImport.m,,string"></a>
<dt><pre><span class="Keyword">macro</span> <span class="Identifier">cImport</span><span class="Other">(</span><span class="Identifier">filename</span><span class="Other">:</span> <span class="Identifier">static</span> <span class="Identifier">string</span><span class="Other">;</span> <span class="Identifier">recurse</span><span class="Other">:</span> <span class="Identifier">static</span> <span class="Identifier">bool</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">;</span>
<span class="Identifier">dynlib</span><span class="Other">:</span> <span class="Identifier">static</span> <span class="Identifier">string</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt>
<dd>
<p>Import all supported definitions from specified header file. Generated content is cached in <tt class="docutils literal"><span class="pre">nimcache</span></tt> until <tt class="docutils literal"><span class="pre">filename</span></tt> changes unless <a class="reference external" href="cimport.html#cDisableCaching,">cDisableCaching()</a> is set. <tt class="docutils literal"><span class="pre">nim -f</span></tt> can also be used after Nim v0.19.4 to flush the cache.</p>
<p><tt class="docutils literal"><span class="pre">recurse</span></tt> can be used to generate Nim wrappers from <tt class="docutils literal"><span class="pre">#include</span></tt> files referenced in <tt class="docutils literal"><span class="pre">filename</span></tt>. This is only done for files in the same directory as <tt class="docutils literal"><span class="pre">filename</span></tt> or in a directory added using <a class="reference external" href="cimport.html#cIncludeDir.m,">cIncludeDir()</a></p>
<p><tt class="docutils literal"><span class="pre">dynlib</span></tt> can be used to specify the Nim string to use to specify the dynamic library to load the imported symbols from. For example:</p>
<pre class="listing"><span class="Keyword">const</span>
<span class="Identifier">dynpcre</span> <span class="Operator">=</span>
<span class="Keyword">when</span> <span class="Identifier">defined</span><span class="Punctuation">(</span><span class="Identifier">windows</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
<span class="Keyword">when</span> <span class="Identifier">defined</span><span class="Punctuation">(</span><span class="Identifier">cpu64</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
<span class="StringLit">&quot;pcre64.dll&quot;</span>
<span class="Keyword">else</span><span class="Punctuation">:</span>
<span class="StringLit">&quot;pcre32.dll&quot;</span>
<span class="Keyword">elif</span> <span class="Identifier">hostOS</span> <span class="Operator">==</span> <span class="StringLit">&quot;macosx&quot;</span><span class="Punctuation">:</span>
<span class="StringLit">&quot;libpcre(.3|.1|).dylib&quot;</span>
<span class="Keyword">else</span><span class="Punctuation">:</span>
<span class="StringLit">&quot;libpcre.so(.3|.1|)&quot;</span>
<span class="Identifier">cImport</span><span class="Punctuation">(</span><span class="StringLit">&quot;pcre.h&quot;</span><span class="Punctuation">,</span> <span class="Identifier">dynlib</span><span class="Operator">=</span><span class="StringLit">&quot;dynpcre&quot;</span><span class="Punctuation">)</span></pre><p>If <tt class="docutils literal"><span class="pre">dynlib</span></tt> is not specified, the C/C++ implementation files can be compiled in with <a class="reference external" href="cimport.html#cCompile.m,,string">cCompile()</a>, or the <cite>{.passL.}</cite> pragma can be used to specify the static lib to link.</p>
</dd>
@ -1463,7 +1479,7 @@ Add an include directory that is forwarded to the C/C++ compiler using <tt class
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:17 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:53:00 UTC</small>
</div>
</div>
</div>

View file

@ -9,4 +9,4 @@ cAddSearchDir cimport.html#cAddSearchDir,string cimport: cAddSearchDir(dir: stri
cIncludeDir cimport.html#cIncludeDir.m, cimport: cIncludeDir(dir: static string): untyped
cAddStdDir cimport.html#cAddStdDir,string cimport: cAddStdDir(mode = &quot;c&quot;)
cCompile cimport.html#cCompile.m,,string,string cimport: cCompile(path: static string; mode = &quot;c&quot;; exclude = &quot;&quot;): untyped
cImport cimport.html#cImport.m, cimport: cImport(filename: static string; recurse: static bool = false): untyped
cImport cimport.html#cImport.m,,string cimport: cImport(filename: static string; recurse: static bool = false;\n dynlib: static string = &quot;&quot;): untyped

View file

@ -1281,7 +1281,7 @@ naive version of <cite>os.relativePath</cite> ; remove after nim &gt;= 0.19.9
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:14 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:52:57 UTC</small>
</div>
</div>
</div>

View file

@ -1368,7 +1368,7 @@ function main() {
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:14 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:52:58 UTC</small>
</div>
</div>
</div>

View file

@ -1312,7 +1312,7 @@ all nimterop generated files go under here (gitignored)
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:12 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:52:55 UTC</small>
</div>
</div>
</div>

View file

@ -1287,7 +1287,7 @@ function main() {
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:12 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:52:55 UTC</small>
</div>
</div>
</div>

View file

@ -1247,7 +1247,9 @@ function main() {
</ul></dd>
<dt><a name="cImport" href="#cImport"><span>cImport:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
data-doc-search-tag="cimport: cImport(filename: static string; recurse: static bool = false): untyped" href="cimport.html#cImport.m%2C">cimport: cImport(filename: static string; recurse: static bool = false): untyped</a></li>
data-doc-search-tag="cimport: cImport(filename: static string; recurse: static bool = false;
dynlib: static string = &quot;&quot;): untyped" href="cimport.html#cImport.m%2C%2Cstring">cimport: cImport(filename: static string; recurse: static bool = false;
dynlib: static string = &quot;&quot;): untyped</a></li>
</ul></dd>
<dt><a name="cIncludeDir" href="#cIncludeDir"><span>cIncludeDir:</span></a></dt><dd><ul class="simple">
<li><a class="reference external"
@ -1370,7 +1372,7 @@ function main() {
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:17 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:53:01 UTC</small>
</div>
</div>
</div>

View file

@ -1315,7 +1315,7 @@ function main() {
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small>Made with Nim. Generated: 2019-05-09 02:07:14 UTC</small>
<small>Made with Nim. Generated: 2019-05-09 04:52:58 UTC</small>
</div>
</div>
</div>