Training courses

Kernel and Embedded Linux

Bootlin training courses

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

Bootlin logo

Elixir Cross Referencer

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcbor: src/cbor/maps.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libcbor
   &#160;<span id="projectnumber">0.5.0</span>
   </div>
   <div id="projectbrief">libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_cb565ba51d82ea933604984cbab6233d.html">cbor</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">maps.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="maps_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2014-2017 Pavel Kalvoda &lt;me@pavelkalvoda.com&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libcbor is free software; you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the MIT license. See LICENSE for details.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef LIBCBOR_MAPS_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define LIBCBOR_MAPS_H</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="common_8h.html">cbor/common.h</a>&quot;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">* ============================================================================</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">* Map manipulation</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">* ============================================================================</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="maps_8h.html#a1bbbee9c6f1eaa0ff4c19559fe109baf">cbor_map_size</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>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="maps_8h.html#a3bf8e5779a3f1311b9b3f9e0a4e4f37e">cbor_map_allocated</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="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> *<a class="code" href="maps_8h.html#adab3c6ff2e51dcf2637567431cc6e76e">cbor_new_definite_map</a>(<span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> *<a class="code" href="maps_8h.html#a58ac69227f48815754651e93d15a5051">cbor_new_indefinite_map</a>();</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="maps_8h.html#af077a30d8258ab02307c24af28036fca">cbor_map_add</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> *item, <span class="keyword">struct</span> <a class="code" href="structcbor__pair.html">cbor_pair</a> pair);</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="maps_8h.html#a64c91e7ecba7cf7d0d4949153d681db8">_cbor_map_add_key</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> *item, <a class="code" href="structcbor__item__t.html">cbor_item_t</a> *<a class="code" href="structcbor__pair.html#a5122c22ad7ef32b2c6ae0a413caca7a1">key</a>);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="maps_8h.html#abb15486eebcd1c41c373613757505705">_cbor_map_add_value</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> *item, <a class="code" href="structcbor__item__t.html">cbor_item_t</a> *<a class="code" href="structcbor__pair.html#a44bbea9cc120de72fc4871a05dc8ec85">value</a>);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="maps_8h.html#a0dccaa76ac293bb5a11dbca6d16f6253">cbor_map_is_definite</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>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="maps_8h.html#a941462383a3c8a6e3a60be9778cd1913">cbor_map_is_indefinite</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="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="keyword">struct </span><a class="code" href="structcbor__pair.html">cbor_pair</a> *<a class="code" href="maps_8h.html#a4cadc8eb7ae7ff8d3f73482fb24455c9">cbor_map_handle</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="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;}</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="preprocessor">#endif //LIBCBOR_MAPS_H</span></div><div class="ttc" id="maps_8h_html_a1bbbee9c6f1eaa0ff4c19559fe109baf"><div class="ttname"><a href="maps_8h.html#a1bbbee9c6f1eaa0ff4c19559fe109baf">cbor_map_size</a></div><div class="ttdeci">size_t cbor_map_size(const cbor_item_t *item)</div><div class="ttdoc">Get the number of pairs. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00011">maps.c:11</a></div></div>
<div class="ttc" id="maps_8h_html_af077a30d8258ab02307c24af28036fca"><div class="ttname"><a href="maps_8h.html#af077a30d8258ab02307c24af28036fca">cbor_map_add</a></div><div class="ttdeci">bool cbor_map_add(cbor_item_t *item, struct cbor_pair pair)</div><div class="ttdoc">Add a pair to the map. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00118">maps.c:118</a></div></div>
<div class="ttc" id="maps_8h_html_a64c91e7ecba7cf7d0d4949153d681db8"><div class="ttname"><a href="maps_8h.html#a64c91e7ecba7cf7d0d4949153d681db8">_cbor_map_add_key</a></div><div class="ttdeci">bool _cbor_map_add_key(cbor_item_t *item, cbor_item_t *key)</div><div class="ttdoc">Add a key to the map. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00066">maps.c:66</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="maps_8h_html_a0dccaa76ac293bb5a11dbca6d16f6253"><div class="ttname"><a href="maps_8h.html#a0dccaa76ac293bb5a11dbca6d16f6253">cbor_map_is_definite</a></div><div class="ttdeci">bool cbor_map_is_definite(const cbor_item_t *item)</div><div class="ttdoc">Is this map definite? </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00126">maps.c:126</a></div></div>
<div class="ttc" id="maps_8h_html_a3bf8e5779a3f1311b9b3f9e0a4e4f37e"><div class="ttname"><a href="maps_8h.html#a3bf8e5779a3f1311b9b3f9e0a4e4f37e">cbor_map_allocated</a></div><div class="ttdeci">size_t cbor_map_allocated(const cbor_item_t *item)</div><div class="ttdoc">Get the size of the allocated storage. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00017">maps.c:17</a></div></div>
<div class="ttc" id="maps_8h_html_adab3c6ff2e51dcf2637567431cc6e76e"><div class="ttname"><a href="maps_8h.html#adab3c6ff2e51dcf2637567431cc6e76e">cbor_new_definite_map</a></div><div class="ttdeci">cbor_item_t * cbor_new_definite_map(size_t size)</div><div class="ttdoc">Create a new definite map. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00023">maps.c:23</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="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="maps_8h_html_a4cadc8eb7ae7ff8d3f73482fb24455c9"><div class="ttname"><a href="maps_8h.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="maps_8h_html_abb15486eebcd1c41c373613757505705"><div class="ttname"><a href="maps_8h.html#abb15486eebcd1c41c373613757505705">_cbor_map_add_value</a></div><div class="ttdeci">bool _cbor_map_add_value(cbor_item_t *item, cbor_item_t *value)</div><div class="ttdoc">Add a value to the map. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00106">maps.c:106</a></div></div>
<div class="ttc" id="maps_8h_html_a58ac69227f48815754651e93d15a5051"><div class="ttname"><a href="maps_8h.html#a58ac69227f48815754651e93d15a5051">cbor_new_indefinite_map</a></div><div class="ttdeci">cbor_item_t * cbor_new_indefinite_map()</div><div class="ttdoc">Create a new indefinite map. </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00046">maps.c:46</a></div></div>
<div class="ttc" id="maps_8h_html_a941462383a3c8a6e3a60be9778cd1913"><div class="ttname"><a href="maps_8h.html#a941462383a3c8a6e3a60be9778cd1913">cbor_map_is_indefinite</a></div><div class="ttdeci">bool cbor_map_is_indefinite(const cbor_item_t *item)</div><div class="ttdoc">Is this map indefinite? </div><div class="ttdef"><b>Definition:</b> <a href="maps_8c_source.html#l00132">maps.c:132</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="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><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Feb 6 2017 00:26:19 for libcbor by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.12
</small></address>
</body>
</html>