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

  1. /*****
  2.  *
  3.  * File: cm_cellsim.h
  4.  *
  5.  * Cellsim, cellular automata simulator
  6.  *
  7.  * Includes, defines, variables, etc related to controlling the CM.
  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.  
  57. /*****
  58.  *
  59.  * Includes, typedefs
  60.  *
  61.  *****/
  62.  
  63. #include "cell.def"
  64. #include "cm_cellproto.h"
  65. #include "sock_rtns.h"
  66.  
  67. typedef unsigned char byte;
  68.  
  69.  
  70. /*****
  71.  *
  72.  * External routines
  73.  *
  74.  *****/
  75.  
  76. extern void
  77.     display_image(),    /* display image in SunView canvas */
  78.     set_rgb_arrays();    /* set up rgb arrays to send cmap to CM */
  79. extern int
  80.     valid_CM_state(),    /* is current nhood valid for CM? */
  81.     valid_CM_image();    /* is current image-size valid for CM? */
  82.  
  83.  
  84. /*****
  85.  *
  86.  * External vars
  87.  *
  88.  *****/
  89.  
  90. extern byte
  91.     *ca,    /* CA array */
  92.     *ta;    /* lookup table */
  93. extern int
  94.     parm1, parm2,    /* global parms for computed-fcn rules */
  95.     stime, *statecount,
  96.     saved_ox, saved_oy,    /* vars for generating random images */
  97.     saved_sx, saved_sy, saved_density,
  98.     saved_min_val, saved_max_val,
  99.     function, auto_nhood_change,
  100.     TSIZE, SOCKET_INUSE,
  101.     setting_sequence, use_CM;
  102. extern short
  103.     B, S, L, N, NHOOD, R;
  104. extern char
  105.     CM_hostname[80];
  106. extern unsigned short CM_port;
  107.  
  108.  
  109.  
  110.  
  111. /*****
  112.  *
  113.  * Local vars
  114.  *
  115.  *****/
  116.  
  117. /*** vars visible to external routines ***/
  118. int
  119.     CM_disp_interval=1,    /* used to skip frames when running w/ display */
  120.     CM_delay=0,        /* delay between updates, to slow down CM */
  121.     CM_zoom, CM_panx=0, CM_pany=0,    /* FB-related variables */
  122.     use_FB, use_Sun_disp;    /* display flags */
  123. char
  124.     CM_image_dir[BUFLEN], CM_LT_dir[BUFLEN], CM_fcn_dir[BUFLEN];
  125.  
  126. /*** private vars ***/
  127. static int server_fd;    /* fd of socket to CMFE */
  128. static char saved_CM_rule_file[128];
  129.  
  130.  
  131. /*****
  132.  *
  133.  * Local routines
  134.  *
  135.  *****/
  136.  
  137. void
  138.     CM_auto_step(), CM_auto_screen(), CM_set_displays(),
  139.     CM_send_cmap(), CM_send_delay(), CM_set_disp_interval(),
  140.     CM_disconnect();
  141.