home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
useful
/
comm
/
tcp
/
amitcp
/
doc
/
netlib.doc
< prev
next >
Wrap
Text File
|
1994-05-02
|
58KB
|
1,750 lines
TABLE OF CONTENTS
net.lib/autoinit
net.lib/autoinit_timer.device
net.lib/autoinit_usergroup.library
net.lib/charRead
net.lib/chmod
net.lib/chown
net.lib/dup
net.lib/dup2
net.lib/fstat
net.lib/gettimeofday
net.lib/herror
net.lib/init_inet_daemon
net.lib/lineRead
net.lib/lstat
net.lib/perror
net.lib/popen
net.lib/PrintNetFault
net.lib/PrintUserFault
net.lib/rcmd
net.lib/serveraccept
net.lib/set_socket_stdio
net.lib/sleep
net.lib/stat
net.lib/strerror
net.lib/syslog
net.lib/usleep
net.lib/utime
net.lib/autoinit net.lib/autoinit
NAME
autoinit - SAS C Autoinitialization Functions
SYNOPSIS
LONG _STI_200_openSockets(void)
void _STD_200_closeSockets(void)
FUNCTION
These functions open and close the bsdsocket.library at the startup
and exit of the program, respectively. For a program to use these
functions, it must be linked with netlib:net.lib (or some variant).
These functions are linked in only if the program references the
global symbol "SocketBase".
If the library can be opened, the _STI_200_openSockets() calls
bsdsocket.library function SocketBaseTags() to tell the library the
address and the size of the errno variable of the calling program,
the program name (to be used in syslog() messages) and the address
of the h_error variable (in which the name resolver errors are
returned).
NOTES
_STI_200_openSockets() also checks that the system version is at
least 37. It also puts up a requester if the bsdsocket.library is
not found or is of wrong version.
The autoinitialization and autotermination functions are features
specific to the SAS C6. However, these functions can be used with
other (ANSI) C compilers, too. Example follows:
/* at start of main() */
atexit(_STD_200_closeSockets);
if (_STD_200_openSockets() != 0)
exit(20);
BUGS
The same autoinitialization won't work for both SAS C 6.3 and SAS C
6.50 or latter. Only way to terminate an initialization function is
by exit() call with SAS C 6.3 binary. If an autoinitialization
function is terminated by exit() call with SAS C 6.50 binary, the
autotermination functions won't be called. Due this braindamage
these compilers require separate net.lib libraries.
SEE ALSO
bsdsocket.library/SocketBaseTags(),
SAS/C 6 User's Guide p. 145 for details of autoinitialization and
autotermination functions.
net.lib/autoinit_timer.device net.lib/autoinit_timer.device
NAME
timerinit - SAS C Autoinitialization Functions for timer.device
SYNOPSIS
_STIopenTimer()
LONG _STI_200_openTimer(void)
_STDcloseTimer()
void _STD_200_closeTimer(void)
FUNCTION
These functions open and close the timer.device at the startup and
exit of the program, respectively. For a program to use these
functions, it must be linked with netlib:net.lib.
The opened device base is stored in the TimerBase global variable.
If the device can be opened, the _STIopenTimer() sets up the time zone
information, which is used by the gettimeofday() function.
NOTES
The time zone information is got from the environment variable named
TZ. The format for this variable is:
zzznnnddd
where zzz is three letter identifier for the time zone (for example
GMT), and the nnn is hours west from Greenwich on range [-23,24]
(negative values are to east). The last field is the abbreviation for
the local daylight saving time zone (which is not interpreted by this
version).
If the TZ environment variable cannot be found, Greenwich Mean Time
(GMT) is used instead.
The autoinitialization and autotermination functions are features
specific to the SAS C6. However, these functions can be used with
other (ANSI) C compilers, too. Example follows:
/* at start of main() */
atexit(_STDcloseTimer);
_STDopenTimer();
BUGS
TZ "hours west from GMT" should be interpreted as float.
The same autoinitialization won't work for both SAS C 6.3 and SAS C
6.50 or latter. Only way to terminate an initialization function is
by exit() call with SAS C 6.3 binary. If an autoinitialization
function is terminated by exit() call with SAS C 6.50 binary, the
autotermination functions won't be called. Due this braindamage
these compilers require separate net.lib libraries.
SEE ALSO
net.lib/gettimeofday(),
SAS/C 6 User's Guide p. 145 for details of autoinitialization and
autotermination functions.
net.lib/autoinit_usergroup.library net.lib/autoinit_usergroup.library
NAME
autoinit usergroup.library - SAS C Autoinitialization Functions
SYNOPSIS
error = _STI_200_openUserGroup()
LONG _STI_200_openUserGroup(void)
_STD_200_closeUserGroup()
void _STD_200_closeUserGroup(void)
FUNCTION
These functions open and close the usergroup.library at the startup
and exit of the program, respectively. For a program to use these
functions, it must be linked with netlib:usr.lib.
NOTES
_STI_200_openUserGroup() also checks that the system version is at
least 37. It puts up a requester if the usergroup.library is not
found or is too old version.
The autoinitialization and autotermination functions are features
specific to the SAS C6. However, these functions can be used with
other (ANSI) C compilers, too. Example follows:
/* at start of main() */
atexit(_STD_200_closeUserGroup);
if (_STI_200_openUserGroup() != 0)
exit(20);
BUGS
The same autoinitialization won't work for both SAS C 6.3 and SAS C
6.50 or latter. Only way to terminate an initialization function is
by exit() call with SAS C 6.3 binary. If an autoinitialization
function is terminated by exit() call with SAS C 6.50 binary, the
autotermination functions won't be called. Due this braindamage
these compilers require separate net.lib libraries.
SEE ALSO
SAS/C 6 User's Guide p. 145 for details of autoinitialization and
autotermination functions.
net.lib/charRead net.lib/charRead
NAME
charRead -- read characters from socket one by one.
SYNOPSIS
initCharRead(rc, fd)
void initCharRead(struct CharRead *, int);
character = charRead(rc)
int charRead(struct CharRead *);
DESCRIPTION
charRead is a macro package which return characters one by one
from given socket input stream. The socket where data is to be read
is set by calling initCharRead(): rc is the pointer to charread
structure previously allocated. fd is the (socket) descriptor where
reading is to be done.
charRead() returns the next character from input stream or one of
the following:
RC_DO_SELECT (-3) - read input buffer is returned. Do select
before next call if you don't want charread
to block.
RC_EOF (-2) - end-of-file condition has occurred.
RC_ERROR (-1) - there has been an error while filling new
charread buffer. Check the value of Errno()
NOTE
Always use variable of type int to store return value from charRead()
since the numeric value of characters returned may vary between
0 -255 (or even greater). As you may know, -3 equals 253 if of type
unsigned char.
EXAMPLE
/*
* This piece of code shows how to use charread with select()
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <charread.h>
main_loop(int sock)
{
struct CharRead rc;
fd_set readfds;