<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcbor: src/cbor/encoding.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libcbor
 <span id="projectnumber">0.5.0</span>
</div>
<div id="projectbrief">libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_cb565ba51d82ea933604984cbab6233d.html">cbor</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">encoding.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "<a class="el" href="common_8h_source.html">cbor/common.h</a>"</code><br />
</div>
<p><a href="encoding_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:afea0835d5129909ae6ccb4cbfc015970"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#afea0835d5129909ae6ccb4cbfc015970">cbor_encode_uint8</a> (uint8_t, unsigned char *, size_t)</td></tr>
<tr class="separator:afea0835d5129909ae6ccb4cbfc015970"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a56bfab261e1beaee3d41faf6463b04bf"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a56bfab261e1beaee3d41faf6463b04bf">cbor_encode_uint16</a> (uint16_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a56bfab261e1beaee3d41faf6463b04bf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a90ad4b026bc13f3807e4b89409773f0b"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a90ad4b026bc13f3807e4b89409773f0b">cbor_encode_uint32</a> (uint32_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a90ad4b026bc13f3807e4b89409773f0b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a235fd97a2a4d13ba6d3c4306c6a643"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a4a235fd97a2a4d13ba6d3c4306c6a643">cbor_encode_uint64</a> (uint64_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a4a235fd97a2a4d13ba6d3c4306c6a643"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7863aaacf5c10dbc7770010250525ed3"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a7863aaacf5c10dbc7770010250525ed3">cbor_encode_uint</a> (uint64_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a7863aaacf5c10dbc7770010250525ed3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa850f2be3940fbc309fc9f611ac2989b"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#aa850f2be3940fbc309fc9f611ac2989b">cbor_encode_negint8</a> (uint8_t, unsigned char *, size_t)</td></tr>
<tr class="separator:aa850f2be3940fbc309fc9f611ac2989b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0df96946a16ed6ab94d45adb7b1a14d9"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a0df96946a16ed6ab94d45adb7b1a14d9">cbor_encode_negint16</a> (uint16_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a0df96946a16ed6ab94d45adb7b1a14d9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac1854fff9cbe4be7fa08fd311d851922"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#ac1854fff9cbe4be7fa08fd311d851922">cbor_encode_negint32</a> (uint32_t, unsigned char *, size_t)</td></tr>
<tr class="separator:ac1854fff9cbe4be7fa08fd311d851922"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d803ca867e14739665283bee5b66b58"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a1d803ca867e14739665283bee5b66b58">cbor_encode_negint64</a> (uint64_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a1d803ca867e14739665283bee5b66b58"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1cc1e5a1b1ee934291abcfef75626616"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a1cc1e5a1b1ee934291abcfef75626616">cbor_encode_negint</a> (uint64_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a1cc1e5a1b1ee934291abcfef75626616"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2105cee299618a9598bc39f5ae215c0b"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a2105cee299618a9598bc39f5ae215c0b">cbor_encode_bytestring_start</a> (size_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a2105cee299618a9598bc39f5ae215c0b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a180ccc6318bf86af67bfbdd0955548df"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a180ccc6318bf86af67bfbdd0955548df">cbor_encode_indef_bytestring_start</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:a180ccc6318bf86af67bfbdd0955548df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a58f3f82978563d732a03d4b585a1a9ea"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a58f3f82978563d732a03d4b585a1a9ea">cbor_encode_string_start</a> (size_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a58f3f82978563d732a03d4b585a1a9ea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a743eaba2ad48bc23acbf567e1eb75eac"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a743eaba2ad48bc23acbf567e1eb75eac">cbor_encode_indef_string_start</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:a743eaba2ad48bc23acbf567e1eb75eac"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7cf3eb01b259b2e4ea9fddd4b1a37d9a"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a7cf3eb01b259b2e4ea9fddd4b1a37d9a">cbor_encode_array_start</a> (size_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a7cf3eb01b259b2e4ea9fddd4b1a37d9a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a12630f19ed6040b193ac79b66b3082a4"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a12630f19ed6040b193ac79b66b3082a4">cbor_encode_indef_array_start</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:a12630f19ed6040b193ac79b66b3082a4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a89ca7a5834e479190406de4fa886a975"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a89ca7a5834e479190406de4fa886a975">cbor_encode_map_start</a> (size_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a89ca7a5834e479190406de4fa886a975"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7c73f8226b908bc2e917e7d0fa3125c7"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a7c73f8226b908bc2e917e7d0fa3125c7">cbor_encode_indef_map_start</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:a7c73f8226b908bc2e917e7d0fa3125c7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a153f903a2763439d0be4dc13d8e01b81"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a153f903a2763439d0be4dc13d8e01b81">cbor_encode_tag</a> (uint64_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a153f903a2763439d0be4dc13d8e01b81"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9c298069fd256fe98007f8ebb2c3b7e4"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a9c298069fd256fe98007f8ebb2c3b7e4">cbor_encode_bool</a> (bool, unsigned char *, size_t)</td></tr>
<tr class="separator:a9c298069fd256fe98007f8ebb2c3b7e4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a01795a392b9945c416ee82f66ff5d50f"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a01795a392b9945c416ee82f66ff5d50f">cbor_encode_null</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:a01795a392b9945c416ee82f66ff5d50f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ace6e55205c8e7fb624cb1f39d46f1479"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#ace6e55205c8e7fb624cb1f39d46f1479">cbor_encode_undef</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:ace6e55205c8e7fb624cb1f39d46f1479"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a570e080b214be14a3263494b3d5d19f2"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a570e080b214be14a3263494b3d5d19f2">cbor_encode_half</a> (float, unsigned char *, size_t)</td></tr>
<tr class="memdesc:a570e080b214be14a3263494b3d5d19f2"><td class="mdescLeft"> </td><td class="mdescRight">Encodes a half-precision float. <a href="#a570e080b214be14a3263494b3d5d19f2">More...</a><br /></td></tr>
<tr class="separator:a570e080b214be14a3263494b3d5d19f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ea12535f26f24032ea9e0975cac3cec"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a7ea12535f26f24032ea9e0975cac3cec">cbor_encode_single</a> (float, unsigned char *, size_t)</td></tr>
<tr class="separator:a7ea12535f26f24032ea9e0975cac3cec"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a63da011839918fac84a7bdef9f0f24f2"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a63da011839918fac84a7bdef9f0f24f2">cbor_encode_double</a> (double, unsigned char *, size_t)</td></tr>
<tr class="separator:a63da011839918fac84a7bdef9f0f24f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaefd57d48643806d1b5bc7ba304f9060"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#aaefd57d48643806d1b5bc7ba304f9060">cbor_encode_break</a> (unsigned char *, size_t)</td></tr>
<tr class="separator:aaefd57d48643806d1b5bc7ba304f9060"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9cfc3c3ca85e6acb7258cf0fb33b3543"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="encoding_8h.html#a9cfc3c3ca85e6acb7258cf0fb33b3543">cbor_encode_ctrl</a> (uint8_t, unsigned char *, size_t)</td></tr>
<tr class="separator:a9cfc3c3ca85e6acb7258cf0fb33b3543"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7cf3eb01b259b2e4ea9fddd4b1a37d9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7cf3eb01b259b2e4ea9fddd4b1a37d9a">§ </a></span>cbor_encode_array_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_array_start </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00091">91</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a9c298069fd256fe98007f8ebb2c3b7e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c298069fd256fe98007f8ebb2c3b7e4">§ </a></span>cbor_encode_bool()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_bool </td>
<td>(</td>
<td class="paramtype">bool </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00116">116</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="aaefd57d48643806d1b5bc7ba304f9060"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaefd57d48643806d1b5bc7ba304f9060">§ </a></span>cbor_encode_break()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_break </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00178">178</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a2105cee299618a9598bc39f5ae215c0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2105cee299618a9598bc39f5ae215c0b">§ </a></span>cbor_encode_bytestring_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_bytestring_start </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00062">62</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a9cfc3c3ca85e6acb7258cf0fb33b3543"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9cfc3c3ca85e6acb7258cf0fb33b3543">§ </a></span>cbor_encode_ctrl()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_ctrl </td>
<td>(</td>
<td class="paramtype">uint8_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00183">183</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a63da011839918fac84a7bdef9f0f24f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63da011839918fac84a7bdef9f0f24f2">§ </a></span>cbor_encode_double()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_double </td>
<td>(</td>
<td class="paramtype">double </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00173">173</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a570e080b214be14a3263494b3d5d19f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a570e080b214be14a3263494b3d5d19f2">§ </a></span>cbor_encode_half()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_half </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Encodes a half-precision float. </p>
<p>Since there is no native representation or semantics for half floats in the language, we use single-precision floats, as every value that can be expressed as a half-float can also be expressed as a float.</p>
<p>This however means that not all floats passed to this function can be unambiguously encoded. The behavior is as follows:</p><ul>
<li>Infinity, NaN are preserved</li>
<li>Zero is preserved</li>
<li>Denormalized numbers keep their sign bit and 10 most significant bit of the significand</li>
<li>All other numbers<ul>
<li>If the logical value of the exponent is < -24, the output is zero</li>
<li>If the logical value of the exponent is between -23 and -14, the output is cut off to represent the 'magnitude' of the input, by which we mean (-1)^{signbit} x 1.0e{exponent}. The value in the significand is lost.</li>
<li>In all other cases, the sign bit, the exponent, and 10 most significant bits of the significand are kept</li>
</ul>
</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">value</td><td></td></tr>
<tr><td class="paramname">buffer</td><td>Target buffer </td></tr>
<tr><td class="paramname">buffer_size</td><td>Available space in the buffer </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>number of bytes written </dd></dl>
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00131">131</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a12630f19ed6040b193ac79b66b3082a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12630f19ed6040b193ac79b66b3082a4">§ </a></span>cbor_encode_indef_array_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_indef_array_start </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00096">96</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a180ccc6318bf86af67bfbdd0955548df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a180ccc6318bf86af67bfbdd0955548df">§ </a></span>cbor_encode_indef_bytestring_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_indef_bytestring_start </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00076">76</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a7c73f8226b908bc2e917e7d0fa3125c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c73f8226b908bc2e917e7d0fa3125c7">§ </a></span>cbor_encode_indef_map_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_indef_map_start </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00106">106</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a743eaba2ad48bc23acbf567e1eb75eac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a743eaba2ad48bc23acbf567e1eb75eac">§ </a></span>cbor_encode_indef_string_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_indef_string_start </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00086">86</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a89ca7a5834e479190406de4fa886a975"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89ca7a5834e479190406de4fa886a975">§ </a></span>cbor_encode_map_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_map_start </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00101">101</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a1cc1e5a1b1ee934291abcfef75626616"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cc1e5a1b1ee934291abcfef75626616">§ </a></span>cbor_encode_negint()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_negint </td>
<td>(</td>
<td class="paramtype">uint64_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00057">57</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a0df96946a16ed6ab94d45adb7b1a14d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0df96946a16ed6ab94d45adb7b1a14d9">§ </a></span>cbor_encode_negint16()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_negint16 </td>
<td>(</td>
<td class="paramtype">uint16_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00042">42</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="ac1854fff9cbe4be7fa08fd311d851922"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1854fff9cbe4be7fa08fd311d851922">§ </a></span>cbor_encode_negint32()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_negint32 </td>
<td>(</td>
<td class="paramtype">uint32_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00047">47</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a1d803ca867e14739665283bee5b66b58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d803ca867e14739665283bee5b66b58">§ </a></span>cbor_encode_negint64()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_negint64 </td>
<td>(</td>
<td class="paramtype">uint64_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00052">52</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="aa850f2be3940fbc309fc9f611ac2989b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa850f2be3940fbc309fc9f611ac2989b">§ </a></span>cbor_encode_negint8()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_negint8 </td>
<td>(</td>
<td class="paramtype">uint8_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00037">37</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a01795a392b9945c416ee82f66ff5d50f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01795a392b9945c416ee82f66ff5d50f">§ </a></span>cbor_encode_null()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_null </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00121">121</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a7ea12535f26f24032ea9e0975cac3cec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ea12535f26f24032ea9e0975cac3cec">§ </a></span>cbor_encode_single()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_single </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00167">167</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a58f3f82978563d732a03d4b585a1a9ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a58f3f82978563d732a03d4b585a1a9ea">§ </a></span>cbor_encode_string_start()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_string_start </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00081">81</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a153f903a2763439d0be4dc13d8e01b81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a153f903a2763439d0be4dc13d8e01b81">§ </a></span>cbor_encode_tag()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_tag </td>
<td>(</td>
<td class="paramtype">uint64_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00111">111</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a7863aaacf5c10dbc7770010250525ed3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7863aaacf5c10dbc7770010250525ed3">§ </a></span>cbor_encode_uint()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_uint </td>
<td>(</td>
<td class="paramtype">uint64_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00031">31</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a56bfab261e1beaee3d41faf6463b04bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56bfab261e1beaee3d41faf6463b04bf">§ </a></span>cbor_encode_uint16()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_uint16 </td>
<td>(</td>
<td class="paramtype">uint16_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00016">16</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a90ad4b026bc13f3807e4b89409773f0b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a90ad4b026bc13f3807e4b89409773f0b">§ </a></span>cbor_encode_uint32()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_uint32 </td>
<td>(</td>
<td class="paramtype">uint32_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00021">21</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="a4a235fd97a2a4d13ba6d3c4306c6a643"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a235fd97a2a4d13ba6d3c4306c6a643">§ </a></span>cbor_encode_uint64()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_uint64 </td>
<td>(</td>
<td class="paramtype">uint64_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00026">26</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="afea0835d5129909ae6ccb4cbfc015970"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afea0835d5129909ae6ccb4cbfc015970">§ </a></span>cbor_encode_uint8()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_uint8 </td>
<td>(</td>
<td class="paramtype">uint8_t </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00011">11</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
<a id="ace6e55205c8e7fb624cb1f39d46f1479"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace6e55205c8e7fb624cb1f39d46f1479">§ </a></span>cbor_encode_undef()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t cbor_encode_undef </td>
<td>(</td>
<td class="paramtype">unsigned char * </td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="encoding_8c_source.html#l00126">126</a> of file <a class="el" href="encoding_8c_source.html">encoding.c</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Feb 6 2017 00:26:19 for libcbor by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>