📄 ansistdlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ansiStdlib.html - generated by refgen from ansiStdlib.c --> <title> ansiStdlib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>ansiStdlib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>ansiStdlib</strong> - ANSI <b>stdlib</b> documentation </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./ansiStdlib.html#abort">abort</a></i>( )</b> - cause abnormal program termination (ANSI)<br><b><i><a href="./ansiStdlib.html#abs">abs</a></i>( )</b> - compute the absolute value of an integer (ANSI)<br><b><i><a href="./ansiStdlib.html#atexit">atexit</a></i>( )</b> - call a function at program termination (Unimplemented) (ANSI)<br><b><i><a href="./ansiStdlib.html#atof">atof</a></i>( )</b> - convert a string to a <b>double</b> (ANSI)<br><b><i><a href="./ansiStdlib.html#atoi">atoi</a></i>( )</b> - convert a string to an <b>int</b> (ANSI)<br><b><i><a href="./ansiStdlib.html#atol">atol</a></i>( )</b> - convert a string to a <b>long</b> (ANSI)<br><b><i><a href="./ansiStdlib.html#bsearch">bsearch</a></i>( )</b> - perform a binary search (ANSI)<br><b><i><a href="./ansiStdlib.html#div">div</a></i>( )</b> - compute a quotient and remainder (ANSI)<br><b><i><a href="./ansiStdlib.html#div_r">div_r</a></i>( )</b> - compute a quotient and remainder (reentrant)<br><b><i><a href="./ansiStdlib.html#labs">labs</a></i>( )</b> - compute the absolute value of a <b>long</b> (ANSI)<br><b><i><a href="./ansiStdlib.html#ldiv">ldiv</a></i>( )</b> - compute the quotient and remainder of the division (ANSI)<br><b><i><a href="./ansiStdlib.html#ldiv_r">ldiv_r</a></i>( )</b> - compute a quotient and remainder (reentrant)<br><b><i><a href="./ansiStdlib.html#mblen">mblen</a></i>( )</b> - calculate the length of a multibyte character (Unimplemented) (ANSI)<br><b><i><a href="./ansiStdlib.html#mbtowc">mbtowc</a></i>( )</b> - convert a multibyte character to a wide character (Unimplemented) (ANSI)<br><b><i><a href="./ansiStdlib.html#wctomb">wctomb</a></i>( )</b> - convert a wide character to a multibyte character (Unimplemented) (ANSI)<br><b><i><a href="./ansiStdlib.html#mbstowcs">mbstowcs</a></i>( )</b> - convert a series of multibyte char's to wide char's (Unimplemented) (ANSI)<br><b><i><a href="./ansiStdlib.html#wcstombs">wcstombs</a></i>( )</b> - convert a series of wide char's to multibyte char's (Unimplemented) (ANSI)<br><b><i><a href="./ansiStdlib.html#qsort">qsort</a></i>( )</b> - sort an array of objects (ANSI)<br><b><i><a href="./ansiStdlib.html#rand">rand</a></i>( )</b> - generate a pseudo-random integer between 0 and <b>RAND_MAX</b> (ANSI)<br><b><i><a href="./ansiStdlib.html#srand">srand</a></i>( )</b> - reset the value of the seed used to generate random numbers (ANSI)<br><b><i><a href="./ansiStdlib.html#strtod">strtod</a></i>( )</b> - convert the initial portion of a string to a double (ANSI) <br><b><i><a href="./ansiStdlib.html#strtol">strtol</a></i>( )</b> - convert a string to a long integer (ANSI)<br><b><i><a href="./ansiStdlib.html#strtoul">strtoul</a></i>( )</b> - convert a string to an unsigned long integer (ANSI)<br><b><i><a href="./ansiStdlib.html#system">system</a></i>( )</b> - pass a string to a command processor (Unimplemented) (ANSI)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library includes several standard ANSI routines. Note that where there is a pair of routines, such as <b><i><a href="./ansiStdlib.html#div">div</a></i>( )</b> and <b><i><a href="./ansiStdlib.html#div_r">div_r</a></i>( )</b>, only the routine<b><i>xxx_r</i>( )</b> is reentrant. The <b><i>xxx</i>( )</b> routine is not reentrant.<p>The header <b>stdlib.h</b> declares four types and several functions of generalutility, and defines several macros.<p></blockQuote><h4>Types</h4><blockQuote>The types declared are <b>size_t</b>, <b>wchar_t</b>, and:<dl><dt><b>div_t</b><dd>is the structure type of the value returned by the <b><i><a href="./ansiStdlib.html#div">div</a></i>( )</b>.<p><dt><b>ldiv_t</b><dd>is the structure type of the value returned by the <b><i>ldiv_t</i>( )</b>.<p></dl>.SS<br> MacrosThe macros defined are NULL and:<dl><dt><b>EXIT_FAILURE</b>, <b>EXIT_SUCCESS</b><dd>expand to integral constant expressions that may be used as theargument to <b><i><a href="./taskLib.html#exit">exit</a></i>( )</b> to return unsuccessful or successful terminationstatus, respectively, to the host environment.<p><dt><b>RAND_MAX</b><dd>expands to a positive integer expression whose value is the maximumnumber of bytes on a multibyte character for the extended character setspecified by the current locale, and whose value is never greaterthan <b>MB_LEN_MAX</b>. </dl><p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b>, American National Standard X3.159-1989<p><hr><a name="abort"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>abort</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>abort</i>( )</strong> - cause abnormal program termination (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void abort (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine causes abnormal program termination, unless the signalSIGABRT is being caught and the signal handler does not return. VxWorksdoes not flush output streams, close open streams, or remove temporaryfiles. <b><i><a href="./ansiStdlib.html#abort">abort</a></i>( )</b> returns unsuccessful status termination to the hostenvironment by calling:<pre> raise (SIGABRT);</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>This routine cannot return to the caller.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="abs"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>abs</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>abs</i>( )</strong> - compute the absolute value of an integer (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int abs ( int i /* integer for which to return absolute value */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine computes the absolute value of a specified integer. If theresult cannot be represented, the behavior is undefined.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>The absolute value of <i>i</i>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="atexit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>atexit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>atexit</i>( )</strong> - call a function at program termination (Unimplemented) (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int atexit ( void (* __func)(void) /* pointer to a function */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is unimplemented. VxWorks task exit hooksprovide this functionality.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>ERROR, always.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b>, <b><a href="./taskHookLib.html#top">taskHookLib</a></b><hr><a name="atof"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>atof</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>atof</i>( )</strong> - convert a string to a <b>double</b> (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>double atof ( const char * s /* pointer to string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts the initial portion of the string <i>s</i> to double-precision representation. <p>Its behavior is equivalent to:<pre> strtod (s, (char **)NULL);</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>The converted value in double-precision representation.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="atoi"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>atoi</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>atoi</i>( )</strong> - convert a string to an <b>int</b> (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int atoi ( const char * s /* pointer to string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts the initial portion of the string<i>s</i> to <b>int</b> representation.<p>Its behavior is equivalent to:<pre> (int) strtol (s, (char **) NULL, 10);</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>The converted value represented as an <b>int</b>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="atol"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>atol</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>atol</i>( )</strong> - convert a string to a <b>long</b> (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>long atol ( const register char * s /* pointer to string */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine converts the initial portion of the string <i>s</i> to long integer representation.<p>Its behavior is equivalent to:<pre> strtol (s, (char **)NULL, 10);</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p>The converted value represented as a <b>long</b>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="bsearch"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>bsearch</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>bsearch</i>( )</strong> - perform a binary search (ANSI)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void * bsearch ( const void * key, /* element to match */ const void * base0, /* initial element in array */ size_t nmemb, /* array to search */ size_t size, /* size of array element */ int (* compar) (const void * , const void * ) /* comparison function */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine searches an array of <i>nmemb</i> objects, the initial element ofwhich is pointed to by <i>base0</i>, for an element that matches the objectpointed to by <i>key</i>. The <i>size</i> of each element of the array is specifiedby <i>size</i>.<p>The comparison function pointed to by <i>compar</i> is called with two argumentsthat point to the <i>key</i> object and to an array element, in that order. Thefunction shall return an integer less than, equal to, or greater than zero ifthe <i>key</i> object is considered, respectively, to be less than, to match, orto be greater than the array element. The array shall consist of all theelements that compare greater than the <i>key</i> object, in that order.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>stdlib.h</b><p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to a matching element of the array, or a NULL pointerif no match is found. If two elements compare as equal, which element is matched is unspecified.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ansiStdlib.html#top">ansiStdlib</a></b><hr><a name="div"></a><p align=right>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -