-->

Previous | Table of Contents | Next

Page 902


unsigned long int ntohl(unsigned long int netlong);

unsigned short int ntohs(unsigned short int netshort);

DESCRIPTION

The htonl() function converts the long integer hostlong from host byte order to network byte order.

The htons() function converts the short integer hostshort from host byte order to network byte order.

The ntohl() function converts the long integer netlong from network byte order to host byte order.

The ntohs() function converts the short integer netshort from network byte order to host byte order.

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.

CONFORMS TO

BSD 4.3

SEE ALSO


gethostbyname(3), getservent(3)

BSD, 15 April 1993

bzero

bzero—Writes 0s to a byte string

SYNOPSIS


#include <string.h>

void bzero(void *s, int n);

DESCRIPTION

The bzero() function sets the first n bytes of the byte string s to 0.

RETURN VALUE

The bzero() function returns no value.

CONFORMS TO

4.3BSD. This function is deprecated—use memset in new programs.

SEE ALSO


memset(3), swab(3)

GNU, 9 April 1993

catgets

catgets—Gets message from a message catalog

SYNOPSIS


#include <features.h>

#include <nl_types.h>

char *catgets(nl_catd catalog, int set_number, int

message_number, char *message);

Page 903

DESCRIPTION

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.

RETURN VALUES

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.

NOTES

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

SEE ALSO


catopen(3), setlocale(3)

29 November 1993

catopen, catclose

catopen, catclose—Open/close a message catalog

SYNOPSIS


#include <features.h>

#include <nl_types.h>

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

void catclose(nl_catd catalog);

DESCRIPTION

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:


/etc/locale/LC_MESSAGES

/usr/lib/locale/LC_MESSAGES

/usr/lib/locale/name/LC_MESSAGES

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" locale. In the last search path, name refers to the catalog name.

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.

catclose() closes the message catalog identified by catalog. It invalidates any subsequent references to the message catalog defined by catalog.

RETURN VALUES

catopen() returns a message catalog descriptor of type nl_catd on success. On failure, it returns _1.

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

Page 904

NOTES

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.

SEE ALSO


catgets(3), setlocale(3)

30 November 1993

ceil

ceil—Smallest integral value not less than x

SYNOPSIS


#include <math.h>

double ceil (double x);

DESCRIPTION

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

CONFORMS TO

SVID 3, POSIX, BSD 4.3, ISO 9899

SEE ALSO


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

6 June 1993

clientlib

clientlib—NNTP clientlib part of InterNetNews library

SYNOPSIS


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();

DESCRIPTION

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.

Previous | Table of Contents | Next