C:/Users/Dennis/src/lang/Life_start/Life/life-1.02/source/extern.h

Go to the documentation of this file.
00001 /* Copyright 1991 Digital Equipment Corporation.
00002 ** All Rights Reserved.
00003 *****************************************************************/
00004 /*      $Id: extern.h,v 1.9 1995/07/27 20:02:29 duchier Exp $    */
00005 
00006 #ifndef _LIFE_EXTERN_H_
00007 #define _LIFE_EXTERN_H_
00008 
00009 #include <stdio.h>
00010 #include <string.h>
00011 #include <math.h>
00012 #include <sys/types.h>
00013 #ifndef OS2_PORT
00014 #include <sys/stat.h>
00015 #include <sys/time.h>
00016 #include <sys/times.h>
00017 #else
00018 #include <time.h>
00019 #define OS2_HOME "/home/dennis/src/lang/Life/life-1.02/lf/";
00020 #define bzero(p,l) memset(p,0,l)
00021 #define bcopy memcpy
00022 #define bcmp memcmp
00023 #define random rand
00024 #define srandom srand
00025 
00026 #endif
00027 #include <assert.h>
00028 #include <errno.h>
00029 #include <setjmp.h>
00030 
00031 /* Memory Alignment and size */
00032 #define WORD sizeof(long)
00033 
00034 #ifdef WORDALIGN
00035 #define ALIGN WORD
00036 #else
00037 #define ALIGN 8
00038 #endif
00039 
00040 
00041 /* Time stamp technique */
00042 #define TS
00043 
00044 #ifdef CLIFE
00045 #include "blockdef.h"
00046 #endif /* CLIFE */
00047 
00048 
00049 /*************************** CONSTANTS **************************/
00050 
00051 /* Enable looking first for local set_up file */
00052 /* In the final release, LOCALSETUP should be undefined. */
00053 #define LOCALSETUP
00054 #define LOCALSETUPFILE  "./.set_up"
00055 
00056 
00057 /* RM: Mar 1 1994: replaced macros with variables. */
00058 
00059 /* Memory is determined in words by the variable "alloc_words", this may be
00060    specified on the command line and defaults to the macro "ALLOC_WORDS". mem_size
00061    is in bytes and is the product of alloc_words by the size of a machine word.
00062    This system is thus consistent between 32 and 64-bit architectures: the same
00063    number of psi-terms can be allocated in either.
00064    */
00065 
00066 extern int mem_size;
00067 extern int alloc_words;
00068 
00069 
00070 
00071 /* Garbage collection threshold (1/8 of MEM_SIZE is reasonable). */
00072 #define GC_THRESHOLD (alloc_words>>3) /* number of words */
00073 
00074 /* Copy threshold (1/8 of GC_THRESHOLD is reasonable) */
00075 #define COPY_THRESHOLD (GC_THRESHOLD>>3)
00076 
00077 
00078 /* Which C type to use to represent reals and integers in Wild_Life. */
00079 #define REAL double
00080 
00081 /* Maximum exactly representable integer (2^53-1 for double IEEE format) */
00082 /* May be incorrect for Alpha - haven't checked. RM: Mar  1 1994  */
00083 #define WL_MAXINT 9007199254740991.0
00084 
00085 /* Maximum number of syntactic tokens in a pretty-printed output term. */
00086 #define PRETTY_SIZE 20000
00087 
00088 /* Maximum number of built_ins */
00089 #define MAX_BUILT_INS 300
00090 
00091 /* Maximum size of file names and input tokens (which includes input strings) */
00092 /* (Note: calculated tokens can be arbitrarily large) */
00093 #define STRLEN 10000
00094 
00095 /* Initial page width for printing */
00096 #define PAGE_WIDTH 80
00097 
00098 /* Initial depth limit for printing */
00099 #define PRINT_DEPTH 1000000000
00100 
00101 /* Power of ten to split printing (REALs are often more precise than ints) */
00102 #define PRINT_SPLIT 1000000000
00103 #define PRINT_POWER 9
00104 
00105 /* Maximum depth of the parser stack */
00106 /* = maximum depth of embedded brackets etc... */
00107 #define PARSER_STACK_SIZE 10000
00108 
00109 /* Maximum operator precedence */
00110 #define MAX_PRECEDENCE 1200
00111 
00112 /* Size of prlong buffer */
00113 #define PRINT_BUFFER 100000
00114 
00115 /* Head of prompt */
00116 #define PROMPT "> "
00117 
00118 /* Size of prompt buffer */
00119 #define PROMPT_BUFFER 200
00120 #define MAX_LEVEL ((PROMPT_BUFFER-4-strlen(PROMPT))/2)
00121 
00122 /* Maximum number of goals executed between event polling */
00123 /* Ideally, this should be a function of machine speed. */
00124 #define XEVENTDELAY 1000
00125 
00126 /* Maximum goal indentation during tracing */
00127 #define MAX_TRACE_INDENT 40
00128 
00129 #define HEAP_ALLOC(A) (A *)heap_alloc(sizeof(A))
00130 #define STACK_ALLOC(A) (A *)stack_alloc(sizeof(A))
00131 
00132 /* True flags for the flags field of psi-terms */
00133 #define QUOTED_TRUE   1
00134 #define UNFOLDED_TRUE 2
00135 
00136 /* Standard booleans */
00137 #define TRUE      1
00138 #define FALSE     0
00139 #define TRUEMASK  1
00140 
00141 /* For LIFE boolean calculation built-ins */
00142 #define UNDEF     2
00143 
00144 #define NOT_CODED 0
00145 #define UN_CODED (CODE)0
00146 
00147 /* Must be different from NULL, a built-in index, and a pointer */
00148 /* Used to indicate that the rules of the definition are needed. */
00149 #define DEFRULES  -1
00150 
00151 #define EOLN 10
00152 
00153 /* How many types can be encoded on one integer */
00154 /* in the transitive closure encoding. */
00155 #define INT_SIZE 8*sizeof(unsigned long)
00156 
00157 /* Flags to indicate heap or stack allocation */
00158 #define HEAP TRUE
00159 #define STACK FALSE
00160 
00161 /* Kinds of user inputs */
00162 #define FACT 100
00163 #define QUERY 200
00164 #define ERROR 999
00165 
00166 /* Bit masks for status field of psi-terms: RMASK is used as a flag to */
00167 /* avoid infinite loops when tracing psi-terms, SMASK masks off the    */
00168 /* status bits.  These are used in the 'mark' routines (copy.c) and in */
00169 /* check_out. */
00170 #define RMASK 256
00171 #define SMASK 255
00172 
00173 /* Initial value of time stamp (for variable binding) */
00174 #ifdef TS
00175 #define INIT_TIME_STAMP 1
00176 #endif
00177 
00178 /*  RM: Feb 10 1993  */
00179 /* To distinguish function actual parameters from formal parameters during
00180    matching:
00181    */
00182 
00183 #define FUNC_ARG(t)  ((t)<match_date || (GENERIC)(t)>=heap_pointer)
00184 
00185 
00186 
00187 
00188 
00189 /******************************** MACROS *******************************/
00190 
00191 /* *** Macros for the tokenizer, define the types of ASCII characters. */
00192 
00193 
00194 #define DIGIT(C) (C>='0' && C<='9')
00195 
00196 #define UPPER(C) ((C>='A' && C<='Z') || C=='_')
00197 
00198 #define LOWER(C) (C>='a' && C<='z')
00199 
00200 #define ISALPHA(C) (DIGIT(C) || UPPER(C) || LOWER(C))
00201 
00202 /* Must be single-character tokens (unless surrounded by quotes) */
00203 /* The chars '.', '?', and '`' have been added */
00204 #define SINGLE(C) (C=='(' || C==')' || C=='[' || C==']' || C=='{' || C=='`' ||\
00205                    C=='}' || C==',' || C=='.' || C==';' || C=='@' ||\
00206                    C=='!')/*  RM: Jul  7 1993  */
00207 
00208 /* Can be components of multi-character tokens */
00209 #define SYMBOL(C) (C=='#' || C=='$' || C=='%' || C=='&' ||\
00210                    C=='*' || C=='+' || C=='-' || C=='>' || C=='/' ||\
00211                    C==':' || C=='<' || C=='=' ||\
00212                    C=='~' || C=='^' || C=='|' || C=='\\' ||\
00213                    C=='.' || C=='?' /*  RM: Jul  7 1993  */ \
00214                    )
00215 /*C=='!' ||  RM: Jul  7 1993  */
00216 
00217 /* Returns TRUE iff psi_term A is equal to string B. */
00218 /* This cannot be used on encoded types.  */
00219 #define equ_tok(A,B) (!strcmp(A.type->keyword->symbol,B))
00220 #define equ_tok3(A,B,Q) (Q?FALSE:equ_tok(A,B))
00221 
00222 /* Returns TRUE iff psi_term A is equal to character B. */
00223 #define equ_tokch(A,B) (A.type->keyword->symbol[0]==B && A.type->keyword->symbol[1]==0)
00224 #define equ_tokch3(A,B,Q) (Q?FALSE:equ_tokch(A,B))
00225 
00226 /* Returns TRUE iff psi_term A is equal to character B. */
00227 /* Handles also the case where B may be NULL, i.e. A must be empty */
00228 #define equ_tokc(A,B) (B?equ_tokch(A,B):A.type->keyword->symbol[0]==0)
00229 #define equ_tokc3(A,B,Q) (Q?FALSE:equ_tokc(A,B))
00230 
00231 /* *** Other macros. */
00232 
00233 /* The cut operation */
00234 /* This ensures that a cut is below choice_stack. */
00235 
00236 
00237 #define cut_to(C) { ptr_choice_point cp=choice_stack; \
00238                     while ((GENERIC)cp>(GENERIC)(C)) cp=cp->next; \
00239                     choice_stack=cp; \
00240                   }
00241 
00242 /*
00243 #define cut_to(C) if ((ptr_choice_point)(C)<=choice_stack) { \
00244   choice_stack=(ptr_choice_point)(C); \
00245   }
00246 */
00247 
00248 
00249 /* The basic dereference operation. */
00250 /* P must be a pointer to a psi_term.  */
00251 /* (For the other dereference routines, see lefun.c) */
00252 #define deref_ptr(P) while(P->coref) P=P->coref
00253 
00254 /* Predicates defined in Life whose args should not be evaluated. */
00255 #define noneval(T) (T->type==quote || T->type==listingsym || T->type==loadsym)
00256 
00257 /* CONSTant used to be a function, */
00258 /* returns TRUE if psi_term S is a constant.  */
00259 #define wl_const(S) ((S).value==NULL && (S).type!=variable)
00260 
00261 #define equal_types(A,B) ((A)==(B))
00262 
00263 #define is_top(T) ((T)!=NULL && (T)->type==top && (T)->attr_list==NULL)
00264 
00265 /* Object is inside Life data space */
00266 
00267 /* #define VALID_RANGE(A) ((GENERIC)A>=mem_base && (GENERIC)A<mem_limit) \
00268   ?TRUE \
00269   :printf("*** Address out of range: %ld, base=%ld, limit=%ld\n",   \
00270           (unsigned long) A,   \
00271           (unsigned long) mem_base,   \
00272           (unsigned long) mem_limit),FALSE;
00273 
00274             RM: Jan  4 1993   An idea
00275 */
00276 
00277 #define VALID_RANGE(A) ((GENERIC)A>=mem_base && (GENERIC)A<mem_limit)
00278 
00279 /* Object has valid address to be modified in garbage collector */
00280 #ifdef X11
00281 #define VALID_ADDRESS(A) (  VALID_RANGE(A) \
00282                          || (GENERIC)A==(GENERIC)&xevent_list \
00283                          || (GENERIC)A==(GENERIC)&xevent_existing \
00284                          || (GENERIC)A==(GENERIC)&var_tree \
00285                          )
00286 #else
00287 #define VALID_ADDRESS(A) (  VALID_RANGE(A) \
00288                          || (GENERIC)A==(GENERIC)&var_tree \
00289                          )
00290 #endif
00291 
00292 /******************************* TYPES ************************************/
00293 
00294 /* GENERIC is the type of a pointer to any type.  This might not work on */
00295 /* some machines, but it should be possible as MALLOC() uses something of */
00296 /* that kind.  ANSI uses "void *" instead.  */
00297 
00298 
00299 typedef unsigned long *                    GENERIC;
00300 /* typedef void * GENERIC; */
00301 
00302 
00303 typedef char                      string[STRLEN];
00304 typedef struct wl_operator_data *   ptr_operator_data;
00305 typedef struct wl_int_list *        ptr_int_list;
00306 typedef struct wl_resid_list *      ptr_resid_list; /* 21.9 */
00307 typedef struct wl_definition *      ptr_definition;
00308 typedef struct wl_residuation *     ptr_residuation;
00309 typedef struct wl_psi_term *        ptr_psi_term;
00310 typedef struct wl_node *            ptr_node;
00311 typedef struct wl_pair_list *       ptr_pair_list;
00312 typedef struct wl_triple_list *     ptr_triple_list;
00313 typedef struct wl_list *            ptr_list;
00314 typedef struct wl_stack *           ptr_stack;
00315 typedef struct wl_goal *            ptr_goal;
00316 typedef struct wl_choice_point *    ptr_choice_point;
00317 
00318 /****************************** DATA STRUCTURES **************************/
00319 
00320 /* Definition of an operator */
00321 
00322 typedef enum { nop, xf, fx, yf, fy, xfx, /* yfy, */ xfy, yfx } operator;
00323 
00324 typedef struct wl_operator_data {
00325   operator type;
00326   long precedence;
00327   ptr_operator_data next;
00328 } operator_data;
00329 
00330 /* List of integers or pointers */
00331 typedef struct wl_int_list {
00332   GENERIC value;
00333   ptr_int_list next;
00334 } int_list;
00335 
00336 /* List of residuation variables */ /* 21.9 */
00337 typedef struct wl_resid_list { 
00338   ptr_psi_term var;
00339   ptr_psi_term othervar; /* needed for its sort only */
00340   ptr_resid_list next;
00341 } resid_list;
00342 
00343 typedef enum {   undef,
00344                  predicate,
00345                  function,
00346                  type,
00347                  global    /*  RM: Feb  8 1993  */
00348 #ifdef CLIFE
00349                  ,block       /*  AA: Mar  8 1993  */
00350 #endif /* CLIFE */
00351                  } def_type;
00352 
00353 
00354 
00355 
00356 typedef struct wl_hash_table * ptr_hash_table;
00357 
00358 
00359 /************ MODULES **************/
00360 /*        RM: Jan  7 1993          */
00361 
00362 struct wl_module {
00363   char *module_name;
00364   char *source_file;
00365   ptr_int_list open_modules;
00366   ptr_int_list inherited_modules;
00367   ptr_hash_table symbol_table;
00368 };
00369 
00370 
00371 typedef struct wl_module * ptr_module;
00372 
00373 extern ptr_node module_table;        /* The table of modules */
00374 extern ptr_module current_module;    /* The current module for the tokenizer */
00375 
00376 
00377 struct wl_keyword {
00378   ptr_module module;
00379   char *symbol;
00380   char *combined_name; /* module#symbol */
00381   int public;
00382   int private_feature; /*  RM: Mar 11 1993  */
00383   ptr_definition definition;
00384 };
00385 
00386 typedef struct wl_keyword * ptr_keyword;
00387 
00388 /********* END MODULES *************/
00389 
00390 
00391 
00392 /************ HASH CODED SYMBOL TABLE **************/
00393 /*                RM: Feb  3 1993                  */
00394 
00395 
00396 /* Hash tables for keywords */
00397 
00398 struct wl_hash_table {
00399   int size;
00400   int used;
00401   ptr_keyword *data;
00402 };
00403 
00404 /*
00405 void           hash_insert(ptr_hash_table table,char *symbol,ptr_keyword data);
00406 ptr_keyword    hash_lookup(ptr_hash_table table,char *symbol);
00407 ptr_hash_table hash_create(int size);
00408 void           hash_expand(ptr_hash_table table,int new_size);
00409 int            hash_code(ptr_hash_table table,char *symbol);
00410 void           hash_display(ptr_hash_table table);
00411 */
00412 
00413 void           hash_insert();
00414 ptr_keyword    hash_lookup();
00415 ptr_hash_table hash_create();
00416 void           hash_expand();
00417 int            hash_code();
00418 void           hash_display();
00419 
00420 extern ptr_definition first_definition;
00421 
00422 /****************** END HASH TABLES *****************/
00423 
00424 
00425 
00426 
00427 /****************************/
00428 /* Definition of a keyword. */
00429 /* This includes the rules associated to the symbol and how old they are.  */
00430 typedef struct wl_definition {
00431   long date;
00432 
00433   ptr_keyword keyword; /*  RM: Jan 11 1993  */
00434   
00435   ptr_pair_list rule;
00436   ptr_triple_list properties;
00437 
00438   ptr_int_list code;
00439   ptr_int_list parents;
00440   ptr_int_list children;
00441 
00442   def_type type;
00443   char always_check;  /* TRUE by default */
00444   char protected;     /* TRUE by default */
00445   char evaluate_args; /* TRUE by default */
00446   char already_loaded; /* Cleared at the prompt, set upon loading */
00447 
00448   ptr_operator_data op_data;
00449 
00450   ptr_psi_term global_value; /*  RM: Feb  8 1993  */
00451   ptr_psi_term init_value;   /*  RM: Mar 23 1993  */
00452   
00453 #ifdef CLIFE
00454   ptr_block_definition block_def; /* AA: Mar 10 1993 */
00455 #endif /* CLIFE */
00456   
00457   ptr_definition next;
00458 } definition;
00459 
00460 /* 22.9 */
00461 typedef struct wl_residuation {
00462   long sortflag; /* bestsort == if TRUE ptr_definition else ptr_int_list */
00463   GENERIC bestsort; /* 21.9 */
00464   GENERIC value; /* to handle psi-terms with a value field 6.10 */
00465   ptr_goal goal;
00466   ptr_residuation next;
00467 } residuation;
00468 
00469 /* PSI_TERM */
00470 typedef struct wl_psi_term {
00471 #ifdef TS
00472   unsigned long time_stamp; /* Avoid multiple trailing on a choice point. 9.6 */
00473 #endif
00474   ptr_definition type;
00475   long status; /* Indicates whether the properties of the type have been */
00476               /* checked or the function evaluated */
00477   /* long curried; Distinguish between quoted and curried object 20.5 */
00478   long flags; /* 14.9 */
00479   GENERIC value;
00480   ptr_node attr_list;
00481   ptr_psi_term coref;
00482   ptr_residuation resid; /* List of goals to prove if type is narrowed. */
00483 } psi_term;
00484 
00485 /* Binary tree node. */
00486 /* KEY can be either an integer (a pointer) or a pointer to a string. */
00487 /* DATA is the information accessed under the KEY, in most cases a pointer */
00488 /* to a PSI-TERM.  */
00489 
00490 typedef struct wl_node {
00491   char *key;
00492   ptr_node left;
00493   ptr_node right;
00494   GENERIC data;
00495 } node;
00496 
00497 typedef struct wl_pair_list {
00498   ptr_psi_term a;
00499   ptr_psi_term b;
00500   ptr_pair_list next;
00501 } pair_list;
00502 
00503 /* Used for type properties */
00504 typedef struct wl_triple_list {
00505   ptr_psi_term a;   /* Attributes */
00506   ptr_psi_term b;   /* Constralong */
00507   ptr_definition c; /* Original type of attribute & constralong */
00508   ptr_triple_list next;
00509 } triple_list;
00510 
00511 /*  RM: Dec 15 1992  Away goes the old list structure!!
00512     typedef struct wl_list {
00513     ptr_psi_term car;
00514     ptr_psi_term cdr;
00515     } list;
00516     */
00517 
00518 
00519 #ifdef CLIFE
00520 #ifdef OS2_PORT
00521 #include "blockstr.h"
00522 #else
00523 #include "blockstruct.h"
00524 #endif
00525 #endif /* CLIFE */
00526 
00527 
00528 /* Used to identify the object on the undo_stack */
00529 /* Use define instead of enums because quick masking is important */
00530 typedef long type_ptr;
00531 #define psi_term_ptr    0
00532 #define resid_ptr       1
00533 #define int_ptr         2
00534 #define def_ptr         3
00535 #define code_ptr        4
00536 #define goal_ptr        5
00537 #define cut_ptr         6 /* 22.9 */
00538 
00539 #ifdef CLIFE
00540 #define block_ptr      12
00541 #define value_ptr      13
00542 #endif /* CLIFE */
00543 
00544 #define destroy_window  7+32 /* To backtrack on window creation */
00545 #define show_window     8+32 /* To backtrack on show window */
00546 #define hide_window     9+32 /* To backtrack on hide window */
00547 #define show_subwindow  10+32 /* To backtrack on show sub windows RM 8/12/92 */
00548 #define hide_subwindow  11+32 /* To backtrack on hide sub windows RM 8/12/92 */
00549 #define undo_action       32 /* Fast checking for an undo action */
00550 
00551 typedef struct wl_stack {
00552   type_ptr type; 
00553   GENERIC a;
00554   GENERIC b;
00555   ptr_stack next;
00556 } stack;
00557 
00558 typedef enum {
00559   fail,
00560   prove,
00561   unify,
00562   unify_noeval,
00563   disj,
00564   what_next,
00565   eval,
00566   eval_cut,
00567   freeze_cut,
00568   implies_cut,
00569   general_cut,
00570   match,
00571   type_disj,
00572   clause,
00573   del_clause,
00574   retract,
00575   load,
00576   c_what_next /*  RM: Mar 31 1993  */
00577 } goals;
00578 
00579 typedef struct wl_goal {
00580   goals type;
00581   ptr_psi_term a;
00582   ptr_psi_term b;
00583   GENERIC c;
00584   ptr_goal next;
00585   long pending;
00586 } goal;
00587 
00588 typedef struct wl_choice_point {
00589   unsigned long time_stamp;
00590   ptr_stack undo_point;
00591   ptr_goal goal_stack;
00592   ptr_choice_point next;
00593   GENERIC stack_top;
00594 } choice_point;
00595 
00596 /***************************** EXTERNAL VARIABLES ************************/
00597 
00598 
00599 
00600 /* Memory-manager variables. */
00601 /* Garbage collection is done when HEAP_POINTER-STACK_POINTER<MEM_LIMIT. */
00602 
00603 extern int arg_c;
00604 extern char **arg_v;
00605 
00606 extern GENERIC mem_base;
00607 extern GENERIC heap_pointer;
00608 extern GENERIC mem_limit;
00609 extern GENERIC stack_pointer;
00610 extern GENERIC stack_alloc();
00611 extern GENERIC heap_alloc();
00612 
00613 extern float garbage_time;
00614 #ifndef OS2_PORT
00615 extern struct tms life_start,life_end;
00616 #else
00617 extern float life_start,life_end;
00618 extern float times(float*);
00619 #endif
00620 
00621 extern GENERIC other_base;
00622 extern GENERIC other_limit;
00623 extern GENERIC other_pointer;
00624 
00625 extern ptr_psi_term error_psi_term;
00626 extern long parser_stack_index;
00627 
00628 extern ptr_node var_tree;
00629 extern ptr_node printed_vars;
00630 extern ptr_node printed_pointers;
00631 extern ptr_node pointer_names;
00632 extern long gen_sym_counter;
00633 
00634 extern long warningflag;
00635 extern long verbose;
00636 extern long trace,noisy;
00637 extern long types_done;
00638 extern long interrupted;
00639 
00640 extern FILE *input_stream;
00641 extern long line_count;
00642 extern string input_file_name;
00643 extern FILE *output_stream;
00644 extern char *prompt;
00645 extern long page_width;
00646 
00647 /* extern ptr_psi_term empty_list; 5.8 */
00648 extern ptr_definition *gamma_table;
00649 extern long type_count;
00650 extern long types_modified;
00651 
00652 extern long main_loop_ok;
00653 extern ptr_goal aim;
00654 extern ptr_goal goal_stack;
00655 extern ptr_choice_point choice_stack;
00656 /* extern ptr_choice_point prompt_choice_stack; 12.7 */
00657 extern ptr_stack undo_stack;
00658 #ifdef TS
00659 extern unsigned long global_time_stamp; /* 9.6 */
00660 #endif
00661 
00662 extern long assert_first;
00663 extern long assert_ok;
00664 extern long file_date;
00665 
00666 /* The following variables are used to make built-in type comparisons */
00667 /* as fast as possible.  They are defined in built_ins.c.  */
00668 extern ptr_definition abortsym; /* 26.1 */
00669 extern ptr_definition aborthooksym; /* 26.1 */
00670 
00671 extern ptr_definition add_module1;  /*  RM: Mar 12 1993  */
00672 extern ptr_definition add_module2;
00673 extern ptr_definition add_module3;
00674 
00675 extern ptr_definition and;
00676 extern ptr_definition apply;
00677 extern ptr_definition boolean;
00678 extern ptr_definition boolpredsym;
00679 extern ptr_definition built_in;
00680 extern ptr_definition colonsym;
00681 extern ptr_definition commasym;
00682 extern ptr_definition comment;
00683 /* extern ptr_definition conjunction; 19.8 */
00684 extern ptr_definition constant;
00685 extern ptr_definition cut;
00686 extern ptr_definition disjunction;
00687 extern ptr_definition disj_nil; /*  RM: Feb 16 1993  */
00688 extern ptr_definition eof;
00689 extern ptr_definition eqsym;
00690 extern ptr_definition leftarrowsym; /* PVR 15.9.93 */
00691 extern ptr_definition false;
00692 extern ptr_definition funcsym;
00693 extern ptr_definition functor;
00694 extern ptr_definition iff;
00695 extern ptr_definition integer;
00696 extern ptr_definition alist;
00697 extern ptr_definition life_or; /*  RM: Apr  6 1993  */
00698 extern ptr_definition minus_symbol;/*  RM: Jun 21 1993  */
00699 extern ptr_definition nil;    /*** RM 9 Dec 1992 ***/
00700 extern ptr_definition nothing;
00701 extern ptr_definition predsym;
00702 extern ptr_definition quote;
00703 extern ptr_definition quoted_string;
00704 extern ptr_definition real;
00705 extern ptr_definition stream;
00706 extern ptr_definition succeed;
00707 extern ptr_definition such_that;
00708 extern ptr_definition top;
00709 extern ptr_definition true;
00710 extern ptr_definition timesym;
00711 extern ptr_definition tracesym; /* 26.1 */
00712 extern ptr_definition typesym;
00713 extern ptr_definition variable;
00714 extern ptr_definition opsym;
00715 extern ptr_definition loadsym;
00716 extern ptr_definition dynamicsym;
00717 extern ptr_definition staticsym;
00718 extern ptr_definition encodesym;
00719 extern ptr_definition listingsym;
00720 extern ptr_definition delay_checksym;
00721 extern ptr_definition eval_argsym;
00722 extern ptr_definition inputfilesym;
00723 extern ptr_definition call_handlersym;
00724 extern ptr_definition xf_sym;
00725 extern ptr_definition fx_sym;
00726 extern ptr_definition yf_sym;
00727 extern ptr_definition fy_sym;
00728 extern ptr_definition xfx_sym;
00729 extern ptr_definition xfy_sym;
00730 extern ptr_definition yfx_sym;
00731 extern ptr_definition nullsym;
00732 extern ptr_definition sys_bytedata; /* DENYS: BYTEDATA */
00733 extern ptr_definition sys_bitvector;
00734 extern ptr_definition sys_regexp;
00735 extern ptr_definition sys_stream;
00736 extern ptr_definition sys_file_stream;
00737 extern ptr_definition sys_socket_stream;
00738 
00739 /*  RM: Jul  7 1993  */
00740 extern ptr_definition final_dot;
00741 extern ptr_definition final_question;
00742 
00743 extern ptr_psi_term null_psi_term; /* Used to represent an empty parse token */
00744 
00745 extern char *one;
00746 extern char *two;
00747 extern char *three;
00748 extern char *year_attr;
00749 extern char *month_attr;
00750 extern char *day_attr;
00751 extern char *hour_attr;
00752 extern char *minute_attr;
00753 extern char *second_attr;
00754 extern char *weekday_attr;
00755 
00756 
00757 extern ptr_psi_term old_state; /*  RM: Feb 17 1993  */
00758 
00759 /************************* EXTERNAL FUNCTIONS *************************/
00760 
00761 extern void init_system(); /* in life.c */ /* 26.1 */
00762 
00763 extern long (* c_rule[])(); /* in built_ins.c */
00764 
00765 extern ptr_psi_term stack_psi_term(); /* in lefun.c */
00766 extern ptr_psi_term real_stack_psi_term(); /* in lefun.c */
00767 extern ptr_psi_term heap_psi_term(); /* in lefun.c */
00768 
00769 #define stack_empty_list()   stack_nil()   /*  RM: Dec 14 1992  */
00770 /* extern ptr_psi_term stack_empty_list(); */
00771 
00772 /**********************************************************************/
00773 
00774 /* include files that everyone needs */
00775 #include "types.h"
00776 #include "error.h"
00777 
00778 /************ VarArg compatibility definitions ************************/
00779 
00780 /*
00781  * Author:              Seth Copen Goldstein
00782  * Version:             11
00783  * Creation Date:       Tue May 26 16:31:09 1992
00784  * Filename:            seth.h
00785  * History:
00786 */
00787 #ifndef OS2_PORT
00788 
00789 #if !defined(wl_SETH_H_FILE_)
00790 #define wl_SETH_H_FILE_
00791 
00792 #include <varargs.h>
00793 
00794 /* function protoype macros for ansi and old compilers */
00795 
00796 #if defined(__STDC__) || defined(ds3100)
00797 # define        ARGS(args)      args
00798 #else
00799 # define        ARGS(args)      ()
00800 #endif
00801 
00802 /* varargs macros that understand the difference between stdargs and varargs */
00803 
00804 #define VarArgBase      va_alist
00805 #define VarArgBaseDecl  va_dcl
00806 #define VarArg          ___va_lp___
00807 #define VarArgDecl      va_list VarArg
00808 /* Added last condition -- see Maurice Keulen */
00809 #if defined(_VARARGS_H) || defined(__VARARGS_H__) || defined(_VARARGS_) || defined(_sys_varargs_h) || __alpha
00810 # define VarArgInit(l)  va_start(VarArg)
00811 #else
00812 # define VarArgInit(l)  va_start(VarArg, l)
00813 #endif
00814 #define VarArgNext(t)   va_arg(VarArg, t)
00815 #define VarArgEnd()     va_end(VarArg)
00816 #endif
00817 #if 0
00818 /* example usage of vararg macros */
00819 
00820 foo(var1, var2, VarArgBase)     /* VarArgBase must be last parameter */
00821 type var1;
00822 type var2;
00823 VarArgBaseDecl;                 /* must have this as last decl */
00824 {
00825         VarArgDecl;             /* declares variable that will be used to
00826                                  * run down the list of arguments starting at
00827                                  * VarArgBase
00828                                  */
00829         typename var3;          /* example variable that gets one of the
00830                                  * arguments from the argument list
00831                                  */
00832 
00833         VarArgInit(var2);       /* MUST BE CALLED BEFORE ACCESSING THE
00834                                  * ARGUMENTS, the parameter to this macro is
00835                                  * ALWAYS the parameter preceding VarArgBase
00836                                  */
00837         
00838 
00839         /* usage to send argument list to one of the v-printf functions */
00840         
00841         vfprintf(of, format, VarArg);
00842 
00843         /* usage to get an element off the argument list */
00844         
00845         var3 = VarArgNext(typename);
00846 
00847         /* for saftey sake use this to finish up */
00848 
00849         VarArgEnd();
00850 }
00851 #endif
00852 
00853 #endif
00854 
00855 
00856 
00857 
00858 
00859 
00860 
00861 
00862 
00863 
00864 /**********************************************************************/
00865 
00879 #ifdef CLIFE
00880 #include "block.h"
00881 #endif /* CLIFE */
00882 
00883 #endif /* _LIFE_EXTERN_H_ */

Generated on Sat Jan 26 08:48:06 2008 for WildLife by  doxygen 1.5.4