0902-0904.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 382 行

HTML
382
字号
<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="0897-0901.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0905-0908.html">Next</A></CENTER></P>







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





<!-- CODE SNIP //-->

<PRE>

unsigned long int ntohl(unsigned long int netlong);

unsigned short int ntohs(unsigned short int netshort);

</PRE>

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





<P><B>DESCRIPTION</B>

</P>



<P>The htonl() function converts the long integer

hostlong from host byte order to network byte order.

</P>



<P>The htons() function converts the short integer

hostshort from host byte order to network byte order.

</P>



<P>The ntohl() function converts the long integer

netlong from network byte order to host byte order.

</P>



<P>The ntohs() function converts the short integer

netshort from network byte order to host byte order.

</P>



<P>On the i80x86, the host byte order is least significant byte first, whereas the network byte order, as used on the Internet,

is most significant byte first.

</P>



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

</P>



<P>BSD 4.3

</P>



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

</P>



<!-- CODE SNIP //-->

<PRE>

gethostbyname(3), getservent(3)

</PRE>

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



<P>BSD, 15 April 1993

</P>



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

bzero

</A></H3>



<P>bzero&#151;Writes 0s to a byte string

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;string.h&gt;

void bzero(void *s, int n);

</PRE>

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





<P><B>DESCRIPTION</B>

</P>



<P>The bzero() function sets the first n bytes of the byte string

s to 0.

</P>



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

</P>



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

</P>



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

</P>



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

memset in new programs.

</P>



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

</P>



<!-- CODE SNIP //-->

<PRE>

memset(3), swab(3)

</PRE>

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



<P>GNU, 9 April 1993

</P>



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

catgets

</A></H3>



<P>catgets&#151;Gets message from a message catalog

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;features.h&gt;

#include &lt;nl_types.h&gt;

char *catgets(nl_catd catalog, int set_number, int

message_number, char *message);

</PRE>

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





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





<P><B>DESCRIPTION</B>

</P>



<P>catgets() reads the message message_number, in set

set_number, from the message catalog identified by

catalog. (catalog is a catalog descriptor returned from an earlier call to

catopen(3).) The fourth argument message points to a default

message string that will be returned by catgets() if the identified message catalog is not currently open or is damaged. The

message text is contained in an internal buffer area and should be copied by the application if it is to be saved or modified. The

return string is always terminated with a null byte.

</P>



<P><B>RETURN VALUES</B>

</P>



<P>On success, catgets() returns a pointer to an internal buffer area containing the null-terminated message string.

catgets() returns a pointer to message if it fails because the message catalog specified by catalog is not currently open.

Otherwise, catgets() returns a pointer to an empty string if the message catalog is available but does not contain the specified message.

</P>



<P><B>NOTES</B>

</P>



<P>These functions are only available in libc.so.4.4.4c and above.

</P>



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

</P>



<!-- CODE SNIP //-->

<PRE>

catopen(3), setlocale(3)

</PRE>

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



<P>29 November 1993

</P>



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

catopen, catclose

</A></H3>



<P>catopen, catclose&#151;Open/close a message catalog

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;features.h&gt;

#include &lt;nl_types.h&gt;

nl catd catopen(char *name, int flag);

void catclose(nl_catd catalog);

</PRE>

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



<P><B>DESCRIPTION</B>

</P>



<P>catopen() opens a message catalog and returns a catalog descriptor.

name specifies the name of the message catalog to

be opened. If name specifies an absolute path (that is, contains a

/), name specifies a pathname for the message catalog.

Otherwise, the environment variable NLSPATH is used, with

name substituted for %N (see locale(5)). If

NLSPATH does not exist in the environment, or if a message catalog cannot be opened in any of the paths specified by

NLSPATH, the following paths are searched in order:

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

/etc/locale/LC_MESSAGES

/usr/lib/locale/LC_MESSAGES

/usr/lib/locale/name/LC_MESSAGES

</PRE>

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





<P>In all cases, LC_MESSAGES stands for the current setting of the

LC_MESSAGES category of locale from a previous call

to setlocale() and defaults to the C&quot; locale. In the last search path,

name refers to the catalog name.

</P>



<P>The flag argument to catopen is used to indicate the type of loading desired. This should be either

MCLoadBySet or MCLoadAll. The former value indicates that only the required set from the catalog is loaded into memory when needed, whereas the

latter causes the initial call to catopen() to load the entire catalog into memory.

<P>catclose() closes the message catalog identified by

catalog. It invalidates any subsequent references to the message

catalog defined by catalog.

</P>



<P><B>RETURN VALUES</B>

</P>



<P>catopen() returns a message catalog descriptor of type

nl_catd on success. On failure, it returns _1.

</P>



<P>catclose() returns 0 on success, or -1 on failure.

</P>





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





<P><B>NOTES</B>

</P>



<P>These functions are only available in libc.so.4.4.4c and above. In the case of Linux, the catalog descriptor

nl_catd is actually an area of memory assigned by

mmap() and not a file descriptor, thus allowing catalogs to be shared.

</P>



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

</P>



<!-- CODE SNIP //-->

<PRE>

catgets(3), setlocale(3)

</PRE>

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



<P>30 November 1993

</P>



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

ceil

</A></H3>



<P>ceil&#151;Smallest integral value not less than x

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">

#include &lt;math.h&gt;

double ceil (double x);

</PRE>

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





<P><B>DESCRIPTION</B>

</P>



<P>The ceil() function rounds up x to the nearest integer, returning that value as a double.

</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>

abs(3), fabs(3), floor(3), labs(3), rint(3)

</PRE>

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



<P>6 June 1993

</P>



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

clientlib

</A></H3>



<P>clientlib&#151;NNTP clientlib part of InterNetNews library

</P>



<P><B>SYNOPSIS</B>

</P>



<!-- CODE //-->

<PRE WIDTH="1">

extern FILE *ser_rd_fp;

extern FILE *ser_wr_fp;

extern char ser_line[];

char * getserverbyfile(file);

char *file; int server_init(host);

char *host;

int handle_server_response(response, host);

int reponse;

char *host;

void put_server(text);

char *text;

int get_server(buff, buffsize);

char *buff;

int buffsize;

void close_server();

</PRE>

<!-- END CODE //-->



<P><B>DESCRIPTION</B>

</P>



<P>The routines described in this manual page are part of the InterNetNews library,

libinn(3). They are replacements for the clientlib part of the NNTP distribution, and are intended to be used in building programs such as

rrn.

</P>









<P><CENTER>

<a href="0897-0901.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0905-0908.html">Next</A></CENTER></P>







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

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

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