home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / logo / part02 / logo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-23  |  5.2 KB  |  251 lines

  1.  
  2. /* Unix Logo, release 3 */
  3.  
  4. /* Installation-dependent parameters */
  5.  
  6. #define EDT "/u/bh/bin/jove"    /* default editor for procedure editing */
  7.  
  8. /* Turn on the graphics devices you have. */
  9. /* #define ATARI /* L-S and Atari */
  10. #define GIGI /* L-S */
  11. /* #define ADM /* COM */
  12. /* #define TEK /* COM */
  13. /* #define SUN /* Lucasfilm */
  14. /* #define FLOOR /* L-S */
  15. /* #define NOTURTLE /* turn on for no graphics at all */
  16.  
  17. /* #define EUNICE        /* turn on for inferior Eunice */
  18.  
  19. /* #define SMALL         /* turn on for non-split-I/D PDP-11. */
  20.  
  21. /* #define EXTLOGO        /* Turn on for .logo instead of .lg */
  22.  
  23. #ifdef SMALL
  24. #define NAMELEN 11
  25. #else
  26. #define NAMELEN 100        /* max length of procedure name, must fit
  27.                    into xxxxxxx.lg filename format */
  28.     /* Should be 11 for pre-4.2 Unix unless EXTLOGO is on,
  29.        9 for Eunice or EXTLOGO. */
  30. #endif SMALL
  31.  
  32. /* Initial values for which signal pauses and which aborts */
  33. #define PAUSESIG SIGINT
  34. #define OTHERSIG SIGQUIT
  35.  
  36. /* Following for 4.2BSD */
  37. #define RAND random
  38. #define SRAND srandom
  39.  
  40. /* Following for non-4.2
  41. #define RAND rand
  42. #define SRAND srand
  43.  */
  44.  
  45. #ifdef SMALL
  46. #define MAXALLOC 30
  47. #define YYMAXDEPTH 150
  48. #else
  49.  
  50. /* Memory allocation tuning.  Adjust these numbers if you run out of space. */
  51. #define MAXALLOC 100
  52. /* Increase MAXALLOC for "I can't remember everything you have told me." */
  53. #define YYMAXDEPTH 2200
  54. /* Increase YYMAXDEPTH if you see "Too many levels of recursion." */
  55. /* Decrease something if you see "No more memory, sorry." */
  56. #endif
  57.  
  58. #ifndef SMALL
  59. #define DEBUG        /* enable debugging code */
  60. #define PAUSE        /* enable pause feature */
  61. #define SETCURSOR    /* enable termcap stuff */
  62. #endif
  63.  
  64. #define LIBLOGO "/usr/lib/logo/"
  65. #define LIBNL "cat /usr/lib/logo/nl >> %s"
  66. #define HELPFILE "/usr/doc/logo/helpfile"
  67. #define DOCLOGO "/usr/doc/logo/"
  68.  
  69. #ifdef EXTLOGO
  70. #define EXTEN ".logo"
  71. #define POTSCMD "/usr/lib/logo/logohead *.logo"
  72. #else
  73. #define EXTEN ".lg"
  74. #define POTSCMD "/usr/lib/logo/logohead *.lg"
  75. #endif
  76.  
  77. /* ---------  End of installation-dependent parameters  --------- */
  78.  
  79. #ifdef SMALL
  80. #define NUMBER float
  81. #define FIXNUM int
  82. #define EFMT "%e"
  83. #define FIXFMT "%d"
  84. #define IBUFSIZ 200
  85. #define PSTKSIZ 64
  86. #else
  87. #define NUMBER double
  88. #define FIXNUM long
  89. #define EFMT "%E"
  90. #define FIXFMT "%D"
  91. #define IBUFSIZ 1000
  92. #define PSTKSIZ 128
  93. #endif
  94.  
  95. #ifdef DEBUG
  96. #define YYDEBUG
  97. #define JFREE jfree
  98. #else
  99. #define JFREE free
  100. #endif
  101.  
  102. #define GLOBAL extern
  103. #define READ 0
  104. #define WRITE 1
  105. #define NULL 0
  106. #define FAST register
  107. #define FOREVER for(;;)
  108. #define FILDES int
  109. #define BUFSIZE 512
  110. #include <stdio.h>
  111. #undef getchar
  112.  
  113. struct cons {
  114.     struct object *car;
  115.     struct object *cdr;
  116. };
  117.  
  118. struct object {
  119. #ifdef SMALL
  120.     char obtype;
  121.     char refcnt;
  122. #else
  123.     int obtype;
  124.     int refcnt;
  125. #endif
  126.     union {
  127.         struct cons ob_cons;
  128.         char *ob_str;
  129.         FIXNUM ob_int;
  130.         NUMBER ob_dub;
  131.     } obob;
  132. };
  133.  
  134. #define obcons    obob.ob_cons
  135. #define obstr    obob.ob_str
  136. #define obint    obob.ob_int
  137. #define obdub    obob.ob_dub
  138. #define obcar    obob.ob_cons.car
  139. #define obcdr    obob.ob_cons.cdr
  140.  
  141. #define CONS    0
  142. #define STRING    1
  143. #define    INT    2
  144. #define    DUB    3
  145.  
  146. extern int memtrace;
  147.  
  148. #define listp(x)    (((x)==0) || (((x)->obtype)==CONS))
  149. #define stringp(x)    ((x) && (((x)->obtype)==STRING))
  150. #define intp(x)        ((x) && (((x)->obtype)==INT))
  151. #define dubp(x)        ((x) && (((x)->obtype)==DUB))
  152.  
  153. extern char *ckmalloc();
  154. extern struct object *localize(),*globcopy(),*globcons(),*loccons();
  155. extern struct object *objstr(),*objcpstr(),*objint(),*objdub();
  156. extern struct object *numconv(),*dubconv(),*true(),*false();
  157. extern struct object *makelist(),*stringform(),*torf();
  158. extern int errrec();
  159.  
  160. struct stkframe
  161. {
  162.     struct alist *loclist;
  163.     char argtord;
  164.     char iftest;
  165.     int *stk;
  166.     int ind;
  167.     int *oldnewstk;
  168.     struct alist *oldnloc;
  169.     struct plist *prevpcell;
  170.     int oldyyc;
  171.     int oldyyl;
  172.     char *oldbpt;
  173.     struct stkframe *prevframe;
  174. #ifdef SMALL
  175.     char oldline;
  176.     char oldpfg;
  177. #else
  178.     int oldline;
  179.     int oldpfg;
  180. #endif
  181. };
  182.  
  183. struct plist
  184. {
  185.     struct plist *before;
  186.     struct object *procname;
  187.     int recdepth;
  188.     struct object *ptitle;
  189.     int *realbase;
  190.     struct lincell *plines;
  191.     struct plist *after;
  192. };
  193.  
  194. struct lincell
  195. {
  196.     int linenum;
  197.     int *base;
  198.     int index;
  199.     struct lincell *nextline;
  200. };
  201.  
  202. struct alist
  203. {
  204.     struct object *name;
  205.     struct object *val;
  206.     struct alist *next;
  207. };
  208.  
  209. struct lexstruct
  210. {
  211.     char *word;
  212.     int lexret;
  213.     struct object *(*lexval)();
  214.     char *abbr;
  215. };
  216.  
  217. struct runblock
  218. {
  219.     struct runblock *rprev;
  220.     struct object *str;
  221.     char *svbpt;
  222.     int roldyyc;
  223.     int roldyyl;
  224.     int roldline;
  225.     FIXNUM rcount;
  226.     FIXNUM rupcount;
  227.     int svpflag;
  228.     int svletflag;
  229.     char svch;
  230. };
  231.  
  232. struct display {
  233.     NUMBER turtx,turty,turth;    /* current values */
  234.     NUMBER xlow,xhigh,ylow,yhigh;    /* limits for this dpy */
  235.     NUMBER stdscrunch;        /* standard aspect ratio */
  236.     int cleared;            /* nonzero after first use */
  237.     char *init,*finish;        /* printed to enable, disable gfx */
  238.     char *totext;            /* printed for temporary textscreen */
  239.     char *clear;            /* printed for cs, and after init */
  240.     int (*drawturt)();        /* one arg, 0 to show, 1 to erase */
  241.     int (*drawfrom)(), (*drawto)();    /* 2 args, x and y, draw vector */
  242.     int (*txtchk)();        /* make error if can't gfx in txtmode */
  243.     int (*infn)(), (*outfn)();    /* no args, called to enable, disable */
  244.     int (*turnturt)();        /* no args, tell Atari turtle heading */
  245.     int (*penc)(), (*setc)();    /* color map routines */
  246.     int (*state)();            /* one arg, state change flag */
  247. };
  248.  
  249. extern int nullfn();
  250.  
  251.