You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1196 lines
71 KiB
HTML
1196 lines
71 KiB
HTML
4 years ago
|
<!-- HTML header for doxygen 1.8.7-->
|
||
|
<!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.6.3"/>
|
||
|
<!--BEGIN PROJECT_NAME--><title>avr-libc: avr-libc: <stdlib.h>: General utilities</title><!--END PROJECT_NAME-->
|
||
|
<!--BEGIN !PROJECT_NAME--><title>avr-libc: <stdlib.h>: General utilities</title><!--END !PROJECT_NAME-->
|
||
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||
|
$treeview
|
||
|
$search
|
||
|
$mathjax
|
||
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||
|
$extrastylesheet
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||
|
|
||
|
<!--BEGIN TITLEAREA-->
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
<!--BEGIN PROJECT_LOGO-->
|
||
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
||
|
<!--END PROJECT_LOGO-->
|
||
|
<!--BEGIN PROJECT_NAME-->
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectname">avr-libc
|
||
|
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">2.0.0</span><!--END PROJECT_NUMBER-->
|
||
|
</div>
|
||
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
||
|
</td>
|
||
|
<!--END PROJECT_NAME-->
|
||
|
<!--BEGIN !PROJECT_NAME-->
|
||
|
<!--BEGIN PROJECT_BRIEF-->
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectbrief">$projectbrief</div>
|
||
|
</td>
|
||
|
<!--END PROJECT_BRIEF-->
|
||
|
<!--END !PROJECT_NAME-->
|
||
|
<!--BEGIN DISABLE_INDEX-->
|
||
|
<!--BEGIN SEARCHENGINE-->
|
||
|
<td>$searchbox</td>
|
||
|
<!--END SEARCHENGINE-->
|
||
|
<!--END DISABLE_INDEX-->
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<table>
|
||
|
<tr>
|
||
|
<td align="left"><a href="http://www.nongnu.org/avr-libc/"><h2>AVR Libc Home Page</h2></a></td>
|
||
|
<td align="center" colspan=4><img src="avrs.png" alt="AVRs" align="middle" border="0"></td>
|
||
|
<td align="right"><a href="https://savannah.nongnu.org/projects/avr-libc/"><h2>AVR Libc Development Pages</h2></a></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td align="center" width="20%"><a href="index.html"><h2>Main Page</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="pages.html"><h2>User Manual</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="modules.html"><h2>Library Reference</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="FAQ.html"><h2>FAQ</h2></a></td>
|
||
|
<td align="center" width="20%"><a href="group__demos.html"><h2>Example Projects</h2></a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<!--END TITLEAREA-->
|
||
|
<!-- end header part -->
|
||
|
<!-- Generated by Doxygen 1.6.3 -->
|
||
|
<script type="text/javascript"><!--
|
||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||
|
--></script>
|
||
|
<div class="contents">
|
||
|
<h1><stdlib.h>: General utilities</h1><table border="0" cellpadding="0" cellspacing="0">
|
||
|
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structdiv__t.html">div_t</a></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structldiv__t.html">ldiv_t</a></td></tr>
|
||
|
<tr><td colspan="2"><h2>Defines</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga690f251553b39fd4f31894826141b61a">RAND_MAX</a> 0x7FFF</td></tr>
|
||
|
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gad37588b5e19ccf152d3e4447098402e2">__compar_fn_t</a> )(const void *, const void *)</td></tr>
|
||
|
<tr><td colspan="2"><h2>Functions</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga63e28bec3592384b44606f011634c5a8">abort</a> (void) __ATTR_NORETURN__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gadb8c83badc195efc1229799391fececc">abs</a> (int __i)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gae017047d6d0a688ccb622ff062dcd230">labs</a> (long __i)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga885c1ccefb716ff16ab73a57003140be">bsearch</a> (const void *__key, const void *__base, size_t __nmemb, size_t __size, int(*__compar)(const void *, const void *))</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structdiv__t.html">div_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga7486ea9a8a90ac6b93bed37d08ebbd9e">div</a> (int __num, int __denom) __asm__("__divmodhi4")</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structldiv__t.html">ldiv_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga5b688b463f9faaa82f31ac7587e06849">ldiv</a> (long __num, long __denom) __asm__("__divmodsi4")</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gafd4bf2faec43342e7ad3d2ab37bac1fe">qsort</a> (void *__base, size_t __nmemb, size_t __size, <a class="el" href="group__avr__stdlib.html#gad37588b5e19ccf152d3e4447098402e2">__compar_fn_t</a> __compar)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol</a> (const char *__nptr, char **__endptr, int __base)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2">strtoul</a> (const char *__nptr, char **__endptr, int __base)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga764de49bd918caf24ce1caf3a10b3823">atol</a> (const char *__s) __ATTR_PURE__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga3a1fe00c1327bbabc76688a7a1d73370">atoi</a> (const char *__s) __ATTR_PURE__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga137096a48cc0c731052cadfb69c39b34">exit</a> (int __status) __ATTR_NORETURN__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc</a> (size_t __size) __ATTR_MALLOC__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gafb8699abb1f51d920a176e695ff3be8a">free</a> (void *__ptr)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga51ac965dacbc9daf922f469bdcfe00c2">calloc</a> (size_t __nele, size_t __size) __ATTR_MALLOC__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gafd300bad8b4dd2e88b07d464d76c92aa">realloc</a> (void *__ptr, size_t __size) __ATTR_MALLOC__</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga5ee4d110a3bb55d2eadda05e3ebedf8a">strtod</a> (const char *__nptr, char **__endptr)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga689c9d3c4c04463aa31d329937789d06">atof</a> (const char *__nptr)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand</a> (void)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gacceff9dc95bb3c5562dc9e61fc3d9075">srand</a> (unsigned int __seed)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gaf5085001be836a0f2a5d3269a7c9fd04">rand_r</a> (unsigned long *__ctx)</td></tr>
|
||
|
<tr><td colspan="2"><h2>Variables</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gaffadd67736fd340e893fb22c207de597">__malloc_margin</a></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga9310042b3956282440c091d20cb98c5f">__malloc_heap_start</a></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga4d7b1bf0f75d529cc75229a266132115">__malloc_heap_end</a></td></tr>
|
||
|
<tr><td colspan="2"><h2>Non-standard (i.e. non-ISO C) functions.</h2></td></tr>
|
||
|
<tr><td colspan="2"><p><a class="anchor" id="amgrpa116bb983e59d48cace8e751bbec5472"></a> </p>
|
||
|
<br/><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga5a3fce5fbd20140584619ba9aed09f75">ltoa</a> (long val, char *s, int radix)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gad50d835af7e358518fd100179732e948">utoa</a> (unsigned int val, char *s, int radix)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga34f41757388f40e340f31e370ac009b5">ultoa</a> (unsigned long val, char *s, int radix)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga114aeb1751119382aaf3340355b22cfd">random</a> (void)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga4fca27496ca29c0a723d197696641eff">srandom</a> (unsigned long __seed)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gaa99a0733f06d2b9960a1401c2721af1e">random_r</a> (unsigned long *__ctx)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#gaa571de9e773dde59b0550a5ca4bd2f00">itoa</a> (int val, char *s, int radix)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga3bd31f0d9a9127548b734e7ca03cc6df">RANDOM_MAX</a> 0x7FFFFFFF</td></tr>
|
||
|
<tr><td colspan="2"><h2>Conversion functions for double arguments.</h2></td></tr>
|
||
|
<tr><td colspan="2"><p><a class="anchor" id="amgrp67796e0946dab291b611cb32584a051f"></a> Note that these functions are not located in the default library, <code>libc.a</code>, but in the mathematical library, <code>libm.a</code>. So when linking the application, the <code>-lm</code> option needs to be specified. </p>
|
||
|
<br/><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga6c140bdd3b9bd740a1490137317caa44">dtostre</a> (double __val, char *__s, unsigned char __prec, unsigned char __flags)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga060c998e77fb5fc0d3168b3ce8771d42">dtostrf</a> (double __val, signed char __width, unsigned char __prec, char *__s)</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga815d0d26e215d9b78af1cb2288d22361">DTOSTR_ALWAYS_SIGN</a> 0x01</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga268774f80047812307365f3113109767">DTOSTR_PLUS_SIGN</a> 0x02</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga125348f1e1fed1793426f4c4dc6fb2f7">DTOSTR_UPPERCASE</a> 0x04</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga687984f47d8cce148d1b914d2b79612a">EXIT_SUCCESS</a> 0</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__stdlib.html#ga73efe787c131b385070f25d18b7c9aa4">EXIT_FAILURE</a> 1</td></tr>
|
||
|
</table>
|
||
|
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
||
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <<a class="code" href="stdlib_8h.html">stdlib.h</a>></span>
|
||
|
</pre></div><p>This file declares some basic C macros and functions as defined by the ISO standard, plus some AVR-specific extensions. </p>
|
||
|
<hr/><h2>Define Documentation</h2>
|
||
|
<a class="anchor" id="ga815d0d26e215d9b78af1cb2288d22361"></a><!-- doxytag: member="stdlib.h::DTOSTR_ALWAYS_SIGN" ref="ga815d0d26e215d9b78af1cb2288d22361" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define DTOSTR_ALWAYS_SIGN 0x01</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Bit value that can be passed in <code>flags</code> to <a class="el" href="group__avr__stdlib.html#ga6c140bdd3b9bd740a1490137317caa44">dtostre()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga268774f80047812307365f3113109767"></a><!-- doxytag: member="stdlib.h::DTOSTR_PLUS_SIGN" ref="ga268774f80047812307365f3113109767" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define DTOSTR_PLUS_SIGN 0x02</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Bit value that can be passed in <code>flags</code> to <a class="el" href="group__avr__stdlib.html#ga6c140bdd3b9bd740a1490137317caa44">dtostre()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga125348f1e1fed1793426f4c4dc6fb2f7"></a><!-- doxytag: member="stdlib.h::DTOSTR_UPPERCASE" ref="ga125348f1e1fed1793426f4c4dc6fb2f7" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define DTOSTR_UPPERCASE 0x04</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Bit value that can be passed in <code>flags</code> to <a class="el" href="group__avr__stdlib.html#ga6c140bdd3b9bd740a1490137317caa44">dtostre()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga73efe787c131b385070f25d18b7c9aa4"></a><!-- doxytag: member="stdlib.h::EXIT_FAILURE" ref="ga73efe787c131b385070f25d18b7c9aa4" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define EXIT_FAILURE 1</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Unsuccessful termination for <a class="el" href="group__avr__stdlib.html#ga137096a48cc0c731052cadfb69c39b34">exit()</a>; evaluates to a non-zero value. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga687984f47d8cce148d1b914d2b79612a"></a><!-- doxytag: member="stdlib.h::EXIT_SUCCESS" ref="ga687984f47d8cce148d1b914d2b79612a" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define EXIT_SUCCESS 0</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Successful termination for <a class="el" href="group__avr__stdlib.html#ga137096a48cc0c731052cadfb69c39b34">exit()</a>; evaluates to 0. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga690f251553b39fd4f31894826141b61a"></a><!-- doxytag: member="stdlib.h::RAND_MAX" ref="ga690f251553b39fd4f31894826141b61a" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define RAND_MAX 0x7FFF</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Highest number that can be generated by <a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga3bd31f0d9a9127548b734e7ca03cc6df"></a><!-- doxytag: member="stdlib.h::RANDOM_MAX" ref="ga3bd31f0d9a9127548b734e7ca03cc6df" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define RANDOM_MAX 0x7FFFFFFF</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Highest number that can be generated by <a class="el" href="group__avr__stdlib.html#ga114aeb1751119382aaf3340355b22cfd">random()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Typedef Documentation</h2>
|
||
|
<a class="anchor" id="gad37588b5e19ccf152d3e4447098402e2"></a><!-- doxytag: member="stdlib.h::__compar_fn_t" ref="gad37588b5e19ccf152d3e4447098402e2" args=")(const void *, const void *)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">typedef int(* <a class="el" href="group__avr__stdlib.html#gad37588b5e19ccf152d3e4447098402e2">__compar_fn_t</a>)(const void *, const void *)</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Comparision function type for <a class="el" href="group__avr__stdlib.html#gafd4bf2faec43342e7ad3d2ab37bac1fe">qsort()</a>, just for convenience. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Function Documentation</h2>
|
||
|
<a class="anchor" id="ga63e28bec3592384b44606f011634c5a8"></a><!-- doxytag: member="stdlib.h::abort" ref="ga63e28bec3592384b44606f011634c5a8" args="(void) __ATTR_NORETURN__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void abort </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void </td>
|
||
|
<td class="paramname"></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga63e28bec3592384b44606f011634c5a8">abort()</a> function causes abnormal program termination to occur. This realization disables interrupts and jumps to _exit() function with argument equal to 1. In the limited AVR environment, execution is effectively halted by entering an infinite loop. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gadb8c83badc195efc1229799391fececc"></a><!-- doxytag: member="stdlib.h::abs" ref="gadb8c83badc195efc1229799391fececc" args="(int __i)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int abs </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>__i</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gadb8c83badc195efc1229799391fececc">abs()</a> function computes the absolute value of the integer <code>i</code>. </p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>The <a class="el" href="group__avr__stdlib.html#gadb8c83badc195efc1229799391fececc">abs()</a> and <a class="el" href="group__avr__stdlib.html#gae017047d6d0a688ccb622ff062dcd230">labs()</a> functions are builtins of gcc. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga689c9d3c4c04463aa31d329937789d06"></a><!-- doxytag: member="stdlib.h::atof" ref="ga689c9d3c4c04463aa31d329937789d06" args="(const char *__nptr)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">double atof </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"> <em>nptr</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga689c9d3c4c04463aa31d329937789d06">atof()</a> function converts the initial portion of the string pointed to by <em>nptr</em> to double representation.</p>
|
||
|
<p>It is equivalent to calling </p>
|
||
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__stdlib.html#ga5ee4d110a3bb55d2eadda05e3ebedf8a">strtod</a>(nptr, (<span class="keywordtype">char</span> **)0);
|
||
|
</pre></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga3a1fe00c1327bbabc76688a7a1d73370"></a><!-- doxytag: member="stdlib.h::atoi" ref="ga3a1fe00c1327bbabc76688a7a1d73370" args="(const char *__s) __ATTR_PURE__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int atoi </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"> <em>s</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Convert a string to an integer. </p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga3a1fe00c1327bbabc76688a7a1d73370" title="Convert a string to an integer.">atoi()</a> function converts the initial portion of the string pointed to by <code>s</code> to integer representation. In contrast to</p>
|
||
|
<div class="fragment"><pre class="fragment"> (int)<a class="code" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol</a>(s, (<span class="keywordtype">char</span> **)NULL, 10);
|
||
|
</pre></div><p>this function does not detect overflow (<code>errno</code> is not changed and the result value is not predictable), uses smaller memory (flash and stack) and works more quickly. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga764de49bd918caf24ce1caf3a10b3823"></a><!-- doxytag: member="stdlib.h::atol" ref="ga764de49bd918caf24ce1caf3a10b3823" args="(const char *__s) __ATTR_PURE__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">long atol </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"> <em>s</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Convert a string to a long integer. </p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga764de49bd918caf24ce1caf3a10b3823" title="Convert a string to a long integer.">atol()</a> function converts the initial portion of the string pointed to by <code>s</code> to long integer representation. In contrast to</p>
|
||
|
<div class="fragment"><pre class="fragment"> <a class="code" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol</a>(s, (<span class="keywordtype">char</span> **)NULL, 10);
|
||
|
</pre></div><p>this function does not detect overflow (<code>errno</code> is not changed and the result value is not predictable), uses smaller memory (flash and stack) and works more quickly. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga885c1ccefb716ff16ab73a57003140be"></a><!-- doxytag: member="stdlib.h::bsearch" ref="ga885c1ccefb716ff16ab73a57003140be" args="(const void *__key, const void *__base, size_t __nmemb, size_t __size, int(*__compar)(const void *, const void *))" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void* bsearch </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const void * </td>
|
||
|
<td class="paramname"> <em>__key</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">const void * </td>
|
||
|
<td class="paramname"> <em>__base</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__nmemb</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__size</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int(*)(const void *, const void *) </td>
|
||
|
<td class="paramname"> <em>__compar</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga885c1ccefb716ff16ab73a57003140be">bsearch()</a> function searches an array of <code>nmemb</code> objects, the initial member of which is pointed to by <code>base</code>, for a member that matches the object pointed to by <code>key</code>. The size of each member of the array is specified by <code>size</code>.</p>
|
||
|
<p>The contents of the array should be in ascending sorted order according to the comparison function referenced by <code>compar</code>. The <code>compar</code> routine is expected to have two arguments which point to the key object and to an array member, in that order, and should return an integer less than, equal to, or greater than zero if the key object is found, respectively, to be less than, to match, or be greater than the array member.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga885c1ccefb716ff16ab73a57003140be">bsearch()</a> function returns a pointer to a matching member of the array, or a null pointer if no match is found. If two members compare as equal, which member is matched is unspecified. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga51ac965dacbc9daf922f469bdcfe00c2"></a><!-- doxytag: member="stdlib.h::calloc" ref="ga51ac965dacbc9daf922f469bdcfe00c2" args="(size_t __nele, size_t __size) __ATTR_MALLOC__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void* calloc </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__nele</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__size</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Allocate <code>nele</code> elements of <code>size</code> each. Identical to calling <code><a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a></code> using <code>nele * size</code> as argument, except the allocated memory will be cleared to zero. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga7486ea9a8a90ac6b93bed37d08ebbd9e"></a><!-- doxytag: member="stdlib.h::div" ref="ga7486ea9a8a90ac6b93bed37d08ebbd9e" args="(int __num, int __denom) __asm__("__divmodhi4")" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="structdiv__t.html">div_t</a> div </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>__num</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>__denom</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga7486ea9a8a90ac6b93bed37d08ebbd9e">div()</a> function computes the value <code>num/denom</code> and returns the quotient and remainder in a structure named <code><a class="el" href="structdiv__t.html">div_t</a></code> that contains two int members named <code>quot</code> and <code>rem</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga6c140bdd3b9bd740a1490137317caa44"></a><!-- doxytag: member="stdlib.h::dtostre" ref="ga6c140bdd3b9bd740a1490137317caa44" args="(double __val, char *__s, unsigned char __prec, unsigned char __flags)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* dtostre </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">double </td>
|
||
|
<td class="paramname"> <em>__val</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>__s</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned char </td>
|
||
|
<td class="paramname"> <em>__prec</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned char </td>
|
||
|
<td class="paramname"> <em>__flags</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga6c140bdd3b9bd740a1490137317caa44">dtostre()</a> function converts the double value passed in <code>val</code> into an ASCII representation that will be stored under <code>s</code>. The caller is responsible for providing sufficient storage in <code>s</code>.</p>
|
||
|
<p>Conversion is done in the format <code>"[-]d.ddde±dd"</code> where there is one digit before the decimal-point character and the number of digits after it is equal to the precision <code>prec</code>; if the precision is zero, no decimal-point character appears. If <code>flags</code> has the DTOSTR_UPPERCASE bit set, the letter <code>'E'</code> (rather than <code>'e'</code> ) will be used to introduce the exponent. The exponent always contains two digits; if the value is zero, the exponent is <code>"00"</code>.</p>
|
||
|
<p>If <code>flags</code> has the DTOSTR_ALWAYS_SIGN bit set, a space character will be placed into the leading position for positive numbers.</p>
|
||
|
<p>If <code>flags</code> has the DTOSTR_PLUS_SIGN bit set, a plus sign will be used instead of a space character in this case.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga6c140bdd3b9bd740a1490137317caa44">dtostre()</a> function returns the pointer to the converted string <code>s</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga060c998e77fb5fc0d3168b3ce8771d42"></a><!-- doxytag: member="stdlib.h::dtostrf" ref="ga060c998e77fb5fc0d3168b3ce8771d42" args="(double __val, signed char __width, unsigned char __prec, char *__s)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* dtostrf </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">double </td>
|
||
|
<td class="paramname"> <em>__val</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">signed char </td>
|
||
|
<td class="paramname"> <em>__width</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">unsigned char </td>
|
||
|
<td class="paramname"> <em>__prec</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>__s</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga060c998e77fb5fc0d3168b3ce8771d42">dtostrf()</a> function converts the double value passed in <code>val</code> into an ASCII representationthat will be stored under <code>s</code>. The caller is responsible for providing sufficient storage in <code>s</code>.</p>
|
||
|
<p>Conversion is done in the format <code>"[-]d.ddd"</code>. The minimum field width of the output string (including the possible <code>'</code>.' and the possible sign for negative values) is given in <code>width</code>, and <code>prec</code> determines the number of digits after the decimal sign. <code>width</code> is signed value, negative for left adjustment.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga060c998e77fb5fc0d3168b3ce8771d42">dtostrf()</a> function returns the pointer to the converted string <code>s</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga137096a48cc0c731052cadfb69c39b34"></a><!-- doxytag: member="stdlib.h::exit" ref="ga137096a48cc0c731052cadfb69c39b34" args="(int __status) __ATTR_NORETURN__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void exit </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>__status</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga137096a48cc0c731052cadfb69c39b34">exit()</a> function terminates the application. Since there is no environment to return to, <code>status</code> is ignored, and code execution will eventually reach an infinite loop, thereby effectively halting all code processing. Before entering the infinite loop, interrupts are globally disabled.</p>
|
||
|
<p>In a C++ context, global destructors will be called before halting execution. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gafb8699abb1f51d920a176e695ff3be8a"></a><!-- doxytag: member="stdlib.h::free" ref="gafb8699abb1f51d920a176e695ff3be8a" args="(void *__ptr)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void free </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void * </td>
|
||
|
<td class="paramname"> <em>__ptr</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gafb8699abb1f51d920a176e695ff3be8a">free()</a> function causes the allocated memory referenced by <code>ptr</code> to be made available for future allocations. If <code>ptr</code> is NULL, no action occurs. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gaa571de9e773dde59b0550a5ca4bd2f00"></a><!-- doxytag: member="stdlib.h::itoa" ref="gaa571de9e773dde59b0550a5ca4bd2f00" args="(int val, char *s, int radix)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* itoa </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>val</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>s</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>radix</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Convert an integer to a string. </p>
|
||
|
<p>The function <a class="el" href="group__avr__stdlib.html#gaa571de9e773dde59b0550a5ca4bd2f00" title="Convert an integer to a string.">itoa()</a> converts the integer value from <code>val</code> into an ASCII representation that will be stored under <code>s</code>. The caller is responsible for providing sufficient storage in <code>s</code>.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>The minimal size of the buffer <code>s</code> depends on the choice of radix. For example, if the radix is 2 (binary), you need to supply a buffer with a minimal length of 8 * sizeof (int) + 1 characters, i.e. one character for each bit plus one for the string terminator. Using a larger radix will require a smaller minimal buffer size.</dd></dl>
|
||
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>If the buffer is too small, you risk a buffer overflow.</dd></dl>
|
||
|
<p>Conversion is done using the <code>radix</code> as base, which may be a number between 2 (binary conversion) and up to 36. If <code>radix</code> is greater than 10, the next digit after <code>'9'</code> will be the letter <code>'a'</code>.</p>
|
||
|
<p>If radix is 10 and val is negative, a minus sign will be prepended.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gaa571de9e773dde59b0550a5ca4bd2f00" title="Convert an integer to a string.">itoa()</a> function returns the pointer passed as <code>s</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gae017047d6d0a688ccb622ff062dcd230"></a><!-- doxytag: member="stdlib.h::labs" ref="gae017047d6d0a688ccb622ff062dcd230" args="(long __i)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">long labs </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">long </td>
|
||
|
<td class="paramname"> <em>__i</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gae017047d6d0a688ccb622ff062dcd230">labs()</a> function computes the absolute value of the long integer <code>i</code>. </p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>The <a class="el" href="group__avr__stdlib.html#gadb8c83badc195efc1229799391fececc">abs()</a> and <a class="el" href="group__avr__stdlib.html#gae017047d6d0a688ccb622ff062dcd230">labs()</a> functions are builtins of gcc. </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga5b688b463f9faaa82f31ac7587e06849"></a><!-- doxytag: member="stdlib.h::ldiv" ref="ga5b688b463f9faaa82f31ac7587e06849" args="(long __num, long __denom) __asm__("__divmodsi4")" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="structldiv__t.html">ldiv_t</a> ldiv </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">long </td>
|
||
|
<td class="paramname"> <em>__num</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">long </td>
|
||
|
<td class="paramname"> <em>__denom</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga5b688b463f9faaa82f31ac7587e06849">ldiv()</a> function computes the value <code>num/denom</code> and returns the quotient and remainder in a structure named <code><a class="el" href="structldiv__t.html">ldiv_t</a></code> that contains two long integer members named <code>quot</code> and <code>rem</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga5a3fce5fbd20140584619ba9aed09f75"></a><!-- doxytag: member="stdlib.h::ltoa" ref="ga5a3fce5fbd20140584619ba9aed09f75" args="(long val, char *s, int radix)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* ltoa </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">long </td>
|
||
|
<td class="paramname"> <em>val</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>s</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>radix</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Convert a long integer to a string. </p>
|
||
|
<p>The function <a class="el" href="group__avr__stdlib.html#ga5a3fce5fbd20140584619ba9aed09f75" title="Convert a long integer to a string.">ltoa()</a> converts the long integer value from <code>val</code> into an ASCII representation that will be stored under <code>s</code>. The caller is responsible for providing sufficient storage in <code>s</code>.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>The minimal size of the buffer <code>s</code> depends on the choice of radix. For example, if the radix is 2 (binary), you need to supply a buffer with a minimal length of 8 * sizeof (long int) + 1 characters, i.e. one character for each bit plus one for the string terminator. Using a larger radix will require a smaller minimal buffer size.</dd></dl>
|
||
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>If the buffer is too small, you risk a buffer overflow.</dd></dl>
|
||
|
<p>Conversion is done using the <code>radix</code> as base, which may be a number between 2 (binary conversion) and up to 36. If <code>radix</code> is greater than 10, the next digit after <code>'9'</code> will be the letter <code>'a'</code>.</p>
|
||
|
<p>If radix is 10 and val is negative, a minus sign will be prepended.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga5a3fce5fbd20140584619ba9aed09f75" title="Convert a long integer to a string.">ltoa()</a> function returns the pointer passed as <code>s</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga4996af830ebe744d9678e5251dfd3ebd"></a><!-- doxytag: member="stdlib.h::malloc" ref="ga4996af830ebe744d9678e5251dfd3ebd" args="(size_t __size) __ATTR_MALLOC__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void* malloc </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__size</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a> function allocates <code>size</code> bytes of memory. If <a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a> fails, a NULL pointer is returned.</p>
|
||
|
<p>Note that <a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a> does <em>not</em> initialize the returned memory to zero bytes.</p>
|
||
|
<p>See the chapter about <a class="el" href="malloc.html">malloc() usage</a> for implementation details. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gafd4bf2faec43342e7ad3d2ab37bac1fe"></a><!-- doxytag: member="stdlib.h::qsort" ref="gafd4bf2faec43342e7ad3d2ab37bac1fe" args="(void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void qsort </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void * </td>
|
||
|
<td class="paramname"> <em>__base</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__nmemb</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__size</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype"><a class="el" href="group__avr__stdlib.html#gad37588b5e19ccf152d3e4447098402e2">__compar_fn_t</a> </td>
|
||
|
<td class="paramname"> <em>__compar</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gafd4bf2faec43342e7ad3d2ab37bac1fe">qsort()</a> function is a modified partition-exchange sort, or quicksort.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gafd4bf2faec43342e7ad3d2ab37bac1fe">qsort()</a> function sorts an array of <code>nmemb</code> objects, the initial member of which is pointed to by <code>base</code>. The size of each object is specified by <code>size</code>. The contents of the array base are sorted in ascending order according to a comparison function pointed to by <code>compar</code>, which requires two arguments pointing to the objects being compared.</p>
|
||
|
<p>The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gae23144bcbb8e3742b00eb687c36654d1"></a><!-- doxytag: member="stdlib.h::rand" ref="gae23144bcbb8e3742b00eb687c36654d1" args="(void)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int rand </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void </td>
|
||
|
<td class="paramname"></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand()</a> function computes a sequence of pseudo-random integers in the range of 0 to <code>RAND_MAX</code> (as defined by the header file <<a class="el" href="stdlib_8h.html">stdlib.h</a>>).</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gacceff9dc95bb3c5562dc9e61fc3d9075">srand()</a> function sets its argument <code>seed</code> as the seed for a new sequence of pseudo-random numbers to be returned by <a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand()</a>. These sequences are repeatable by calling <a class="el" href="group__avr__stdlib.html#gacceff9dc95bb3c5562dc9e61fc3d9075">srand()</a> with the same seed value.</p>
|
||
|
<p>If no seed value is provided, the functions are automatically seeded with a value of 1.</p>
|
||
|
<p>In compliance with the C standard, these functions operate on <code>int</code> arguments. Since the underlying algorithm already uses 32-bit calculations, this causes a loss of precision. See <code><a class="el" href="group__avr__stdlib.html#ga114aeb1751119382aaf3340355b22cfd">random()</a></code> for an alternate set of functions that retains full 32-bit precision. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gaf5085001be836a0f2a5d3269a7c9fd04"></a><!-- doxytag: member="stdlib.h::rand_r" ref="gaf5085001be836a0f2a5d3269a7c9fd04" args="(unsigned long *__ctx)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">int rand_r </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned long * </td>
|
||
|
<td class="paramname"> <em>__ctx</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Variant of <a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand()</a> that stores the context in the user-supplied variable located at <code>ctx</code> instead of a static library variable so the function becomes re-entrant. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga114aeb1751119382aaf3340355b22cfd"></a><!-- doxytag: member="stdlib.h::random" ref="ga114aeb1751119382aaf3340355b22cfd" args="(void)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">long random </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void </td>
|
||
|
<td class="paramname"></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga114aeb1751119382aaf3340355b22cfd">random()</a> function computes a sequence of pseudo-random integers in the range of 0 to <code>RANDOM_MAX</code> (as defined by the header file <<a class="el" href="stdlib_8h.html">stdlib.h</a>>).</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga4fca27496ca29c0a723d197696641eff">srandom()</a> function sets its argument <code>seed</code> as the seed for a new sequence of pseudo-random numbers to be returned by <a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand()</a>. These sequences are repeatable by calling <a class="el" href="group__avr__stdlib.html#ga4fca27496ca29c0a723d197696641eff">srandom()</a> with the same seed value.</p>
|
||
|
<p>If no seed value is provided, the functions are automatically seeded with a value of 1. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gaa99a0733f06d2b9960a1401c2721af1e"></a><!-- doxytag: member="stdlib.h::random_r" ref="gaa99a0733f06d2b9960a1401c2721af1e" args="(unsigned long *__ctx)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">long random_r </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned long * </td>
|
||
|
<td class="paramname"> <em>__ctx</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Variant of <a class="el" href="group__avr__stdlib.html#ga114aeb1751119382aaf3340355b22cfd">random()</a> that stores the context in the user-supplied variable located at <code>ctx</code> instead of a static library variable so the function becomes re-entrant. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gafd300bad8b4dd2e88b07d464d76c92aa"></a><!-- doxytag: member="stdlib.h::realloc" ref="gafd300bad8b4dd2e88b07d464d76c92aa" args="(void *__ptr, size_t __size) __ATTR_MALLOC__" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void* realloc </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void * </td>
|
||
|
<td class="paramname"> <em>__ptr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">size_t </td>
|
||
|
<td class="paramname"> <em>__size</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gafd300bad8b4dd2e88b07d464d76c92aa">realloc()</a> function tries to change the size of the region allocated at <code>ptr</code> to the new <code>size</code> value. It returns a pointer to the new region. The returned pointer might be the same as the old pointer, or a pointer to a completely different region.</p>
|
||
|
<p>The contents of the returned region up to either the old or the new size value (whatever is less) will be identical to the contents of the old region, even in case a new region had to be allocated.</p>
|
||
|
<p>It is acceptable to pass <code>ptr</code> as NULL, in which case <a class="el" href="group__avr__stdlib.html#gafd300bad8b4dd2e88b07d464d76c92aa">realloc()</a> will behave identical to <a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a>.</p>
|
||
|
<p>If the new memory cannot be allocated, <a class="el" href="group__avr__stdlib.html#gafd300bad8b4dd2e88b07d464d76c92aa">realloc()</a> returns NULL, and the region at <code>ptr</code> will not be changed. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gacceff9dc95bb3c5562dc9e61fc3d9075"></a><!-- doxytag: member="stdlib.h::srand" ref="gacceff9dc95bb3c5562dc9e61fc3d9075" args="(unsigned int __seed)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void srand </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"> <em>__seed</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Pseudo-random number generator seeding; see <a class="el" href="group__avr__stdlib.html#gae23144bcbb8e3742b00eb687c36654d1">rand()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga4fca27496ca29c0a723d197696641eff"></a><!-- doxytag: member="stdlib.h::srandom" ref="ga4fca27496ca29c0a723d197696641eff" args="(unsigned long __seed)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void srandom </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned long </td>
|
||
|
<td class="paramname"> <em>__seed</em></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>Pseudo-random number generator seeding; see <a class="el" href="group__avr__stdlib.html#ga114aeb1751119382aaf3340355b22cfd">random()</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga5ee4d110a3bb55d2eadda05e3ebedf8a"></a><!-- doxytag: member="stdlib.h::strtod" ref="ga5ee4d110a3bb55d2eadda05e3ebedf8a" args="(const char *__nptr, char **__endptr)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">double strtod </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"> <em>nptr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char ** </td>
|
||
|
<td class="paramname"> <em>endptr</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga5ee4d110a3bb55d2eadda05e3ebedf8a">strtod()</a> function converts the initial portion of the string pointed to by <em>nptr</em> to double representation.</p>
|
||
|
<p>The expected form of the string is an optional plus ( <code>'+'</code> ) or minus sign ( <code>'-'</code> ) followed by a sequence of digits optionally containing a decimal-point character, optionally followed by an exponent. An exponent consists of an <code>'E'</code> or <code>'e'</code>, followed by an optional plus or minus sign, followed by a sequence of digits.</p>
|
||
|
<p>Leading white-space characters in the string are skipped.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga5ee4d110a3bb55d2eadda05e3ebedf8a">strtod()</a> function returns the converted value, if any.</p>
|
||
|
<p>If <em>endptr</em> is not <code>NULL</code>, a pointer to the character after the last character used in the conversion is stored in the location referenced by <em>endptr</em>.</p>
|
||
|
<p>If no conversion is performed, zero is returned and the value of <em>nptr</em> is stored in the location referenced by <em>endptr</em>.</p>
|
||
|
<p>If the correct value would cause overflow, plus or minus <code>INFINITY</code> is returned (according to the sign of the value), and <code>ERANGE</code> is stored in <code>errno</code>. If the correct value would cause underflow, zero is returned and <code>ERANGE</code> is stored in <code>errno</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gaf8ce3b8dae3d45c34c3b172de503f7b3"></a><!-- doxytag: member="stdlib.h::strtol" ref="gaf8ce3b8dae3d45c34c3b172de503f7b3" args="(const char *__nptr, char **__endptr, int __base)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">long strtol </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"> <em>__nptr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char ** </td>
|
||
|
<td class="paramname"> <em>__endptr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>__base</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol()</a> function converts the string in <code>nptr</code> to a long value. The conversion is done according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.</p>
|
||
|
<p>The string may begin with an arbitrary amount of white space (as determined by <a class="el" href="group__ctype.html#ga16e58710aba8108549a1a3c33691b24e">isspace()</a>) followed by a single optional <code>'+'</code> or <code>'-'</code> sign. If <code>base</code> is zero or 16, the string may then include a <code>"0x"</code> prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is <code>'0'</code>, in which case it is taken as 8 (octal).</p>
|
||
|
<p>The remainder of the string is converted to a long value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter <code>'A'</code> in either upper or lower case represents 10, <code>'B'</code> represents 11, and so forth, with <code>'Z'</code> representing 35.)</p>
|
||
|
<p>If <code>endptr</code> is not NULL, <a class="el" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol()</a> stores the address of the first invalid character in <code>*endptr</code>. If there were no digits at all, however, <a class="el" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol()</a> stores the original value of <code>nptr</code> in <code>endptr</code>. (Thus, if <code>*nptr</code> is not <code>'\0'</code> but <code>**endptr</code> is <code>'\0'</code> on return, the entire string was valid.)</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3">strtol()</a> function returns the result of the conversion, unless the value would underflow or overflow. If no conversion could be performed, 0 is returned. If an overflow or underflow occurs, <code>errno</code> is set to <a class="el" href="group__avr__errno.html">ERANGE</a> and the function return value is clamped to <code>LONG_MIN</code> or <code>LONG_MAX</code>, respectively. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gaea44aa48bda8261f794dcb2d1e7ab2b2"></a><!-- doxytag: member="stdlib.h::strtoul" ref="gaea44aa48bda8261f794dcb2d1e7ab2b2" args="(const char *__nptr, char **__endptr, int __base)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">unsigned long strtoul </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const char * </td>
|
||
|
<td class="paramname"> <em>__nptr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char ** </td>
|
||
|
<td class="paramname"> <em>__endptr</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>__base</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2">strtoul()</a> function converts the string in <code>nptr</code> to an unsigned long value. The conversion is done according to the given base, which must be between 2 and 36 inclusive, or be the special value 0.</p>
|
||
|
<p>The string may begin with an arbitrary amount of white space (as determined by <a class="el" href="group__ctype.html#ga16e58710aba8108549a1a3c33691b24e">isspace()</a>) followed by a single optional <code>'+'</code> or <code>'-'</code> sign. If <code>base</code> is zero or 16, the string may then include a <code>"0x"</code> prefix, and the number will be read in base 16; otherwise, a zero base is taken as 10 (decimal) unless the next character is <code>'0'</code>, in which case it is taken as 8 (octal).</p>
|
||
|
<p>The remainder of the string is converted to an unsigned long value in the obvious manner, stopping at the first character which is not a valid digit in the given base. (In bases above 10, the letter <code>'A'</code> in either upper or lower case represents 10, <code>'B'</code> represents 11, and so forth, with <code>'Z'</code> representing 35.)</p>
|
||
|
<p>If <code>endptr</code> is not NULL, <a class="el" href="group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2">strtoul()</a> stores the address of the first invalid character in <code>*endptr</code>. If there were no digits at all, however, <a class="el" href="group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2">strtoul()</a> stores the original value of <code>nptr</code> in <code>endptr</code>. (Thus, if <code>*nptr</code> is not <code>'\0'</code> but <code>**endptr</code> is <code>'\0'</code> on return, the entire string was valid.)</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2">strtoul()</a> function return either the result of the conversion or, if there was a leading minus sign, the negation of the result of the conversion, unless the original (non-negated) value would overflow; in the latter case, <a class="el" href="group__avr__stdlib.html#gaea44aa48bda8261f794dcb2d1e7ab2b2">strtoul()</a> returns ULONG_MAX, and <code>errno</code> is set to <a class="el" href="group__avr__errno.html">ERANGE</a>. If no conversion could be performed, 0 is returned. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga34f41757388f40e340f31e370ac009b5"></a><!-- doxytag: member="stdlib.h::ultoa" ref="ga34f41757388f40e340f31e370ac009b5" args="(unsigned long val, char *s, int radix)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* ultoa </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned long </td>
|
||
|
<td class="paramname"> <em>val</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>s</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>radix</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Convert an unsigned long integer to a string. </p>
|
||
|
<p>The function <a class="el" href="group__avr__stdlib.html#ga34f41757388f40e340f31e370ac009b5" title="Convert an unsigned long integer to a string.">ultoa()</a> converts the unsigned long integer value from <code>val</code> into an ASCII representation that will be stored under <code>s</code>. The caller is responsible for providing sufficient storage in <code>s</code>.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>The minimal size of the buffer <code>s</code> depends on the choice of radix. For example, if the radix is 2 (binary), you need to supply a buffer with a minimal length of 8 * sizeof (unsigned long int) + 1 characters, i.e. one character for each bit plus one for the string terminator. Using a larger radix will require a smaller minimal buffer size.</dd></dl>
|
||
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>If the buffer is too small, you risk a buffer overflow.</dd></dl>
|
||
|
<p>Conversion is done using the <code>radix</code> as base, which may be a number between 2 (binary conversion) and up to 36. If <code>radix</code> is greater than 10, the next digit after <code>'9'</code> will be the letter <code>'a'</code>.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#ga34f41757388f40e340f31e370ac009b5" title="Convert an unsigned long integer to a string.">ultoa()</a> function returns the pointer passed as <code>s</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gad50d835af7e358518fd100179732e948"></a><!-- doxytag: member="stdlib.h::utoa" ref="gad50d835af7e358518fd100179732e948" args="(unsigned int val, char *s, int radix)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* utoa </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">unsigned int </td>
|
||
|
<td class="paramname"> <em>val</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>s</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">int </td>
|
||
|
<td class="paramname"> <em>radix</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Convert an unsigned integer to a string. </p>
|
||
|
<p>The function <a class="el" href="group__avr__stdlib.html#gad50d835af7e358518fd100179732e948" title="Convert an unsigned integer to a string.">utoa()</a> converts the unsigned integer value from <code>val</code> into an ASCII representation that will be stored under <code>s</code>. The caller is responsible for providing sufficient storage in <code>s</code>.</p>
|
||
|
<dl class="note"><dt><b>Note:</b></dt><dd>The minimal size of the buffer <code>s</code> depends on the choice of radix. For example, if the radix is 2 (binary), you need to supply a buffer with a minimal length of 8 * sizeof (unsigned int) + 1 characters, i.e. one character for each bit plus one for the string terminator. Using a larger radix will require a smaller minimal buffer size.</dd></dl>
|
||
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>If the buffer is too small, you risk a buffer overflow.</dd></dl>
|
||
|
<p>Conversion is done using the <code>radix</code> as base, which may be a number between 2 (binary conversion) and up to 36. If <code>radix</code> is greater than 10, the next digit after <code>'9'</code> will be the letter <code>'a'</code>.</p>
|
||
|
<p>The <a class="el" href="group__avr__stdlib.html#gad50d835af7e358518fd100179732e948" title="Convert an unsigned integer to a string.">utoa()</a> function returns the pointer passed as <code>s</code>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Variable Documentation</h2>
|
||
|
<a class="anchor" id="ga4d7b1bf0f75d529cc75229a266132115"></a><!-- doxytag: member="stdlib.h::__malloc_heap_end" ref="ga4d7b1bf0f75d529cc75229a266132115" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* <a class="el" href="group__avr__stdlib.html#ga4d7b1bf0f75d529cc75229a266132115">__malloc_heap_end</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p><code><a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a></code> <a class="el" href="malloc.html#malloc_tunables">tunable</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ga9310042b3956282440c091d20cb98c5f"></a><!-- doxytag: member="stdlib.h::__malloc_heap_start" ref="ga9310042b3956282440c091d20cb98c5f" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">char* <a class="el" href="group__avr__stdlib.html#ga9310042b3956282440c091d20cb98c5f">__malloc_heap_start</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p><code><a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a></code> <a class="el" href="malloc.html#malloc_tunables">tunable</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="gaffadd67736fd340e893fb22c207de597"></a><!-- doxytag: member="stdlib.h::__malloc_margin" ref="gaffadd67736fd340e893fb22c207de597" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">size_t <a class="el" href="group__avr__stdlib.html#gaffadd67736fd340e893fb22c207de597">__malloc_margin</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
<p><code><a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a></code> <a class="el" href="malloc.html#malloc_tunables">tunable</a>. </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!--- window showing the filter options -->
|
||
|
<div id="MSearchSelectWindow"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Defines</a></div>
|
||
|
|
||
|
<!-- iframe showing the search results (closed by default) -->
|
||
|
<div id="MSearchResultsWindow">
|
||
|
<iframe src="" frameborder="0"
|
||
|
name="MSearchResults" id="MSearchResults">
|
||
|
</iframe>
|
||
|
</div>
|
||
|
|
||
|
<!-- HTML footer for doxygen 1.8.7-->
|
||
|
<!-- start footer part -->
|
||
|
<!--BEGIN GENERATE_TREEVIEW-->
|
||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||
|
<ul>
|
||
|
$navpath
|
||
|
<li class="footer">$generatedby
|
||
|
<a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> 1.6.3 </li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<!--END GENERATE_TREEVIEW-->
|
||
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
||
|
<hr class="footer"/><address class="footer"><small>
|
||
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
|
||
|
</a> 1.6.3
|
||
|
</small></address>
|
||
|
<!--END !GENERATE_TREEVIEW-->
|
||
|
</body>
|
||
|
</html>
|