1 /*
2  **********************************************************************
3  *                                                                    *
4  *   ML/I macro processor -- C version                                *
5  *                                                                    *
6  *   Common header file                                               *
7  *                                                                    *
8  *   Copyright (C) R.D. Eager                        MMXVIII          *
9  *                 P.J. Brown   University of Kent   MCMLXVII         *
10  *                                                                    *
11  **********************************************************************
12  */
13 
14 /*
15  * Edit History (machine independent logic):
16  *
17  * CJA  --  Pre-release version.
18  * CJB  --  First release of C version.
19  * CKA  --  Addition of optional character string variables.
20  * CKB  --  Addition of function prototypes and revision of types.
21  * CKC  --  Addition of ANSI C support.
22  * CKD  --  Addition of logical and (&) and logical or (|) operators in
23  *          macro expressions.
24  * CKE  --  Use of 'const' made conditional on ANSI.
25  *      --  Include of 'stdarg.h' made conditional on ANSI.
26  * CKF  --  Fixed bug in 'joinch' that resulted in loop if more than
27  *          one element in chain.
28  * CKG  --  Changed 'jmp_sw' in basic scanner to be an int, and removed
29  *          INT cast when calling 'setjmp' to set it. This is to conform
30  *          with ANSI.
31  *          Added support for IBM C Set/2.
32  * CKH  --  Further fixes for IBM C Set/2.
33  * CKI  --  Added support for Zortech C extended model.
34  * CKJ  --  Changed EOFCH and SLREP and EOFCH to values greater than 255,
35  *          to allow MD-logic to use all character code values between 0
36  *          and 255.
37  * CKL  --  Added support for a single non-alphanumeric character to be
38  *          treated as alphanumeric (via S6 setting).
39  * CKM  --  Added support for Microsoft Windows (32 bit).
40  * CKN  --  Added support for gcc on FreeBSD.
41  * CKO  --  Added support for clang on FreeBSD.
42  * CKP  --  Added support for 64 bit clang on FreeBSD.
43  *
44  */
45 
46 #include <ctype.h>
47 #include <setjmp.h>
48 #include <stdio.h>
49 
50 /* Define EXACTLY ONE of the following symbols non-zero to enable the
51    appropriate conditional compilation:
52 
53    ATT3B        - AT&T 3B series (UNIX)
54    BSD4         - Berkeley UNIX version 4.x
55    FBSD32	- GCC/CLANG on FreeBSD (32 bit)
56    FBSD64	- CLANG on FreeBSD (64 bit)
57    IBMC         - IBM C Set/2 on OS/2
58    L1           - MOS-X on Olivetti Line 1
59    MSC          - Microsoft C on the IBM PC and PS/2 under OS/2 and DOS
60 		  (small model)
61    VMS          - VAXC on VMS
62    WIN          - Visual C++ 5.0 on Microsoft Windows (32 bit)
63    ZTC          - Zortech C on the IBM PC and PS/2
64    ZTCX         - Zortech C on the IBM PC and PS/2 under DOS (extended model)
65 */
66 
67 #define ATT3B           0
68 #define BSD4            0
69 #define IBMC            0
70 #define L1              0
71 #define MSC             0
72 #define VMS             0
73 #define	WIN		0
74 #define ZTC             0
75 #define ZTCX            0
76 #define	FBSD32		0
77 #define	FBSD64		1
78 
79 #if     IBMC | FBSD32 | FBSD64 | MSC | ZTCX | VMS | WIN | ZTC
80 #define ANSI            1
81 #else
82 #define ANSI            0
83 #endif
84 
85 #if     ANSI
86 #include <stdarg.h>
87 #define CONST   const
88 #else
89 #define CONST
90 #endif
91 
92 /*** Machine dependent constants ***/
93 
94 #if     ATT3B | BSD4 | FBSD32 | IBMC | VMS | WIN
95 #define MAXINT  0x7fffffff              /* Largest positive number */
96 #endif
97 #if     FBSD64 | L1 | ZTCX
98 #define MAXINT  0x7fffffffffffffffL     /* Largest positive number */
99 #endif
100 #if     MSC | ZTC
101 #define MAXINT  32767                   /* Largest positive number */
102 #endif
103 
104 
105 /*** Machine dependent type definitions ***/
106 
107 #if     ATT3B | BSD4 | FBSD32 | IBMC | MSC | VMS | WIN | ZTC | ZTCX
108 typedef int     INT;
109 #endif
110 #if     FBSD64 | L1
111 typedef long    INT;
112 #endif
113 
114 #if     ANSI
115 #define VOID    void
116 #else
117 #define VOID
118 #endif
119 
120 /*** Truth values ***/
121 
122 #define FALSE           ((INT) 0)       /* Truth value */
123 #define TRUE            ((INT) 1)       /* Truth value */
124 
125 
126 /*** Version number ***/
127 
128 #define MIVERSION       "CKP"           /* Version number of machine independent logic */
129 
130 
131 /*** Tunable values ***/
132 
133 #define CVARS           1               /* Set non-zero to enable character string variables */
134 #define	SPECAN		1		/* Set non-zero to enable special alphanumeric character */
135 
136 #define DEBUGGING       1               /* Set non-zero during development and testing */
137 #define LHV             32              /* Size of hash table */
138 #define TEXMAX          64              /* Maximum length of construction in an error message */
139 #define HTMAX           (TEXMAX/2 - 4)
140 #if     CVARS
141 #define CVSIZE          20              /* Default character string variable size */
142 #endif
143 #define PVARNUM         10              /* Initial number of permanent variables */
144 #define SVARNUM         24              /* Number of system variables */
145 #define EOFCH           0x100           /* End of file character */
146 #define SLREP           0x101           /* For SL keyword */
147 
148 
149 /*** Miscellaneous constants ***/
150 
151 #if     ATT3B | BSD4 | FBSD32 | IBMC | MSC | VMS | WIN | ZTC | ZTCX
152 #define ZEROPT          ((INT *) 0)     /* Must be less than or equal to any pointer value */
153 #define NULLPT          ((INT *) 0)     /* Must be different from any pointer value */
154 #endif
155 #if     FBSD64 | L1
156 #define ZEROPT          ((INT *) 0L)    /* Must be less than or equal to any pointer value */
157 #define NULLPT          ((INT *) 0L)    /* Must be different from any pointer value */
158 #endif
159 #define NODESZ          3               /* Size of a node entry on backwards stack */
160 
161 
162 /*** Types of constructions ***/
163 
164 #define OPMK            0               /* Operation macro */
165 #define LOCMK           1               /* Local NEC macro */
166 #define UINSMK          2               /* Unprotected insert */
167 #define PINSMK          3               /* Protected insert */
168 #define STRMK           4               /* Straight-scan macro */
169 
170 #define ENDCHN          (MAXINT)        /* Closing delimiter/end of chain marker */
171 #define EXCLMK          (MAXINT - 1)    /* Exclusive delimiter marker */
172 #define WITHMK          (MAXINT - 2)    /* For WITH keyword */
173 #define WTHSMK          (MAXINT - 3)    /* For WITHS keyword */
174 #define SPCSMK          (MAXINT - 4)    /* For SPACES keyword */
175 
176 
177 /*** Codes for operation macros ***/
178 
179 #define MC_NODEF        0               /* Suppress local macro definitions */
180 #define MC_NOWARN       1               /* Suppress local warning marker definitions */
181 #define MC_NOINS        2               /* Suppress local insert definitions */
182 #define MC_NOSKIP       3               /* Suppress local skip definitions */
183 #define MC_DEF          4               /* Define a macro (local or global) */
184 #define MC_WARN         5               /* Define a warning marker (local or global) */
185 #define MC_INS          6               /* Define an insert (local or global) */
186 #define MC_SKIP         7               /* Define a skip (local or global) */
187 #define MC_SET          8               /* Update a macro-time variable */
188 #define MC_GO           9               /* Perform a macro-time goto */
189 #define MC_ALTER        10              /* Alter name of secondary delimiter, etc. */
190 #define MC_NOTE         11              /* Macro-time debugging aid */
191 #define MC_PVAR         12              /* Alter number of permanent variables */
192 #define MC_LENG         13              /* Find length of macro-time string */
193 #define MC_SUB          14              /* Extract macro-time substring */
194 #define MC_STOP         15              /* Define a stop marker */
195 #if     CVARS
196 #define MC_CVAR         16              /* Alter number of character string variables */
197 #endif
198 
199 
200 /*** Values for 'bestpl' ***/
201 
202 #define BP_COPY         0               /* Copy atom to output text */
203 #define BP_MACRO        1               /* Macro name encountered */
204 #define BP_WARN         2               /* Warning marker encountered */
205 #define BP_INSERT       3               /* Insert name encountered */
206 #define BP_SKIP         4               /* Skip name encountered */
207 #define BP_SDELIM       5               /* Scanning for secondary delimiter */
208 #define BP_NULL         6               /* Produce no output text */
209 #define BP_AWARN        7               /* After warning marker encountered */
210 #define BP_STACK        8               /* Place atom on forwards stack */
211 #define BP_STOP         9               /* Stop marker encountered */
212 
213 
214 /*** Types of construction ***/
215 
216 #define TY_STOP         0               /* Stop marker */
217 #define TY_MACRO        1               /* Macro */
218 #define TY_WARN         2               /* Warning marker */
219 #define TY_INSERT       3               /* Insert */
220 #define TY_SKIP         4               /* Skip */
221 
222 
223 /*** Types of keyword in structure representations ***/
224 
225 #define KW_WITH         0               /* WITH */
226 #define KW_WITHS        1               /* WITHS */
227 #define KW_OPT          2               /* OPT */
228 #define KW_OR           3               /* OR */
229 #define KW_ALL          4               /* ALL */
230 
231 
232 /*** Values for 'dbugsw'***/
233 
234 #define DB_SOURCE       ((INT) 0)       /* Scanning source text */
235 #define DB_REPL         ((INT) 1)       /* Scanning replacement text */
236 #define DB_OPARG        ((INT) 2)       /* Scanning for operation macro argument */
237 #define DB_ROPARG       ((INT) 3)       /* Scanning text of operation macro argument or insert */
238 #define DB_SUBARG       ((INT) 4)       /* Scanning for substitution macro argument */
239 #define DB_EVAL         ((INT) 5)       /* Scanning operation macro or first insert */
240 #define DB_DELIM        ((INT) 6)       /* Scanning for delimiter */
241 
242 
243 /*** Scanning description block (SDB) ***/
244 
245 /***
246    * The variables in the SDB are copied as a block, and hence they
247    * are stored in a structure.
248 ***/
249 
250 struct sdbf {
251 INT     argct;                          /* Counts number of arguments when nested construction is scanned */
252 INT     *stakpt;                        /* Points at latest SDB on stack ('nullpt' whilst scanning source text) */
253 INT     *argpt;                         /* Points at argument vector (scanning replacement text) */
254 INT     *dbugpt;                        /* Points at orlink preceding macro name */
255 INT     *spt;                           /* Points at last scanned character */
256 INT     mchlin;                         /* Set to current value of 'linect' when a nested construction is encountered */
257 INT     linect;                         /* Line count of current text */
258 INT     argno;                          /* Number of argument or delimiter */
259 INT     dbugsw;                         /* Indicates state of scan */
260 INT     *tvarpt;                        /* Points at temporary variables */
261 INT     *hashpt;                        /* Points at local hash table */
262 INT     *mtchpt;                        /* Points at orlink when a nested construction is encountered */
263 INT     *stoppt;                        /* Points one beyond last character of current text */
264 INT     *labpt;                         /* Head of chain of labels */
265 INT     *inffpt;                        /* Points at start of source text on forwards stack */
266 INT     skval;                          /* Number of designated label for forward MC-GO */
267 INT     sklin;                          /* Line number in which MC-GO occurred */
268 INT     ohsw;                           /* TRUE if a new hash table has been stacked for this level, otherwise FALSE */
269 };
270 extern  struct  sdbf    sdb;
271 #define SDBSZ           18              /* Size of scanning description block */
272 #define EDBSZ           8               /* Size of the error description block  ('stakpt' to 'dbugsw') */
273 
274 
275 /*** Operation macro description block (OPDB) ***/
276 
277 /***
278    * The variables in the OPDB are copied as a block, and hence they
279    * are stored in a structure.
280 ***/
281 
282 struct opdbf {
283 INT     *topspt;                        /* Points at latest OPDB on backwards stack */
284 INT     *mhshpt;                        /* Value of 'hashpt' when macro was called */
285 INT     *sqpt;                          /* Safe variable, miscellaneous uses */
286 INT     linkpt;                         /* Link for 'stkarg' */
287 INT     arglen;                         /* Length of value of current argument */
288 INT     optyp;                          /* Type, e.g. global, local, insert. Also other uses */
289 INT     sqnum;                          /* Safe variable, miscellaneous uses */
290 INT     sqsw;                           /* Safe variable, miscellaneous uses */
291 INT     ntypsw;                         /* Type of construction being defined */
292 };
293 extern  struct  opdbf   opdb;
294 #define OPDBSZ          9               /* Size of operation macro description block */
295 
296 
297 /*** Variables used in processing OPT - ALL brackets ***/
298 
299 /***
300    * The variables in the OPT-ALL area are copied as a block, and hence they
301    * are stored in a structure.
302 ***/
303 
304 struct oabf {
305 INT     *allpt;                         /* Head of chain of nextlinks to be attached to delimiter following ALL */
306 INT     *opthpt;                        /* Head of orlink chain */
307 INT     *optpt;                         /* Last entry on orlink chain */
308 };
309 extern  struct  oabf    oab;
310 #define ALLSZ           3               /* Size of the OPT-ALL block */
311 
312 
313 /*** Variables requiring dynamic initialisation ***/
314 
315 extern  INT     *endpt;                 /* Points at end of backwards stack */
316 extern  INT     glbwsw;                 /* Global warning switch */
317 extern  INT     *lfpt;                  /* Points at last used location on backwards stack */
318 extern  INT     *pvarpt;                /* Points at permanent variables */
319 extern  INT     pvnum;                  /* Number of permanent variables */
320 #if     CVARS
321 extern  INT     *cvarpt;                /* Points at character string variables */
322 extern  INT     cvnum;                  /* Number of character string variables */
323 extern  INT     cvsize;                 /* Size of each character string variable */
324 extern  INT     exprsw;                 /* Returns expression type from 'gmeadd' */
325 #endif
326 
327 
328 /*** Miscellaneous variables ***/
329 
330 extern  INT     beslin;                 /* Best-so-far value of 'linect' */
331 extern  INT     *bespt;                 /* Best-so-far value of 'spt' */
332 extern  INT     bestpl;                 /* Switch value used in basic scan routine */
333 extern  INT     *bfndpt;                /* Best-so-far value of 'fndpt' */
334 extern  INT     bindic;                 /* Best-so-far value of 'indic' */
335 extern  INT     *binfpt;                /* Best-so-far value of 'infopt' */
336 extern  INT     caltyp;                 /* First number in information block */
337 extern  INT     *chanpt;                /* Used in chaining */
338 extern  INT     chlink;                 /* Used in chaining */
339 extern  INT     *cllfpt;                /* Points at top entry after scanning information is stacked */
340 extern  INT     copdsw;                 /* For skips; reflects setting of delimiter option */
341 extern  INT     coptsw;                 /* For skips; reflects setting of text option */
342 extern  INT     *delpt;                 /* Head of chain of delimiters searching for */
343 extern  INT     *eriapt;                /* Points at value of operation macro argument */
344 extern  INT     *ffpt;                  /* Points to first free location on forwards stack */
345 extern  INT     *htabpt;                /* Points at current hash table */
346 extern  INT     idlen;                  /* Length of current identifier */
347 extern  INT     *idpt;                  /* Points at current identifier */
348 extern  INT     indic;                  /* Contents of nextlink */
349 extern  INT     *infopt;                /* Points beyond currently matched LID */
350 extern  INT     invoct;                 /* Count of macro calls */
351 extern  INT     *knpt;                  /* Points to node marker entry in delimiter chain */
352 extern  INT     levl;                   /* Level of macros and inserts */
353 extern  INT     masksw;                 /* Used to indicate which types of construction are recognised */
354 extern  INT     meval;                  /* Miscellaneous; used for numerical values calculated at macro time */
355 extern  INT     *nargpt;                /* Points at argument vector + 1 */
356 extern  INT     nestlv;                 /* Nesting level of calls and skips during scanning */
357 extern  INT     offset;                 /* Offset in hash table */
358 extern  INT     oplev;                  /* Level of operation macros and inserts */
359 extern  INT     skiplv;                 /* Level of skip nesting */
360 extern  INT     *stffpt;                /* Points at start of global macros */
361 extern  INT     *svarpt;                /* Points at system variables */
362 extern  INT     *tempt;                 /* Temporary */
363 extern  INT     tlinct;                 /* Temporary storage for 'linect' */
364 
365 
366 /*** Variables used in processing structure representations ***/
367 
368 extern  INT     consw;                  /* For syntax checking ('evtree' and 'getdel') */
369 extern  INT     delct;                  /* Count of delimiters */
370 extern  INT     exitsw;                 /* For syntax checking ('evtree') */
371 extern  INT     keysw;                  /* For syntax checking ('evtree' and 'getdel') */
372 extern  INT     *lnodpt;                /* Points at topmost node entry on backwards stack */
373 extern  INT     *ndefpt;                /* Destination of newly defined construction */
374 extern  INT     *nnodpt;                /* Points at current node entry on backwards stack */
375 extern  INT     *nodept;                /* Head of chain of links to be attached to next delimiter */
376 extern  INT     nodesw;                 /* For syntax checking ('evtree' and 'getdel') */
377 extern  INT     *ollfpt;                /* Previous value of 'lfpt' */
378 extern  INT     optlev;                 /* Level of OPT-ALL brackets */
379 
380 
381 /*** Variables used in processing macro expressions or inserts ***/
382 
383 extern  INT     *varpt;                 /* Points at vector of variables */
384 
385 
386 /*** Names of table items - dynamically initialised ***/
387 
388 extern  INT     *das;                   /* Head of AS/SSAS chain for MC-DEF */
389 extern  INT     *delchn;                /* Chain of secondary delimiters */
390 extern  INT     *dge;                   /* Head of relation chain for MC-GO */
391 extern  INT     *dif;                   /* Head of IF/UNLESS chain for MC-GO */
392 extern  INT     *ghshtb[];              /* Global hash table */
393 extern  INT     *keychn;                /* Head of keyword chain */
394 extern  INT     *knrep;                 /* Points at current node marker */
395 extern  INT     *kspacs;                /* Points at SPACES keyword */
396 extern  INT     *laychn;                /* Chain of names of layout characters */
397 extern  INT     *spcsrp;                /* Points at representation of SPACE */
398 
399 
400 /*** More miscellaneous variables ***/
401 
402 extern  INT     *at_edb;                /* \                                                  */
403 extern  INT     *at_sdb;                /* |__ Addresses of blocks of scanning data           */
404 extern  INT     *at_opdb;               /* |                                                  */
405 extern  INT     *at_all;                /* /                                                  */
406 extern  INT     *at_s1;                 /* \                                                  */
407 extern  INT     *at_s2;                 /* |__ Addresses of S-variables; for efficient access */
408 extern  INT     *at_s5;                 /* |                                                  */
409 #if	SPECAN
410 extern  INT     *at_s6;                 /* /                                                  */
411 #endif
412 extern  INT     *convarea;              /* Pointer to number conversion area for 'mdconv' */
413 extern  INT     nlsw;                   /* TRUE if last character read was a newline, otherwise FALSE */
414 
415 
416 /*** Machine-dependent variables ***/
417 
418 extern  INT     *at_s10;                /* \                                                  */
419 extern  INT     *at_s12;                /* |                                                  */
420 extern  INT     *at_s16;                /* |                                                  */
421 extern  INT     *at_s17;                /* |                                                  */
422 extern  INT     *at_s19;                /* |-- Addresses of S-variables; for efficient access */
423 extern  INT     *at_s20;                /* |                                                  */
424 extern  INT     *at_s21;                /* |                                                  */
425 extern  INT     *at_s22;                /* |                                                  */
426 extern  INT     *at_s23;                /* |                                                  */
427 extern  INT     *at_s24;                /*/                                                   */
428 
429 /*** Save areas for 'setjmp' calls ***/
430 
431 extern  jmp_buf bssave;                 /* Transfers control to 'bsnext' */
432 extern  jmp_buf bstsave;                /* Transfers control to 'bstrex' */
433 extern  jmp_buf entsave;                /* Transfers control to 'entext' */
434 extern  jmp_buf evpsave;                /* Transfers control to 'evopt' */
435 extern  jmp_buf evrsave;                /* Transfers control to 'evor' */
436 extern  jmp_buf evxsave;                /* Transfers control to 'evexit' */
437 
438 
439 /*** External function definitions ***/
440 
441 #if     ANSI
442 
443 /* Function prototypes */
444 
445 extern  INT     advnce(void);
446 extern  void    basic_scan(void);
447 extern  void    bumpff(INT);
448 extern  void    chatom(void);
449 extern  void    chekid(void);
450 extern  INT     ckvaly(INT *,INT);
451 extern  INT     cmpare(INT *);
452 extern  INT     decalv(void);
453 extern  void    declf(INT);
454 extern  void    encall(void);
455 extern  void    er1tst(void);
456 extern  void    erlia(void);
457 extern  void    erlmd(void);
458 extern  void    erlme(void);
459 extern  void    erlovf(void);
460 extern  void    erlso(void);
461 extern  void    ermtst(void);
462 extern  void    ersic(void);
463 extern  void    ersnw(void);
464 extern  INT     gargch(void);
465 extern  void    getdel(void);
466 extern  void    getexp(void);
467 extern  INT     *gmeadd(void);
468 extern  INT     gsatom(void);
469 extern  void    gtatom(void);
470 extern  void    init_tables(void);
471 extern  void    joinch(void);
472 extern  INT     ludel(INT *);
473 extern  INT     *lulayk(INT);
474 extern  void    macerr(INT);
475 extern  void    macexp(INT);
476 extern  void    mihalt(void);
477 extern  INT     milogic(INT *,INT);
478 #if     CVARS
479 extern  void    mkcroom(INT);
480 #endif
481 extern  void    mkroom(INT);
482 extern  void    opexit(void);
483 extern  void    prarg(INT);
484 extern  void    prctxt(void);
485 extern  void    prenv(void);
486 extern  void    prerr(void);
487 extern  void    prscan(void);
488 extern  void    prviz(void);
489 extern  INT     ressp(void);
490 extern  void    sbstpl(void);
491 extern  void    setpts(INT);
492 extern  INT     sklab(INT);
493 extern  void    stkhsh(void);
494 extern  void    subchk(void);
495 extern  void    tebest(void);
496 extern  INT     tesdel(INT *);
497 extern  void    tespac(void);
498 extern  INT     tewith(INT *);
499 extern  void    unopdb(void);
500 extern  void    unsdb(void);
501 extern  INT     xisalnum(INT);
502 extern	INT	xisalpha(INT);
503 extern  INT     xisdigit(INT);
504 extern  INT     xisupper(INT);
505 
506 #else
507 
508 /* These are provided mainly for documentation and for a small amount
509 of additional type checking. Functions with no effective result are
510 represented as such in order to make clear which they are. */
511 
512 extern  INT     advnce();
513 extern  VOID    basic_scan();
514 extern  VOID    bumpff();
515 extern  VOID    chatom();
516 extern  VOID    chekid();
517 extern  INT     ckvaly();
518 extern  INT     cmpare();
519 extern  INT     decalv();
520 extern  VOID    declf();
521 extern  VOID    encall();
522 extern  VOID    er1tst();
523 extern  VOID    erlia();
524 extern  VOID    erlmd();
525 extern  VOID    erlme();
526 extern  VOID    erlovf();
527 extern  VOID    erlso();
528 extern  VOID    ermtst();
529 extern  VOID    ersic();
530 extern  VOID    ersnw();
531 extern  INT     gargch();
532 extern  VOID    getdel();
533 extern  VOID    getexp();
534 extern  INT     *gmeadd();
535 extern  INT     gsatom();
536 extern  VOID    gtatom();
537 extern  VOID    init_tables();
538 extern  VOID    joinch();
539 extern  INT     ludel();
540 extern  INT     *lulayk();
541 extern  VOID    macerr();
542 extern  VOID    macexp();
543 extern  VOID    mihalt();
544 extern  INT     milogic();
545 #if     CVARS
546 extern  VOID    mkcroom();
547 #endif
548 extern  VOID    mkroom();
549 extern  VOID    opexit();
550 extern  VOID    prarg();
551 extern  VOID    prctxt();
552 extern  VOID    prenv();
553 extern  VOID    prerr();
554 extern  VOID    prscan();
555 extern  VOID    prviz();
556 extern  INT     ressp();
557 extern  VOID    sbstpl();
558 extern  VOID    setpts();
559 extern  INT     sklab();
560 extern  VOID    stkhsh();
561 extern  VOID    subchk();
562 extern  VOID    tebest();
563 extern  INT     tesdel();
564 extern  VOID    tespac();
565 extern  INT     tewith();
566 extern  VOID    unopdb();
567 extern  VOID    unsdb();
568 extern  INT     xisalnum();
569 extern  INT     xisdigit();
570 extern  INT     xisupper();
571 #endif
572 
573 /*** Machine-dependent routines ***/
574 
575 #if     ANSI
576 extern  VOID    bmove(INT,INT *,INT *); /* Moves blocks of data, starting at their end */
577 extern  VOID    fmove(INT,INT *,INT *); /* Moves blocks of data, starting at their start */
578 extern  void    mdconv(INT);            /* Converts numbers to strings */
579 extern  INT     mddiv(INT,INT);         /* Performs division */
580 extern  void    mderid(void);           /* Outputs atom to the debugging file */
581 extern  void    mderpr(char *,...);     /* Outputs messages to the debugging file */
582 extern  void    mdfinal(void);          /* Performs machine-dependent finalisation */
583 extern  INT     *mdfind(void);          /* The hashing function */
584 extern  void    mdinit(void);           /* Machine-independent initialisation */
585 extern  INT     mdnum(void);            /* Converts strings to numbers */
586 extern  void    mdouch(INT);            /* Main output routine */
587 extern  INT     mdread(void);           /* Main input routine */
588 
589 #else
590 
591 extern  VOID    bmove();                /* Moves blocks of data, starting at their end */
592 extern  VOID    fmove();                /* Moves blocks of data, starting at their start */
593 extern  VOID    mdconv();               /* Converts numbers to strings */
594 extern  INT     mddiv();                /* Performs division */
595 extern  VOID    mderid();               /* Outputs atom to the debugging file */
596 extern  VOID    mderpr();               /* Outputs messages to the debugging file */
597 extern  VOID    mdfinal();              /* Performs machine-dependent finalisation */
598 extern  INT     *mdfind();              /* The hashing function */
599 extern  VOID    mdinit();               /* Machine-independent initialisation */
600 extern  INT     mdnum();                /* Converts strings to numbers */
601 extern  VOID    mdouch();               /* Main output routine */
602 extern  INT     mdread();               /* Main input routine */
603 #endif
604 
605 /*
606  ************************************
607  *                                  *
608  *   End of common header file      *
609  *                                  *
610  ************************************
611  */
612 
613