mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-05-06 01:15:11 -04:00
2 lines
7.2 KiB
HTML
2 lines
7.2 KiB
HTML
<!DOCTYPE html>
|
||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>LE (cstruct.Cstruct_cap.LE)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.1.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../../index.html">Index</a> » <a href="../../index.html">cstruct</a> » <a href="../index.html">Cstruct_cap</a> » LE</nav><header class="odoc-preamble"><h1>Module <code><span>Cstruct_cap.LE</span></code></h1></header><div class="odoc-tocs"><nav class="odoc-toc odoc-local-toc"><ul><li><a href="#little-endian-byte-order">Little-endian Byte Order</a></li></ul></nav></div><div class="odoc-content"><h4 id="little-endian-byte-order"><a href="#little-endian-byte-order" class="anchor"></a>Little-endian Byte Order</h4><p>The following operations assume a little-endian byte ordering of the cstruct. If the machine-native byte ordering differs, then the get operations will reorder the bytes so that they are in machine-native byte order before returning the result, and the set operations will reorder the bytes so that they are written out in the appropriate order.</p><p>Most modern processor architectures are little-endian, so more likely than not, these operations will not do any byte reordering.</p><div class="odoc-spec"><div class="spec value anchored" id="val-get_uint16"><a href="#val-get_uint16" class="anchor"></a><code><span><span class="keyword">val</span> get_uint16 : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-rd">rd</a></span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>int <span class="arrow">-></span></span> <a href="../index.html#type-uint16">uint16</a></span></code></div><div class="spec-doc"><p><code>get_uint16 t off</code> returns the two bytes in <code>t</code> starting at offset <code>off</code>, interpreted as an <a href="../index.html#type-uint16"><code>uint16</code></a>. <code>t</code> needs at least read capability <a href="../index.html#type-rd"><code>rd</code></a>.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Invalid_argument</code> <p>if offset <code>off</code> exceeds <code>length t - 2</code>.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_uint32"><a href="#val-get_uint32" class="anchor"></a><code><span><span class="keyword">val</span> get_uint32 : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-rd">rd</a></span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>int <span class="arrow">-></span></span> <a href="../index.html#type-uint32">uint32</a></span></code></div><div class="spec-doc"><p><code>get_uint32 t off</code> returns the four bytes in <code>t</code> starting at offset <code>off</code>. <code>t</code> needs at least read capability <a href="../index.html#type-rd"><code>rd</code></a>.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Invalid_argument</code> <p>if offset <code>off</code> exceeds <code>length t - 4</code>.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_uint64"><a href="#val-get_uint64" class="anchor"></a><code><span><span class="keyword">val</span> get_uint64 : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-rd">rd</a></span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>int <span class="arrow">-></span></span> <a href="../index.html#type-uint64">uint64</a></span></code></div><div class="spec-doc"><p><code>get_uint64 t off</code> returns the eight bytes in <code>t</code> starting at offset <code>off</code>. <code>t</code> needs at least read capability <a href="../index.html#type-rd"><code>rd</code></a>.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Invalid_argument</code> <p>if offset <code>off</code> exceeds <code>length t - 8</code>.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_uint16"><a href="#val-set_uint16" class="anchor"></a><code><span><span class="keyword">val</span> set_uint16 : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-wr">wr</a></span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>int <span class="arrow">-></span></span> <span><a href="../index.html#type-uint16">uint16</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>set_uint16 t off v</code> sets the two bytes in <code>t</code> starting at offset <code>off</code> to the value <code>v</code>. <code>t</code> needs at least write capability <a href="../index.html#type-wr"><code>wr</code></a>.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Invalid_argument</code> <p>if offset <code>off</code> exceeds <code>length t - 2</code>.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_uint32"><a href="#val-set_uint32" class="anchor"></a><code><span><span class="keyword">val</span> set_uint32 : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-wr">wr</a></span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>int <span class="arrow">-></span></span> <span><a href="../index.html#type-uint32">uint32</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>set_uint32 t off v</code> sets the four bytes in <code>t</code> starting at offset <code>off</code> to the value <code>v</code>. <code>t</code> needs at least write capability <a href="../index.html#type-wr"><code>wr</code></a>.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Invalid_argument</code> <p>if offset <code>off</code> exceeds <code>length t - 4</code>.</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_uint64"><a href="#val-set_uint64" class="anchor"></a><code><span><span class="keyword">val</span> set_uint64 : <span><span><span><span class="type-var">'a</span> <a href="../index.html#type-wr">wr</a></span> <a href="../index.html#type-t">t</a></span> <span class="arrow">-></span></span> <span>int <span class="arrow">-></span></span> <span><a href="../index.html#type-uint64">uint64</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p><code>set_uint64 t off v</code> sets the eight bytes in <code>t</code> starting at offset <code>off</code> to the value <code>v</code>. <code>t</code> needs at least write capability <a href="../index.html#type-wr"><code>wr</code></a>.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <code>Invalid_argument</code> <p>if offset <code>off</code> exceeds <code>length t - 8</code>.</p></li></ul></div></div></div></body></html>
|