Files
Nim/ctypes.html
github-actions[bot] de413ab6bb Deploy to GitHub pages
2025-12-25 20:14:24 +00:00

338 lines
27 KiB
HTML

<?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" data-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>system/ctypes</title>
<!-- 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'/>
<!-- 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?v=2.3.1">
<!-- JS -->
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">system/ctypes</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-boot">
<li><a href="manual.html">Manual</a></li>
<li><a href="lib.html">Standard library</a></li>
<li> <a id="indexLink" href="theindex.html">Index</a></li>
<li><a href="compiler/theindex.html">Compiler docs</a></li>
<li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
<li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput"
oninput="search()" />
</div>
<ul class="simple simple-toc" id="toc-list">
<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="#BiggestFloat" title="BiggestFloat = float64">BiggestFloat</a></li>
<li><a class="reference" href="#BiggestInt" title="BiggestInt = int64">BiggestInt</a></li>
<li><a class="reference" href="#BiggestUInt" title="BiggestUInt = uint64">BiggestUInt</a></li>
<li><a class="reference" href="#ByteAddress" title="ByteAddress {.deprecated: &quot;use `uint`&quot;.} = int">ByteAddress</a></li>
<li><a class="reference" href="#cchar" title="cchar {.importc: &quot;char&quot;, nodecl.} = char">cchar</a></li>
<li><a class="reference" href="#cdouble" title="cdouble {.importc: &quot;double&quot;, nodecl.} = float64">cdouble</a></li>
<li><a class="reference" href="#cfloat" title="cfloat {.importc: &quot;float&quot;, nodecl.} = float32">cfloat</a></li>
<li><a class="reference" href="#cint" title="cint {.importc: &quot;int&quot;, nodecl.} = int32">cint</a></li>
<li><a class="reference" href="#clong" title="clong = ClongImpl">clong</a></li>
<li><a class="reference" href="#clongdouble" title="clongdouble {.importc: &quot;long double&quot;, nodecl.} = BiggestFloat">clongdouble</a></li>
<li><a class="reference" href="#clonglong" title="clonglong {.importc: &quot;long long&quot;, nodecl.} = int64">clonglong</a></li>
<li><a class="reference" href="#cschar" title="cschar {.importc: &quot;signed char&quot;, nodecl.} = int8">cschar</a></li>
<li><a class="reference" href="#cshort" title="cshort {.importc: &quot;short&quot;, nodecl.} = int16">cshort</a></li>
<li><a class="reference" href="#csize_t" title="csize_t {.importc: &quot;size_t&quot;, nodecl.} = uint">csize_t</a></li>
<li><a class="reference" href="#cstringArray" title="cstringArray {.importc: &quot;char**&quot;, nodecl.} = ptr UncheckedArray[cstring]">cstringArray</a></li>
<li><a class="reference" href="#cuchar" title="cuchar {.importc: &quot;unsigned char&quot;, nodecl,
deprecated: &quot;Use `char` or `uint8` instead&quot;.} = char">cuchar</a></li>
<li><a class="reference" href="#cuint" title="cuint {.importc: &quot;unsigned int&quot;, nodecl.} = uint32">cuint</a></li>
<li><a class="reference" href="#culong" title="culong = CulongImpl">culong</a></li>
<li><a class="reference" href="#culonglong" title="culonglong {.importc: &quot;unsigned long long&quot;, nodecl.} = uint64">culonglong</a></li>
<li><a class="reference" href="#cushort" title="cushort {.importc: &quot;unsigned short&quot;, nodecl.} = uint16">cushort</a></li>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
<div id="tocRoot"></div>
<p class="module-desc">Some type definitions for compatibility between different backends and platforms.</p>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="BiggestFloat">
<dt><pre><a href="ctypes.html#BiggestFloat"><span class="Identifier">BiggestFloat</span></a> <span class="Other">=</span> <a href="system.html#float64"><span class="Identifier">float64</span></a></pre></dt>
<dd>
is an alias for the biggest floating point type the Nim compiler supports. Currently this is <tt class="docutils literal"><span class="pre"><span class="Identifier">float64</span></span></tt>, but it is platform-dependent in general.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L10" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L10" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="BiggestInt">
<dt><pre><a href="ctypes.html#BiggestInt"><span class="Identifier">BiggestInt</span></a> <span class="Other">=</span> <a href="system.html#int64"><span class="Identifier">int64</span></a></pre></dt>
<dd>
is an alias for the biggest signed integer type the Nim compiler supports. Currently this is <tt class="docutils literal"><span class="pre"><span class="Identifier">int64</span></span></tt>, but it is platform-dependent in general.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L5" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L5" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="BiggestUInt">
<dt><pre><a href="ctypes.html#BiggestUInt"><span class="Identifier">BiggestUInt</span></a> <span class="Other">=</span> <a href="system.html#uint64"><span class="Identifier">uint64</span></a></pre></dt>
<dd>
is an alias for the biggest unsigned integer type the Nim compiler supports. Currently this is <tt class="docutils literal"><span class="pre"><span class="Identifier">uint64</span></span></tt>, but it is platform-dependent in general.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L15" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L15" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="ByteAddress">
<dt><pre><a href="ctypes.html#ByteAddress"><span class="Identifier">ByteAddress</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;use `uint`&quot;</span></span>.} <span class="Other">=</span> <a href="system.html#int"><span class="Identifier">int</span></a></pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> use `uint`
</div>
is the signed integer type that should be used for converting pointers to integer addresses for readability.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L95" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L95" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cchar">
<dt><pre><a href="ctypes.html#cchar"><span class="Identifier">cchar</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;char&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#char"><span class="Identifier">char</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">char</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L66" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L66" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cdouble">
<dt><pre><a href="ctypes.html#cdouble"><span class="Identifier">cdouble</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;double&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#float64"><span class="Identifier">float64</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">double</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L80" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L80" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cfloat">
<dt><pre><a href="ctypes.html#cfloat"><span class="Identifier">cfloat</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;float&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#float32"><span class="Identifier">float32</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">float</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L78" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L78" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cint">
<dt><pre><a href="ctypes.html#cint"><span class="Identifier">cint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;int&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#int32"><span class="Identifier">int32</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">int</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L72" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L72" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="clong">
<dt><pre><a href="ctypes.html#clong"><span class="Identifier">clong</span></a> <span class="Other">=</span> <span class="Identifier">ClongImpl</span></pre></dt>
<dd>
<p>Represents the <em>C</em> <tt class="docutils literal"><span class="pre"><span class="Identifier">long</span></span></tt> type, used for interoperability.</p>
<p>Its purpose is to match the <em>C</em> <tt class="docutils literal"><span class="pre"><span class="Identifier">long</span></span></tt> for the target platform's Application Binary Interface (ABI).</p>
<p>Typically, the compiler resolves it to one of the following Nim types based on the target:</p>
<ul class="simple"><li><a class="reference external" href="system.html#int32">int32</a> on Windows using MSVC or MinGW compilers.</li>
<li><a class="reference external" href="system.html#int">int</a> on Linux, macOS and other platforms that use the LP64 or ILP32 <a class="reference external" href="https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models">data models</a>.</li>
</ul>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
The underlying Nim type is an implementation detail and should not be relied upon.</div>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L26" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L26" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="clongdouble">
<dt><pre><a href="ctypes.html#clongdouble"><span class="Identifier">clongdouble</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;long double&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="ctypes.html#BiggestFloat"><span class="Identifier">BiggestFloat</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">long</span> <span class="Identifier">double</span></span></tt> in <em>C</em>. This C type is not supported by Nim's code generator.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L82" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L82" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="clonglong">
<dt><pre><a href="ctypes.html#clonglong"><span class="Identifier">clonglong</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;long long&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#int64"><span class="Identifier">int64</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">long</span> <span class="Identifier">long</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L76" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L76" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cschar">
<dt><pre><a href="ctypes.html#cschar"><span class="Identifier">cschar</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;signed char&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#int8"><span class="Identifier">int8</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">signed</span> <span class="Identifier">char</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L68" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L68" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cshort">
<dt><pre><a href="ctypes.html#cshort"><span class="Identifier">cshort</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;short&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#int16"><span class="Identifier">int16</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">short</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L70" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L70" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="csize_t">
<dt><pre><a href="ctypes.html#csize_t"><span class="Identifier">csize_t</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;size_t&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#uint"><span class="Identifier">uint</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">size_t</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L74" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L74" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cstringArray">
<dt><pre><a href="ctypes.html#cstringArray"><span class="Identifier">cstringArray</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;char**&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <span class="Keyword">ptr</span> <a href="system.html#UncheckedArray"><span class="Identifier">UncheckedArray</span></a><span class="Other">[</span><a href="system.html#cstring"><span class="Identifier">cstring</span></a><span class="Other">]</span></pre></dt>
<dd>
This is binary compatible to the type <tt class="docutils literal"><span class="pre"><span class="Identifier">char</span><span class="Operator">**</span></span></tt> in <em>C</em>. The array's high value is large enough to disable bounds checking in practice. Use <a class="reference external" href="#cstringArrayToSeq,cstringArray,Natural">cstringArrayToSeq proc</a> to convert it into a <tt class="docutils literal"><span class="pre"><span class="Identifier">seq</span><span class="Punctuation">[</span><span class="Identifier">string</span><span class="Punctuation">]</span></span></tt>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L99" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L99" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cuchar">
<dt><pre><a href="ctypes.html#cuchar"><span class="Identifier">cuchar</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;unsigned char&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span><span class="Other">,</span>
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Use `char` or `uint8` instead&quot;</span></span>.} <span class="Other">=</span> <a href="system.html#char"><span class="Identifier">char</span></a></pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Use `char` or `uint8` instead
</div>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L86" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L86" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cuint">
<dt><pre><a href="ctypes.html#cuint"><span class="Identifier">cuint</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;unsigned int&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#uint32"><span class="Identifier">uint32</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">unsigned</span> <span class="Identifier">int</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L89" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L89" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="culong">
<dt><pre><a href="ctypes.html#culong"><span class="Identifier">culong</span></a> <span class="Other">=</span> <span class="Identifier">CulongImpl</span></pre></dt>
<dd>
<p>Represents the <em>C</em> <tt class="docutils literal"><span class="pre"><span class="Identifier">unsigned</span> <span class="Identifier">long</span></span></tt> type, used for interoperability.</p>
<p>Its purpose is to match the <em>C</em> <tt class="docutils literal"><span class="pre"><span class="Identifier">unsigned</span> <span class="Identifier">long</span></span></tt> for the target platform's Application Binary Interface (ABI).</p>
<p>Typically, the compiler resolves it to one of the following Nim types based on the target:</p>
<ul class="simple"><li><a class="reference external" href="system.html#uint32">uint32</a> on Windows using MSVC or MinGW compilers.</li>
<li><a class="reference external" href="system.html#uint">uint</a> on Linux, macOS and other platforms that use the LP64 or ILP32 <a class="reference external" href="https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models">data models</a>.</li>
</ul>
<div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
The underlying Nim type is an implementation detail and should not be relied upon.</div>
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L41" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L41" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="culonglong">
<dt><pre><a href="ctypes.html#culonglong"><span class="Identifier">culonglong</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;unsigned long long&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#uint64"><span class="Identifier">uint64</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">unsigned</span> <span class="Identifier">long</span> <span class="Identifier">long</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L91" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L91" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="cushort">
<dt><pre><a href="ctypes.html#cushort"><span class="Identifier">cushort</span></a> {.<span class="Identifier">importc</span><span class="Other">:</span> <span class="StringLit">&quot;unsigned short&quot;</span><span class="Other">,</span> <span class="Identifier">nodecl</span>.} <span class="Other">=</span> <a href="system.html#uint16"><span class="Identifier">uint16</span></a></pre></dt>
<dd>
This is the same as the type <tt class="docutils literal"><span class="pre"><span class="Identifier">unsigned</span> <span class="Identifier">short</span></span></tt> in <em>C</em>.
<a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/ctypes.nim#L87" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/ctypes.nim#L87" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</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: 2025-12-25 20:14:03 UTC</small>
</div>
</div>
</div>
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>