Operating System-Dependent Public Interface These functions are in OS-dependent code, and are rewritten each time c-client is ported to a new operating system. void rfc822_date (char *date); date buffer to write the date, must be large enough This function is called to get the current date and time in an RFC 822 format string into the given buffer. void *fs_get (size_t size); size number of octets requested This function allocates and returns a block of free storage of the specified size. Unlike malloc(), there is no failure return; this function must return with the requested storage. void fs_resize (void **block,size_t size); block pointer to pointer to block to be resized size new size in octets This function resizes the free storage block, updating the pointer if necessary. Unlike realloc(), there is no failure return; this function must return with the requested storage. void fs_give (void **block); block pointer to pointer to block to free This function releases a block of free storage allocated by fs_get(). It also erases the block pointer, so it isn't necessary to do this in the application. void fatal (char *string); string message string This function is called when an "impossible" error is detected and the client wishes to crash. The string should contain a reason. char *strcrlfcpy (char **dst,long *dstl,char *src,long srcl); dst pointer to destination string pointer dstl pointer to destination string size src source strin srcl source string size This function is called to copy into a destination string dst of size dstl (resized if necessary), a CRLF newline form string from local format string src of size srcl. TCPSTREAM *tcp_open (char *host,long port); TCPSTREAM *tcp_aopen (char *host,char *service); char *tcp_getline (TCPSTREAM *stream); long tcp_getbuffer (TCPSTREAM *stream,long size,char *buffer); long tcp_soutr (TCPSTREAM *stream,char *string); void tcp_close (TCPSTREAM *stream); char *tcp_host (TCPSTREAM *stream); unsigned long tcp_port (TCPSTREAM *stream); char *tcp_localhost (TCPSTREAM *stream); These functions are TCP-specific versions of the more general net_xxx() functions. These should not be called directly by applications. char *tcp_clienthost (char *dst); dst destination string buffer This function should be called only by a server called by inetd or similar mechanism which maps standard input to a network socket. It returns the host name of the other end (e.g. the client of a server) using the given string buffer, or NIL if it can't get this information.