home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / comm / tcp / amitcp / doc / netlib.doc < prev    next >
Text File  |  1994-05-02  |  58KB  |  1,750 lines

  1. TABLE OF CONTENTS
  2.  
  3. net.lib/autoinit
  4. net.lib/autoinit_timer.device
  5. net.lib/autoinit_usergroup.library
  6. net.lib/charRead
  7. net.lib/chmod
  8. net.lib/chown
  9. net.lib/dup
  10. net.lib/dup2
  11. net.lib/fstat
  12. net.lib/gettimeofday
  13. net.lib/herror
  14. net.lib/init_inet_daemon
  15. net.lib/lineRead
  16. net.lib/lstat
  17. net.lib/perror
  18. net.lib/popen
  19. net.lib/PrintNetFault
  20. net.lib/PrintUserFault
  21. net.lib/rcmd
  22. net.lib/serveraccept
  23. net.lib/set_socket_stdio
  24. net.lib/sleep
  25. net.lib/stat
  26. net.lib/strerror
  27. net.lib/syslog
  28. net.lib/usleep
  29. net.lib/utime
  30. net.lib/autoinit                                             net.lib/autoinit
  31.  
  32.    NAME
  33.        autoinit - SAS C Autoinitialization Functions
  34.  
  35.    SYNOPSIS
  36.        LONG _STI_200_openSockets(void)
  37.  
  38.        void _STD_200_closeSockets(void)
  39.  
  40.    FUNCTION
  41.        These functions open and close the bsdsocket.library at the startup
  42.        and exit of the program, respectively.  For a program to use these
  43.        functions, it must be linked with netlib:net.lib (or some variant).
  44.        These functions are linked in only if the program references the
  45.        global symbol "SocketBase".
  46.  
  47.        If the library can be opened, the _STI_200_openSockets() calls
  48.        bsdsocket.library function SocketBaseTags() to tell the library the
  49.        address and the size of the errno variable of the calling program,
  50.        the program name (to be used in syslog() messages) and the address
  51.        of the h_error variable (in which the name resolver errors are
  52.        returned).
  53.  
  54.    NOTES
  55.        _STI_200_openSockets() also checks that the system version is at
  56.        least 37. It also puts up a requester if the bsdsocket.library is
  57.        not found or is of wrong version.
  58.  
  59.        The autoinitialization and autotermination functions are features
  60.        specific to the SAS C6.  However, these functions can be used with
  61.        other (ANSI) C compilers, too. Example follows:
  62.  
  63.        /* at start of main() */
  64.  
  65.        atexit(_STD_200_closeSockets);
  66.        if (_STD_200_openSockets() != 0)
  67.           exit(20);
  68.  
  69.    BUGS
  70.        The same autoinitialization won't work for both SAS C 6.3 and SAS C
  71.        6.50 or latter.  Only way to terminate an initialization function is
  72.        by exit() call with SAS C 6.3 binary.  If an autoinitialization
  73.        function is terminated by exit() call with SAS C 6.50 binary, the
  74.        autotermination functions won't be called.  Due this braindamage
  75.        these compilers require separate net.lib libraries.
  76.  
  77.    SEE ALSO
  78.        bsdsocket.library/SocketBaseTags(),
  79.        SAS/C 6 User's Guide p. 145 for details of autoinitialization and
  80.        autotermination functions.
  81.  
  82. net.lib/autoinit_timer.device                   net.lib/autoinit_timer.device
  83.  
  84.    NAME
  85.        timerinit - SAS C Autoinitialization Functions for timer.device
  86.  
  87.    SYNOPSIS
  88.        _STIopenTimer()
  89.  
  90.        LONG _STI_200_openTimer(void)
  91.  
  92.        _STDcloseTimer()
  93.  
  94.        void _STD_200_closeTimer(void)
  95.  
  96.    FUNCTION
  97.  
  98.        These functions open and close the timer.device at the startup and
  99.        exit of the program, respectively. For a program to use these
  100.        functions, it must be linked with netlib:net.lib.
  101.  
  102.        The opened device base is stored in the TimerBase global variable.
  103.  
  104.        If the device can be opened, the _STIopenTimer() sets up the time zone
  105.        information, which is used by the gettimeofday() function.
  106.  
  107.    NOTES
  108.        The time zone information is got from the environment variable named
  109.        TZ. The format for this variable is:
  110.  
  111.            zzznnnddd
  112.  
  113.        where zzz is three letter identifier for the time zone (for example
  114.        GMT), and the nnn is hours west from Greenwich on range [-23,24]
  115.        (negative values are to east).  The last field is the abbreviation for
  116.        the local daylight saving time zone (which is not interpreted by this
  117.        version).
  118.  
  119.        If the TZ environment variable cannot be found, Greenwich Mean Time
  120.        (GMT) is used instead.
  121.  
  122.        The autoinitialization and autotermination functions are features
  123.        specific to the SAS C6.  However, these functions can be used with
  124.        other (ANSI) C compilers, too.  Example follows:
  125.  
  126.        /* at start of main() */
  127.  
  128.        atexit(_STDcloseTimer);
  129.        _STDopenTimer();
  130.  
  131.    BUGS
  132.        TZ "hours west from GMT" should be interpreted as float.
  133.  
  134.        The same autoinitialization won't work for both SAS C 6.3 and SAS C
  135.        6.50 or latter.  Only way to terminate an initialization function is
  136.        by exit() call with SAS C 6.3 binary.  If an autoinitialization
  137.        function is terminated by exit() call with SAS C 6.50 binary, the
  138.        autotermination functions won't be called.  Due this braindamage
  139.        these compilers require separate net.lib libraries.
  140.  
  141.    SEE ALSO
  142.        net.lib/gettimeofday(),
  143.        SAS/C 6 User's Guide p. 145 for details of autoinitialization and
  144.        autotermination functions.
  145. net.lib/autoinit_usergroup.library         net.lib/autoinit_usergroup.library
  146.  
  147.    NAME
  148.        autoinit usergroup.library - SAS C Autoinitialization Functions
  149.  
  150.    SYNOPSIS
  151.        error = _STI_200_openUserGroup()
  152.  
  153.        LONG _STI_200_openUserGroup(void)
  154.  
  155.        _STD_200_closeUserGroup()
  156.  
  157.        void _STD_200_closeUserGroup(void)
  158.  
  159.    FUNCTION
  160.        These functions open and close the usergroup.library at the startup
  161.        and exit of the program, respectively.  For a program to use these
  162.        functions, it must be linked with netlib:usr.lib.
  163.  
  164.    NOTES
  165.        _STI_200_openUserGroup() also checks that the system version is at
  166.        least 37.  It puts up a requester if the usergroup.library is not
  167.        found or is too old version.
  168.  
  169.        The autoinitialization and autotermination functions are features
  170.        specific to the SAS C6.  However, these functions can be used with
  171.        other (ANSI) C compilers, too.  Example follows:
  172.  
  173.        /* at start of main() */
  174.  
  175.        atexit(_STD_200_closeUserGroup);
  176.        if (_STI_200_openUserGroup() != 0)
  177.           exit(20);
  178.  
  179.    BUGS 
  180.        The same autoinitialization won't work for both SAS C 6.3 and SAS C
  181.        6.50 or latter.  Only way to terminate an initialization function is
  182.        by exit() call with SAS C 6.3 binary.  If an autoinitialization
  183.        function is terminated by exit() call with SAS C 6.50 binary, the
  184.        autotermination functions won't be called.  Due this braindamage
  185.        these compilers require separate net.lib libraries.
  186.  
  187.    SEE ALSO
  188.        SAS/C 6 User's Guide p. 145 for details of autoinitialization and
  189.        autotermination functions.
  190.  
  191. net.lib/charRead                                             net.lib/charRead
  192.  
  193.    NAME
  194.        charRead -- read characters from socket one by one.
  195.  
  196.    SYNOPSIS
  197.        initCharRead(rc, fd)
  198.  
  199.        void initCharRead(struct CharRead *, int);
  200.  
  201.  
  202.        character = charRead(rc)
  203.  
  204.        int charRead(struct CharRead *);
  205.  
  206.  
  207.    DESCRIPTION
  208.        charRead is a macro package which return characters one by one 
  209.        from given socket input stream. The socket where data is to be read
  210.        is set by calling initCharRead(): rc is the pointer to charread
  211.        structure previously allocated. fd is the (socket) descriptor where
  212.        reading is to be done.
  213.  
  214.        charRead() returns the next character from input stream or one of
  215.        the following:
  216.  
  217.        RC_DO_SELECT    (-3)    - read input buffer is returned. Do select
  218.                                  before next call if you don't want charread
  219.                                  to block.
  220.  
  221.        RC_EOF          (-2)    - end-of-file condition has occurred.
  222.  
  223.        RC_ERROR        (-1)    - there has been an error while filling new
  224.                                  charread buffer. Check the value of Errno()
  225.  
  226.    NOTE
  227.        Always use variable of type int to store return value from charRead()
  228.        since the numeric value of characters returned may vary between
  229.        0 -255 (or even greater). As you may know, -3 equals 253 if of type
  230.        unsigned char.
  231.  
  232.    EXAMPLE
  233.        /*
  234.         * This piece of code shows how to use charread with select()
  235.         */
  236.        #include <sys/types.h>
  237.        #include <sys/socket.h>
  238.        #include <charread.h>
  239.  
  240.        main_loop(int sock)
  241.        {
  242.          struct CharRead rc;
  243.          fd_set readfds;
  244.