-#undef WORD1
-#undef WORD1X
-#undef WORD2
-#undef WORD2X
-#define GETIN(SRC,WORD1,WORD1X,WORD2,WORD2X) fGETIN(SRC,&WORD1,&WORD1X,&WORD2,&WORD2X)
-
-long YES(FILE *input, long X, long Y, long Z) {
-long YEAH, REPLY, JUNK1, JUNK2, JUNK3;
-
-/* Print message X, wait for yes/no answer. If yes, print Y and return true;
- * if no, print Z and return false. */
-
-L1: RSPEAK(X);
- GETIN(input, REPLY,JUNK1,JUNK2,JUNK3);
- if(REPLY == MAKEWD(250519) || REPLY == MAKEWD(25)) goto L10;
- if(REPLY == MAKEWD(1415) || REPLY == MAKEWD(14)) goto L20;
- RSPEAK(185);
- goto L1;
-L10: YEAH=true;
- RSPEAK(Y);
- return(YEAH);
-L20: YEAH=false;
- RSPEAK(Z);
- return(YEAH);
-}
-
-
-/* Line-parsing routines (GETNUM, GETTXT, MAKEWD, PUTTXT, SHFTXT, TYPE0)
- */
-/* The routines on this page handle all the stuff that would normally be
- * taken care of by format statements. We do it this way instead so that
- * we can handle textual data in a machine independent fashion. All the
- * machine dependent i/o stuff is on the following page. See that page
- * for a description of MAPCOM's inline array. */
-
-long GETNUM(FILE *source) {
-long DIGIT, NUMBER, SIGN;
-
-/* Obtain the next integer from an input line. If K>0, we first read a
- * new input line from a file; if K<0, we read a line from the keyboard;
- * if K=0 we use a line that has already been read (and perhaps partially
- * scanned). If we're at the end of the line or encounter an illegal
- * character (not a digit, hyphen, or blank), we return 0. */
-
-
- if(source != NULL)MAPLIN(source);
- NUMBER=0;
-L10: if(LNPOSN > LNLENG)return(NUMBER);
- if(INLINE[LNPOSN] != 0) goto L20;
- LNPOSN=LNPOSN+1;
- goto L10;
-
-L20: SIGN=1;
- if(INLINE[LNPOSN] != 9) goto L32;
- SIGN= -1;
-L30: LNPOSN=LNPOSN+1;
-L32: if(LNPOSN > LNLENG || INLINE[LNPOSN] == 0) goto L42;
- DIGIT=INLINE[LNPOSN]-64;
- if(DIGIT < 0 || DIGIT > 9) goto L40;
- NUMBER=NUMBER*10+DIGIT;
- goto L30;
-
-L40: NUMBER=0;
-L42: NUMBER=NUMBER*SIGN;
- LNPOSN=LNPOSN+1;
- return(NUMBER);
-}
-
-long GETTXT(long SKIP,long ONEWRD, long UPPER) {
-long CHAR, TEXT, I; static long SPLITTING = -1;
-
-/* Take characters from an input line and pack them into 30-bit words.
- * Skip says to skip leading blanks. ONEWRD says stop if we come to a
- * blank. UPPER says to map all letters to uppercase. If we reach the
- * end of the line, the word is filled up with blanks (which encode as 0's).
- * If we're already at end of line when TEXT is called, we return -1. */
-
- if(LNPOSN != SPLITTING)SPLITTING = -1;
- TEXT= -1;
-L10: if(LNPOSN > LNLENG)return(TEXT);
- if((!SKIP) || INLINE[LNPOSN] != 0) goto L11;
- LNPOSN=LNPOSN+1;
- goto L10;
-
-L11: TEXT=0;
- /* 15 */ for (I=1; I<=5; I++) {
- TEXT=TEXT*64;
- if(LNPOSN > LNLENG || (ONEWRD && INLINE[LNPOSN] == 0)) goto L15;
- CHAR=INLINE[LNPOSN];
- if(CHAR >= 63) goto L12;
- SPLITTING = -1;
- if(UPPER && CHAR >= 37)CHAR=CHAR-26;
- TEXT=TEXT+CHAR;
- goto L14;
-
-L12: if(SPLITTING == LNPOSN) goto L13;
- TEXT=TEXT+63;
- SPLITTING = LNPOSN;
- goto L15;
-
-L13: TEXT=TEXT+CHAR-63;
- SPLITTING = -1;
-L14: LNPOSN=LNPOSN+1;
-L15: /*etc*/ ;
- } /* end loop */
-
- return(TEXT);
-}
-
-long MAKEWD(long LETTRS) {
-long I, L, WORD;
-
-/* Combine five uppercase letters (represented by pairs of decimal digits
- * in lettrs) to form a 30-bit value matching the one that GETTXT would
- * return given those characters plus trailing blanks. Caution:
- * lettrs will overflow 31 bits if 5-letter word starts with V-Z. As a
- * kludgey workaround, you can increment a letter by 5 by adding 50 to
- * the next pair of digits. */
-
-
- WORD=0;
- I=1;
- L=LETTRS;
-L10: WORD=WORD+I*(MOD(L,50)+10);
- I=I*64;
- if(MOD(L,100) > 50)WORD=WORD+I*5;
- L=L/100;
- if(L != 0) goto L10;
- I=64L*64L*64L*64L*64L/I;
- WORD=WORD*I;
- return(WORD);
-}
-
-
-#define STATE (*sTATE)
-void fPUTTXT(long WORD, long *sTATE, long CASE) {
-long ALPH1, ALPH2, BYTE, DIV, I, W;
-
-/* Unpack the 30-bit value in word to obtain up to 5 integer-encoded chars,
- * and store them in inline starting at LNPOSN. If LNLENG>=LNPOSN, shift
- * existing characters to the right to make room. STATE will be zero when
- * puttxt is called with the first of a sequence of words, but is thereafter
- * unchanged by the caller, so PUTTXT can use it to maintain state across
- * calls. LNPOSN and LNLENG are incremented by the number of chars stored.
- * If CASE=1, all letters are made uppercase; if -1, lowercase; if 0, as is.
- * any other value for case is the same as 0 but also causes trailing blanks
- * to be included (in anticipation of subsequent additional text). */
-
-
- ALPH1=13*CASE+24;
- ALPH2=26*IABS(CASE)+ALPH1;
- if(IABS(CASE) > 1)ALPH1=ALPH2;
-/* ALPH1&2 DEFINE RANGE OF WRONG-CASE CHARS, 11-36 OR 37-62 OR EMPTY. */
- DIV=64L*64L*64L*64L;
- W=WORD;
- /* 18 */ for (I=1; I<=5; I++) {
- if(W <= 0 && STATE == 0 && IABS(CASE) <= 1)return;
- BYTE=W/DIV;
- if(STATE != 0 || BYTE != 63) goto L12;
- STATE=63;
- goto L18;
-
-L12: SHFTXT(LNPOSN,1);
- STATE=STATE+BYTE;
- if(STATE < ALPH2 && STATE >= ALPH1)STATE=STATE-26*CASE;
- INLINE[LNPOSN]=STATE;
- LNPOSN=LNPOSN+1;
- STATE=0;
-L18: W=(W-BYTE*DIV)*64;
- } /* end loop */
- return;
-}
-
-#undef STATE
-#define PUTTXT(WORD,STATE,CASE) fPUTTXT(WORD,&STATE,CASE)
-
-void SHFTXT(long FROM, long DELTA) {
-long I, II, JJ;
-
-/* Move INLINE(N) to INLINE(N+DELTA) for N=FROM,LNLENG. Delta can be
- * negative. LNLENG is updated; LNPOSN is not changed. */
-
-
- if(LNLENG < FROM || DELTA == 0) goto L2;
- for (I=FROM; I<=LNLENG; I++) {
- II=I;
- if(DELTA > 0)II=FROM+LNLENG-I;
- JJ=II+DELTA;
- INLINE[JJ]=INLINE[II];
- } /* end loop */
-L2: LNLENG=LNLENG+DELTA;
- return;
-}
-
-
-void TYPE0() {
-long TEMP;
-/* Type a blank line. This procedure is provided as a convenience for callers
- * who otherwise have no use for MAPCOM. */