blob: a24715174e15c55758793bf65efbf271522c2dfb [file] [log] [blame]
<!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.6"/>
<title>TinyCBOR API: Global constants</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="doxygen.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 style="padding-left: 0.5em;">
<div id="projectname">TinyCBOR API
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">Global constants</div> </div>
</div><!--header-->
<div class="contents">
<p>Constants used by all TinyCBOR function groups.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga46c29d9d57408740dc269d6125d37d26"><td class="memItemLeft" align="right" valign="top">typedef uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#ga46c29d9d57408740dc269d6125d37d26">CborTag</a></td></tr>
<tr class="memdesc:ga46c29d9d57408740dc269d6125d37d26"><td class="mdescLeft">&#160;</td><td class="mdescRight">This typedef is an unsigned 64-bit integer. <a href="#ga46c29d9d57408740dc269d6125d37d26">More...</a><br/></td></tr>
<tr class="separator:ga46c29d9d57408740dc269d6125d37d26"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga38f51ceba8bc8a9b1cf7dd31e3f9c178"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#ga38f51ceba8bc8a9b1cf7dd31e3f9c178">CborType</a> </td></tr>
<tr class="memdesc:ga38f51ceba8bc8a9b1cf7dd31e3f9c178"><td class="mdescLeft">&#160;</td><td class="mdescRight">The CborType enum contains the types known to TinyCBOR. <a href="a00017.html#ga38f51ceba8bc8a9b1cf7dd31e3f9c178">More...</a><br/></td></tr>
<tr class="separator:ga38f51ceba8bc8a9b1cf7dd31e3f9c178"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gade6fa23a8fb3df9db434c69ca05d5ec1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#gade6fa23a8fb3df9db434c69ca05d5ec1">CborKnownTags</a> </td></tr>
<tr class="memdesc:gade6fa23a8fb3df9db434c69ca05d5ec1"><td class="mdescLeft">&#160;</td><td class="mdescRight">The CborKnownTags enum contains known tags specified in RFC 7049, for use by the application. <a href="a00017.html#gade6fa23a8fb3df9db434c69ca05d5ec1">More...</a><br/></td></tr>
<tr class="separator:gade6fa23a8fb3df9db434c69ca05d5ec1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76e9c9acc63dd940da4ab7e91309f7b5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#ga76e9c9acc63dd940da4ab7e91309f7b5">CborError</a> </td></tr>
<tr class="memdesc:ga76e9c9acc63dd940da4ab7e91309f7b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The CborError enum contains the possible error values used by the CBOR encoder and decoder. <a href="a00017.html#ga76e9c9acc63dd940da4ab7e91309f7b5">More...</a><br/></td></tr>
<tr class="separator:ga76e9c9acc63dd940da4ab7e91309f7b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad4519e8ab62ea64773fa6dce00c361dc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad4519e8ab62ea64773fa6dce00c361dc"></a>
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#gad4519e8ab62ea64773fa6dce00c361dc">cbor_error_string</a> (<a class="el" href="a00017.html#ga76e9c9acc63dd940da4ab7e91309f7b5">CborError</a> error)</td></tr>
<tr class="memdesc:gad4519e8ab62ea64773fa6dce00c361dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the error string corresponding to the CBOR error condition <em>error</em>. <br/></td></tr>
<tr class="separator:gad4519e8ab62ea64773fa6dce00c361dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:gadc05d7725df5c9a2995580e2be0e5b57"><td class="memItemLeft" align="right" valign="top">static const size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00017.html#gadc05d7725df5c9a2995580e2be0e5b57">CborIndefiniteLength</a> = ((size_t)-1)</td></tr>
<tr class="memdesc:gadc05d7725df5c9a2995580e2be0e5b57"><td class="mdescLeft">&#160;</td><td class="mdescRight">This variable is a constant used to indicate that the length of the map or array is not yet determined. <a href="#gadc05d7725df5c9a2995580e2be0e5b57">More...</a><br/></td></tr>
<tr class="separator:gadc05d7725df5c9a2995580e2be0e5b57"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Constants used by all TinyCBOR function groups. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga46c29d9d57408740dc269d6125d37d26"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00017.html#ga46c29d9d57408740dc269d6125d37d26">CborTag</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>This typedef is an unsigned 64-bit integer. </p>
<p>Known CBOR tags can be used from the CborKnownTags enum but the user application may use other tag values than the ones specified in RFC 7049. </p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga76e9c9acc63dd940da4ab7e91309f7b5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00017.html#ga76e9c9acc63dd940da4ab7e91309f7b5">CborError</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The CborError enum contains the possible error values used by the CBOR encoder and decoder. </p>
<p>TinyCBOR functions report success by returning CborNoError, or one error condition by returning one of the values below. One exception is the out-of-memory condition (CborErrorOutOfMemory), which the functions for <a class="el" href="a00018.html">Encoding to CBOR</a> may report in bit-wise OR with other conditions.</p>
<p>This technique allows code to determine whether the only error condition was a lack of buffer space, which may not be a fatal condition if the buffer can be resized. Additionally, the functions for <a class="el" href="a00018.html">Encoding to CBOR</a> may continue to be used even after CborErrorOutOfMemory is returned, and instead they will simply calculate the extra space needed.</p>
<ul>
<li><code>CborNoError</code> No error occurred CborUnknownError </li>
<li><code>CborErrorUnknownLength</code> Request for the length of an array, map or string whose length is not provided in the CBOR stream </li>
<li><code>CborErrorAdvancePastEOF</code> Not enough data in the stream to decode item (decoding would advance past end of stream) </li>
<li><code>CborErrorIO</code> An I/O error occurred, probably due to an out-of-memory situation </li>
<li><code>CborErrorGarbageAtEnd</code> Bytes exist past the end of the CBOR stream </li>
<li><code>CborErrorUnexpectedEOF</code> End of stream reached unexpectedly </li>
<li><code>CborErrorUnexpectedBreak</code> A CBOR break byte was found where not expected </li>
<li><code>CborErrorUnknownType</code> An unknown type (future extension to CBOR) was found in the stream </li>
<li><code>CborErrorIllegalType</code> An invalid type was found while parsing a chunked CBOR string </li>
<li><code>CborErrorIllegalNumber</code> An illegal initial byte (encoding unspecified additional information) was found </li>
<li><code>CborErrorIllegalSimpleType</code> An illegal encoding of a CBOR Simple Type of value less than 32 was found CborErrorUnknownSimpleType CborErrorUnknownTag CborErrorInappropriateTagForType CborErrorDuplicateObjectKeys </li>
<li><code>CborErrorInvalidUtf8TextString</code> Illegal UTF-8 encoding found while parsing CBOR Text String </li>
<li><code>CborErrorTooManyItems</code> Too many items were added to CBOR map or array of pre-determined length </li>
<li><code>CborErrorTooFewItems</code> Too few items were added to CBOR map or array of pre-determeined length </li>
<li><code>CborErrorDataTooLarge</code> Data item size exceeds TinyCBOR's implementation limits </li>
<li><code>CborErrorNestingTooDeep</code> Data item nesting exceeds TinyCBOR's implementation limits CborErrorUnsupportedType </li>
<li><code>CborErrorJsonObjectKeyIsAggregate</code> Conversion to JSON failed because the key in a map is a CBOR map or array </li>
<li><code>CborErrorJsonObjectKeyNotString</code> Conversion to JSON failed because the key in a map is not a text string </li>
<li><code>CborErrorOutOfMemory</code> During CBOR encoding, the buffer provided is insufficient for encoding the data item; in other situations, TinyCBOR failed to allocate memory </li>
<li><code>CborErrorInternalError</code> An internal error occurred in TinyCBOR </li>
</ul>
</div>
</div>
<a class="anchor" id="gade6fa23a8fb3df9db434c69ca05d5ec1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00017.html#gade6fa23a8fb3df9db434c69ca05d5ec1">CborKnownTags</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The CborKnownTags enum contains known tags specified in RFC 7049, for use by the application. </p>
<p>TinyCBOR does not usually interpret the meaning of these tags and does not add them to the output stream, unless specifically instructed to do so in functions for that effect.</p>
<ul>
<li><code>CborDateTimeStringTag</code> Text string contains a date-time encoded in RFC 3339 format, "YYYY-MM-DD hh:mm:ss+zzzz" </li>
<li><code>CborUnixTime_tTag</code> Number is a Unix time_t quantity, the number of seconds since 1970-01-01 midnight UTC </li>
<li><code>CborPositiveBignumTag</code> Item is a CBOR byte string encoding a positive integer of arbitrary precision </li>
<li><code>CborNegativeBignumTag</code> Item is a CBOR byte string encoding a negative integer of arbitrary precision </li>
<li><code>CborDecimalTag</code> Item is a CBOR array of two integers encoding a fixed-point decimal </li>
<li><code>CborBigfloatTag</code> Item is a bigfloat </li>
<li><code>CborExpectedBase64urlTag</code> Item is a CBOR byte string that is expected to be encoded as Base64Url </li>
<li><code>CborExpectedBase64Tag</code> Item is a CBOR byte string that is expected to be encoded as Base64 </li>
<li><code>CborExpectedBase16Tag</code> Item is a CBOR byte string that is expected to be encoded as Base16 (also known as "hexdump") </li>
<li><code>CborUriTag</code> Item is a CBOR text string containing an URI (RFC 3986) or IRI (RFC 3987) </li>
<li><code>CborBase64urlTag</code> Item is a CBOR text string that was encoded as Base64Url </li>
<li><code>CborBase64Tag</code> Item is a CBOR text string that was encoded as Base64 </li>
<li><code>CborRegularExpressionTag</code> Item is a CBOR text string containing a regular expression </li>
<li><code>CborMimeMessageTag</code> Item is a CBOR text string containing a MIME message (RFC 2045, 2046, 2047, 2822) </li>
<li><code>CborSignatureTag</code> Item contains CBOR-encoded data. This tag is also used as "file magic," marking a file as containing CBOR </li>
</ul>
</div>
</div>
<a class="anchor" id="ga38f51ceba8bc8a9b1cf7dd31e3f9c178"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00017.html#ga38f51ceba8bc8a9b1cf7dd31e3f9c178">CborType</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The CborType enum contains the types known to TinyCBOR. </p>
<ul>
<li><code>CborIntegerType</code> Type is an integer value, positive, negative or zero </li>
<li><code>CborByteStringType</code> Type is a string of arbitrary raw bytes </li>
<li><code>CborTextStringType</code> Type is a text string encoded in UTF-8 </li>
<li><code>CborArrayType</code> Type is a CBOR array </li>
<li><code>CborMapType</code> Type is a CBOR map (an associative container with key and value pairs) </li>
<li><code>CborTagType</code> Type is a CBOR tag (a 64-bit integer describing the item that follows, see CborKnownTags) </li>
<li><code>CborSimpleType</code> Type is one of CBOR Simple Types </li>
<li><code>CborBooleanType</code> Type is a boolean (true or false) </li>
<li><code>CborNullType</code> Type encodes a null </li>
<li><code>CborUndefinedType</code> Type encodes an undefined value </li>
<li><code>CborHalfFloatType</code> Type is an IEEE 754 half precision (16-bit) floating point type </li>
<li><code>CborFloatType</code> Type is an IEEE 754 single precision (32-bit) floating point type </li>
<li><code>CborDoubleType</code> Type is an IEEE 754 double precision (64-bit) floating point type </li>
<li><code>CborInvalidType</code> Type is not valid (this value is used to indicate error conditions) </li>
</ul>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="gadc05d7725df5c9a2995580e2be0e5b57"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">size_t CborIndefiniteLength = ((size_t)-1)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This variable is a constant used to indicate that the length of the map or array is not yet determined. </p>
<p>It is used in functions <a class="el" href="a00018.html#gad4a5ef2d574b5ac30d18ba696e219340" title="Creates a CBOR map in the CBOR stream provided by encoder and initializes mapEncoder so that items ca...">cbor_encoder_create_map()</a> and <a class="el" href="a00018.html#ga97b4d15feaa128ed900704523979bd3f" title="Creates a CBOR array in the CBOR stream provided by encoder and initializes arrayEncoder so that item...">cbor_encoder_create_array()</a> </p>
<p>Referenced by <a class="el" href="a00018.html#gad4a5ef2d574b5ac30d18ba696e219340">cbor_encoder_create_map()</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>