- * If we're already at end of line when GETTXT is called, we return -1. */
-
- if(LNPOSN != SPLITTING)SPLITTING = -1;
- GETTXT= -1;
-L10: if(LNPOSN > LNLENG)return(GETTXT);
- if((!SKIP) || INLINE[LNPOSN] != 0) goto L11;
- LNPOSN=LNPOSN+1;
- goto L10;
-
-L11: GETTXT=0;
- /* 15 */ for (I=1; I<=5; I++) {
- GETTXT=GETTXT*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;
- GETTXT=GETTXT+CHAR;
- goto L14;
-
-L12: if(SPLITTING == LNPOSN) goto L13;
- GETTXT=GETTXT+63;
- SPLITTING = LNPOSN;
- goto L15;
-
-L13: GETTXT=GETTXT+CHAR-63;
- SPLITTING = -1;
-L14: LNPOSN=LNPOSN+1;
-L15: /*etc*/ ;
- } /* end loop */
-
- if(HASH)GETTXT=GETTXT+MOD(HASH*13579L+5432L,97531L)*12345L+HASH;
- return(GETTXT);
-}
-
-
-
-#define GETTXT(SKIP,ONEWRD,UPPER,HASH) fGETTXT(SKIP,ONEWRD,UPPER,HASH)
-#undef MAKEWD
-long fMAKEWD(long LETTRS) {
-long I, L, MAKEWD;
-
-/* 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 and HASH=0. 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. */
-
-
- MAKEWD=0;
- I=1;
- L=LETTRS;
-L10: MAKEWD=MAKEWD+I*(MOD(L,50)+10);
- I=I*64;
- if(MOD(L,100) > 50)MAKEWD=MAKEWD+I*5;
- L=L/100;
- if(L != 0) goto L10;
- I=64L*64L*64L*64L*64L/I;
- MAKEWD=MAKEWD*I;
- return(MAKEWD);
-}
-
-
-
-#define MAKEWD(LETTRS) fMAKEWD(LETTRS)
-#undef PUTTXT
-#define STATE (*sTATE)
-void fPUTTXT(long WORD, long *sTATE, long CASE, long HASH) {
-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. HASH must be the same
- * as it was when gettxt created the 30-bit word. 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;
- if(HASH)W=W-MOD(HASH*13579L+5432L,97531L)*12345L-HASH;
- /* 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;