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/bytestrings.h 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  <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">bytestrings.h File Reference</div> </div> 72</div><!--header--> 73<div class="contents"> 74<div class="textblock"><code>#include "<a class="el" href="common_8h_source.html">cbor/common.h</a>"</code><br /> 75</div> 76<p><a href="bytestrings_8h_source.html">Go to the source code of this file.</a></p> 77<table class="memberdecls"> 78<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 79Functions</h2></td></tr> 80<tr class="memitem:a7c15a63fdc3830707eac0877a261f1cd"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a7c15a63fdc3830707eac0877a261f1cd">cbor_bytestring_length</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr> 81<tr class="memdesc:a7c15a63fdc3830707eac0877a261f1cd"><td class="mdescLeft"> </td><td class="mdescRight">Returns the length of the binary data. <a href="#a7c15a63fdc3830707eac0877a261f1cd">More...</a><br /></td></tr> 82<tr class="separator:a7c15a63fdc3830707eac0877a261f1cd"><td class="memSeparator" colspan="2"> </td></tr> 83<tr class="memitem:a368222dbbcea25e06469524e26587e2a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a368222dbbcea25e06469524e26587e2a">cbor_bytestring_is_definite</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr> 84<tr class="memdesc:a368222dbbcea25e06469524e26587e2a"><td class="mdescLeft"> </td><td class="mdescRight">Is the byte string definite? <a href="#a368222dbbcea25e06469524e26587e2a">More...</a><br /></td></tr> 85<tr class="separator:a368222dbbcea25e06469524e26587e2a"><td class="memSeparator" colspan="2"> </td></tr> 86<tr class="memitem:a3a6c450f105bb18b6b56d20f0de4786a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a3a6c450f105bb18b6b56d20f0de4786a">cbor_bytestring_is_indefinite</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr> 87<tr class="memdesc:a3a6c450f105bb18b6b56d20f0de4786a"><td class="mdescLeft"> </td><td class="mdescRight">Is the byte string indefinite? <a href="#a3a6c450f105bb18b6b56d20f0de4786a">More...</a><br /></td></tr> 88<tr class="separator:a3a6c450f105bb18b6b56d20f0de4786a"><td class="memSeparator" colspan="2"> </td></tr> 89<tr class="memitem:a05c09e147b0a244abc481b0b078ebcb9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="data_8h.html#aabb40e458ece40477e134a69c76693e8">cbor_mutable_data</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a05c09e147b0a244abc481b0b078ebcb9">cbor_bytestring_handle</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr> 90<tr class="memdesc:a05c09e147b0a244abc481b0b078ebcb9"><td class="mdescLeft"> </td><td class="mdescRight">Get the handle to the binary data. <a href="#a05c09e147b0a244abc481b0b078ebcb9">More...</a><br /></td></tr> 91<tr class="separator:a05c09e147b0a244abc481b0b078ebcb9"><td class="memSeparator" colspan="2"> </td></tr> 92<tr class="memitem:a513fd06374cb4faa9e909c85e4248199"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a513fd06374cb4faa9e909c85e4248199">cbor_bytestring_set_handle</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item, <a class="el" href="data_8h.html#aabb40e458ece40477e134a69c76693e8">cbor_mutable_data</a> <a class="el" href="common_8h.html#a9ac79315ed2dcf2c9587e8e3a9a6bc97">CBOR_RESTRICT_POINTER</a> data, size_t length)</td></tr> 93<tr class="memdesc:a513fd06374cb4faa9e909c85e4248199"><td class="mdescLeft"> </td><td class="mdescRight">Set the handle to the binary data. <a href="#a513fd06374cb4faa9e909c85e4248199">More...</a><br /></td></tr> 94<tr class="separator:a513fd06374cb4faa9e909c85e4248199"><td class="memSeparator" colspan="2"> </td></tr> 95<tr class="memitem:a8ab6255d6f8f209149bdf794dffed849"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> ** </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a8ab6255d6f8f209149bdf794dffed849">cbor_bytestring_chunks_handle</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr> 96<tr class="memdesc:a8ab6255d6f8f209149bdf794dffed849"><td class="mdescLeft"> </td><td class="mdescRight">Get the handle to the array of chunks. <a href="#a8ab6255d6f8f209149bdf794dffed849">More...</a><br /></td></tr> 97<tr class="separator:a8ab6255d6f8f209149bdf794dffed849"><td class="memSeparator" colspan="2"> </td></tr> 98<tr class="memitem:ad02102832d452fd5a5cfa96272b1095d"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#ad02102832d452fd5a5cfa96272b1095d">cbor_bytestring_chunk_count</a> (const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item)</td></tr> 99<tr class="memdesc:ad02102832d452fd5a5cfa96272b1095d"><td class="mdescLeft"> </td><td class="mdescRight">Get the number of chunks this string consist of. <a href="#ad02102832d452fd5a5cfa96272b1095d">More...</a><br /></td></tr> 100<tr class="separator:ad02102832d452fd5a5cfa96272b1095d"><td class="memSeparator" colspan="2"> </td></tr> 101<tr class="memitem:a5dc8c27d6e7acfdd05fdc15c01e25b47"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a5dc8c27d6e7acfdd05fdc15c01e25b47">cbor_bytestring_add_chunk</a> (<a class="el" href="structcbor__item__t.html">cbor_item_t</a> *item, <a class="el" href="structcbor__item__t.html">cbor_item_t</a> *chunk)</td></tr> 102<tr class="memdesc:a5dc8c27d6e7acfdd05fdc15c01e25b47"><td class="mdescLeft"> </td><td class="mdescRight">Appends a chunk to the bytestring. <a href="#a5dc8c27d6e7acfdd05fdc15c01e25b47">More...</a><br /></td></tr> 103<tr class="separator:a5dc8c27d6e7acfdd05fdc15c01e25b47"><td class="memSeparator" colspan="2"> </td></tr> 104<tr class="memitem:a86fc646f4520b90c85a704d27b46e69e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a86fc646f4520b90c85a704d27b46e69e">cbor_new_definite_bytestring</a> ()</td></tr> 105<tr class="memdesc:a86fc646f4520b90c85a704d27b46e69e"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new definite byte string. <a href="#a86fc646f4520b90c85a704d27b46e69e">More...</a><br /></td></tr> 106<tr class="separator:a86fc646f4520b90c85a704d27b46e69e"><td class="memSeparator" colspan="2"> </td></tr> 107<tr class="memitem:a6de9d6387e856c33d2ef8e8e9fdac0ac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#a6de9d6387e856c33d2ef8e8e9fdac0ac">cbor_new_indefinite_bytestring</a> ()</td></tr> 108<tr class="memdesc:a6de9d6387e856c33d2ef8e8e9fdac0ac"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new indefinite byte string. <a href="#a6de9d6387e856c33d2ef8e8e9fdac0ac">More...</a><br /></td></tr> 109<tr class="separator:a6de9d6387e856c33d2ef8e8e9fdac0ac"><td class="memSeparator" colspan="2"> </td></tr> 110<tr class="memitem:ab76bd5ff62831739cd9a8d7ec2768c1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="bytestrings_8h.html#ab76bd5ff62831739cd9a8d7ec2768c1a">cbor_build_bytestring</a> (<a class="el" href="data_8h.html#a121c5944682215e742475f12f07c0a72">cbor_data</a> handle, size_t length)</td></tr> 111<tr class="memdesc:ab76bd5ff62831739cd9a8d7ec2768c1a"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new byte string and initializes it. <a href="#ab76bd5ff62831739cd9a8d7ec2768c1a">More...</a><br /></td></tr> 112<tr class="separator:ab76bd5ff62831739cd9a8d7ec2768c1a"><td class="memSeparator" colspan="2"> </td></tr> 113</table> 114<h2 class="groupheader">Function Documentation</h2> 115<a id="ab76bd5ff62831739cd9a8d7ec2768c1a"></a> 116<h2 class="memtitle"><span class="permalink"><a href="#ab76bd5ff62831739cd9a8d7ec2768c1a">§ </a></span>cbor_build_bytestring()</h2> 117 118<div class="memitem"> 119<div class="memproto"> 120 <table class="memname"> 121 <tr> 122 <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_build_bytestring </td> 123 <td>(</td> 124 <td class="paramtype"><a class="el" href="data_8h.html#a121c5944682215e742475f12f07c0a72">cbor_data</a> </td> 125 <td class="paramname"><em>handle</em>, </td> 126 </tr> 127 <tr> 128 <td class="paramkey"></td> 129 <td></td> 130 <td class="paramtype">size_t </td> 131 <td class="paramname"><em>length</em> </td> 132 </tr> 133 <tr> 134 <td></td> 135 <td>)</td> 136 <td></td><td></td> 137 </tr> 138 </table> 139</div><div class="memdoc"> 140 141<p>Creates a new byte string and initializes it. </p> 142<p>The <code>handle</code> will be copied to a newly allocated block</p> 143<dl class="params"><dt>Parameters</dt><dd> 144 <table class="params"> 145 <tr><td class="paramname">handle</td><td>Block of binary data </td></tr> 146 <tr><td class="paramname">length</td><td>Length of <code>data</code> </td></tr> 147 </table> 148 </dd> 149</dl> 150<dl class="section return"><dt>Returns</dt><dd>A <b>new</b> byte string with content <code>handle</code>. <code>NULL</code> on malloc failure. </dd></dl> 151 152<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00063">63</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 153 154</div> 155</div> 156<a id="a5dc8c27d6e7acfdd05fdc15c01e25b47"></a> 157<h2 class="memtitle"><span class="permalink"><a href="#a5dc8c27d6e7acfdd05fdc15c01e25b47">§ </a></span>cbor_bytestring_add_chunk()</h2> 158 159<div class="memitem"> 160<div class="memproto"> 161 <table class="memname"> 162 <tr> 163 <td class="memname">bool cbor_bytestring_add_chunk </td> 164 <td>(</td> 165 <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 166 <td class="paramname"><em>item</em>, </td> 167 </tr> 168 <tr> 169 <td class="paramkey"></td> 170 <td></td> 171 <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 172 <td class="paramname"><em>chunk</em> </td> 173 </tr> 174 <tr> 175 <td></td> 176 <td>)</td> 177 <td></td><td></td> 178 </tr> 179 </table> 180</div><div class="memdoc"> 181 182<p>Appends a chunk to the bytestring. </p> 183<p>Indefinite byte strings only.</p> 184<p>May realloc the chunk storage.</p> 185<dl class="params"><dt>Parameters</dt><dd> 186 <table class="params"> 187 <tr><td class="paramname">item[borrow]</td><td>An indefinite byte string </td></tr> 188 <tr><td class="paramname">item[incref]</td><td>A definite byte string </td></tr> 189 </table> 190 </dd> 191</dl> 192<dl class="section return"><dt>Returns</dt><dd>true on success, false on realloc failure. In that case, the refcount of <code>chunk</code> is not increased and the <code>item</code> is left intact. </dd></dl> 193 194<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00095">95</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 195 196</div> 197</div> 198<a id="ad02102832d452fd5a5cfa96272b1095d"></a> 199<h2 class="memtitle"><span class="permalink"><a href="#ad02102832d452fd5a5cfa96272b1095d">§ </a></span>cbor_bytestring_chunk_count()</h2> 200 201<div class="memitem"> 202<div class="memproto"> 203 <table class="memname"> 204 <tr> 205 <td class="memname">size_t cbor_bytestring_chunk_count </td> 206 <td>(</td> 207 <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 208 <td class="paramname"><em>item</em></td><td>)</td> 209 <td></td> 210 </tr> 211 </table> 212</div><div class="memdoc"> 213 214<p>Get the number of chunks this string consist of. </p> 215<dl class="params"><dt>Parameters</dt><dd> 216 <table class="params"> 217 <tr><td class="paramname">item[borrow]</td><td>A indefinite bytestring </td></tr> 218 </table> 219 </dd> 220</dl> 221<dl class="section return"><dt>Returns</dt><dd>The chunk count. 0 for freshly created items. </dd></dl> 222 223<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00087">87</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 224 225</div> 226</div> 227<a id="a8ab6255d6f8f209149bdf794dffed849"></a> 228<h2 class="memtitle"><span class="permalink"><a href="#a8ab6255d6f8f209149bdf794dffed849">§ </a></span>cbor_bytestring_chunks_handle()</h2> 229 230<div class="memitem"> 231<div class="memproto"> 232 <table class="memname"> 233 <tr> 234 <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>** cbor_bytestring_chunks_handle </td> 235 <td>(</td> 236 <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 237 <td class="paramname"><em>item</em></td><td>)</td> 238 <td></td> 239 </tr> 240 </table> 241</div><div class="memdoc"> 242 243<p>Get the handle to the array of chunks. </p> 244<p>Manipulations with the memory block (e.g. sorting it) are allowed, but the validity and the number of chunks must be retained.</p> 245<dl class="params"><dt>Parameters</dt><dd> 246 <table class="params"> 247 <tr><td class="paramname">item[borrow]</td><td>A indefinite byte string </td></tr> 248 </table> 249 </dd> 250</dl> 251<dl class="section return"><dt>Returns</dt><dd>array of <a class="el" href="bytestrings_8h.html#ad02102832d452fd5a5cfa96272b1095d" title="Get the number of chunks this string consist of. ">cbor_bytestring_chunk_count</a> definite bytestrings </dd></dl> 252 253<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00080">80</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 254 255</div> 256</div> 257<a id="a05c09e147b0a244abc481b0b078ebcb9"></a> 258<h2 class="memtitle"><span class="permalink"><a href="#a05c09e147b0a244abc481b0b078ebcb9">§ </a></span>cbor_bytestring_handle()</h2> 259 260<div class="memitem"> 261<div class="memproto"> 262 <table class="memname"> 263 <tr> 264 <td class="memname"><a class="el" href="data_8h.html#aabb40e458ece40477e134a69c76693e8">cbor_mutable_data</a> cbor_bytestring_handle </td> 265 <td>(</td> 266 <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 267 <td class="paramname"><em>item</em></td><td>)</td> 268 <td></td> 269 </tr> 270 </table> 271</div><div class="memdoc"> 272 273<p>Get the handle to the binary data. </p> 274<p>Definite items only. Modifying the data is allowed. In that case, the caller takes responsibility for the effect on items this item might be a part of</p> 275<dl class="params"><dt>Parameters</dt><dd> 276 <table class="params"> 277 <tr><td class="paramname">item[borrow]</td><td>A definite byte string </td></tr> 278 </table> 279 </dd> 280</dl> 281<dl class="section return"><dt>Returns</dt><dd>The address of the binary data. <code>NULL</code> if no data have been assigned yet. </dd></dl> 282 283<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00018">18</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 284 285</div> 286</div> 287<a id="a368222dbbcea25e06469524e26587e2a"></a> 288<h2 class="memtitle"><span class="permalink"><a href="#a368222dbbcea25e06469524e26587e2a">§ </a></span>cbor_bytestring_is_definite()</h2> 289 290<div class="memitem"> 291<div class="memproto"> 292 <table class="memname"> 293 <tr> 294 <td class="memname">bool cbor_bytestring_is_definite </td> 295 <td>(</td> 296 <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 297 <td class="paramname"><em>item</em></td><td>)</td> 298 <td></td> 299 </tr> 300 </table> 301</div><div class="memdoc"> 302 303<p>Is the byte string definite? </p> 304<dl class="params"><dt>Parameters</dt><dd> 305 <table class="params"> 306 <tr><td class="paramname">item[borrow]</td><td>a byte string </td></tr> 307 </table> 308 </dd> 309</dl> 310<dl class="section return"><dt>Returns</dt><dd>Is the byte string definite? </dd></dl> 311 312<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00024">24</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 313 314</div> 315</div> 316<a id="a3a6c450f105bb18b6b56d20f0de4786a"></a> 317<h2 class="memtitle"><span class="permalink"><a href="#a3a6c450f105bb18b6b56d20f0de4786a">§ </a></span>cbor_bytestring_is_indefinite()</h2> 318 319<div class="memitem"> 320<div class="memproto"> 321 <table class="memname"> 322 <tr> 323 <td class="memname">bool cbor_bytestring_is_indefinite </td> 324 <td>(</td> 325 <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 326 <td class="paramname"><em>item</em></td><td>)</td> 327 <td></td> 328 </tr> 329 </table> 330</div><div class="memdoc"> 331 332<p>Is the byte string indefinite? </p> 333<dl class="params"><dt>Parameters</dt><dd> 334 <table class="params"> 335 <tr><td class="paramname">item[borrow]</td><td>a byte string </td></tr> 336 </table> 337 </dd> 338</dl> 339<dl class="section return"><dt>Returns</dt><dd>Is the byte string indefinite? </dd></dl> 340 341<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00030">30</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 342 343</div> 344</div> 345<a id="a7c15a63fdc3830707eac0877a261f1cd"></a> 346<h2 class="memtitle"><span class="permalink"><a href="#a7c15a63fdc3830707eac0877a261f1cd">§ </a></span>cbor_bytestring_length()</h2> 347 348<div class="memitem"> 349<div class="memproto"> 350 <table class="memname"> 351 <tr> 352 <td class="memname">size_t cbor_bytestring_length </td> 353 <td>(</td> 354 <td class="paramtype">const <a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 355 <td class="paramname"><em>item</em></td><td>)</td> 356 <td></td> 357 </tr> 358 </table> 359</div><div class="memdoc"> 360 361<p>Returns the length of the binary data. </p> 362<p>For definite byte strings only</p> 363<dl class="params"><dt>Parameters</dt><dd> 364 <table class="params"> 365 <tr><td class="paramname">item[borrow]</td><td>a definite bytestring </td></tr> 366 </table> 367 </dd> 368</dl> 369<dl class="section return"><dt>Returns</dt><dd>length of the binary data. Zero if no chunk has been attached yet </dd></dl> 370 371<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00012">12</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 372 373</div> 374</div> 375<a id="a513fd06374cb4faa9e909c85e4248199"></a> 376<h2 class="memtitle"><span class="permalink"><a href="#a513fd06374cb4faa9e909c85e4248199">§ </a></span>cbor_bytestring_set_handle()</h2> 377 378<div class="memitem"> 379<div class="memproto"> 380 <table class="memname"> 381 <tr> 382 <td class="memname">void cbor_bytestring_set_handle </td> 383 <td>(</td> 384 <td class="paramtype"><a class="el" href="structcbor__item__t.html">cbor_item_t</a> * </td> 385 <td class="paramname"><em>item</em>, </td> 386 </tr> 387 <tr> 388 <td class="paramkey"></td> 389 <td></td> 390 <td class="paramtype"><a class="el" href="data_8h.html#aabb40e458ece40477e134a69c76693e8">cbor_mutable_data</a> <a class="el" href="common_8h.html#a9ac79315ed2dcf2c9587e8e3a9a6bc97">CBOR_RESTRICT_POINTER</a> </td> 391 <td class="paramname"><em>data</em>, </td> 392 </tr> 393 <tr> 394 <td class="paramkey"></td> 395 <td></td> 396 <td class="paramtype">size_t </td> 397 <td class="paramname"><em>length</em> </td> 398 </tr> 399 <tr> 400 <td></td> 401 <td>)</td> 402 <td></td><td></td> 403 </tr> 404 </table> 405</div><div class="memdoc"> 406 407<p>Set the handle to the binary data. </p> 408<dl class="params"><dt>Parameters</dt><dd> 409 <table class="params"> 410 <tr><td class="paramname">item[borrow]</td><td>A definite byte string </td></tr> 411 <tr><td class="paramname">data</td><td>The memory block. The caller gives up the ownership of the block. libcbor will deallocate it when appropriate using its free function </td></tr> 412 <tr><td class="paramname">length</td><td>Length of the data block </td></tr> 413 </table> 414 </dd> 415</dl> 416 417<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00072">72</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 418 419</div> 420</div> 421<a id="a86fc646f4520b90c85a704d27b46e69e"></a> 422<h2 class="memtitle"><span class="permalink"><a href="#a86fc646f4520b90c85a704d27b46e69e">§ </a></span>cbor_new_definite_bytestring()</h2> 423 424<div class="memitem"> 425<div class="memproto"> 426 <table class="memname"> 427 <tr> 428 <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_new_definite_bytestring </td> 429 <td>(</td> 430 <td class="paramname"></td><td>)</td> 431 <td></td> 432 </tr> 433 </table> 434</div><div class="memdoc"> 435 436<p>Creates a new definite byte string. </p> 437<p>The handle is initialized to <code>NULL</code> and length to 0</p> 438<dl class="section return"><dt>Returns</dt><dd><b>new</b> definite bytestring. <code>NULL</code> on malloc failure. </dd></dl> 439 440<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00035">35</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 441 442</div> 443</div> 444<a id="a6de9d6387e856c33d2ef8e8e9fdac0ac"></a> 445<h2 class="memtitle"><span class="permalink"><a href="#a6de9d6387e856c33d2ef8e8e9fdac0ac">§ </a></span>cbor_new_indefinite_bytestring()</h2> 446 447<div class="memitem"> 448<div class="memproto"> 449 <table class="memname"> 450 <tr> 451 <td class="memname"><a class="el" href="structcbor__item__t.html">cbor_item_t</a>* cbor_new_indefinite_bytestring </td> 452 <td>(</td> 453 <td class="paramname"></td><td>)</td> 454 <td></td> 455 </tr> 456 </table> 457</div><div class="memdoc"> 458 459<p>Creates a new indefinite byte string. </p> 460<p>The chunks array is initialized to <code>NULL</code> and chunkcount to 0</p> 461<dl class="section return"><dt>Returns</dt><dd><b>new</b> indefinite bytestring. <code>NULL</code> on malloc failure. </dd></dl> 462 463<p>Definition at line <a class="el" href="bytestrings_8c_source.html#l00046">46</a> of file <a class="el" href="bytestrings_8c_source.html">bytestrings.c</a>.</p> 464 465</div> 466</div> 467</div><!-- contents --> 468<!-- start footer part --> 469<hr class="footer"/><address class="footer"><small> 470Generated on Mon Feb 6 2017 00:26:19 for libcbor by  <a href="http://www.doxygen.org/index.html"> 471<img class="footer" src="doxygen.png" alt="doxygen"/> 472</a> 1.8.12 473</small></address> 474</body> 475</html> 476