Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

<!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/common.h Source File</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
   &#160;<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="headertitle">
<div class="title">common.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="common_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2014-2015 Pavel Kalvoda &lt;me@pavelkalvoda.com&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libcbor is free software; you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the MIT license. See LICENSE for details.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef LIBCBOR_COMMON_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define LIBCBOR_COMMON_H</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;stdint.h&gt;</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;assert.h&gt;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="data_8h.html">data.h</a>&quot;</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;cbor/configuration.h&quot;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#define CBOR_RESTRICT_POINTER</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">// MSVC + C++ workaround</span></div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="common_8h.html#a9ac79315ed2dcf2c9587e8e3a9a6bc97">   33</a></span>&#160;<span class="preprocessor">#define CBOR_RESTRICT_POINTER CBOR_RESTRICT_SPECIFIER</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t cbor_major_version = CBOR_MAJOR_VERSION;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t cbor_minor_version = CBOR_MINOR_VERSION;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t cbor_patch_version = CBOR_PATCH_VERSION;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="common_8h.html#a956e417f98370dd1a96e4dac2e0ed7dd">   41</a></span>&#160;<span class="preprocessor">#define CBOR_VERSION TO_STR(CBOR_MAJOR_VERSION) &quot;.&quot; TO_STR(CBOR_MINOR_VERSION) &quot;.&quot; TO_STR(CBOR_PATCH_VERSION)</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="common_8h.html#ac61efb646fdd1936ac0ce32829f947b8">   42</a></span>&#160;<span class="preprocessor">#define CBOR_HEX_VERSION ((CBOR_MAJOR_VERSION &lt;&lt; 16) | (CBOR_MINOR_VERSION &lt;&lt; 8) | CBOR_PATCH_VERSION)</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="comment">/* http://stackoverflow.com/questions/1644868/c-define-macro-for-debug-printing */</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#define debug_print(fmt, ...) do { \</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">    if (DEBUG) \</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">        fprintf(stderr, &quot;%s:%d:%s(): &quot; fmt, __FILE__, __LINE__, __func__, __VA_ARGS__); \</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">    } while (0)</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="common_8h.html#a7377cc956f5c81538f0fbf0a0492a539">   53</a></span>&#160;<span class="preprocessor">#define debug_print(fmt, ...) do {} while (0)</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="common_8h.html#a4576b20b5200a67aa939a1ce7fc27bd9">   56</a></span>&#160;<span class="preprocessor">#define TO_STR_(x) #x</span></div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="common_8h.html#ae45fd01d870751555ae09a0257f40eb2">   57</a></span>&#160;<span class="preprocessor">#define TO_STR(x) TO_STR_(x) </span><span class="comment">/* enables proper double expansion */</span><span class="preprocessor"></span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">#if CBOR_CUSTOM_ALLOC</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">   61</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">void</span> * (* _cbor_malloc_t)(size_t);</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="common_8h.html#a5b52369a95930104d33301d12faabe75">   62</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">void</span> * (* _cbor_realloc_t)(<span class="keywordtype">void</span> *, size_t);</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">   63</a></span>&#160;<span class="keyword">typedef</span> void (* <a class="code" href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a>)(<span class="keywordtype">void</span> *);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="keyword">extern</span> <a class="code" href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">_cbor_malloc_t</a> <a class="code" href="common_8h.html#a3218c24af00a3efeaecb1716c8f5a289">_cbor_malloc</a>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">extern</span> <a class="code" href="common_8h.html#a5b52369a95930104d33301d12faabe75">_cbor_realloc_t</a> <a class="code" href="common_8h.html#a84ecc1fc92c3812ab6ced693f2c6254c">_cbor_realloc</a>;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keyword">extern</span> <a class="code" href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a> <a class="code" href="common_8h.html#a994f4145360ef0bfa3c48e59a5ca7186">_cbor_free</a>;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keywordtype">void</span> <a class="code" href="common_8h.html#a3f9f1d527374dbb4b48ef3fafa92e0bf">cbor_set_allocs</a>(<a class="code" href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">_cbor_malloc_t</a> custom_malloc, <a class="code" href="common_8h.html#a5b52369a95930104d33301d12faabe75">_cbor_realloc_t</a> custom_realloc, <a class="code" href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a> custom_free);</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="common_8h.html#a07a781e9212fad361b0f59f7fc921057">   84</a></span>&#160;<span class="preprocessor">#define _CBOR_MALLOC _cbor_malloc</span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="common_8h.html#a1e39038d9b8e9b3a1e6529c9ff6091b8">   85</a></span>&#160;<span class="preprocessor">#define _CBOR_REALLOC _cbor_realloc</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">   86</a></span>&#160;<span class="preprocessor">#define _CBOR_FREE _cbor_free</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#define _CBOR_MALLOC malloc</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#define _CBOR_REALLOC realloc</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">#define _CBOR_FREE free</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="comment">* ============================================================================</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="comment">* Type manipulation</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="comment">* ============================================================================</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6">cbor_type</a> <a class="code" href="common_8h.html#ac2b9aba4cf07857524a0a520eabeef52">cbor_typeof</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item); <span class="comment">/* Will be inlined iff link-time opt is enabled */</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="comment">/* Standard item types as described by the RFC */</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a682a023f7012a5b66a57847e6f8d386f">cbor_isa_uint</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a0ca5042e3807d2cc9c3d40f9266460dd">cbor_isa_negint</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#adedaf37527b8d8261e287a0001e5a190">cbor_isa_bytestring</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a02edd93bb8eab83bc2b8f8bf5d7d1335">cbor_isa_string</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a9ed0fa96105c211867c5032f2a5a8b20">cbor_isa_array</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#af0de041481b61922d0995b63f82d8ddd">cbor_isa_map</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a0d5054202c5ec9375e8daf5930087a61">cbor_isa_tag</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="comment">/* Practical types with respect to their semantics (but not tag values) */</span></div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a4e705f34221ba434756a4a1f8e3325e6">cbor_is_int</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a4dde28c548375aa954f1cad15b3739aa">cbor_is_float</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#a5618a3689e31829f4f84da008e20798e">cbor_is_bool</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#ad1f5efac647b4d9c437c4441d1177e01">cbor_is_null</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="common_8h.html#afb7eb76a2953224c96d194640f3092e3">cbor_is_undef</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="comment">* ============================================================================</span></div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<span class="comment">* Memory management</span></div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="comment">* ============================================================================</span></div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="common_8h.html#aa62e72f275c2f0fa604896bfed18e992">cbor_incref</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;<span class="keywordtype">void</span> <a class="code" href="common_8h.html#aa10ebec46eddc9312ec46a0898b5d196">cbor_decref</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> ** item);</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;<span class="keywordtype">void</span> <a class="code" href="common_8h.html#a4ed20937cc091bc1f481d53787fe306b">cbor_intermediate_decref</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="common_8h.html#ab27dda20ad909cebaee1b2f43e676f2c">cbor_refcount</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="common_8h.html#a327dce45c1cb680953555290dba8e35b">cbor_move</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item);</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;}</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="preprocessor">#endif //LIBCBOR_COMMON_H</span></div><div class="ttc" id="common_8h_html_af05bb33f6d22cdac535576c8edaf208c"><div class="ttname"><a href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a></div><div class="ttdeci">void(* _cbor_free_t)(void *)</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00063">common.h:63</a></div></div>
<div class="ttc" id="common_8h_html_aa10ebec46eddc9312ec46a0898b5d196"><div class="ttname"><a href="common_8h.html#aa10ebec46eddc9312ec46a0898b5d196">cbor_decref</a></div><div class="ttdeci">void cbor_decref(cbor_item_t **item)</div><div class="ttdoc">Decreases the reference count by one, deallocating the item if needed. </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00099">common.c:99</a></div></div>
<div class="ttc" id="common_8h_html_a4ed20937cc091bc1f481d53787fe306b"><div class="ttname"><a href="common_8h.html#a4ed20937cc091bc1f481d53787fe306b">cbor_intermediate_decref</a></div><div class="ttdeci">void cbor_intermediate_decref(cbor_item_t *item)</div><div class="ttdoc">Decreases the reference count by one, deallocating the item if needed. </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00174">common.c:174</a></div></div>
<div class="ttc" id="common_8h_html_a02edd93bb8eab83bc2b8f8bf5d7d1335"><div class="ttname"><a href="common_8h.html#a02edd93bb8eab83bc2b8f8bf5d7d1335">cbor_isa_string</a></div><div class="ttdeci">bool cbor_isa_string(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00033">common.c:33</a></div></div>
<div class="ttc" id="data_8h_html"><div class="ttname"><a href="data_8h.html">data.h</a></div></div>
<div class="ttc" id="common_8h_html_a327dce45c1cb680953555290dba8e35b"><div class="ttname"><a href="common_8h.html#a327dce45c1cb680953555290dba8e35b">cbor_move</a></div><div class="ttdeci">cbor_item_t * cbor_move(cbor_item_t *item)</div><div class="ttdoc">Provides CPP-like move construct. </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00184">common.c:184</a></div></div>
<div class="ttc" id="common_8h_html_afb7eb76a2953224c96d194640f3092e3"><div class="ttname"><a href="common_8h.html#afb7eb76a2953224c96d194640f3092e3">cbor_is_undef</a></div><div class="ttdeci">bool cbor_is_undef(const cbor_item_t *item)</div><div class="ttdoc">Does this item represent undefined </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00082">common.c:82</a></div></div>
<div class="ttc" id="common_8h_html_a0ca5042e3807d2cc9c3d40f9266460dd"><div class="ttname"><a href="common_8h.html#a0ca5042e3807d2cc9c3d40f9266460dd">cbor_isa_negint</a></div><div class="ttdeci">bool cbor_isa_negint(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00023">common.c:23</a></div></div>
<div class="ttc" id="common_8h_html_a5b52369a95930104d33301d12faabe75"><div class="ttname"><a href="common_8h.html#a5b52369a95930104d33301d12faabe75">_cbor_realloc_t</a></div><div class="ttdeci">void *(* _cbor_realloc_t)(void *, size_t)</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00062">common.h:62</a></div></div>
<div class="ttc" id="common_8h_html_aa62e72f275c2f0fa604896bfed18e992"><div class="ttname"><a href="common_8h.html#aa62e72f275c2f0fa604896bfed18e992">cbor_incref</a></div><div class="ttdeci">cbor_item_t * cbor_incref(cbor_item_t *item)</div><div class="ttdoc">Increases the reference count by one. </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00093">common.c:93</a></div></div>
<div class="ttc" id="common_8h_html_a994f4145360ef0bfa3c48e59a5ca7186"><div class="ttname"><a href="common_8h.html#a994f4145360ef0bfa3c48e59a5ca7186">_cbor_free</a></div><div class="ttdeci">_cbor_free_t _cbor_free</div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00012">allocators.c:12</a></div></div>
<div class="ttc" id="common_8h_html_a0d5054202c5ec9375e8daf5930087a61"><div class="ttname"><a href="common_8h.html#a0d5054202c5ec9375e8daf5930087a61">cbor_isa_tag</a></div><div class="ttdeci">bool cbor_isa_tag(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00048">common.c:48</a></div></div>
<div class="ttc" id="common_8h_html_a983dec76e934c49ed6979226f9db4386"><div class="ttname"><a href="common_8h.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a></div><div class="ttdeci">bool cbor_isa_float_ctrl(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00053">common.c:53</a></div></div>
<div class="ttc" id="common_8h_html_a9ed0fa96105c211867c5032f2a5a8b20"><div class="ttname"><a href="common_8h.html#a9ed0fa96105c211867c5032f2a5a8b20">cbor_isa_array</a></div><div class="ttdeci">bool cbor_isa_array(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00038">common.c:38</a></div></div>
<div class="ttc" id="common_8h_html_a682a023f7012a5b66a57847e6f8d386f"><div class="ttname"><a href="common_8h.html#a682a023f7012a5b66a57847e6f8d386f">cbor_isa_uint</a></div><div class="ttdeci">bool cbor_isa_uint(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00018">common.c:18</a></div></div>
<div class="ttc" id="common_8h_html_af0de041481b61922d0995b63f82d8ddd"><div class="ttname"><a href="common_8h.html#af0de041481b61922d0995b63f82d8ddd">cbor_isa_map</a></div><div class="ttdeci">bool cbor_isa_map(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00043">common.c:43</a></div></div>
<div class="ttc" id="common_8h_html_a3f9f1d527374dbb4b48ef3fafa92e0bf"><div class="ttname"><a href="common_8h.html#a3f9f1d527374dbb4b48ef3fafa92e0bf">cbor_set_allocs</a></div><div class="ttdeci">void cbor_set_allocs(_cbor_malloc_t custom_malloc, _cbor_realloc_t custom_realloc, _cbor_free_t custom_free)</div><div class="ttdoc">Sets the memory management routines to use. </div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00014">allocators.c:14</a></div></div>
<div class="ttc" id="common_8h_html_ad89d15c2e3f18e8914fcdffe4d725d42"><div class="ttname"><a href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">_cbor_malloc_t</a></div><div class="ttdeci">void *(* _cbor_malloc_t)(size_t)</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00061">common.h:61</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6">cbor_type</a></div><div class="ttdeci">cbor_type</div><div class="ttdoc">Specifies the Major type of cbor_item_t. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00024">data.h:24</a></div></div>
<div class="ttc" id="common_8h_html_a5618a3689e31829f4f84da008e20798e"><div class="ttname"><a href="common_8h.html#a5618a3689e31829f4f84da008e20798e">cbor_is_bool</a></div><div class="ttdeci">bool cbor_is_bool(const cbor_item_t *item)</div><div class="ttdoc">Is the item an a boolean? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00071">common.c:71</a></div></div>
<div class="ttc" id="common_8h_html_a4dde28c548375aa954f1cad15b3739aa"><div class="ttname"><a href="common_8h.html#a4dde28c548375aa954f1cad15b3739aa">cbor_is_float</a></div><div class="ttdeci">bool cbor_is_float(const cbor_item_t *item)</div><div class="ttdoc">Is the item an a floating point number? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00087">common.c:87</a></div></div>
<div class="ttc" id="common_8h_html_a3218c24af00a3efeaecb1716c8f5a289"><div class="ttname"><a href="common_8h.html#a3218c24af00a3efeaecb1716c8f5a289">_cbor_malloc</a></div><div class="ttdeci">_cbor_malloc_t _cbor_malloc</div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00010">allocators.c:10</a></div></div>
<div class="ttc" id="common_8h_html_a4e705f34221ba434756a4a1f8e3325e6"><div class="ttname"><a href="common_8h.html#a4e705f34221ba434756a4a1f8e3325e6">cbor_is_int</a></div><div class="ttdeci">bool cbor_is_int(const cbor_item_t *item)</div><div class="ttdoc">Is the item an integer, either positive or negative? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00065">common.c:65</a></div></div>
<div class="ttc" id="common_8h_html_adedaf37527b8d8261e287a0001e5a190"><div class="ttname"><a href="common_8h.html#adedaf37527b8d8261e287a0001e5a190">cbor_isa_bytestring</a></div><div class="ttdeci">bool cbor_isa_bytestring(const cbor_item_t *item)</div><div class="ttdoc">Does the item have the appropriate major type? </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00028">common.c:28</a></div></div>
<div class="ttc" id="common_8h_html_ac2b9aba4cf07857524a0a520eabeef52"><div class="ttname"><a href="common_8h.html#ac2b9aba4cf07857524a0a520eabeef52">cbor_typeof</a></div><div class="ttdeci">cbor_type cbor_typeof(const cbor_item_t *item)</div><div class="ttdoc">Get the type of the item. </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00059">common.c:59</a></div></div>
<div class="ttc" id="common_8h_html_ad1f5efac647b4d9c437c4441d1177e01"><div class="ttname"><a href="common_8h.html#ad1f5efac647b4d9c437c4441d1177e01">cbor_is_null</a></div><div class="ttdeci">bool cbor_is_null(const cbor_item_t *item)</div><div class="ttdoc">Does this item represent null </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00077">common.c:77</a></div></div>
<div class="ttc" id="structcbor__item__t_html"><div class="ttname"><a href="structcbor__item__t.html">cbor_item_t</a></div><div class="ttdoc">The item handle. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00149">data.h:149</a></div></div>
<div class="ttc" id="common_8h_html_a84ecc1fc92c3812ab6ced693f2c6254c"><div class="ttname"><a href="common_8h.html#a84ecc1fc92c3812ab6ced693f2c6254c">_cbor_realloc</a></div><div class="ttdeci">_cbor_realloc_t _cbor_realloc</div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00011">allocators.c:11</a></div></div>
<div class="ttc" id="common_8h_html_ab27dda20ad909cebaee1b2f43e676f2c"><div class="ttname"><a href="common_8h.html#ab27dda20ad909cebaee1b2f43e676f2c">cbor_refcount</a></div><div class="ttdeci">size_t cbor_refcount(const cbor_item_t *item)</div><div class="ttdoc">Get the reference count. </div><div class="ttdef"><b>Definition:</b> <a href="common_8c_source.html#l00179">common.c:179</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Feb 6 2017 00:26:19 for libcbor by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>