stdlib_8h_source.html (20459B)
1<!-- HTML header for doxygen 1.8.14--> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4<head> 5<meta http-equiv="cache-control" content="max-age=86400"/> 6<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 7<meta http-equiv="X-UA-Compatible" content="IE=9"/> 8<meta name="generator" content="Doxygen 1.8.20"/> 9<meta name="viewport" content="width=device-width, initial-scale=1"/> 10<title>GBDK 2020 Docs: stdlib.h Source File</title> 11<link href="tabs.css" rel="stylesheet" type="text/css"/> 12<script type="text/javascript" src="jquery.js"></script> 13<script type="text/javascript" src="dynsections.js"></script> 14<link href="navtree.css" rel="stylesheet" type="text/css"/> 15<script type="text/javascript" src="resize.js"></script> 16<script type="text/javascript" src="navtreedata.js"></script> 17<script type="text/javascript" src="navtree.js"></script> 18<link href="search/search.css" rel="stylesheet" type="text/css"/> 19<script type="text/javascript" src="search/searchdata.js"></script> 20<script type="text/javascript" src="search/search.js"></script> 21<link href="doxygen.css" rel="stylesheet" type="text/css" /> 22<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/> 23</head> 24<body> 25<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 26<div id="titlearea"> 27<table cellspacing="0" cellpadding="0"> 28 <tbody> 29 <tr style="height: 56px;"> 30 <td id="projectalign" style="padding-left: 0.5em;"> 31 <div id="projectname">GBDK 2020 Docs 32  <span id="projectnumber">4.0.6</span> 33 </div> 34 <div id="projectbrief">API Documentation for GBDK 2020</div> 35 </td> 36 </tr> 37 </tbody> 38</table> 39</div> 40<!-- end header part --> 41<!-- Generated by Doxygen 1.8.20 --> 42<script type="text/javascript"> 43/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 44var searchBox = new SearchBox("searchBox", "search",false,'Search'); 45/* @license-end */ 46</script> 47<script type="text/javascript" src="menudata.js"></script> 48<script type="text/javascript" src="menu.js"></script> 49<script type="text/javascript"> 50/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 51$(function() { 52 initMenu('',true,false,'search.php','Search'); 53 $(document).ready(function() { init_search(); }); 54}); 55/* @license-end */</script> 56<div id="main-nav"></div> 57</div><!-- top --> 58<div id="side-nav" class="ui-resizable side-nav-resizable"> 59 <div id="nav-tree"> 60 <div id="nav-tree-contents"> 61 <div id="nav-sync" class="sync"></div> 62 </div> 63 </div> 64 <div id="splitbar" style="-moz-user-select:none;" 65 class="ui-resizable-handle"> 66 </div> 67</div> 68<script type="text/javascript"> 69/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 70$(document).ready(function(){initNavTree('stdlib_8h_source.html',''); initResizable(); }); 71/* @license-end */ 72</script> 73<div id="doc-content"> 74<!-- window showing the filter options --> 75<div id="MSearchSelectWindow" 76 onmouseover="return searchBox.OnSearchSelectShow()" 77 onmouseout="return searchBox.OnSearchSelectHide()" 78 onkeydown="return searchBox.OnSearchSelectKey(event)"> 79</div> 80 81<!-- iframe showing the search results (closed by default) --> 82<div id="MSearchResultsWindow"> 83<iframe src="javascript:void(0)" frameborder="0" 84 name="MSearchResults" id="MSearchResults"> 85</iframe> 86</div> 87 88<div class="header"> 89 <div class="headertitle"> 90<div class="title">stdlib.h</div> </div> 91</div><!--header--> 92<div class="contents"> 93<a href="stdlib_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>  </div> 94<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor">#ifndef STDLIB_INCLUDE</span></div> 95<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#define STDLIB_INCLUDE</span></div> 96<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>  </div> 97<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <<a class="code" href="types_8h.html">types.h</a>></span></div> 98<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>  </div> 99<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_ds400) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk13) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)</span></div> 100<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a83798998ad669e85a8f75d6490191760"> 10</a></span> <span class="preprocessor">#define __reentrant</span></div> 101<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#endif</span></div> 102<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  </div> 103<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a55e99c539cf7723ec15e856b7e0a8cee"> 17</a></span> <span class="keywordtype">void</span> <a class="code" href="stdlib_8h.html#a55e99c539cf7723ec15e856b7e0a8cee">exit</a>(<span class="keywordtype">int</span> status);</div> 104<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  </div> 105<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#if 0</span></div> 106<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  </div> 107<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">int</span> getkey(<span class="keywordtype">void</span>);</div> 108<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#endif</span></div> 109<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  </div> 110<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a3bb2d2cacc5535004757ebbc640079fb"> 30</a></span> <span class="keywordtype">int</span> <a class="code" href="stdlib_8h.html#a3bb2d2cacc5535004757ebbc640079fb">abs</a>(<span class="keywordtype">int</span> i) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 111<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  </div> 112<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  </div> 113<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a8b7210ba18f750970a2db3c73a841a22"> 37</a></span> <span class="keywordtype">long</span> <a class="code" href="stdlib_8h.html#a8b7210ba18f750970a2db3c73a841a22">labs</a>(<span class="keywordtype">long</span> num) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 114<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div> 115<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  </div> 116<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a30670a60464f77af17dfb353353d6df8"> 55</a></span> <span class="keywordtype">int</span> <a class="code" href="stdlib_8h.html#a30670a60464f77af17dfb353353d6df8">atoi</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *s);</div> 117<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  </div> 118<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div> 119<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a825c37450147a643edbcb1a435518307"> 64</a></span> <span class="keywordtype">long</span> <a class="code" href="stdlib_8h.html#a825c37450147a643edbcb1a435518307">atol</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *s);</div> 120<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  </div> 121<div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="stdlib_8h.html#aac2ea595a9ea8f5ebd883a0bc05eba5c"> 74</a></span> <span class="keywordtype">char</span> *<a class="code" href="stdlib_8h.html#aac2ea595a9ea8f5ebd883a0bc05eba5c">itoa</a>(<span class="keywordtype">int</span> n, <span class="keywordtype">char</span> *s, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> radix) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 122<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div> 123<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a38c070016cb06132360cfa5bacc2ed19"> 84</a></span> <span class="keywordtype">char</span> *<a class="code" href="stdlib_8h.html#a38c070016cb06132360cfa5bacc2ed19">uitoa</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n, <span class="keywordtype">char</span> *s, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> radix) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 124<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  </div> 125<div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a6374e62474a5a76c7ace9a59fb1cc829"> 94</a></span> <span class="keywordtype">char</span> *<a class="code" href="stdlib_8h.html#a6374e62474a5a76c7ace9a59fb1cc829">ltoa</a>(<span class="keywordtype">long</span> n, <span class="keywordtype">char</span> *s, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> radix) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 126<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  </div> 127<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="stdlib_8h.html#ac22b79fe0c1279eabc3daf57328008d2"> 104</a></span> <span class="keywordtype">char</span> *<a class="code" href="stdlib_8h.html#ac22b79fe0c1279eabc3daf57328008d2">ultoa</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> n, <span class="keywordtype">char</span> *s, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> radix) <a class="code" href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a>;</div> 128<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  </div> 129<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div> 130<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a62b7798461bd461da64c5f9d35feddf7"> 109</a></span> <span class="keywordtype">void</span> *<a class="code" href="stdlib_8h.html#a62b7798461bd461da64c5f9d35feddf7">calloc</a> (<span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size);</div> 131<div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a7ac38fce3243a7dcf448301ee9ffd392"> 110</a></span> <span class="keywordtype">void</span> *<a class="code" href="stdlib_8h.html#a7ac38fce3243a7dcf448301ee9ffd392">malloc</a> (<span class="keywordtype">size_t</span> size);</div> 132<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a1a6b5e8d2f1c37e5b43e4345586075be"> 111</a></span> <span class="keywordtype">void</span> *<a class="code" href="stdlib_8h.html#a1a6b5e8d2f1c37e5b43e4345586075be">realloc</a> (<span class="keywordtype">void</span> *ptr, <span class="keywordtype">size_t</span> size);</div> 133<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="preprocessor">#if __STDC_VERSION__ >= 201112L</span></div> 134<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> *aligned_alloc(<span class="keywordtype">size_t</span> alignment, <span class="keywordtype">size_t</span> size)</div> 135<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> {</div> 136<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  (void)alignment;</div> 137<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keywordflow">return</span> <a class="code" href="stdlib_8h.html#a7ac38fce3243a7dcf448301ee9ffd392">malloc</a>(size);</div> 138<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> }</div> 139<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="preprocessor">#endif</span></div> 140<div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="stdlib_8h.html#afbedc913aa4651b3c3b4b3aecd9b4711"> 119</a></span> <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="stdlib_8h.html#afbedc913aa4651b3c3b4b3aecd9b4711">free</a> (<span class="keywordtype">void</span> * ptr);</div> 141<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  </div> 142<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment">/* Searching and sorting utilities (ISO C11 7.22.5) */</span></div> 143<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="stdlib_8h.html#ab0ace018fe7dfa1720930d2dce0c45e3"> 132</a></span> <span class="keyword">extern</span> <span class="keywordtype">void</span> *<a class="code" href="stdlib_8h.html#ab0ace018fe7dfa1720930d2dce0c45e3">bsearch</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *key, <span class="keyword">const</span> <span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span> (*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *) <a class="code" href="stdlib_8h.html#a83798998ad669e85a8f75d6490191760">__reentrant</a>);</div> 144<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  </div> 145<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  </div> 146<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="stdlib_8h.html#a02d9d6443b9e613802b2e9c5c71caf59"> 141</a></span> <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="stdlib_8h.html#a02d9d6443b9e613802b2e9c5c71caf59">qsort</a>(<span class="keywordtype">void</span> *base, <span class="keywordtype">size_t</span> nmemb, <span class="keywordtype">size_t</span> size, <span class="keywordtype">int</span> (*compar)(<span class="keyword">const</span> <span class="keywordtype">void</span> *, <span class="keyword">const</span> <span class="keywordtype">void</span> *) <a class="code" href="stdlib_8h.html#a83798998ad669e85a8f75d6490191760">__reentrant</a>);</div> 147<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  </div> 148<div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="preprocessor">#endif</span></div> 149</div><!-- fragment --></div><!-- contents --> 150</div><!-- doc-content --> 151<div class="ttc" id="atypes_8h_html"><div class="ttname"><a href="types_8h.html">types.h</a></div></div> 152<div class="ttc" id="astdlib_8h_html_a1a6b5e8d2f1c37e5b43e4345586075be"><div class="ttname"><a href="stdlib_8h.html#a1a6b5e8d2f1c37e5b43e4345586075be">realloc</a></div><div class="ttdeci">void * realloc(void *ptr, size_t size)</div></div> 153<div class="ttc" id="astdlib_8h_html_a8b7210ba18f750970a2db3c73a841a22"><div class="ttname"><a href="stdlib_8h.html#a8b7210ba18f750970a2db3c73a841a22">labs</a></div><div class="ttdeci">long labs(long num) OLDCALL</div></div> 154<div class="ttc" id="astdlib_8h_html_a3bb2d2cacc5535004757ebbc640079fb"><div class="ttname"><a href="stdlib_8h.html#a3bb2d2cacc5535004757ebbc640079fb">abs</a></div><div class="ttdeci">int abs(int i) OLDCALL</div></div> 155<div class="ttc" id="astdlib_8h_html_afbedc913aa4651b3c3b4b3aecd9b4711"><div class="ttname"><a href="stdlib_8h.html#afbedc913aa4651b3c3b4b3aecd9b4711">free</a></div><div class="ttdeci">void free(void *ptr)</div></div> 156<div class="ttc" id="astdlib_8h_html_a7ac38fce3243a7dcf448301ee9ffd392"><div class="ttname"><a href="stdlib_8h.html#a7ac38fce3243a7dcf448301ee9ffd392">malloc</a></div><div class="ttdeci">void * malloc(size_t size)</div></div> 157<div class="ttc" id="astdlib_8h_html_a62b7798461bd461da64c5f9d35feddf7"><div class="ttname"><a href="stdlib_8h.html#a62b7798461bd461da64c5f9d35feddf7">calloc</a></div><div class="ttdeci">void * calloc(size_t nmemb, size_t size)</div></div> 158<div class="ttc" id="astdlib_8h_html_a30670a60464f77af17dfb353353d6df8"><div class="ttname"><a href="stdlib_8h.html#a30670a60464f77af17dfb353353d6df8">atoi</a></div><div class="ttdeci">int atoi(const char *s)</div></div> 159<div class="ttc" id="astdlib_8h_html_ab0ace018fe7dfa1720930d2dce0c45e3"><div class="ttname"><a href="stdlib_8h.html#ab0ace018fe7dfa1720930d2dce0c45e3">bsearch</a></div><div class="ttdeci">void * bsearch(const void *key, const void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) __reentrant)</div></div> 160<div class="ttc" id="astdlib_8h_html_a825c37450147a643edbcb1a435518307"><div class="ttname"><a href="stdlib_8h.html#a825c37450147a643edbcb1a435518307">atol</a></div><div class="ttdeci">long atol(const char *s)</div></div> 161<div class="ttc" id="aasm_2types_8h_html_a0971918860055db2e50dacea4da8f3bc"><div class="ttname"><a href="asm_2types_8h.html#a0971918860055db2e50dacea4da8f3bc">OLDCALL</a></div><div class="ttdeci">#define OLDCALL</div><div class="ttdef"><b>Definition:</b> types.h:19</div></div> 162<div class="ttc" id="astdlib_8h_html_a02d9d6443b9e613802b2e9c5c71caf59"><div class="ttname"><a href="stdlib_8h.html#a02d9d6443b9e613802b2e9c5c71caf59">qsort</a></div><div class="ttdeci">void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *) __reentrant)</div></div> 163<div class="ttc" id="astdlib_8h_html_a55e99c539cf7723ec15e856b7e0a8cee"><div class="ttname"><a href="stdlib_8h.html#a55e99c539cf7723ec15e856b7e0a8cee">exit</a></div><div class="ttdeci">void exit(int status)</div></div> 164<div class="ttc" id="astdlib_8h_html_aac2ea595a9ea8f5ebd883a0bc05eba5c"><div class="ttname"><a href="stdlib_8h.html#aac2ea595a9ea8f5ebd883a0bc05eba5c">itoa</a></div><div class="ttdeci">char * itoa(int n, char *s, unsigned char radix) OLDCALL</div></div> 165<div class="ttc" id="astdlib_8h_html_a6374e62474a5a76c7ace9a59fb1cc829"><div class="ttname"><a href="stdlib_8h.html#a6374e62474a5a76c7ace9a59fb1cc829">ltoa</a></div><div class="ttdeci">char * ltoa(long n, char *s, unsigned char radix) OLDCALL</div></div> 166<div class="ttc" id="astdlib_8h_html_ac22b79fe0c1279eabc3daf57328008d2"><div class="ttname"><a href="stdlib_8h.html#ac22b79fe0c1279eabc3daf57328008d2">ultoa</a></div><div class="ttdeci">char * ultoa(unsigned long n, char *s, unsigned char radix) OLDCALL</div></div> 167<div class="ttc" id="astdlib_8h_html_a83798998ad669e85a8f75d6490191760"><div class="ttname"><a href="stdlib_8h.html#a83798998ad669e85a8f75d6490191760">__reentrant</a></div><div class="ttdeci">#define __reentrant</div><div class="ttdef"><b>Definition:</b> stdlib.h:10</div></div> 168<div class="ttc" id="astdlib_8h_html_a38c070016cb06132360cfa5bacc2ed19"><div class="ttname"><a href="stdlib_8h.html#a38c070016cb06132360cfa5bacc2ed19">uitoa</a></div><div class="ttdeci">char * uitoa(unsigned int n, char *s, unsigned char radix) OLDCALL</div></div> 169<!-- HTML footer for doxygen 1.8.14--> 170<!-- start footer part --> 171<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 172</div> 173</body> 174</html>