home *** CD-ROM | disk | FTP | other *** search
/ Photo CD Demo 1 / Demo.bin / cellsim / v2_5 / src / sck_rtns.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-26  |  2.3 KB  |  89 lines

  1. /*
  2.  * File: sock_rtns.h
  3.  *   By: Dave Hiebeler
  4.  *       May 1988
  5.  *
  6.  * Header-file for the socket-routines
  7.  *
  8.  */
  9.  
  10.  
  11. /*
  12.  *
  13.  * Cellsim copyright 1989, 1990 by Chris Langton and Dave Hiebeler
  14.  * (cgl@lanl.gov, hiebeler@heretic.lanl.gov)
  15.  *
  16.  * This package may be freely distributed, as long as you don't:
  17.  * - remove this notice
  18.  * - try to make money by doing so
  19.  * - prevent others from copying it freely
  20.  * - distribute modified versions without clearly documenting your changes
  21.  *   and notifying us
  22.  *
  23.  * Please contact either of the authors listed above if you have questions
  24.  * or feel an exception to any of the above restrictions is in order.
  25.  *
  26.  * If you make changes to the code, or have suggestions for changes,
  27.  * let us know!  If we use your suggestion, you will receive full credit
  28.  * of course.
  29.  */
  30.  
  31. /*****
  32.  * Cellsim history:
  33.  *
  34.  * Cellsim was originally written on Apollo workstations by Chris Langton.
  35.  *
  36.  * Sun versions:
  37.  *
  38.  * - version 1.0
  39.  *   by C. Ferenbaugh and C. Langton
  40.  *   released 09/02/88
  41.  *
  42.  * - version 1.5
  43.  *   by Dave Hiebeler and C. Langton  May - June 1989
  44.  *   released 07/03/89
  45.  *
  46.  * - version 2.0
  47.  *   by Dave Hiebeler and C. Langton  July - August 1989
  48.  *   never officially released (unofficially released 09/08/89)
  49.  *
  50.  * - version 2.5
  51.  *   by Dave Hiebeler and C. Langton  September '89 - February 1990
  52.  *   released 02/26/90
  53.  *****/
  54.  
  55.  
  56. /* We probably don't need to include *all* of these.. but I haven't
  57.  * carefully checked to see just what we do and don't need.
  58.  */
  59.  
  60. #include <stdio.h>      /* for fprintf, NULL, etc, etc */
  61. #include <errno.h>      /* for errno, and error names */
  62. #include <strings.h>    /* for strcpy, strcmp */
  63. #include <signal.h>     /* for signal */
  64. #include <sys/file.h>   /* for open, close */
  65. #include <sys/ioctl.h>  /* for ioctl */
  66. #include <sys/time.h>   /* for the timeout structure */
  67. #include <sys/types.h>  /* for accept, socket, listen */
  68. #include <sys/socket.h> /* for accept, socket, listen */
  69. #include <netinet/in.h> /* for sockaddr_in structure */
  70. #include <netdb.h>      /* for hostent structure */
  71. #include <arpa/inet.h>    /* for inet_ntoa & other stuff */
  72.  
  73.  
  74. #define ON    1
  75. #define OFF    0
  76.  
  77.  
  78. extern int
  79.     write_to_sock(),
  80.     read_from_sock(),
  81.     open_host_socket(),
  82.     get_my_host_number(),
  83.     wait_to_accept_socket(),
  84.     connect_to_waiting_socket(),
  85.     write_to_file(),
  86.     see_who_client_is(),
  87.     read_from_file(),
  88.     set_mode();
  89.