home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / X_PROLOG.LZH / X_PROLOG / SOURCES / GLOBAL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-13  |  3.2 KB  |  114 lines

  1. /*
  2.  
  3.  *        X PROLOG  Vers. 2.0
  4.  
  5.  *
  6.  
  7.  *
  8.  
  9.  *    Written by :     Andreas Toenne
  10.  
  11.  *            CS Dept. , IRB
  12.  
  13.  *            University of Dortmund, W-Germany
  14.  
  15.  *            <at@unido.uucp>
  16.  
  17.  *            <....!seismo!unido!at>
  18.  
  19.  *            <at@unido.bitnet>
  20.  
  21.  *
  22.  
  23.  *    Copyright :    This software is copyrighted by Andreas Toenne.
  24.  
  25.  *            Permission is granted hereby to copy the entire
  26.  
  27.  *            package including this copyright notice without fee.
  28.  
  29.  *
  30.  
  31.  */
  32.  
  33.  
  34.  
  35. /* global stack (env, backlog, frame) */
  36.  
  37.  
  38.  
  39. char *stack;            /* pointer to the stack */
  40.  
  41. char *stacktop;
  42.  
  43. char *stackfull;        /* hightide */
  44.  
  45.  
  46.  
  47. /* backtrack stack */
  48.  
  49.  
  50.  
  51. backlog    *Backpoint;        /* the topmost backtrack point */
  52.  
  53.  
  54.  
  55. /* enviroment stack */
  56.  
  57.  
  58.  
  59. env    *Topenv;        /* the topmost enviroment */
  60.  
  61. env    *Preenv;        /* the previous enviroment */
  62.  
  63.  
  64.  
  65. /* prototyp stack(area) */
  66.  
  67.  
  68.  
  69. char     *protostack;        /* the prototypes stack */
  70.  
  71. term     *prototop;        /* the current top element */
  72.  
  73. term    *protonext;        /* the next to be used element */
  74.  
  75. char     *protofull;        /* the highest element */
  76.  
  77. term    *protofree[MAXARGS+1];    /* list of free terms */
  78.  
  79.  
  80.  
  81. /* copyterm stack */
  82.  
  83.  
  84.  
  85. char     *copystack;        /* the copystack */
  86.  
  87. term     *copytop;        /* the current top element */
  88.  
  89. term    *copynext;        /* the next to be used element */
  90.  
  91. char     *copyfull;        /* the highest element */
  92.  
  93.  
  94.  
  95. /* trail stack */
  96.  
  97.  
  98.  
  99. term    **trailstack;        /* the stack base */
  100.  
  101. long    trailtop;        /* the index of the next free element */
  102.  
  103. long    trailfull;        /* the highest possible index */
  104.  
  105.  
  106.  
  107. /* clause area */
  108.  
  109.  
  110.  
  111. clause    *clausesp;        /* room for clauses */
  112.  
  113. clause    *clausefree;        /* pointer to next free clause */
  114.  
  115. long    clausefull;        /* max. count of clauses */
  116.  
  117. clause     *clausenext;
  118.  
  119.  
  120.  
  121. /* functor area */
  122.  
  123.  
  124.  
  125. char  *functorsp;        /* room for functors */
  126.  
  127. char  *functorfull;
  128.  
  129. char  *functornext;        /* next functor */
  130.  
  131.  
  132.  
  133. functor *functors = (functor *)NULL;    /* the root of the AVL tree */
  134.  
  135.  
  136.  
  137. /* io data */
  138.  
  139.  
  140.  
  141. stream     streams[MAXSTREAMS];    /* list of open streams */
  142.  
  143. stream    *in;            /* current input stream */
  144.  
  145. stream    *out;            /* current output stream */
  146.  
  147.  
  148.  
  149. /* standard data */
  150.  
  151.  
  152.  
  153. functor    *stdfunctor[STDFUNCTORS];    /* list of standard functors */
  154.  
  155.  
  156.  
  157. /* error values */
  158.  
  159.  
  160.  
  161. short c_errno = 0;        /* the number of the last soft error */
  162.  
  163. short io_errors = 1;        /* signal io errors ? */
  164.  
  165.  
  166.  
  167. /* enviroment data (from executing shell) */
  168.  
  169.  
  170.  
  171. char *shell;            /* the path of the default shell */
  172.  
  173. char **enviroment;        /* the program's enviroment */
  174.  
  175.  
  176.  
  177. /* reader data */
  178.  
  179.  
  180.  
  181. lookup    l_table[MAXVARS];    /* the lookup table */
  182.  
  183. short     tide;            /* end-of-table */
  184.  
  185. char     line[MAXLINE];        /* buffer for the current line */
  186.  
  187. char     name[MAXNAME];        /* temp. name space */
  188.  
  189. char    *p;            /* pointer to current character */
  190.  
  191. char     c;            /* the current character */
  192.  
  193. char     lastc;            /* low io */
  194.  
  195. short    c_type;            /* the type of the current character */
  196.  
  197. char    *token;            /* the currently read token */
  198.  
  199. short    token_type;        /* it's type */
  200.  
  201. short    valid_token;        /* token is unused */
  202.  
  203.  
  204.  
  205. term *prompt;            /* the prompt */
  206.  
  207.  
  208.  
  209. /* misc data */
  210.  
  211.  
  212.  
  213. short dodebug;
  214.  
  215. #ifdef ATARI
  216.  
  217. long s_time;            /* timer tic at prolog's start */
  218.  
  219. #endif
  220.  
  221. long  abortpoint[3];        /* save point of abort */
  222.  
  223. short booting;            /* true while booting */
  224.  
  225. long lastconsult;        /* last consulted clause */
  226.  
  227.