<!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.c 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
 <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.c</div> </div>
</div><!--header-->
<div class="contents">
<a href="common_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2014-2017 Pavel Kalvoda <me@pavelkalvoda.com></span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <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> <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> <span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> </div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "<a class="code" href="common_8h.html">cbor/common.h</a>"</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include "<a class="code" href="arrays_8h.html">arrays.h</a>"</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "<a class="code" href="bytestrings_8h.html">bytestrings.h</a>"</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "<a class="code" href="data_8h.html">data.h</a>"</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include "<a class="code" href="floats__ctrls_8h.html">floats_ctrls.h</a>"</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#include "<a class="code" href="ints_8h.html">ints.h</a>"</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include "<a class="code" href="maps_8h.html">maps.h</a>"</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include "<a class="code" href="strings_8h.html">strings.h</a>"</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="tags_8h.html">tags.h</a>"</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="common_8h.html#a682a023f7012a5b66a57847e6f8d386f"> 18</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00019"></a><span class="lineno"> 19</span> {</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a2137d55d8028e37ff4319a633ef0634f">CBOR_TYPE_UINT</a>;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> }</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="common_8h.html#a0ca5042e3807d2cc9c3d40f9266460dd"> 23</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00024"></a><span class="lineno"> 24</span> {</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae140516103af792c8f2af84390acfdcd">CBOR_TYPE_NEGINT</a>;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> }</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="common_8h.html#adedaf37527b8d8261e287a0001e5a190"> 28</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00029"></a><span class="lineno"> 29</span> {</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a70b9f0b5958c8d51f15ad7bb7c4af01d">CBOR_TYPE_BYTESTRING</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> }</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="common_8h.html#a02edd93bb8eab83bc2b8f8bf5d7d1335"> 33</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00034"></a><span class="lineno"> 34</span> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae05102a66420250eacd5f17b95d04443">CBOR_TYPE_STRING</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> }</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="common_8h.html#a9ed0fa96105c211867c5032f2a5a8b20"> 38</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00039"></a><span class="lineno"> 39</span> {</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae48b04b3538ade49d7eae9ee6b656103">CBOR_TYPE_ARRAY</a>;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> }</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="common_8h.html#af0de041481b61922d0995b63f82d8ddd"> 43</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00044"></a><span class="lineno"> 44</span> {</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a057fc3133cb4465f9eb734acfd195db2">CBOR_TYPE_MAP</a>;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> }</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="common_8h.html#a0d5054202c5ec9375e8daf5930087a61"> 48</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00049"></a><span class="lineno"> 49</span> {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a16f0eaf29eeea66fe37ec1ed0fa45415">CBOR_TYPE_TAG</a>;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="common_8h.html#a983dec76e934c49ed6979226f9db4386"> 53</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00054"></a><span class="lineno"> 54</span> {</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a> == <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a1276dcc4ac56df5fd7e0270344a6e57d">CBOR_TYPE_FLOAT_CTRL</a>;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="common_8h.html#ac2b9aba4cf07857524a0a520eabeef52"> 59</a></span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6">cbor_type</a> <a class="code" href="common_8c.html#ac2b9aba4cf07857524a0a520eabeef52">cbor_typeof</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="l00060"></a><span class="lineno"> 60</span> {</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a>;</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="common_8h.html#a4e705f34221ba434756a4a1f8e3325e6"> 65</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00066"></a><span class="lineno"> 66</span> {</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">return</span> <a class="code" href="common_8c.html#a682a023f7012a5b66a57847e6f8d386f">cbor_isa_uint</a>(item) || <a class="code" href="common_8c.html#a0ca5042e3807d2cc9c3d40f9266460dd">cbor_isa_negint</a>(item);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="common_8h.html#a5618a3689e31829f4f84da008e20798e"> 71</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00072"></a><span class="lineno"> 72</span> {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">return</span> <a class="code" href="common_8c.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a>(item) &&</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  (<a class="code" href="floats__ctrls_8c.html#a9d15faa0a33797ce0b8a1a66d5773d88">cbor_ctrl_value</a>(item) == <a class="code" href="data_8h.html#a6454b577999b479ac2585af7c204ae3babbcec81d7145fdf31329e07a0bb064bd">CBOR_CTRL_FALSE</a> || <a class="code" href="floats__ctrls_8c.html#a9d15faa0a33797ce0b8a1a66d5773d88">cbor_ctrl_value</a>(item) == <a class="code" href="data_8h.html#a6454b577999b479ac2585af7c204ae3baf4f149be1611cec155482645ff2be8de">CBOR_CTRL_TRUE</a>);</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> }</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="common_8h.html#ad1f5efac647b4d9c437c4441d1177e01"> 77</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00078"></a><span class="lineno"> 78</span> {</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> <a class="code" href="common_8c.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a>(item) && <a class="code" href="floats__ctrls_8c.html#a9d15faa0a33797ce0b8a1a66d5773d88">cbor_ctrl_value</a>(item) == <a class="code" href="data_8h.html#a6454b577999b479ac2585af7c204ae3ba64e142780db46497df37d5cfb40ef8fd">CBOR_CTRL_NULL</a>;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="common_8h.html#afb7eb76a2953224c96d194640f3092e3"> 82</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00083"></a><span class="lineno"> 83</span> {</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> <a class="code" href="common_8c.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a>(item) && <a class="code" href="floats__ctrls_8c.html#a9d15faa0a33797ce0b8a1a66d5773d88">cbor_ctrl_value</a>(item) == <a class="code" href="data_8h.html#a6454b577999b479ac2585af7c204ae3ba5354f70478e0acf68bf1682229b05b6d">CBOR_CTRL_UNDEF</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> }</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="common_8h.html#a4dde28c548375aa954f1cad15b3739aa"> 87</a></span> <span class="keywordtype">bool</span> <a class="code" href="common_8c.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="l00088"></a><span class="lineno"> 88</span> {</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">return</span> <a class="code" href="common_8c.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a>(item) && !<a class="code" href="floats__ctrls_8c.html#a2b304df65e44de17064bc3de154522fa">cbor_float_ctrl_is_ctrl</a>(item);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> }</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="common_8h.html#aa62e72f275c2f0fa604896bfed18e992"> 93</a></span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="common_8c.html#aa62e72f275c2f0fa604896bfed18e992">cbor_incref</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> *item)</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> {</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  item-><a class="code" href="structcbor__item__t.html#a6bb24fe655f086c6aa9a66d427e09cca">refcount</a>++;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">return</span> item;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> }</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="common_8h.html#aa10ebec46eddc9312ec46a0898b5d196"> 99</a></span> <span class="keywordtype">void</span> <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> **item_ref)</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> {</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item = *item_ref;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">if</span> (--item-><a class="code" href="structcbor__item__t.html#a6bb24fe655f086c6aa9a66d427e09cca">refcount</a> == 0) {</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">switch</span> (item-><a class="code" href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">type</a>) {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a2137d55d8028e37ff4319a633ef0634f">CBOR_TYPE_UINT</a>:</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="comment">/* Fallthrough */</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae140516103af792c8f2af84390acfdcd">CBOR_TYPE_NEGINT</a>:</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="comment">/* Combined allocation, freeing the item suffices */</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  {</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  }</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a70b9f0b5958c8d51f15ad7bb7c4af01d">CBOR_TYPE_BYTESTRING</a>: {</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">if</span> (<a class="code" href="bytestrings_8c.html#a368222dbbcea25e06469524e26587e2a">cbor_bytestring_is_definite</a>(item)) {</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="comment">/* We need to decref all chunks */</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="code" href="structcbor__item__t.html">cbor_item_t</a> **handle = <a class="code" href="bytestrings_8c.html#a8ab6255d6f8f209149bdf794dffed849">cbor_bytestring_chunks_handle</a>(item);</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < <a class="code" href="bytestrings_8c.html#ad02102832d452fd5a5cfa96272b1095d">cbor_bytestring_chunk_count</a>(item); i++)</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&handle[i]);</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(((<span class="keyword">struct</span> <a class="code" href="structcbor__indefinite__string__data.html">cbor_indefinite_string_data</a> *) item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>)->chunks);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  }</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  }</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae05102a66420250eacd5f17b95d04443">CBOR_TYPE_STRING</a>: {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordflow">if</span> (<a class="code" href="strings_8c.html#aa2778891e70dec4cd59c9a969294d4aa">cbor_string_is_definite</a>(item)) {</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="comment">/* We need to decref all chunks */</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <a class="code" href="structcbor__item__t.html">cbor_item_t</a> **handle = <a class="code" href="strings_8c.html#a81d1160eed81b2a29b6c5e9ff6b9e02a">cbor_string_chunks_handle</a>(item);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < <a class="code" href="strings_8c.html#ad8062db21711a51ae520cc1e4f5fe5ab">cbor_string_chunk_count</a>(item); i++)</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&handle[i]);</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(((<span class="keyword">struct</span> <a class="code" href="structcbor__indefinite__string__data.html">cbor_indefinite_string_data</a> *) item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>)->chunks);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  }</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae48b04b3538ade49d7eae9ee6b656103">CBOR_TYPE_ARRAY</a>: {</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="comment">/* Get all items and decref them */</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <a class="code" href="structcbor__item__t.html">cbor_item_t</a> **handle = <a class="code" href="arrays_8c.html#a8dd01f4a46f162fa4f06b7df7428128e">cbor_array_handle</a>(item);</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  <span class="keywordtype">size_t</span> size = <a class="code" href="arrays_8c.html#a4f634a9a4bc834e4ea6ac43e94d51f84">cbor_array_size</a>(item);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < size; i++)</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keywordflow">if</span> (handle[i] != NULL)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&handle[i]);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  }</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a057fc3133cb4465f9eb734acfd195db2">CBOR_TYPE_MAP</a>: {</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keyword">struct </span><a class="code" href="structcbor__pair.html">cbor_pair</a> *handle = <a class="code" href="maps_8c.html#a4cadc8eb7ae7ff8d3f73482fb24455c9">cbor_map_handle</a>(item);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < item-><a class="code" href="structcbor__item__t.html#a7d97fa5cdf027ca0499c37ec19acf843">metadata</a>.<a class="code" href="unioncbor__item__metadata.html#ac497580bfcb0c0e47438a45407ac7b4e">map_metadata</a>.<a class="code" href="struct__cbor__map__metadata.html#a38136af91105ba320f1d95a4a4ceb4de">end_ptr</a>; i++, handle++) {</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&handle-><a class="code" href="structcbor__pair.html#a5122c22ad7ef32b2c6ae0a413caca7a1">key</a>);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordflow">if</span> (handle-><a class="code" href="structcbor__pair.html#a44bbea9cc120de72fc4871a05dc8ec85">value</a> != NULL)</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&handle-><a class="code" href="structcbor__pair.html#a44bbea9cc120de72fc4871a05dc8ec85">value</a>);</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  }</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  };</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a16f0eaf29eeea66fe37ec1ed0fa45415">CBOR_TYPE_TAG</a>: {</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">if</span> (item-><a class="code" href="structcbor__item__t.html#a7d97fa5cdf027ca0499c37ec19acf843">metadata</a>.<a class="code" href="unioncbor__item__metadata.html#a7cf72d7dbb3104bd14d0e4934646212f">tag_metadata</a>.<a class="code" href="struct__cbor__tag__metadata.html#ae275f5a8e0a72192d393f770db923907">tagged_item</a> != NULL)</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&item-><a class="code" href="structcbor__item__t.html#a7d97fa5cdf027ca0499c37ec19acf843">metadata</a>.<a class="code" href="unioncbor__item__metadata.html#a7cf72d7dbb3104bd14d0e4934646212f">tag_metadata</a>.<a class="code" href="struct__cbor__tag__metadata.html#ae275f5a8e0a72192d393f770db923907">tagged_item</a>);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item-><a class="code" href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">data</a>);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordflow">case</span> <a class="code" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a1276dcc4ac56df5fd7e0270344a6e57d">CBOR_TYPE_FLOAT_CTRL</a>: {</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="comment">/* Floats have combined allocation */</span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  }</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  }</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <a class="code" href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a>(item);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="comment">//TODO</span></div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  *item_ref = NULL;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  }</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> }</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> </div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="common_8h.html#a4ed20937cc091bc1f481d53787fe306b"> 174</a></span> <span class="keywordtype">void</span> <a class="code" href="common_8c.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="l00175"></a><span class="lineno"> 175</span> {</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a>(&item);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> }</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> </div><div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="common_8h.html#ab27dda20ad909cebaee1b2f43e676f2c"> 179</a></span> <span class="keywordtype">size_t</span> <a class="code" href="common_8c.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="l00180"></a><span class="lineno"> 180</span> {</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordflow">return</span> item-><a class="code" href="structcbor__item__t.html#a6bb24fe655f086c6aa9a66d427e09cca">refcount</a>;</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span> }</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span> </div><div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="common_8h.html#a327dce45c1cb680953555290dba8e35b"> 184</a></span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="common_8c.html#a327dce45c1cb680953555290dba8e35b">cbor_move</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item)</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> {</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  item-><a class="code" href="structcbor__item__t.html#a6bb24fe655f086c6aa9a66d427e09cca">refcount</a>--;</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keywordflow">return</span> item;</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> }</div><div class="ttc" id="bytestrings_8c_html_a368222dbbcea25e06469524e26587e2a"><div class="ttname"><a href="bytestrings_8c.html#a368222dbbcea25e06469524e26587e2a">cbor_bytestring_is_definite</a></div><div class="ttdeci">bool cbor_bytestring_is_definite(const cbor_item_t *item)</div><div class="ttdoc">Is the byte string definite? </div><div class="ttdef"><b>Definition:</b> <a href="bytestrings_8c_source.html#l00024">bytestrings.c:24</a></div></div>
<div class="ttc" id="data_8h_html_a6454b577999b479ac2585af7c204ae3baf4f149be1611cec155482645ff2be8de"><div class="ttname"><a href="data_8h.html#a6454b577999b479ac2585af7c204ae3baf4f149be1611cec155482645ff2be8de">CBOR_CTRL_TRUE</a></div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00071">data.h:71</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6a16f0eaf29eeea66fe37ec1ed0fa45415"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a16f0eaf29eeea66fe37ec1ed0fa45415">CBOR_TYPE_TAG</a></div><div class="ttdoc">6 - tags </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00031">data.h:31</a></div></div>
<div class="ttc" id="data_8h_html_a6454b577999b479ac2585af7c204ae3ba64e142780db46497df37d5cfb40ef8fd"><div class="ttname"><a href="data_8h.html#a6454b577999b479ac2585af7c204ae3ba64e142780db46497df37d5cfb40ef8fd">CBOR_CTRL_NULL</a></div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00072">data.h:72</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6ae05102a66420250eacd5f17b95d04443"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae05102a66420250eacd5f17b95d04443">CBOR_TYPE_STRING</a></div><div class="ttdoc">3 - strings </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00028">data.h:28</a></div></div>
<div class="ttc" id="structcbor__item__t_html_a7d97fa5cdf027ca0499c37ec19acf843"><div class="ttname"><a href="structcbor__item__t.html#a7d97fa5cdf027ca0499c37ec19acf843">cbor_item_t::metadata</a></div><div class="ttdeci">union cbor_item_metadata metadata</div><div class="ttdoc">Discriminated by type. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00151">data.h:151</a></div></div>
<div class="ttc" id="strings_8h_html"><div class="ttname"><a href="strings_8h.html">strings.h</a></div></div>
<div class="ttc" id="common_8c_html_a4ed20937cc091bc1f481d53787fe306b"><div class="ttname"><a href="common_8c.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="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6a70b9f0b5958c8d51f15ad7bb7c4af01d"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a70b9f0b5958c8d51f15ad7bb7c4af01d">CBOR_TYPE_BYTESTRING</a></div><div class="ttdoc">2 - byte strings </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00027">data.h:27</a></div></div>
<div class="ttc" id="unioncbor__item__metadata_html_ac497580bfcb0c0e47438a45407ac7b4e"><div class="ttname"><a href="unioncbor__item__metadata.html#ac497580bfcb0c0e47438a45407ac7b4e">cbor_item_metadata::map_metadata</a></div><div class="ttdeci">struct _cbor_map_metadata map_metadata</div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00143">data.h:143</a></div></div>
<div class="ttc" id="common_8c_html_a0ca5042e3807d2cc9c3d40f9266460dd"><div class="ttname"><a href="common_8c.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="structcbor__pair_html_a44bbea9cc120de72fc4871a05dc8ec85"><div class="ttname"><a href="structcbor__pair.html#a44bbea9cc120de72fc4871a05dc8ec85">cbor_pair::value</a></div><div class="ttdeci">cbor_item_t * value</div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00180">data.h:180</a></div></div>
<div class="ttc" id="common_8c_html_aedbe700f2241de4282aedaae017e0de9"><div class="ttname"><a href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a></div><div class="ttdeci">void cbor_decref(cbor_item_t **item_ref)</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_8c_html_a02edd93bb8eab83bc2b8f8bf5d7d1335"><div class="ttname"><a href="common_8c.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="maps_8h_html"><div class="ttname"><a href="maps_8h.html">maps.h</a></div></div>
<div class="ttc" id="bytestrings_8c_html_ad02102832d452fd5a5cfa96272b1095d"><div class="ttname"><a href="bytestrings_8c.html#ad02102832d452fd5a5cfa96272b1095d">cbor_bytestring_chunk_count</a></div><div class="ttdeci">size_t cbor_bytestring_chunk_count(const cbor_item_t *item)</div><div class="ttdoc">Get the number of chunks this string consist of. </div><div class="ttdef"><b>Definition:</b> <a href="bytestrings_8c_source.html#l00087">bytestrings.c:87</a></div></div>
<div class="ttc" id="strings_8c_html_a81d1160eed81b2a29b6c5e9ff6b9e02a"><div class="ttname"><a href="strings_8c.html#a81d1160eed81b2a29b6c5e9ff6b9e02a">cbor_string_chunks_handle</a></div><div class="ttdeci">cbor_item_t ** cbor_string_chunks_handle(const cbor_item_t *item)</div><div class="ttdoc">Get the handle to the array of chunks. </div><div class="ttdef"><b>Definition:</b> <a href="strings_8c_source.html#l00067">strings.c:67</a></div></div>
<div class="ttc" id="common_8c_html_a4e705f34221ba434756a4a1f8e3325e6"><div class="ttname"><a href="common_8c.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_8c_html_adedaf37527b8d8261e287a0001e5a190"><div class="ttname"><a href="common_8c.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="bytestrings_8c_html_a8ab6255d6f8f209149bdf794dffed849"><div class="ttname"><a href="bytestrings_8c.html#a8ab6255d6f8f209149bdf794dffed849">cbor_bytestring_chunks_handle</a></div><div class="ttdeci">cbor_item_t ** cbor_bytestring_chunks_handle(const cbor_item_t *item)</div><div class="ttdoc">Get the handle to the array of chunks. </div><div class="ttdef"><b>Definition:</b> <a href="bytestrings_8c_source.html#l00080">bytestrings.c:80</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6ae48b04b3538ade49d7eae9ee6b656103"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae48b04b3538ade49d7eae9ee6b656103">CBOR_TYPE_ARRAY</a></div><div class="ttdoc">4 - arrays </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00029">data.h:29</a></div></div>
<div class="ttc" id="common_8c_html_ab27dda20ad909cebaee1b2f43e676f2c"><div class="ttname"><a href="common_8c.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 class="ttc" id="structcbor__pair_html_a5122c22ad7ef32b2c6ae0a413caca7a1"><div class="ttname"><a href="structcbor__pair.html#a5122c22ad7ef32b2c6ae0a413caca7a1">cbor_pair::key</a></div><div class="ttdeci">cbor_item_t * key</div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00180">data.h:180</a></div></div>
<div class="ttc" id="data_8h_html_a6454b577999b479ac2585af7c204ae3ba5354f70478e0acf68bf1682229b05b6d"><div class="ttname"><a href="data_8h.html#a6454b577999b479ac2585af7c204ae3ba5354f70478e0acf68bf1682229b05b6d">CBOR_CTRL_UNDEF</a></div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00073">data.h:73</a></div></div>
<div class="ttc" id="floats__ctrls_8h_html"><div class="ttname"><a href="floats__ctrls_8h.html">floats_ctrls.h</a></div></div>
<div class="ttc" id="struct__cbor__map__metadata_html_a38136af91105ba320f1d95a4a4ceb4de"><div class="ttname"><a href="struct__cbor__map__metadata.html#a38136af91105ba320f1d95a4a4ceb4de">_cbor_map_metadata::end_ptr</a></div><div class="ttdeci">size_t end_ptr</div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00104">data.h:104</a></div></div>
<div class="ttc" id="structcbor__item__t_html_a6743a75cf89e1b455ddf3198ff98842a"><div class="ttname"><a href="structcbor__item__t.html#a6743a75cf89e1b455ddf3198ff98842a">cbor_item_t::type</a></div><div class="ttdeci">cbor_type type</div><div class="ttdoc">Major type discriminator. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00155">data.h:155</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6a1276dcc4ac56df5fd7e0270344a6e57d"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a1276dcc4ac56df5fd7e0270344a6e57d">CBOR_TYPE_FLOAT_CTRL</a></div><div class="ttdoc">7 - decimals and special values (true, false, nil, ...) </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00032">data.h:32</a></div></div>
<div class="ttc" id="common_8h_html_a1300043d7db8adf6ab67f7b787f14635"><div class="ttname"><a href="common_8h.html#a1300043d7db8adf6ab67f7b787f14635">_CBOR_FREE</a></div><div class="ttdeci">#define _CBOR_FREE</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00086">common.h:86</a></div></div>
<div class="ttc" id="structcbor__pair_html"><div class="ttname"><a href="structcbor__pair.html">cbor_pair</a></div><div class="ttdoc">Simple pair of items for use in maps. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00179">data.h:179</a></div></div>
<div class="ttc" id="structcbor__item__t_html_a6bb24fe655f086c6aa9a66d427e09cca"><div class="ttname"><a href="structcbor__item__t.html#a6bb24fe655f086c6aa9a66d427e09cca">cbor_item_t::refcount</a></div><div class="ttdeci">size_t refcount</div><div class="ttdoc">Reference count - initialize to 0. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00153">data.h:153</a></div></div>
<div class="ttc" id="arrays_8h_html"><div class="ttname"><a href="arrays_8h.html">arrays.h</a></div></div>
<div class="ttc" id="common_8c_html_ad1f5efac647b4d9c437c4441d1177e01"><div class="ttname"><a href="common_8c.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="strings_8c_html_ad8062db21711a51ae520cc1e4f5fe5ab"><div class="ttname"><a href="strings_8c.html#ad8062db21711a51ae520cc1e4f5fe5ab">cbor_string_chunk_count</a></div><div class="ttdeci">size_t cbor_string_chunk_count(const cbor_item_t *item)</div><div class="ttdoc">Get the number of chunks this string consist of. </div><div class="ttdef"><b>Definition:</b> <a href="strings_8c_source.html#l00074">strings.c:74</a></div></div>
<div class="ttc" id="arrays_8c_html_a4f634a9a4bc834e4ea6ac43e94d51f84"><div class="ttname"><a href="arrays_8c.html#a4f634a9a4bc834e4ea6ac43e94d51f84">cbor_array_size</a></div><div class="ttdeci">size_t cbor_array_size(const cbor_item_t *item)</div><div class="ttdoc">Get the number of members. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00012">arrays.c:12</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6a2137d55d8028e37ff4319a633ef0634f"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a2137d55d8028e37ff4319a633ef0634f">CBOR_TYPE_UINT</a></div><div class="ttdoc">0 - positive integers </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00025">data.h:25</a></div></div>
<div class="ttc" id="common_8c_html_a4dde28c548375aa954f1cad15b3739aa"><div class="ttname"><a href="common_8c.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_8c_html_aa62e72f275c2f0fa604896bfed18e992"><div class="ttname"><a href="common_8c.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="unioncbor__item__metadata_html_a7cf72d7dbb3104bd14d0e4934646212f"><div class="ttname"><a href="unioncbor__item__metadata.html#a7cf72d7dbb3104bd14d0e4934646212f">cbor_item_metadata::tag_metadata</a></div><div class="ttdeci">struct _cbor_tag_metadata tag_metadata</div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00144">data.h:144</a></div></div>
<div class="ttc" id="floats__ctrls_8c_html_a9d15faa0a33797ce0b8a1a66d5773d88"><div class="ttname"><a href="floats__ctrls_8c.html#a9d15faa0a33797ce0b8a1a66d5773d88">cbor_ctrl_value</a></div><div class="ttdeci">uint8_t cbor_ctrl_value(const cbor_item_t *item)</div><div class="ttdoc">Reads the control value. </div><div class="ttdef"><b>Definition:</b> <a href="floats__ctrls_8c_source.html#l00018">floats_ctrls.c:18</a></div></div>
<div class="ttc" id="structcbor__indefinite__string__data_html"><div class="ttname"><a href="structcbor__indefinite__string__data.html">cbor_indefinite_string_data</a></div><div class="ttdoc">Defines cbor_item_t::data structure for indefinite strings and bytestrings. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00164">data.h:164</a></div></div>
<div class="ttc" id="common_8c_html_a983dec76e934c49ed6979226f9db4386"><div class="ttname"><a href="common_8c.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_8c_html_a9ed0fa96105c211867c5032f2a5a8b20"><div class="ttname"><a href="common_8c.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="ints_8h_html"><div class="ttname"><a href="ints_8h.html">ints.h</a></div></div>
<div class="ttc" id="struct__cbor__tag__metadata_html_ae275f5a8e0a72192d393f770db923907"><div class="ttname"><a href="struct__cbor__tag__metadata.html#ae275f5a8e0a72192d393f770db923907">_cbor_tag_metadata::tagged_item</a></div><div class="ttdeci">struct cbor_item_t * tagged_item</div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00115">data.h:115</a></div></div>
<div class="ttc" id="common_8c_html_af0de041481b61922d0995b63f82d8ddd"><div class="ttname"><a href="common_8c.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_8c_html_a327dce45c1cb680953555290dba8e35b"><div class="ttname"><a href="common_8c.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_8c_html_a682a023f7012a5b66a57847e6f8d386f"><div class="ttname"><a href="common_8c.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_8c_html_a5618a3689e31829f4f84da008e20798e"><div class="ttname"><a href="common_8c.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_8c_html_a0d5054202c5ec9375e8daf5930087a61"><div class="ttname"><a href="common_8c.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="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_8c_html_afb7eb76a2953224c96d194640f3092e3"><div class="ttname"><a href="common_8c.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_8c_html_ac2b9aba4cf07857524a0a520eabeef52"><div class="ttname"><a href="common_8c.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="bytestrings_8h_html"><div class="ttname"><a href="bytestrings_8h.html">bytestrings.h</a></div></div>
<div class="ttc" id="strings_8c_html_aa2778891e70dec4cd59c9a969294d4aa"><div class="ttname"><a href="strings_8c.html#aa2778891e70dec4cd59c9a969294d4aa">cbor_string_is_definite</a></div><div class="ttdeci">bool cbor_string_is_definite(const cbor_item_t *item)</div><div class="ttdoc">Is the string definite? </div><div class="ttdef"><b>Definition:</b> <a href="strings_8c_source.html#l00124">strings.c:124</a></div></div>
<div class="ttc" id="structcbor__item__t_html_a5c6dde1dbef5aad748c49786352eef44"><div class="ttname"><a href="structcbor__item__t.html#a5c6dde1dbef5aad748c49786352eef44">cbor_item_t::data</a></div><div class="ttdeci">unsigned char * data</div><div class="ttdoc">Raw data block - interpretation depends on metadata. </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00157">data.h:157</a></div></div>
<div class="ttc" id="common_8h_html"><div class="ttname"><a href="common_8h.html">common.h</a></div></div>
<div class="ttc" id="tags_8h_html"><div class="ttname"><a href="tags_8h.html">tags.h</a></div></div>
<div class="ttc" id="floats__ctrls_8c_html_a2b304df65e44de17064bc3de154522fa"><div class="ttname"><a href="floats__ctrls_8c.html#a2b304df65e44de17064bc3de154522fa">cbor_float_ctrl_is_ctrl</a></div><div class="ttdeci">bool cbor_float_ctrl_is_ctrl(const cbor_item_t *item)</div><div class="ttdoc">Is this a ctrl value? </div><div class="ttdef"><b>Definition:</b> <a href="floats__ctrls_8c_source.html#l00025">floats_ctrls.c:25</a></div></div>
<div class="ttc" id="data_8h_html_a6454b577999b479ac2585af7c204ae3babbcec81d7145fdf31329e07a0bb064bd"><div class="ttname"><a href="data_8h.html#a6454b577999b479ac2585af7c204ae3babbcec81d7145fdf31329e07a0bb064bd">CBOR_CTRL_FALSE</a></div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00070">data.h:70</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="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6ae140516103af792c8f2af84390acfdcd"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae140516103af792c8f2af84390acfdcd">CBOR_TYPE_NEGINT</a></div><div class="ttdoc">1 - negative integers </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00026">data.h:26</a></div></div>
<div class="ttc" id="maps_8c_html_a4cadc8eb7ae7ff8d3f73482fb24455c9"><div class="ttname"><a href="maps_8c.html#a4cadc8eb7ae7ff8d3f73482fb24455c9">cbor_map_handle</a></div><div class="ttdeci">struct cbor_pair * cbor_map_handle(const cbor_item_t *item)</div><div class="ttdoc">Get the pairs storage. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00137">maps.c:137</a></div></div>
<div class="ttc" id="arrays_8c_html_a8dd01f4a46f162fa4f06b7df7428128e"><div class="ttname"><a href="arrays_8c.html#a8dd01f4a46f162fa4f06b7df7428128e">cbor_array_handle</a></div><div class="ttdeci">cbor_item_t ** cbor_array_handle(const cbor_item_t *item)</div><div class="ttdoc">Get the array contents. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00100">arrays.c:100</a></div></div>
<div class="ttc" id="data_8h_html_a3a931b40fc31b51cccfd1bc3dc5fc5d6a057fc3133cb4465f9eb734acfd195db2"><div class="ttname"><a href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a057fc3133cb4465f9eb734acfd195db2">CBOR_TYPE_MAP</a></div><div class="ttdoc">5 - maps </div><div class="ttdef"><b>Definition:</b> <a href="data_8h_source.html#l00030">data.h:30</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  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>