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.h File Reference</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>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">cbor.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="data_8h_source.html">cbor/data.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="common_8h_source.html">cbor/common.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="arrays_8h_source.html">cbor/arrays.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="bytestrings_8h_source.html">cbor/bytestrings.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="floats__ctrls_8h_source.html">cbor/floats_ctrls.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ints_8h_source.html">cbor/ints.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="maps_8h_source.html">cbor/maps.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="strings_8h_source.html">cbor/strings.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="tags_8h_source.html">cbor/tags.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="encoding_8h_source.html">cbor/encoding.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="serialization_8h_source.html">cbor/serialization.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="callbacks_8h_source.html">cbor/callbacks.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="streaming_8h_source.html">cbor/streaming.h</a>&quot;</code><br />
</div>
<p><a href="cbor_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ae48d76b44e6de39a98ff3599d9acda8f"><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="cbor_8h.html#ae48d76b44e6de39a98ff3599d9acda8f">cbor_load</a> (<a class="el" href="data_8h.html#a121c5944682215e742475f12f07c0a72">cbor_data</a> source, size_t source_size, struct <a class="el" href="structcbor__load__result.html">cbor_load_result</a> *result)</td></tr>
<tr class="memdesc:ae48d76b44e6de39a98ff3599d9acda8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loads data item from a buffer.  <a href="#ae48d76b44e6de39a98ff3599d9acda8f">More...</a><br /></td></tr>
<tr class="separator:ae48d76b44e6de39a98ff3599d9acda8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac54800327647ea17db0f40d72873f505"><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="cbor_8h.html#ac54800327647ea17db0f40d72873f505">cbor_copy</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr>
<tr class="memdesc:ac54800327647ea17db0f40d72873f505"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deep copy of an item.  <a href="#ac54800327647ea17db0f40d72873f505">More...</a><br /></td></tr>
<tr class="separator:ac54800327647ea17db0f40d72873f505"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ac54800327647ea17db0f40d72873f505"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac54800327647ea17db0f40d72873f505">&sect;&nbsp;</a></span>cbor_copy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_copy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> *&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deep copy of an item. </p>
<p>All the reference counts in the new structure are set to one.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">item[borrow]</td><td>item to copy </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><b>new</b> CBOR deep copy </dd></dl>

<p>Definition at line <a class="el" href="cbor_8c_source.html#l00164">164</a> of file <a class="el" href="cbor_8c_source.html">cbor.c</a>.</p>

</div>
</div>
<a id="ae48d76b44e6de39a98ff3599d9acda8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae48d76b44e6de39a98ff3599d9acda8f">&sect;&nbsp;</a></span>cbor_load()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_load </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="data_8h.html#a121c5944682215e742475f12f07c0a72">cbor_data</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>source_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structcbor__load__result.html">cbor_load_result</a> *&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loads data item from a buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>The buffer </td></tr>
    <tr><td class="paramname">source_size</td><td></td></tr>
    <tr><td class="paramname">result[out]</td><td>Result indicator. <a class="el" href="data_8h.html#a13ad43c61d917938e0ce26173e6b2eb6a711ecd32adcc030541f2cfb58f69856d">CBOR_ERR_NONE</a> on success </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><b>new</b> CBOR item or <code>NULL</code> on failure. In that case, <code>result</code> contains location and description of the error. </dd></dl>

<p>Definition at line <a class="el" href="cbor_8c_source.html#l00012">12</a> of file <a class="el" href="cbor_8c_source.html">cbor.c</a>.</p>

</div>
</div>
</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>