xref: /netbsd-src/external/mit/libcbor/dist/docs/doxygen/common_8c.html (revision 5dd36a3bc8bf2a9dec29ceb6349550414570c447)
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6<meta name="generator" content="Doxygen 1.8.12"/>
7<meta name="viewport" content="width=device-width, initial-scale=1"/>
8<title>libcbor: src/cbor/common.c File Reference</title>
9<link href="tabs.css" rel="stylesheet" type="text/css"/>
10<script type="text/javascript" src="jquery.js"></script>
11<script type="text/javascript" src="dynsections.js"></script>
12<link href="search/search.css" rel="stylesheet" type="text/css"/>
13<script type="text/javascript" src="search/searchdata.js"></script>
14<script type="text/javascript" src="search/search.js"></script>
15<link href="doxygen.css" rel="stylesheet" type="text/css" />
16<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
17</head>
18<body>
19<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
20<div id="titlearea">
21<table cellspacing="0" cellpadding="0">
22 <tbody>
23 <tr style="height: 56px;">
24  <td id="projectalign" style="padding-left: 0.5em;">
25   <div id="projectname">libcbor
26   &#160;<span id="projectnumber">0.5.0</span>
27   </div>
28   <div id="projectbrief">libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.</div>
29  </td>
30 </tr>
31 </tbody>
32</table>
33</div>
34<!-- end header part -->
35<!-- Generated by Doxygen 1.8.12 -->
36<script type="text/javascript">
37var searchBox = new SearchBox("searchBox", "search",false,'Search');
38</script>
39<script type="text/javascript" src="menudata.js"></script>
40<script type="text/javascript" src="menu.js"></script>
41<script type="text/javascript">
42$(function() {
43  initMenu('',true,false,'search.php','Search');
44  $(document).ready(function() { init_search(); });
45});
46</script>
47<div id="main-nav"></div>
48<!-- window showing the filter options -->
49<div id="MSearchSelectWindow"
50     onmouseover="return searchBox.OnSearchSelectShow()"
51     onmouseout="return searchBox.OnSearchSelectHide()"
52     onkeydown="return searchBox.OnSearchSelectKey(event)">
53</div>
54
55<!-- iframe showing the search results (closed by default) -->
56<div id="MSearchResultsWindow">
57<iframe src="javascript:void(0)" frameborder="0"
58        name="MSearchResults" id="MSearchResults">
59</iframe>
60</div>
61
62<div id="nav-path" class="navpath">
63  <ul>
64<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>
65</div>
66</div><!-- top -->
67<div class="header">
68  <div class="summary">
69<a href="#func-members">Functions</a>  </div>
70  <div class="headertitle">
71<div class="title">common.c File Reference</div>  </div>
72</div><!--header-->
73<div class="contents">
74<div class="textblock"><code>#include &quot;<a class="el" href="common_8h_source.html">cbor/common.h</a>&quot;</code><br />
75<code>#include &quot;<a class="el" href="arrays_8h_source.html">arrays.h</a>&quot;</code><br />
76<code>#include &quot;<a class="el" href="bytestrings_8h_source.html">bytestrings.h</a>&quot;</code><br />
77<code>#include &quot;<a class="el" href="data_8h_source.html">data.h</a>&quot;</code><br />
78<code>#include &quot;<a class="el" href="floats__ctrls_8h_source.html">floats_ctrls.h</a>&quot;</code><br />
79<code>#include &quot;<a class="el" href="ints_8h_source.html">ints.h</a>&quot;</code><br />
80<code>#include &quot;<a class="el" href="maps_8h_source.html">maps.h</a>&quot;</code><br />
81<code>#include &quot;<a class="el" href="strings_8h_source.html">strings.h</a>&quot;</code><br />
82<code>#include &quot;<a class="el" href="tags_8h_source.html">tags.h</a>&quot;</code><br />
83</div>
84<p><a href="common_8c_source.html">Go to the source code of this file.</a></p>
85<table class="memberdecls">
86<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
87Functions</h2></td></tr>
88<tr class="memitem:a682a023f7012a5b66a57847e6f8d386f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a682a023f7012a5b66a57847e6f8d386f">cbor_isa_uint</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
89<tr class="memdesc:a682a023f7012a5b66a57847e6f8d386f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#a682a023f7012a5b66a57847e6f8d386f">More...</a><br /></td></tr>
90<tr class="separator:a682a023f7012a5b66a57847e6f8d386f"><td class="memSeparator" colspan="2">&#160;</td></tr>
91<tr class="memitem:a0ca5042e3807d2cc9c3d40f9266460dd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a0ca5042e3807d2cc9c3d40f9266460dd">cbor_isa_negint</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
92<tr class="memdesc:a0ca5042e3807d2cc9c3d40f9266460dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#a0ca5042e3807d2cc9c3d40f9266460dd">More...</a><br /></td></tr>
93<tr class="separator:a0ca5042e3807d2cc9c3d40f9266460dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
94<tr class="memitem:adedaf37527b8d8261e287a0001e5a190"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#adedaf37527b8d8261e287a0001e5a190">cbor_isa_bytestring</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
95<tr class="memdesc:adedaf37527b8d8261e287a0001e5a190"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#adedaf37527b8d8261e287a0001e5a190">More...</a><br /></td></tr>
96<tr class="separator:adedaf37527b8d8261e287a0001e5a190"><td class="memSeparator" colspan="2">&#160;</td></tr>
97<tr class="memitem:a02edd93bb8eab83bc2b8f8bf5d7d1335"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a02edd93bb8eab83bc2b8f8bf5d7d1335">cbor_isa_string</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
98<tr class="memdesc:a02edd93bb8eab83bc2b8f8bf5d7d1335"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#a02edd93bb8eab83bc2b8f8bf5d7d1335">More...</a><br /></td></tr>
99<tr class="separator:a02edd93bb8eab83bc2b8f8bf5d7d1335"><td class="memSeparator" colspan="2">&#160;</td></tr>
100<tr class="memitem:a9ed0fa96105c211867c5032f2a5a8b20"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a9ed0fa96105c211867c5032f2a5a8b20">cbor_isa_array</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
101<tr class="memdesc:a9ed0fa96105c211867c5032f2a5a8b20"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#a9ed0fa96105c211867c5032f2a5a8b20">More...</a><br /></td></tr>
102<tr class="separator:a9ed0fa96105c211867c5032f2a5a8b20"><td class="memSeparator" colspan="2">&#160;</td></tr>
103<tr class="memitem:af0de041481b61922d0995b63f82d8ddd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#af0de041481b61922d0995b63f82d8ddd">cbor_isa_map</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
104<tr class="memdesc:af0de041481b61922d0995b63f82d8ddd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#af0de041481b61922d0995b63f82d8ddd">More...</a><br /></td></tr>
105<tr class="separator:af0de041481b61922d0995b63f82d8ddd"><td class="memSeparator" colspan="2">&#160;</td></tr>
106<tr class="memitem:a0d5054202c5ec9375e8daf5930087a61"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a0d5054202c5ec9375e8daf5930087a61">cbor_isa_tag</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
107<tr class="memdesc:a0d5054202c5ec9375e8daf5930087a61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#a0d5054202c5ec9375e8daf5930087a61">More...</a><br /></td></tr>
108<tr class="separator:a0d5054202c5ec9375e8daf5930087a61"><td class="memSeparator" colspan="2">&#160;</td></tr>
109<tr class="memitem:a983dec76e934c49ed6979226f9db4386"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a983dec76e934c49ed6979226f9db4386">cbor_isa_float_ctrl</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
110<tr class="memdesc:a983dec76e934c49ed6979226f9db4386"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does the item have the appropriate major type?  <a href="#a983dec76e934c49ed6979226f9db4386">More...</a><br /></td></tr>
111<tr class="separator:a983dec76e934c49ed6979226f9db4386"><td class="memSeparator" colspan="2">&#160;</td></tr>
112<tr class="memitem:ac2b9aba4cf07857524a0a520eabeef52"><td class="memItemLeft" align="right" valign="top"><a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6">cbor_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#ac2b9aba4cf07857524a0a520eabeef52">cbor_typeof</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
113<tr class="memdesc:ac2b9aba4cf07857524a0a520eabeef52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the type of the item.  <a href="#ac2b9aba4cf07857524a0a520eabeef52">More...</a><br /></td></tr>
114<tr class="separator:ac2b9aba4cf07857524a0a520eabeef52"><td class="memSeparator" colspan="2">&#160;</td></tr>
115<tr class="memitem:a4e705f34221ba434756a4a1f8e3325e6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a4e705f34221ba434756a4a1f8e3325e6">cbor_is_int</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
116<tr class="memdesc:a4e705f34221ba434756a4a1f8e3325e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the item an integer, either positive or negative?  <a href="#a4e705f34221ba434756a4a1f8e3325e6">More...</a><br /></td></tr>
117<tr class="separator:a4e705f34221ba434756a4a1f8e3325e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
118<tr class="memitem:a5618a3689e31829f4f84da008e20798e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a5618a3689e31829f4f84da008e20798e">cbor_is_bool</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
119<tr class="memdesc:a5618a3689e31829f4f84da008e20798e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the item an a boolean?  <a href="#a5618a3689e31829f4f84da008e20798e">More...</a><br /></td></tr>
120<tr class="separator:a5618a3689e31829f4f84da008e20798e"><td class="memSeparator" colspan="2">&#160;</td></tr>
121<tr class="memitem:ad1f5efac647b4d9c437c4441d1177e01"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#ad1f5efac647b4d9c437c4441d1177e01">cbor_is_null</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
122<tr class="memdesc:ad1f5efac647b4d9c437c4441d1177e01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does this item represent <code>null</code>  <a href="#ad1f5efac647b4d9c437c4441d1177e01">More...</a><br /></td></tr>
123<tr class="separator:ad1f5efac647b4d9c437c4441d1177e01"><td class="memSeparator" colspan="2">&#160;</td></tr>
124<tr class="memitem:afb7eb76a2953224c96d194640f3092e3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#afb7eb76a2953224c96d194640f3092e3">cbor_is_undef</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
125<tr class="memdesc:afb7eb76a2953224c96d194640f3092e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Does this item represent <code>undefined</code>  <a href="#afb7eb76a2953224c96d194640f3092e3">More...</a><br /></td></tr>
126<tr class="separator:afb7eb76a2953224c96d194640f3092e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
127<tr class="memitem:a4dde28c548375aa954f1cad15b3739aa"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a4dde28c548375aa954f1cad15b3739aa">cbor_is_float</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
128<tr class="memdesc:a4dde28c548375aa954f1cad15b3739aa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is the item an a floating point number?  <a href="#a4dde28c548375aa954f1cad15b3739aa">More...</a><br /></td></tr>
129<tr class="separator:a4dde28c548375aa954f1cad15b3739aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
130<tr class="memitem:aa62e72f275c2f0fa604896bfed18e992"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#aa62e72f275c2f0fa604896bfed18e992">cbor_incref</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
131<tr class="memdesc:aa62e72f275c2f0fa604896bfed18e992"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increases the reference count by one.  <a href="#aa62e72f275c2f0fa604896bfed18e992">More...</a><br /></td></tr>
132<tr class="separator:aa62e72f275c2f0fa604896bfed18e992"><td class="memSeparator" colspan="2">&#160;</td></tr>
133<tr class="memitem:aedbe700f2241de4282aedaae017e0de9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#aedbe700f2241de4282aedaae017e0de9">cbor_decref</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> **item_ref)</td></tr>
134<tr class="memdesc:aedbe700f2241de4282aedaae017e0de9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decreases the reference count by one, deallocating the item if needed.  <a href="#aedbe700f2241de4282aedaae017e0de9">More...</a><br /></td></tr>
135<tr class="separator:aedbe700f2241de4282aedaae017e0de9"><td class="memSeparator" colspan="2">&#160;</td></tr>
136<tr class="memitem:a4ed20937cc091bc1f481d53787fe306b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a4ed20937cc091bc1f481d53787fe306b">cbor_intermediate_decref</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
137<tr class="memdesc:a4ed20937cc091bc1f481d53787fe306b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decreases the reference count by one, deallocating the item if needed.  <a href="#a4ed20937cc091bc1f481d53787fe306b">More...</a><br /></td></tr>
138<tr class="separator:a4ed20937cc091bc1f481d53787fe306b"><td class="memSeparator" colspan="2">&#160;</td></tr>
139<tr class="memitem:ab27dda20ad909cebaee1b2f43e676f2c"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#ab27dda20ad909cebaee1b2f43e676f2c">cbor_refcount</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
140<tr class="memdesc:ab27dda20ad909cebaee1b2f43e676f2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the reference count.  <a href="#ab27dda20ad909cebaee1b2f43e676f2c">More...</a><br /></td></tr>
141<tr class="separator:ab27dda20ad909cebaee1b2f43e676f2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
142<tr class="memitem:a327dce45c1cb680953555290dba8e35b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_8c.html#a327dce45c1cb680953555290dba8e35b">cbor_move</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
143<tr class="memdesc:a327dce45c1cb680953555290dba8e35b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides CPP-like move construct.  <a href="#a327dce45c1cb680953555290dba8e35b">More...</a><br /></td></tr>
144<tr class="separator:a327dce45c1cb680953555290dba8e35b"><td class="memSeparator" colspan="2">&#160;</td></tr>
145</table>
146<h2 class="groupheader">Function Documentation</h2>
147<a id="aedbe700f2241de4282aedaae017e0de9"></a>
148<h2 class="memtitle"><span class="permalink"><a href="#aedbe700f2241de4282aedaae017e0de9">&sect;&nbsp;</a></span>cbor_decref()</h2>
149
150<div class="memitem">
151<div class="memproto">
152      <table class="memname">
153        <tr>
154          <td class="memname">void cbor_decref </td>
155          <td>(</td>
156          <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> **&#160;</td>
157          <td class="paramname"><em>item</em></td><td>)</td>
158          <td></td>
159        </tr>
160      </table>
161</div><div class="memdoc">
162
163<p>Decreases the reference count by one, deallocating the item if needed. </p>
164<p>In case the item is deallocated, the reference count of any dependent items is adjusted accordingly in a recursive manner.</p>
165<dl class="params"><dt>Parameters</dt><dd>
166  <table class="params">
167    <tr><td class="paramname">item[take]</td><td>the item. Set to <code>NULL</code> if deallocated </td></tr>
168  </table>
169  </dd>
170</dl>
171
172<p>Definition at line <a class="el" href="common_8c_source.html#l00099">99</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
173
174</div>
175</div>
176<a id="aa62e72f275c2f0fa604896bfed18e992"></a>
177<h2 class="memtitle"><span class="permalink"><a href="#aa62e72f275c2f0fa604896bfed18e992">&sect;&nbsp;</a></span>cbor_incref()</h2>
178
179<div class="memitem">
180<div class="memproto">
181      <table class="memname">
182        <tr>
183          <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_incref </td>
184          <td>(</td>
185          <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
186          <td class="paramname"><em>item</em></td><td>)</td>
187          <td></td>
188        </tr>
189      </table>
190</div><div class="memdoc">
191
192<p>Increases the reference count by one. </p>
193<p>No dependent items are affected.</p>
194<dl class="params"><dt>Parameters</dt><dd>
195  <table class="params">
196    <tr><td class="paramname">item[incref]</td><td>item the item </td></tr>
197  </table>
198  </dd>
199</dl>
200<dl class="section return"><dt>Returns</dt><dd>the input reference </dd></dl>
201
202<p>Definition at line <a class="el" href="common_8c_source.html#l00093">93</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
203
204</div>
205</div>
206<a id="a4ed20937cc091bc1f481d53787fe306b"></a>
207<h2 class="memtitle"><span class="permalink"><a href="#a4ed20937cc091bc1f481d53787fe306b">&sect;&nbsp;</a></span>cbor_intermediate_decref()</h2>
208
209<div class="memitem">
210<div class="memproto">
211      <table class="memname">
212        <tr>
213          <td class="memname">void cbor_intermediate_decref </td>
214          <td>(</td>
215          <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
216          <td class="paramname"><em>item</em></td><td>)</td>
217          <td></td>
218        </tr>
219      </table>
220</div><div class="memdoc">
221
222<p>Decreases the reference count by one, deallocating the item if needed. </p>
223<p>Convenience wrapper for <a class="el" href="common_8h.html#aa10ebec46eddc9312ec46a0898b5d196" title="Decreases the reference count by one, deallocating the item if needed. ">cbor_decref</a> when its set-to-null behavior is not needed</p>
224<dl class="params"><dt>Parameters</dt><dd>
225  <table class="params">
226    <tr><td class="paramname">item[take]</td><td>the item </td></tr>
227  </table>
228  </dd>
229</dl>
230
231<p>Definition at line <a class="el" href="common_8c_source.html#l00174">174</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
232
233</div>
234</div>
235<a id="a5618a3689e31829f4f84da008e20798e"></a>
236<h2 class="memtitle"><span class="permalink"><a href="#a5618a3689e31829f4f84da008e20798e">&sect;&nbsp;</a></span>cbor_is_bool()</h2>
237
238<div class="memitem">
239<div class="memproto">
240      <table class="memname">
241        <tr>
242          <td class="memname">bool cbor_is_bool </td>
243          <td>(</td>
244          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
245          <td class="paramname"><em>item</em></td><td>)</td>
246          <td></td>
247        </tr>
248      </table>
249</div><div class="memdoc">
250
251<p>Is the item an a boolean? </p>
252<dl class="params"><dt>Parameters</dt><dd>
253  <table class="params">
254    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
255  </table>
256  </dd>
257</dl>
258<dl class="section return"><dt>Returns</dt><dd>Is the item a boolean? </dd></dl>
259
260<p>Definition at line <a class="el" href="common_8c_source.html#l00071">71</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
261
262</div>
263</div>
264<a id="a4dde28c548375aa954f1cad15b3739aa"></a>
265<h2 class="memtitle"><span class="permalink"><a href="#a4dde28c548375aa954f1cad15b3739aa">&sect;&nbsp;</a></span>cbor_is_float()</h2>
266
267<div class="memitem">
268<div class="memproto">
269      <table class="memname">
270        <tr>
271          <td class="memname">bool cbor_is_float </td>
272          <td>(</td>
273          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
274          <td class="paramname"><em>item</em></td><td>)</td>
275          <td></td>
276        </tr>
277      </table>
278</div><div class="memdoc">
279
280<p>Is the item an a floating point number? </p>
281<dl class="params"><dt>Parameters</dt><dd>
282  <table class="params">
283    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
284  </table>
285  </dd>
286</dl>
287<dl class="section return"><dt>Returns</dt><dd>Is the item a floating point number? </dd></dl>
288
289<p>Definition at line <a class="el" href="common_8c_source.html#l00087">87</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
290
291</div>
292</div>
293<a id="a4e705f34221ba434756a4a1f8e3325e6"></a>
294<h2 class="memtitle"><span class="permalink"><a href="#a4e705f34221ba434756a4a1f8e3325e6">&sect;&nbsp;</a></span>cbor_is_int()</h2>
295
296<div class="memitem">
297<div class="memproto">
298      <table class="memname">
299        <tr>
300          <td class="memname">bool cbor_is_int </td>
301          <td>(</td>
302          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
303          <td class="paramname"><em>item</em></td><td>)</td>
304          <td></td>
305        </tr>
306      </table>
307</div><div class="memdoc">
308
309<p>Is the item an integer, either positive or negative? </p>
310<dl class="params"><dt>Parameters</dt><dd>
311  <table class="params">
312    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
313  </table>
314  </dd>
315</dl>
316<dl class="section return"><dt>Returns</dt><dd>Is the item an integer, either positive or negative? </dd></dl>
317
318<p>Definition at line <a class="el" href="common_8c_source.html#l00065">65</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
319
320</div>
321</div>
322<a id="ad1f5efac647b4d9c437c4441d1177e01"></a>
323<h2 class="memtitle"><span class="permalink"><a href="#ad1f5efac647b4d9c437c4441d1177e01">&sect;&nbsp;</a></span>cbor_is_null()</h2>
324
325<div class="memitem">
326<div class="memproto">
327      <table class="memname">
328        <tr>
329          <td class="memname">bool cbor_is_null </td>
330          <td>(</td>
331          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
332          <td class="paramname"><em>item</em></td><td>)</td>
333          <td></td>
334        </tr>
335      </table>
336</div><div class="memdoc">
337
338<p>Does this item represent <code>null</code> </p>
339<pre class="fragment">embed:rst:leading-asterisk
340* .. warning:: This is in no way related to the value of the pointer. Passing a null pointer will most likely result in a crash.
341* </pre> <dl class="params"><dt>Parameters</dt><dd>
342  <table class="params">
343    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
344  </table>
345  </dd>
346</dl>
347<dl class="section return"><dt>Returns</dt><dd>Is the item (CBOR logical) null? </dd></dl>
348
349<p>Definition at line <a class="el" href="common_8c_source.html#l00077">77</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
350
351</div>
352</div>
353<a id="afb7eb76a2953224c96d194640f3092e3"></a>
354<h2 class="memtitle"><span class="permalink"><a href="#afb7eb76a2953224c96d194640f3092e3">&sect;&nbsp;</a></span>cbor_is_undef()</h2>
355
356<div class="memitem">
357<div class="memproto">
358      <table class="memname">
359        <tr>
360          <td class="memname">bool cbor_is_undef </td>
361          <td>(</td>
362          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
363          <td class="paramname"><em>item</em></td><td>)</td>
364          <td></td>
365        </tr>
366      </table>
367</div><div class="memdoc">
368
369<p>Does this item represent <code>undefined</code> </p>
370<pre class="fragment">embed:rst:leading-asterisk
371* .. warning:: Care must be taken to distinguish nulls and undefined values in C.
372* </pre> <dl class="params"><dt>Parameters</dt><dd>
373  <table class="params">
374    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
375  </table>
376  </dd>
377</dl>
378<dl class="section return"><dt>Returns</dt><dd>Is the item (CBOR logical) undefined? </dd></dl>
379
380<p>Definition at line <a class="el" href="common_8c_source.html#l00082">82</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
381
382</div>
383</div>
384<a id="a9ed0fa96105c211867c5032f2a5a8b20"></a>
385<h2 class="memtitle"><span class="permalink"><a href="#a9ed0fa96105c211867c5032f2a5a8b20">&sect;&nbsp;</a></span>cbor_isa_array()</h2>
386
387<div class="memitem">
388<div class="memproto">
389      <table class="memname">
390        <tr>
391          <td class="memname">bool cbor_isa_array </td>
392          <td>(</td>
393          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
394          <td class="paramname"><em>item</em></td><td>)</td>
395          <td></td>
396        </tr>
397      </table>
398</div><div class="memdoc">
399
400<p>Does the item have the appropriate major type? </p>
401<dl class="params"><dt>Parameters</dt><dd>
402  <table class="params">
403    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
404  </table>
405  </dd>
406</dl>
407<dl class="section return"><dt>Returns</dt><dd>Is the item an <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae48b04b3538ade49d7eae9ee6b656103" title="4 - arrays ">CBOR_TYPE_ARRAY</a>? </dd></dl>
408
409<p>Definition at line <a class="el" href="common_8c_source.html#l00038">38</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
410
411</div>
412</div>
413<a id="adedaf37527b8d8261e287a0001e5a190"></a>
414<h2 class="memtitle"><span class="permalink"><a href="#adedaf37527b8d8261e287a0001e5a190">&sect;&nbsp;</a></span>cbor_isa_bytestring()</h2>
415
416<div class="memitem">
417<div class="memproto">
418      <table class="memname">
419        <tr>
420          <td class="memname">bool cbor_isa_bytestring </td>
421          <td>(</td>
422          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
423          <td class="paramname"><em>item</em></td><td>)</td>
424          <td></td>
425        </tr>
426      </table>
427</div><div class="memdoc">
428
429<p>Does the item have the appropriate major type? </p>
430<dl class="params"><dt>Parameters</dt><dd>
431  <table class="params">
432    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
433  </table>
434  </dd>
435</dl>
436<dl class="section return"><dt>Returns</dt><dd>Is the item a <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a70b9f0b5958c8d51f15ad7bb7c4af01d" title="2 - byte strings ">CBOR_TYPE_BYTESTRING</a>? </dd></dl>
437
438<p>Definition at line <a class="el" href="common_8c_source.html#l00028">28</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
439
440</div>
441</div>
442<a id="a983dec76e934c49ed6979226f9db4386"></a>
443<h2 class="memtitle"><span class="permalink"><a href="#a983dec76e934c49ed6979226f9db4386">&sect;&nbsp;</a></span>cbor_isa_float_ctrl()</h2>
444
445<div class="memitem">
446<div class="memproto">
447      <table class="memname">
448        <tr>
449          <td class="memname">bool cbor_isa_float_ctrl </td>
450          <td>(</td>
451          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
452          <td class="paramname"><em>item</em></td><td>)</td>
453          <td></td>
454        </tr>
455      </table>
456</div><div class="memdoc">
457
458<p>Does the item have the appropriate major type? </p>
459<dl class="params"><dt>Parameters</dt><dd>
460  <table class="params">
461    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
462  </table>
463  </dd>
464</dl>
465<dl class="section return"><dt>Returns</dt><dd>Is the item a <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a1276dcc4ac56df5fd7e0270344a6e57d" title="7 - decimals and special values (true, false, nil, ...) ">CBOR_TYPE_FLOAT_CTRL</a>? </dd></dl>
466
467<p>Definition at line <a class="el" href="common_8c_source.html#l00053">53</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
468
469</div>
470</div>
471<a id="af0de041481b61922d0995b63f82d8ddd"></a>
472<h2 class="memtitle"><span class="permalink"><a href="#af0de041481b61922d0995b63f82d8ddd">&sect;&nbsp;</a></span>cbor_isa_map()</h2>
473
474<div class="memitem">
475<div class="memproto">
476      <table class="memname">
477        <tr>
478          <td class="memname">bool cbor_isa_map </td>
479          <td>(</td>
480          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
481          <td class="paramname"><em>item</em></td><td>)</td>
482          <td></td>
483        </tr>
484      </table>
485</div><div class="memdoc">
486
487<p>Does the item have the appropriate major type? </p>
488<dl class="params"><dt>Parameters</dt><dd>
489  <table class="params">
490    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
491  </table>
492  </dd>
493</dl>
494<dl class="section return"><dt>Returns</dt><dd>Is the item a <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a057fc3133cb4465f9eb734acfd195db2" title="5 - maps ">CBOR_TYPE_MAP</a>? </dd></dl>
495
496<p>Definition at line <a class="el" href="common_8c_source.html#l00043">43</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
497
498</div>
499</div>
500<a id="a0ca5042e3807d2cc9c3d40f9266460dd"></a>
501<h2 class="memtitle"><span class="permalink"><a href="#a0ca5042e3807d2cc9c3d40f9266460dd">&sect;&nbsp;</a></span>cbor_isa_negint()</h2>
502
503<div class="memitem">
504<div class="memproto">
505      <table class="memname">
506        <tr>
507          <td class="memname">bool cbor_isa_negint </td>
508          <td>(</td>
509          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
510          <td class="paramname"><em>item</em></td><td>)</td>
511          <td></td>
512        </tr>
513      </table>
514</div><div class="memdoc">
515
516<p>Does the item have the appropriate major type? </p>
517<dl class="params"><dt>Parameters</dt><dd>
518  <table class="params">
519    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
520  </table>
521  </dd>
522</dl>
523<dl class="section return"><dt>Returns</dt><dd>Is the item a <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae140516103af792c8f2af84390acfdcd" title="1 - negative integers ">CBOR_TYPE_NEGINT</a>? </dd></dl>
524
525<p>Definition at line <a class="el" href="common_8c_source.html#l00023">23</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
526
527</div>
528</div>
529<a id="a02edd93bb8eab83bc2b8f8bf5d7d1335"></a>
530<h2 class="memtitle"><span class="permalink"><a href="#a02edd93bb8eab83bc2b8f8bf5d7d1335">&sect;&nbsp;</a></span>cbor_isa_string()</h2>
531
532<div class="memitem">
533<div class="memproto">
534      <table class="memname">
535        <tr>
536          <td class="memname">bool cbor_isa_string </td>
537          <td>(</td>
538          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
539          <td class="paramname"><em>item</em></td><td>)</td>
540          <td></td>
541        </tr>
542      </table>
543</div><div class="memdoc">
544
545<p>Does the item have the appropriate major type? </p>
546<dl class="params"><dt>Parameters</dt><dd>
547  <table class="params">
548    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
549  </table>
550  </dd>
551</dl>
552<dl class="section return"><dt>Returns</dt><dd>Is the item a <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6ae05102a66420250eacd5f17b95d04443" title="3 - strings ">CBOR_TYPE_STRING</a>? </dd></dl>
553
554<p>Definition at line <a class="el" href="common_8c_source.html#l00033">33</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
555
556</div>
557</div>
558<a id="a0d5054202c5ec9375e8daf5930087a61"></a>
559<h2 class="memtitle"><span class="permalink"><a href="#a0d5054202c5ec9375e8daf5930087a61">&sect;&nbsp;</a></span>cbor_isa_tag()</h2>
560
561<div class="memitem">
562<div class="memproto">
563      <table class="memname">
564        <tr>
565          <td class="memname">bool cbor_isa_tag </td>
566          <td>(</td>
567          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
568          <td class="paramname"><em>item</em></td><td>)</td>
569          <td></td>
570        </tr>
571      </table>
572</div><div class="memdoc">
573
574<p>Does the item have the appropriate major type? </p>
575<dl class="params"><dt>Parameters</dt><dd>
576  <table class="params">
577    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
578  </table>
579  </dd>
580</dl>
581<dl class="section return"><dt>Returns</dt><dd>Is the item a <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a16f0eaf29eeea66fe37ec1ed0fa45415" title="6 - tags ">CBOR_TYPE_TAG</a>? </dd></dl>
582
583<p>Definition at line <a class="el" href="common_8c_source.html#l00048">48</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
584
585</div>
586</div>
587<a id="a682a023f7012a5b66a57847e6f8d386f"></a>
588<h2 class="memtitle"><span class="permalink"><a href="#a682a023f7012a5b66a57847e6f8d386f">&sect;&nbsp;</a></span>cbor_isa_uint()</h2>
589
590<div class="memitem">
591<div class="memproto">
592      <table class="memname">
593        <tr>
594          <td class="memname">bool cbor_isa_uint </td>
595          <td>(</td>
596          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
597          <td class="paramname"><em>item</em></td><td>)</td>
598          <td></td>
599        </tr>
600      </table>
601</div><div class="memdoc">
602
603<p>Does the item have the appropriate major type? </p>
604<dl class="params"><dt>Parameters</dt><dd>
605  <table class="params">
606    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
607  </table>
608  </dd>
609</dl>
610<dl class="section return"><dt>Returns</dt><dd>Is the item an <a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6a2137d55d8028e37ff4319a633ef0634f" title="0 - positive integers ">CBOR_TYPE_UINT</a>? </dd></dl>
611
612<p>Definition at line <a class="el" href="common_8c_source.html#l00018">18</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
613
614</div>
615</div>
616<a id="a327dce45c1cb680953555290dba8e35b"></a>
617<h2 class="memtitle"><span class="permalink"><a href="#a327dce45c1cb680953555290dba8e35b">&sect;&nbsp;</a></span>cbor_move()</h2>
618
619<div class="memitem">
620<div class="memproto">
621      <table class="memname">
622        <tr>
623          <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_move </td>
624          <td>(</td>
625          <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
626          <td class="paramname"><em>item</em></td><td>)</td>
627          <td></td>
628        </tr>
629      </table>
630</div><div class="memdoc">
631
632<p>Provides CPP-like move construct. </p>
633<p>Decreases the reference count by one, but does not deallocate the item even if its refcount reaches zero. This is useful for passing intermediate values to functions that increase reference count. Should only be used with functions that <code>incref</code> their arguments.</p>
634<pre class="fragment">embed:rst:leading-asterisk
635* .. warning:: If the item is moved without correctly increasing the reference count afterwards, the memory will be leaked.
636* </pre><dl class="params"><dt>Parameters</dt><dd>
637  <table class="params">
638    <tr><td class="paramname">item[take]</td><td>the item </td></tr>
639  </table>
640  </dd>
641</dl>
642<dl class="section return"><dt>Returns</dt><dd>the item with reference count decreased by one </dd></dl>
643
644<p>Definition at line <a class="el" href="common_8c_source.html#l00184">184</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
645
646</div>
647</div>
648<a id="ab27dda20ad909cebaee1b2f43e676f2c"></a>
649<h2 class="memtitle"><span class="permalink"><a href="#ab27dda20ad909cebaee1b2f43e676f2c">&sect;&nbsp;</a></span>cbor_refcount()</h2>
650
651<div class="memitem">
652<div class="memproto">
653      <table class="memname">
654        <tr>
655          <td class="memname">size_t cbor_refcount </td>
656          <td>(</td>
657          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
658          <td class="paramname"><em>item</em></td><td>)</td>
659          <td></td>
660        </tr>
661      </table>
662</div><div class="memdoc">
663
664<p>Get the reference count. </p>
665<pre class="fragment">embed:rst:leading-asterisk
666* .. warning:: This does *not* account for transitive references.
667* </pre><dl class="params"><dt>Parameters</dt><dd>
668  <table class="params">
669    <tr><td class="paramname">item[borrow]</td><td>the item </td></tr>
670  </table>
671  </dd>
672</dl>
673<dl class="section return"><dt>Returns</dt><dd>the reference count </dd></dl>
674
675<p>Definition at line <a class="el" href="common_8c_source.html#l00179">179</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
676
677</div>
678</div>
679<a id="ac2b9aba4cf07857524a0a520eabeef52"></a>
680<h2 class="memtitle"><span class="permalink"><a href="#ac2b9aba4cf07857524a0a520eabeef52">&sect;&nbsp;</a></span>cbor_typeof()</h2>
681
682<div class="memitem">
683<div class="memproto">
684      <table class="memname">
685        <tr>
686          <td class="memname"><a class="el" href="data_8h.html#a3a931b40fc31b51cccfd1bc3dc5fc5d6">cbor_type</a> cbor_typeof </td>
687          <td>(</td>
688          <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
689          <td class="paramname"><em>item</em></td><td>)</td>
690          <td></td>
691        </tr>
692      </table>
693</div><div class="memdoc">
694
695<p>Get the type of the item. </p>
696<dl class="params"><dt>Parameters</dt><dd>
697  <table class="params">
698    <tr><td class="paramname">item[borrow]</td><td></td></tr>
699  </table>
700  </dd>
701</dl>
702<dl class="section return"><dt>Returns</dt><dd>The type </dd></dl>
703
704<p>Definition at line <a class="el" href="common_8c_source.html#l00059">59</a> of file <a class="el" href="common_8c_source.html">common.c</a>.</p>
705
706</div>
707</div>
708</div><!-- contents -->
709<!-- start footer part -->
710<hr class="footer"/><address class="footer"><small>
711Generated on Mon Feb 6 2017 00:26:19 for libcbor by &#160;<a href="http://www.doxygen.org/index.html">
712<img class="footer" src="doxygen.png" alt="doxygen"/>
713</a> 1.8.12
714</small></address>
715</body>
716</html>
717