xref: /netbsd-src/external/mit/libcbor/dist/docs/doxygen/maps_8h_source.html (revision 5dd36a3bc8bf2a9dec29ceb6349550414570c447)
1*5dd36a3bSchristos<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2*5dd36a3bSchristos<html xmlns="http://www.w3.org/1999/xhtml">
3*5dd36a3bSchristos<head>
4*5dd36a3bSchristos<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5*5dd36a3bSchristos<meta http-equiv="X-UA-Compatible" content="IE=9"/>
6*5dd36a3bSchristos<meta name="generator" content="Doxygen 1.8.12"/>
7*5dd36a3bSchristos<meta name="viewport" content="width=device-width, initial-scale=1"/>
8*5dd36a3bSchristos<title>libcbor: src/cbor/maps.h Source File</title>
9*5dd36a3bSchristos<link href="tabs.css" rel="stylesheet" type="text/css"/>
10*5dd36a3bSchristos<script type="text/javascript" src="jquery.js"></script>
11*5dd36a3bSchristos<script type="text/javascript" src="dynsections.js"></script>
12*5dd36a3bSchristos<link href="search/search.css" rel="stylesheet" type="text/css"/>
13*5dd36a3bSchristos<script type="text/javascript" src="search/searchdata.js"></script>
14*5dd36a3bSchristos<script type="text/javascript" src="search/search.js"></script>
15*5dd36a3bSchristos<link href="doxygen.css" rel="stylesheet" type="text/css" />
16*5dd36a3bSchristos<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
17*5dd36a3bSchristos</head>
18*5dd36a3bSchristos<body>
19*5dd36a3bSchristos<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
20*5dd36a3bSchristos<div id="titlearea">
21*5dd36a3bSchristos<table cellspacing="0" cellpadding="0">
22*5dd36a3bSchristos <tbody>
23*5dd36a3bSchristos <tr style="height: 56px;">
24*5dd36a3bSchristos  <td id="projectalign" style="padding-left: 0.5em;">
25*5dd36a3bSchristos   <div id="projectname">libcbor
26*5dd36a3bSchristos   &#160;<span id="projectnumber">0.5.0</span>
27*5dd36a3bSchristos   </div>
28*5dd36a3bSchristos   <div id="projectbrief">libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.</div>
29*5dd36a3bSchristos  </td>
30*5dd36a3bSchristos </tr>
31*5dd36a3bSchristos </tbody>
32*5dd36a3bSchristos</table>
33*5dd36a3bSchristos</div>
34*5dd36a3bSchristos<!-- end header part -->
35*5dd36a3bSchristos<!-- Generated by Doxygen 1.8.12 -->
36*5dd36a3bSchristos<script type="text/javascript">
37*5dd36a3bSchristosvar searchBox = new SearchBox("searchBox", "search",false,'Search');
38*5dd36a3bSchristos</script>
39*5dd36a3bSchristos<script type="text/javascript" src="menudata.js"></script>
40*5dd36a3bSchristos<script type="text/javascript" src="menu.js"></script>
41*5dd36a3bSchristos<script type="text/javascript">
42*5dd36a3bSchristos$(function() {
43*5dd36a3bSchristos  initMenu('',true,false,'search.php','Search');
44*5dd36a3bSchristos  $(document).ready(function() { init_search(); });
45*5dd36a3bSchristos});
46*5dd36a3bSchristos</script>
47*5dd36a3bSchristos<div id="main-nav"></div>
48*5dd36a3bSchristos<!-- window showing the filter options -->
49*5dd36a3bSchristos<div id="MSearchSelectWindow"
50*5dd36a3bSchristos     onmouseover="return searchBox.OnSearchSelectShow()"
51*5dd36a3bSchristos     onmouseout="return searchBox.OnSearchSelectHide()"
52*5dd36a3bSchristos     onkeydown="return searchBox.OnSearchSelectKey(event)">
53*5dd36a3bSchristos</div>
54*5dd36a3bSchristos
55*5dd36a3bSchristos<!-- iframe showing the search results (closed by default) -->
56*5dd36a3bSchristos<div id="MSearchResultsWindow">
57*5dd36a3bSchristos<iframe src="javascript:void(0)" frameborder="0"
58*5dd36a3bSchristos        name="MSearchResults" id="MSearchResults">
59*5dd36a3bSchristos</iframe>
60*5dd36a3bSchristos</div>
61*5dd36a3bSchristos
62*5dd36a3bSchristos<div id="nav-path" class="navpath">
63*5dd36a3bSchristos  <ul>
64*5dd36a3bSchristos<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*5dd36a3bSchristos</div>
66*5dd36a3bSchristos</div><!-- top -->
67*5dd36a3bSchristos<div class="header">
68*5dd36a3bSchristos  <div class="headertitle">
69*5dd36a3bSchristos<div class="title">maps.h</div>  </div>
70*5dd36a3bSchristos</div><!--header-->
71*5dd36a3bSchristos<div class="contents">
72*5dd36a3bSchristos<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>
73*5dd36a3bSchristos<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>
74*5dd36a3bSchristos<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>
75*5dd36a3bSchristos<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>
76*5dd36a3bSchristos<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>
77*5dd36a3bSchristos<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>
78*5dd36a3bSchristos<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>
79*5dd36a3bSchristos<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>
80*5dd36a3bSchristos<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>
81*5dd36a3bSchristos<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>
82*5dd36a3bSchristos<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>
83*5dd36a3bSchristos<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>
84*5dd36a3bSchristos<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>
85*5dd36a3bSchristos<div class="ttc" id="common_8h_html"><div class="ttname"><a href="common_8h.html">common.h</a></div></div>
86*5dd36a3bSchristos<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>
87*5dd36a3bSchristos</div><!-- fragment --></div><!-- contents -->
88*5dd36a3bSchristos<!-- start footer part -->
89*5dd36a3bSchristos<hr class="footer"/><address class="footer"><small>
90*5dd36a3bSchristosGenerated on Mon Feb 6 2017 00:26:19 for libcbor by &#160;<a href="http://www.doxygen.org/index.html">
91*5dd36a3bSchristos<img class="footer" src="doxygen.png" alt="doxygen"/>
92*5dd36a3bSchristos</a> 1.8.12
93*5dd36a3bSchristos</small></address>
94*5dd36a3bSchristos</body>
95*5dd36a3bSchristos</html>
96