Page 905 getserverbyfile calls GetConfigValue to get the name of the local NNTP server. It returns a pointer to static space. The file parameter is ignored. server_init opens a connect to the NNTP server at the specified host. It returns the server's response code or _1 on error. If a connection was made, ser_rd_fp and ser_wr_fp can be used to read from and write to the server, respectively, and ser_line will contain the server's response. ser_line can also be used in other routines. handle_server_response decodes the response, which comes from the server on host. If the client is authorized, it returns 0. A client that is only allowed to read is authorized, but handle_server_response will print a message on the standard output. If the client is not authorized to talk to the server, a message is printed, and the routine returns _1. put_server sends the text in buff to the server, adding the necessary NNTP line terminators and flushing the I/O buffer. get_server reads a line of text from the server into buff, reading at most buffsize characters. Any trailing \r\n terminators are stripped off. get_server returns _1 on error. close_server sends a quit command to the server and closes the connection. HISTORY Written by Rich $alz (rsalz@uunet.uu.net) for InterNetNews. SEE ALSO libinn(3) clockclockDetermine processor time SYNOPSIS #include <time.h> clock_t clock(void); DESCRIPTION The clock() function returns an approximation of processor time used by the program. RETURN VALUE The value returned is the CPU time used so far as a clock_t; to get the number of seconds used, divide by CLOCKS_PER_SEC. CONFORMS TO ANSI C BUGS The C standard allows for arbitrary values at the start of the program; take the difference between the value returned from a call to clock() at the start of the program and the value returned at the end for maximum portability. The times() function call returns more information. SEE ALSO times(2) GNU, 21 April 1993 closedirclosedirClose a directory Page 906 SYNOPSIS #include <sys/types.h> #include <dirent.h> int closedir(DIR *dir); DESCRIPTION The closedir() function closes the directory stream associated with dir. The directory stream descriptor dir is not available after this call. RETURN VALUE The closedir() function returns 0 on success or _1 on failure. ERRORS
CONFORMS TO SVID 3, POSIX, BSD 4.3 SEE ALSO close(2), opendir(3), readdir(3), rewinddir(3), seekdir(3), telldir(3), scandir(3) 11 June 1995 confstrconfstrGet configuration-dependent string variables SYNOPSIS #define __USE_POSIX_2 #include <unistd.h> size_t confstr(int name, char *buf, size_t len); DESCRIPTION
RETURN VALUE If name does not correspond to a valid configuration variable, confstr() returns 0. EXAMPLES The following code fragment determines the path where you can find the POSIX.2 system utilities: char *pathbuf; size_t n; n = confstr(_CS_PATH,NULL,(size_t)0); if ((pathbuf = malloc(n)) == NULL) abort(); confstr(_CS_PATH, pathbuf, n); Page 907 ERRORS If the value of name is invalid, errno is set to EINVAL. CONFORMS TO Proposed POSIX.2 BUGS POSIX.2 is not yet an approved standard; the information in this man page is subject to change. SEE ALSO sh(1), exec(2), system(3) GNU, 17 April 1993 copysigncopysignCopies the sign of a number SYNOPSIS #include <math.h> double copysign(double x, double y); DESCRIPTION The copysign() function returns a value whose absolute value matches x, but whose sign matches that of y. CONFORMS TO BSD 4.3 GNU, 6 June 1993 coscosCosine function SYNOPSIS #include <math.h> double cos(double x); DESCRIPTION The cos() function returns the cosine of x, where x is given in radians. RETURN VALUE The cos() function returns a value between _1 and 1. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 SEE ALSO acos(3), asin(3), atan(3), atan2(3), sin(3), tan(3) 8 June 1993 Page 908 coshcoshHyperbolic cosine function SYNOPSIS #include <math.h> double cosh(double x); DESCRIPTION The cosh() function returns the hyperbolic cosine of x, which is defined mathematically as(exp(x)+exp(-x))/2. CONFORMS TO SVID 3, POSIX, BSD 4.3, ISO 9899 SEE ALSO acosh(3), asinh(3), atanh(3), sinh(3), tanh(3) 13 June 1993 cryptcryptPassword and data encryption SYNOPSIS #include <unistd.h> char *crypt(const char *key, const char *salt); DESCRIPTION
CONFORMS TO SVID, X/OPEN, BSD 4.3 |