⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0897-0901.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:Library Functions:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=03 //-->

<!-- PAGES=0891-1062 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="0891-0896.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0902-0904.html">Next</A></CENTER></P>







<A NAME="PAGENUM-897"><P>Page 897</P></A>





<P><B>DESCRIPTION</B>

</P>



<P>The atan2() function calculates the arc tangent of the two variables,

x and y. It is similar to calculating the arc tangent of

y/x, except that the sines of both arguments are used to determine the quadrant of the result.

</P>



<P><B>RETURN VALUE</B>

</P>



<P>The atan2() function returns the result in radians, which is between

-PI and PI (inclusive).

</P>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, POSIX, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

acos(3), asin(3), atan(3), cos(3), sin(3), tan(3)

</PRE>

<!-- END CODE SNIP //-->



<P>8 June 1993

</P>



<H3><A NAME="ch03_ 13">

atanh

</A></H3>



<P>atanh&#151;Inverse hyperbolic tangent function

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE>

#include &lt;math.h&gt;

double atanh(double x);

</PRE>

<!-- END CODE SNIP //-->



<P><B>DESCRIPTION</B>

</P>



<P>The atanh() function calculates the inverse hyperbolic tangent of

x; that is the value whose hyperbolic tangent is x. If

the absolute value of x is greater than 1.0,

acosh() returns not-a-number (NaN), and errno is set.

</P>



<P><B>ERRORS</B>

</P>



<TABLE>



<TR><TD>

EDOM

</TD><TD>

x is out of range.

</TD></TR></TABLE>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, POSIX, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

asinh(3), acosh(3), cosh(3), sinh(3), tanh(3)

</PRE>

<!-- END CODE SNIP //-->



<P>13 June 1993

</P>



<H3><A NAME="ch03_ 14">

atexit

</A></H3>



<P>atexit&#151;Register a function to be called at normal program termination

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;stdlib.h&gt;

int atexit(void *function)(void));

</PRE>

<!-- END CODE SNIP //-->



<P><B>DESCRIPTION</B>

</P>



<P>The atexit() function registers the given function to be called at normal program termination, whether via

exit(2) or via return from the program's main. Functions so registered are called in the reverse order of their registration; no arguments

are passed.

</P>



<A NAME="PAGENUM-898"><P>Page 898</P></A>





<P><B>RETURN VALUE</B>

</P>



<P>The atexit()function returns the value 0 if successful; otherwise, the value

_1 is returned, and the global variable errno is

set to indicate the error.

</P>



<P><B>ERRORS</B>

</P>



<TABLE>



<TR><TD>

ENOMEM

</TD><TD>

Insufficient memory available to add the function.

</TD></TR></TABLE>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

exit(3), on exit(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 29 March 1993

</P>



<H3><A NAME="ch03_ 15">

atof

</A></H3>



<P>atof&#151;Convert a string to a double

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;stdlib.h&gt;

double atof(const char *nptr);

</PRE>

<!-- END CODE SNIP //-->





<P><B>DESCRIPTION</B>

</P>



<P>The atof() function converts the initial portion of the string pointed to by

nptr to double. The behavior is the same as

</P>



<!-- CODE SNIP //-->

<PRE>

strtod(nptr, (char **)NULL);

</PRE>

<!-- END CODE SNIP //-->



<P>except that atof() does not detect errors.

</P>



<P><B>RETURN VALUE.</B>

</P>



<P>The converted value.

</P>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, POSIX, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

atoi(3), atol(3), strtod(3), strtol(3), strtoul(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 29 March 1993

</P>



<H3><A NAME="ch03_ 16">

atoi

</A></H3>



<P>atoi&#151;Convert a string to an integer

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;stdlib.h&gt;

int atoi(const char *nptr);

</PRE>

<!-- END CODE SNIP //-->







<A NAME="PAGENUM-899"><P>Page 899</P></A>









<P><B>DESCRIPTION</B>

</P>



<P>The atoi() function converts the initial portion of the string pointed to by

nptr to int. The behavior is the same as

</P>



<!-- CODE SNIP //-->

<PRE>

strtol(nptr, (char **)NULL, 10);

</PRE>

<!-- END CODE SNIP //-->



<P>except that atoi() does not detect errors.

</P>



<P><B>RETURN VALUE</B>

</P>



<P>The converted value.

</P>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, POSIX, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

atof(3), atol(3), strtod(3), strtol(3), strtoul(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 29 March 1993

</P>



<H3><A NAME="ch03_ 17">

atol

</A></H3>



<P>atol&#151;Convert a string to a long integer

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;stdlib.h&gt;

long atol(const char *nptr);

</PRE>

<!-- END CODE SNIP //-->





<P><B>DESCRIPTION</B>

</P>



<P>The atol() function converts the initial portion of the string pointed to by

nptr to long. The behavior is the same as

</P>



<!-- CODE SNIP //-->

<PRE>

strtol(nptr, (char **)NULL, 10);

</PRE>

<!-- END CODE SNIP //-->



<P>except that atol() does not detect errors.

</P>



<P><B>RETURN VALUE</B>

</P>



<P>The converted value.

</P>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, POSIX, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

atof(3), atoi(3), strtod(3), strtol(3), strtoul(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 29 March 1993

</P>



<H3><A NAME="ch03_ 18">

bcmp

</A></H3>



<P>bcmp&#151;Compare byte strings

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;string.h&gt;

int bcmp(const void *s1, const void *s2, int n);

</PRE>

<!-- END CODE SNIP //-->





<A NAME="PAGENUM-900"><P>Page 900</P></A>







<P><B>DESCRIPTION</B>

</P>



<P>The bcmp() function compares the first n bytes of the strings

s1 and s2. If the two strings are equal, bcmp() returns

0; otherwise, it returns a nonzero result. If n is

0, the two strings are assumed to be equal.

</P>



<P><B>RETURN VALUE</B>

</P>



<P>The bcmp() function returns 0 if the strings are equal; otherwise, a nonzero result is returned.

</P>



<P><B>CONFORMS TO</B>

</P>



<P>4.3BSD. This function is deprecated&#151;use

memcmp in new programs.

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

memcmp(3), strcasecmp(3), strcmp(3), strcoll(3),

strncmp(3), strncasecmp(3)

</PRE>

<!-- END CODE SNIP //-->





<P>GNU, 9 April 1993

</P>



<H3><A NAME="ch03_ 19">

bcopy

</A></H3>



<P>bcopy&#151;Copy byte strings

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;string.h&gt;

void bcopy (const void *src, void*dest, int n);

</PRE>

<!-- END CODE SNIP //-->





<P><B>DESCRIPTION</B>

</P>



<P>The bcopy() function copies the first n bytes of the source string

src to the destination string dest. If n is 0, no bytes

are copied.

</P>



<P><B>RETURN VALUE</B>

</P>



<P>The bcopy() function returns no value.

</P>



<P><B>CONFORMS TO</B>

</P>



<P>4.3BSD. This function is deprecated&#151;use

memcpy in new programs.

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

memccpy(3), memcpy(3), memmove(3), strcpy(3), strncpy(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 9 April 1993

</P>



<H3><A NAME="ch03_ 20">

bsearch

</A></H3>





<P>bsearch&#151;Binary search of a sorted array.

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;stdlib.h&gt;

void *bsearch(const void *key, const void *base, size_t nmemb,

size_t size,int(*compar)(const void *, const void *));

</PRE>

<!-- END CODE SNIP //-->



<P><B>DESCRIPTION</B>

</P>



<P>The bsearch() function searches an array of

nmemb objects, the initial member of which is pointed to by

base, for a member that matches the object pointed to by

key. The size of each member of the array is specified by

size.

</P>



<P>The contents of the array should be in ascending sorted order according to the comparison function referenced by

compar.

</P>









<A NAME="PAGENUM-901"><P>Page 901</P></A>





<P>The compar routine is expected to have two arguments that 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 0, respectively, if the

key object is found to be less than, match, or be greater than the array member.

</P>



<P><B>RETURN VALUE</B>

</P>



<P>The bsearch() function returns a pointer to a matching member of the array, or

NULL if no match is found. If there are multiple elements that match the key, the element returned is unspecified.

</P>



<P><B>CONFORMS TO</B>

</P>



<P>SVID 3, BSD 4.3, ISO 9899

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

qsort(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 29 March 1993

</P>



<H3><A NAME="ch03_ 21">

bcmp, bcopy, bzero, memccpy, memchr, memcmp,

memcpy, memfrob, memmem, memmove, memset

</A></H3>



<!-- CODE SNIP //-->

<PRE>

bcmp, bcopy, bzero, memccpy, memchr, memcmp,

memcpy, memfrob, memmem, memmove, memset&#151;Byte string operations

</PRE>

<!-- END CODE SNIP //-->



<P><B>SYNOPSIS</B>

</P>



<!-- CODE //-->

<PRE WIDTH="1">

#include &lt;string.h&gt;

int bcmp(const void *s1, const void *s2, int n);

void bcopy(const void *src, void *dest, int n);

void bzero(void *s, int n);

void *memccpy(void *dest, const void *src, int c, size_t n);

void *memchr(const void *s, int c, size_t n);

int memcmp(const void *s1, const void *s2, size_t n);

void *memcpy(void *dest, const void *src, size_t n);

void *memfrob(void *s, size_t n);

void *memmem(const void *needle, size_t needlelen,

const void *haystack, size_t haystacklen);

void *memmove(void *dest, const void *src, size_t n);

void *memset(void *s, int c, size_t n);

</PRE>

<!-- END CODE //-->



<P><B>DESCRIPTION</B>

</P>



<P>The byte string functions perform operations on strings that are not NULL terminated. See the individual man pages

for descriptions of each function.

</P>



<P></B>SEE ALSO</B>

</P>



<!-- CODE SNIP //-->

<PRE>

bcmp(3), bcopy(3), bzero(3), memccpy(3), memchr(3),

memcmp(3), memcpy(3), memfrob(3), memmem(3),

memmove(3), memset(3)

</PRE>

<!-- END CODE SNIP //-->



<P>GNU, 12 April 1993

</P>



<H3><A NAME="ch03_ 22">

htonl, htons, ntohl, ntohs

</A></H3>



<P>htonl, htons, ntohl, ntohs&#151;Convert values between host and network byte order

</P>



<P><B>SYNOPSIS</B>

</P>

<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;netinet/in.h&gt;

unsigned long int htonl(unsigned long int hostlong);

unsigned short int htons(unsigned short int hostshort);

</PRE>

<!-- END CODE SNIP //-->









<P><CENTER>

<a href="0891-0896.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0902-0904.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -