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/arrays.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">arrays.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="arrays_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_ARRAYS_H</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define LIBCBOR_ARRAYS_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="l00022"></a><span class="lineno">   22</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="arrays_8h.html#a4f634a9a4bc834e4ea6ac43e94d51f84">cbor_array_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="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="keywordtype">size_t</span> <a class="code" href="arrays_8h.html#a5da97cca271f81f55809c39fad6078b0">cbor_array_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="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="arrays_8h.html#a1573139e26cf5b5acc4b0ed861291069">cbor_array_get</a>(<span class="keyword">const</span> <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item, <span class="keywordtype">size_t</span> index);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="arrays_8h.html#a382cc2dc480ebb9c7951eb3235be89b4">cbor_array_set</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item, <span class="keywordtype">size_t</span> index, <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * value);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="arrays_8h.html#a44020515090bbbe91249aff0016ab8e5">cbor_array_replace</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * item, <span class="keywordtype">size_t</span> index, <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * value);</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="arrays_8h.html#ac2f1480c546a0268e8b046b365e58599">cbor_array_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="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="arrays_8h.html#a291a9f3ff12a2e2c58b2ca8b00280d40">cbor_array_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="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> ** <a class="code" href="arrays_8h.html#a8dd01f4a46f162fa4f06b7df7428128e">cbor_array_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="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="arrays_8h.html#a93d7c18019000d5e206a81a4cca70631">cbor_new_definite_array</a>(<span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * <a class="code" href="arrays_8h.html#aaec916ccc6f19782b6aef5ec1da2cc26">cbor_new_indefinite_array</a>();</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="arrays_8h.html#abb1c1c9731a2195857dc471f2a6f60f5">cbor_array_push</a>(<a class="code" href="structcbor__item__t.html">cbor_item_t</a> * array, <a class="code" href="structcbor__item__t.html">cbor_item_t</a> * pushee);</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="preprocessor">#endif //LIBCBOR_ARRAYS_H</span></div><div class="ttc" id="arrays_8h_html_a93d7c18019000d5e206a81a4cca70631"><div class="ttname"><a href="arrays_8h.html#a93d7c18019000d5e206a81a4cca70631">cbor_new_definite_array</a></div><div class="ttdeci">cbor_item_t * cbor_new_definite_array(size_t size)</div><div class="ttdoc">Create new definite array. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00106">arrays.c:106</a></div></div>
<div class="ttc" id="arrays_8h_html_a44020515090bbbe91249aff0016ab8e5"><div class="ttname"><a href="arrays_8h.html#a44020515090bbbe91249aff0016ab8e5">cbor_array_replace</a></div><div class="ttdeci">bool cbor_array_replace(cbor_item_t *item, size_t index, cbor_item_t *value)</div><div class="ttdoc">Replace item at an index. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00042">arrays.c:42</a></div></div>
<div class="ttc" id="arrays_8h_html_a5da97cca271f81f55809c39fad6078b0"><div class="ttname"><a href="arrays_8h.html#a5da97cca271f81f55809c39fad6078b0">cbor_array_allocated</a></div><div class="ttdeci">size_t cbor_array_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="arrays_8c_source.html#l00018">arrays.c:18</a></div></div>
<div class="ttc" id="arrays_8h_html_aaec916ccc6f19782b6aef5ec1da2cc26"><div class="ttname"><a href="arrays_8h.html#aaec916ccc6f19782b6aef5ec1da2cc26">cbor_new_indefinite_array</a></div><div class="ttdeci">cbor_item_t * cbor_new_indefinite_array()</div><div class="ttdoc">Create new indefinite array. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00138">arrays.c:138</a></div></div>
<div class="ttc" id="arrays_8h_html_a1573139e26cf5b5acc4b0ed861291069"><div class="ttname"><a href="arrays_8h.html#a1573139e26cf5b5acc4b0ed861291069">cbor_array_get</a></div><div class="ttdeci">cbor_item_t * cbor_array_get(const cbor_item_t *item, size_t index)</div><div class="ttdoc">Get item by index. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00025">arrays.c:25</a></div></div>
<div class="ttc" id="arrays_8h_html_a291a9f3ff12a2e2c58b2ca8b00280d40"><div class="ttname"><a href="arrays_8h.html#a291a9f3ff12a2e2c58b2ca8b00280d40">cbor_array_is_indefinite</a></div><div class="ttdeci">bool cbor_array_is_indefinite(const cbor_item_t *item)</div><div class="ttdoc">Is the array indefinite? </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00094">arrays.c:94</a></div></div>
<div class="ttc" id="arrays_8h_html_a4f634a9a4bc834e4ea6ac43e94d51f84"><div class="ttname"><a href="arrays_8h.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="arrays_8h_html_ac2f1480c546a0268e8b046b365e58599"><div class="ttname"><a href="arrays_8h.html#ac2f1480c546a0268e8b046b365e58599">cbor_array_is_definite</a></div><div class="ttdeci">bool cbor_array_is_definite(const cbor_item_t *item)</div><div class="ttdoc">Is the array definite? </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00088">arrays.c:88</a></div></div>
<div class="ttc" id="arrays_8h_html_abb1c1c9731a2195857dc471f2a6f60f5"><div class="ttname"><a href="arrays_8h.html#abb1c1c9731a2195857dc471f2a6f60f5">cbor_array_push</a></div><div class="ttdeci">bool cbor_array_push(cbor_item_t *array, cbor_item_t *pushee)</div><div class="ttdoc">Append to the end. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00052">arrays.c:52</a></div></div>
<div class="ttc" id="arrays_8h_html_a382cc2dc480ebb9c7951eb3235be89b4"><div class="ttname"><a href="arrays_8h.html#a382cc2dc480ebb9c7951eb3235be89b4">cbor_array_set</a></div><div class="ttdeci">bool cbor_array_set(cbor_item_t *item, size_t index, cbor_item_t *value)</div><div class="ttdoc">Set item by index. </div><div class="ttdef"><b>Definition:</b> <a href="arrays_8c_source.html#l00030">arrays.c:30</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 class="ttc" id="arrays_8h_html_a8dd01f4a46f162fa4f06b7df7428128e"><div class="ttname"><a href="arrays_8h.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><!-- 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>