diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /systems/knuth/local/tex-sparc |
Initial commit
Diffstat (limited to 'systems/knuth/local/tex-sparc')
-rw-r--r-- | systems/knuth/local/tex-sparc/Makefile | 74 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/dvitype.in | 5 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/ext.c | 468 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/ext.h | 32 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/ini_to_trip | 41 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/ini_to_vir | 23 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/initex.ch | 1419 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/plain.fmt | bin | 0 -> 166564 bytes | |||
-rw-r--r-- | systems/knuth/local/tex-sparc/plain.log | 103 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/tex.pool | 1040 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/trip1.in | 2 | ||||
-rw-r--r-- | systems/knuth/local/tex-sparc/trip2.in | 1 |
12 files changed, 3208 insertions, 0 deletions
diff --git a/systems/knuth/local/tex-sparc/Makefile b/systems/knuth/local/tex-sparc/Makefile new file mode 100644 index 0000000000..e7880da23c --- /dev/null +++ b/systems/knuth/local/tex-sparc/Makefile @@ -0,0 +1,74 @@ +# Make executable files for this workstation, using the master TeX sources + +#PFLAGS= -I.. -temp=. +PFLAGS= -I.. -g +#PFLAGS= -I.. +CFLAGS= -O -I.. +PC= time pc + +all: initex virtex + +triptest: triptex + -triptex < trip1.in + mv trip.log tripin.log + -triptex < trip2.in | tee trip.fot + dvitype trip.dvi < dvitype.in > /dev/null + mv dvitype.out trip.typ + rm -f *.dif + -diff tripin.log ../../dist/tex/tripin.log > tripin.log.dif + -diff trip.log ../../dist/tex/trip.log > trip.log.dif + -diff trip.fot ../../dist/tex/trip.fot > trip.fot.dif + -diff trip.typ ../../dist/tex/trip.typ > trip.typ.dif + more tripin.log.dif trip.log.dif trip.typ.dif trip.fot.dif + +%.p: %.ch + tangle ../../dist/tex/tex.web $*.ch + mv ../../dist/tex/tex.pool . + mv ../../dist/tex/tex.p $*.p + +initex.ch: ../../dist/tex/tex.web + +virtex.ch: initex.ch ini_to_vir + ini_to_vir initex.ch virtex.ch + +triptex.ch: initex.ch ini_to_trip + ini_to_trip initex.ch triptex.ch + +%.o: %.p + ${PC} ${PFLAGS} -c $*.p + +triptex.o: triptex.p + ${PC} -g ${PFLAGS} -c triptex.p + +initex: initex.o ext.o + pc ${PFLAGS} -o initex initex.o ext.o + +virtex: virtex.o ext.o + pc ${PFLAGS} -o virtex virtex.o ext.o + +triptex: triptex.o ext.o + pc -g ${PFLAGS} -o triptex triptex.o ext.o + cp ../../dist/tex/trip.tex . + +ext.o: ext.c ext.h ../h00vars.h ../texpaths.h + cc ${CFLAGS} -c ext.c + +plain.fmt: ../../dist/lib/plain.tex ../lib/local.tex + -initex plain \\input local \\dump + +install: # doit make install + mv initex virtex /usr/local/bin + rm /usr/local/bin/tex + ln /usr/local/bin/virtex /usr/local/bin/tex + make plain.fmt + +installtrip: # when the trip test is satisfactory + mv trip.tex tripin.log trip.log trip.fot trip.typ ../../dist/tex + +clean: + rm -f *.p *.o *~ *.tex triptex* *.dif trip.* tripin.log virtex.ch + @echo "Remaining files should be:" + @echo "Makefile ext.h initex.ch tex.pool" + @echo "dvitype.in ini_to_trip* plain.fmt trip1.in" + @echo "ext.c ini_to_vir* plain.log trip2.in" + diff --git a/systems/knuth/local/tex-sparc/dvitype.in b/systems/knuth/local/tex-sparc/dvitype.in new file mode 100644 index 0000000000..9aae7baa4b --- /dev/null +++ b/systems/knuth/local/tex-sparc/dvitype.in @@ -0,0 +1,5 @@ +2 +*.*.*.*.*.*.*.*.*.* +1000000 +7227/100 +0 diff --git a/systems/knuth/local/tex-sparc/ext.c b/systems/knuth/local/tex-sparc/ext.c new file mode 100644 index 0000000000..5d86e6799e --- /dev/null +++ b/systems/knuth/local/tex-sparc/ext.c @@ -0,0 +1,468 @@ +/* external procedures called by TeX */ +#include <sys/signal.h> +#include <sys/time.h> +#include "texpaths.h" /* defines MAXINPATHCHARS, defaultinputpath, etc. */ +#include "h00vars.h" + +/* The following are for closing files */ + +closea(f) + int *f; /* actually, file pointer, but it doesn't matter */ +{ + close1(f); +} + +closeb(f) + int *f; /* actually, file pointer, but it doesn't matter */ +{ + close1(f); +} + +closew(f) + int *f; /* actually, file pointer, but it doesn't matter */ +{ + close1(f); +} + +extern int interrupt; /* To be made nonzero to tell TeX about interrupts */ + +/* +** catchint() +** +** Gets called when the user hits his interrupt key. Sets the global +** "interrupt" nonzero, then sets it up so that the next interrupt will +** also be caught here. +** +*/ + +catchint() +{ + interrupt = 1; + signal(SIGINT,catchint); +} + +/* +** dateandtime(time, day, month, year) +** +** Stores minutes since midnight, current day, month and year into +** *time, *day, *month and *year, respectively. +** +** Also, set things up so that catchint() will get control on interrupts. +** +*/ + +dateandtime(minutes, day, month, year) +int *minutes, *day, *month, *year; +{ + long clock; + struct tm *tmptr, *localtime(); + + clock = time(0); + tmptr = localtime(&clock); + + *minutes = tmptr->tm_hour * 60 + tmptr->tm_min; + *day = tmptr->tm_mday; + *month = tmptr->tm_mon + 1; + *year = tmptr->tm_year + 1900; + signal(SIGINT,catchint); +} + + +/* fixed arrays are used to hold the paths, to avoid any possible problems + involving interaction of malloc and undump */ + +char inputpath[MAXINPATHCHARS] = defaultinputpath; +char fontpath[MAXOTHPATHCHARS] = defaultfontpath; +char formatpath[MAXOTHPATHCHARS] = defaultformatpath; +char poolpath[MAXOTHPATHCHARS] = defaultpoolpath; + +char *getenv(); + +/* + * setpaths is called to set up the arrays inputpath, fontpath, formatpath + * and poolpath as follows: if the user's environment has a value for the + * appropriate value, then use it; otherwise, leave the current value of + * the array (which may be the default path, or it may be the result of + * a call to setpaths on a previous run that was made the subject of + * an undump: this will give the maker of a preloaded TeX the option of + * providing a new set of "default" paths. + * + * Note that we have to copy the string from the environment area, since + * that will change on the next run (which matters if this is for a + * preloaded TeX). + */ +setpaths() +{ + register char *envpath; + + if ((envpath = getenv("TEXINPUTS")) != NULL) + copypath(inputpath,envpath,MAXINPATHCHARS); + if ((envpath = getenv("TEXFONTS")) != NULL) + copypath(fontpath,envpath,MAXOTHPATHCHARS); + if ((envpath = getenv("TEXFORMATS")) != NULL) + copypath(formatpath,envpath,MAXOTHPATHCHARS); + if ((envpath = getenv("TEXPOOL")) != NULL) + copypath(poolpath,envpath,MAXOTHPATHCHARS); +} + +/* + * copypath(s1,s2,n) copies at most n characters (including the null) + * from string s2 to string s1, giving an error message for paths + * that are too long. + */ +copypath(s1,s2,n) + register char *s1,*s2; + register int n; +{ + while ((*s1++ = *s2++) != '\0') + if (--n == 0) { + fprintf(stderr, "! Environment search path is too big\n"); + *--s1 = '\0'; + return; /* let user continue with truncated path */ + } +} + +extern short buffer[],xord[]; /* arrays of 0..255 */ +extern short last,first; /* pointers into buffer */ + +/* + * lineread reads from the Pascal text file with iorec pointer filep + * into buffer[first], buffer[first+1],..., buffer[last-1] (and + * setting "last"). + * Since 8-bit code is in the buffer, the elements are "short", not char. +* Characters are read until a newline is found (which isn't put in the + * buffer) or until the next character would go into buffer[lastlim]. + * The characters need to be translated, so really xord[c] is put into + * the buffer when c is read. + * If end-of-file is encountered, the funit field of *filep is set + * appropriately. + */ +lineread(filep, lastlim) +struct iorec *filep; +int lastlim; +{ + register c; + register short *cs; /* pointer into buffer where next char goes */ + register FILE *iop; /* stdio-style FILE pointer */ + int l; /* how many more chars are allowed before buffer overflow */ + short *bf; /* hold address of buffer[first] */ + + iop = filep->fbuf; + bf = cs = &(buffer[first]); + l = lastlim-first; + /* overflow when next char would go into buffer[lastlim] */ + while (--l>=0 && (c = getc(iop)) != EOF && c!='\n') + *cs++ = xord[c]; + if (c == EOF) + filep->funit |= EOFF; /* we hit end-of-file */ + last = first+cs-bf; +} + +#define filenamesize 1024 /* should agree with initex.ch */ +extern char nameoffile[],realnameoffile[]; /* these have size filenamesize */ + +/* + * testaccess(amode,filepath) + * + * Test whether or not the file whose name is in the global nameoffile + * can be opened for reading (if mode=READACCESS) + * or writing (if mode=WRITEACCESS). + * + * The filepath argument is one of the ...FILEPATH constants defined below. + * If the filename given in nameoffile does not begin with '/', we try + * prepending all the ':'-separated areanames in the appropriate path to the + * filename until access can be made, if it ever can. + * + * The realnameoffile global array will contain the name that yielded an + * access success. + */ + +#define READACCESS 4 +#define WRITEACCESS 2 + +#define NOFILEPATH 0 +#define INPUTFILEPATH 1 +#define READFILEPATH 2 +#define FONTFILEPATH 3 +#define FORMATFILEPATH 4 +#define POOLFILEPATH 5 + +bool +testaccess(amode,filepath) + int amode,filepath; +{ + register bool ok; + register char *p; + char *curpathplace; + int f; + + switch(filepath) { + case NOFILEPATH: curpathplace = NULL; break; + case INPUTFILEPATH: case READFILEPATH: + curpathplace = inputpath; break; + case FONTFILEPATH: curpathplace = fontpath; break; + case FORMATFILEPATH: curpathplace = formatpath; break; + case POOLFILEPATH: curpathplace = poolpath; break; + } + if (nameoffile[0]=='/') /* file name has absolute path */ + curpathplace = NULL; + do { + packrealnameoffile(&curpathplace); + if (amode==READACCESS) + /* use system call "access" to see if we could read it */ + if (access(realnameoffile,READACCESS)==0) ok = TRUE; + else ok = FALSE; + else { + /* WRITEACCESS: use creat to see if we could create it, but close + the file again if we're OK, to let pc open it for real */ + f = creat(realnameoffile,0666); + if (f>=0) ok = TRUE; + else ok = FALSE; + if (ok) + close(f); + } + } while (!ok && curpathplace != NULL); + if (ok) { /* pad realnameoffile with blanks, as Pascal wants */ + for (p = realnameoffile; *p != '\0'; p++) + /* nothing: find end of string */ ; + while (p < &(realnameoffile[filenamesize])) + *p++ = ' '; + } + return (ok); +} + +/* + * packrealnameoffile(cpp) makes realnameoffile contain the directory at *cpp, + * followed by '/', followed by the characters in nameoffile up until the + * first blank there, and finally a '\0'. The cpp pointer is left pointing + * at the next directory in the path. + * But: if *cpp == NULL, then we are supposed to use nameoffile as is. + */ +packrealnameoffile(cpp) + char **cpp; +{ + register char *p,*realname; + + realname = realnameoffile; + if ((p = *cpp)!=NULL) { + while ((*p != ':') && (*p != '\0')) { + *realname++ = *p++; + if (realname == &(realnameoffile[filenamesize-1])) + break; + } + if (*p == '\0') *cpp = NULL; /* at end of path now */ + else *cpp = p+1; /* else get past ':' */ + *realname++ = '/'; /* separate the area from the name to follow */ + } + /* now append nameoffile to realname... */ + p = nameoffile; + while (*p != ' ') { + if (realname >= &(realnameoffile[filenamesize-1])) { + fprintf(stderr,"! Full file name is too long\n"); + break; + } + *realname++ = *p++; + } + *realname = '\0'; +} + +/* +** testeof(filep) +** +** Test whether or not the Pascal text file with iorec pointer filep +** has reached end-of-file (when the only I/O on it is done with +** lineread, above). +** We may have to read the next character and unget it to see if perhaps +** the end-of-file is next. +*/ + +bool +testeof(filep) +register struct iorec *filep; +{ + register char c; + register FILE *iop; /* stdio-style FILE pointer */ + if (filep->funit & EOFF) + return(TRUE); + else { /* check to see if next is EOF */ + iop = filep->fbuf; + c = getc(iop); + if (c == EOF) + return(TRUE); + else { + ungetc(c,iop); + return(FALSE); + } + } +} + + +/* +** writedvi(a,b) +** +** writedvi is called to write dvibuf[a..b] to dvifile +** Unfortunately, dvibuf is declared as eight_bits, which in our +** implementation means that two bytes are taken by each entry. +** We only want to output the low order (first) byte of each pair. +*/ +extern struct iorec dvifile; +extern short dvibuf[]; +writedvi (a,b) + int a,b; +{ + register short *ptr,*final; + register FILE *iop; + + iop=dvifile.fbuf; + ptr= &(dvibuf[a]); + final= &(dvibuf[b]); + while (ptr<=final) { + putc((char) (*ptr & 0377), iop); + ptr += 1; + } + /* Note: The above code used to be machine dependent. By changing + * the declarations from "char *" to "short *" we get the machine + * to do its own byte ordering of the de-reference of "ptr" above. + * Then we AND off the low bits (now that it's been pulled from + * memory correctly) and cast it into a "char" for putc(). + * --Peter Kessler's idea; explanation, AND, cast a la clp. + */ +} + + +/* +** close1(filep) +** close1 does the proper things to pc's runtime system file data structure +** to close a file +*/ +close1(filep) + + register struct iorec *filep; +{ + register struct iorec *next; + + if (filep->fbuf != 0) { + if ((filep->funit & FDEF) == 0) { + next = (struct iorec *) &_fchain; + while (next->fchain != FILNIL + && next->fchain != filep) + next = next->fchain; + if (next->fchain != FILNIL) + next->fchain = next->fchain->fchain; + + if (filep->fblk > PREDEF) { + fflush(filep->fbuf); + setbuf(filep->fbuf, NULL); + } + fclose(filep->fbuf); + if (ferror(filep->fbuf)) { +/* ERROR and PERROR no longer exist in Pascal library; TeX doesn't know + what to do with them anyway! So I'm commenting this out... don 7/18/92 */ +/* ERROR("%s: Close failed\n", + filep->pfname); */ + return; + } + filep->fbuf=0; + } + if ((filep->funit & TEMP) != 0 && + unlink(filep->pfname)) { +/* PERROR("Could not remove ", filep->pfname); */ + return; + } + } +} + +/* +** The following procedure is due to sjc@s1-c. +** (with mods for 8-bit changes --- don, Sep 89) +** +** calledit(filename, fnlength, linenumber) +** +** TeX82 can call this to implement the 'e' feature in error-recovery +** mode, invoking a text editor on the erroneous source file. +** +** You should pass to "filename" the first character of the packed array +** containing the filename, and to "fnlength" the size of the filename. +** +** New problem (8-bit mod): need to add 128 to all characters of filename! +** +** Ordinarily, this invokes emacs. If you want a different +** editor, create a shell environment variable TEXEDIT containing +** the string that invokes that editor, with "%s" indicating where +** the filename goes and "%d" indicating where the decimal +** linenumber (if any) goes. For example, a TEXEDIT string for "vi" might be: +** +** setenv TEXEDIT "/usr/bin/vi +%d %s" +** +*/ + + char dvalue[] = "emacs +%d %s"; + char *texeditvalue = &dvalue[0]; + + calledit(filename, fnlength, linenumber) + char *filename; + int fnlength, linenumber; + { + char *temp, *command, c; + int sdone, ddone, i; + + sdone = ddone = 0; + + /* Replace default with environment variable if possible. */ + if (NULL != (temp = (char *) getenv("TEXEDIT"))) + texeditvalue = temp; + + /* Make command string containing envvalue, filename, and linenumber */ + if (NULL == + (command = (char *) malloc(strlen(texeditvalue) + fnlength + 25))) { + fprintf(stderr, "! Not enough memory to issue editor command\n"); + exit(1); + } + temp = command; + while ((c = *texeditvalue++) != '\0') { + if (c == '%') { + switch (c = *texeditvalue++) { + case 'd': + if (ddone) { + fprintf(stderr, + "! Line number cannot appear twice in editor command\n"); + exit(1); + } + sprintf(temp, "%d", linenumber); + while (*temp != '\0') + temp++; + ddone = 1; + break; + case 's': + if (sdone) { + fprintf(stderr, + "! Filename cannot appear twice in editor command\n"); + exit(1); + } + i = 0; + while (i < fnlength) + *temp++ = filename[i++] ^ 0x80; /* don's change */ + sdone = 1; + break; + case '\0': + *temp++ = '%'; + texeditvalue--; /* Back up to \0 to force termination. */ + break; + default: + *temp++ = '%'; + *temp++ = c; + break; + } + } + else + *temp++ = c; + } + *temp = '\0'; + + /* Execute command. */ + if (0 != system(command)) + fprintf(stderr, "! Trouble executing command %s\n", command); + + /* Quit, indicating TeX had found an error before you typed "e". */ + exit(1); + } diff --git a/systems/knuth/local/tex-sparc/ext.h b/systems/knuth/local/tex-sparc/ext.h new file mode 100644 index 0000000000..19dc5595f4 --- /dev/null +++ b/systems/knuth/local/tex-sparc/ext.h @@ -0,0 +1,32 @@ +procedure exit(x : integer); + external; + +procedure closea(var f:text); + external; + +procedure closeb(var f:bytefile); + external; + +procedure closew(var f:wordfile); + external; + +procedure dateandtime(var minutes, day, month, year : integer); + external; + +procedure setpaths; + external; + +function testaccess(accessmode:integer; filepath:integer): boolean; + external; + +function testeof(var f: text): boolean; + external; + +procedure lineread(var f: text; lastlim: integer); + external; + +procedure writedvi(a,b:integer); + external; + +procedure calledit(var filename: packedASCIIcode; fnlength, linenumber: integer); + external; diff --git a/systems/knuth/local/tex-sparc/ini_to_trip b/systems/knuth/local/tex-sparc/ini_to_trip new file mode 100644 index 0000000000..89ccab0759 --- /dev/null +++ b/systems/knuth/local/tex-sparc/ini_to_trip @@ -0,0 +1,41 @@ +#! /bin/csh +# A shell script to perform modifications on the changefile for initex +# to make a changefile for triptex (used to test tex). +# +# To use it, say +# ini_to_trip initex.ch triptex.ch +# +ed - $1 <<edscriptend +/debug=/ +// +s/@{//p +/gubed=/ +s/@t@>@}//p +/@!mem_max=/ +// +s/[0-9][0-9]*/3000/p +/@!mem_min=/ +s/-[0-9]*/1/p +/@!error_line=/ +s/[0-9][0-9]*/64/p +/@!half_error_line=/ +s/[0-9][0-9]*/32/p +/@!max_print_line=/ +s/[0-9][0-9]*/72/p +/@!font_max=/ +s/[0-9][0-9]*/75/p +/@!font_mem_size=/ +s/[0-9][0-9]*/20000/p +/@!pool_size=/ +s/[0-9][0-9]*/32000/p +/@d mem_bot=/ +// +s/-[0-9]*/1/p +/@d mem_top==/ +s/[0-9][0-9]*/3000/p +/@d hash_size=/ +s/[0-9][0-9]*/2100/p +/@d hash_prime=/ +s/[0-9][0-9]*/1777/p +w $2 +edscriptend diff --git a/systems/knuth/local/tex-sparc/ini_to_vir b/systems/knuth/local/tex-sparc/ini_to_vir new file mode 100644 index 0000000000..2120a4beea --- /dev/null +++ b/systems/knuth/local/tex-sparc/ini_to_vir @@ -0,0 +1,23 @@ +#! /bin/csh +# A shell script to perform modifications on the changefile for initex +# to make a changefile for virtex. This means changing constants and +# debug..gubed, init..tini, stat..tats. +# +# To use it, say +# ini_to_vir initex.ch virtex.ch +# +ed - $1 <<edscriptend +/@d init==/ +// +s//&@{/p +/@d tini==/ +s//&@t@>@}/p +/@!mem_max=/ +// +s/[0-9][0-9]*/32766/p +/@!max_strings=/ +s/[0-9][0-9]*/6000/p +/@!trie_size=/ +s/[0-9][0-9]*/6500/p +w $2 +edscriptend diff --git a/systems/knuth/local/tex-sparc/initex.ch b/systems/knuth/local/tex-sparc/initex.ch new file mode 100644 index 0000000000..11b4a9ab38 --- /dev/null +++ b/systems/knuth/local/tex-sparc/initex.ch @@ -0,0 +1,1419 @@ +% Change file for Berkeley UNIX, for a hacked version of the pc pascal +% compiler (with the others: clause in case statements). +% +% Distant relation of David Fuchs' Sep 13, 1982 TOPS20 version, greatly +% modified by Howard Trickey and Pavel Curtis + +% Modification History: +% +% (10/9) HWT Brought up to version 0.1 +% (10/13) HWT Fixed bug in hpack +% (10/17) HWT Changed to version 0.3 +% (10/22) HWT Brought up to version 0.4 +% (10/26) HWT Changed to use version 0.5 source +% (11/19) HWT Changed to use version 0.8 source; fixed glue_ratios to use +% external C procedures +% (11/30) HWT Changed to use new tangle, with verbatim Pascal mode, to avoid +% need for editing in the #include statement +% (changed modules 4,9) +% (1/15/83) HWT Changed to use version 0.94 source; added Pavel's changes to +% allow undumping; added Grim's fix for grtofl, etc.; +% modified for Knuth's new tangle. +% (2/1/83) PC Consolidated with Pavel's version, changed the fl<->gr +% routines to avoid slow and messy union type. +% (3/18/83) HWT Changed to use version 0.96 source (means changing fltogr and +% grtofl to unfloat and float, then getting rid of a lot of +% changes); made TeX print a newline +% at the end of the run. +% (4/2/83) PC Added call to exit() at end of run, with exit-value dependent +% upon the value of `history'. +% (4/16/83) PC Brought up to version 0.97 of TeX. +% (5/23/83) HWT Changed mem_max to 30000 for initex (because of latex) +% (6/2/83) HWT Brought up to version 0.98 of TeX. Changed some of the +% string-related constants to match the latest tops20 +% change file. Modified input_ln and write_dvi to use external +% C procedures, for speed increase. Changed file opening +% procedures to use external C procedure to test for +% accessibility, so that now none of the pc runtime library +% programs need to be modified (though close1 is still needed) +% (6/28/83) HWT Brought up to 0.99, with new change file format. +% (7/17/83) HWT Brought up to 0.999. Added switch-to-editor stuff. +% (7/29/83) HWT Brought up to 0.9999. +% (11/4/83) HWT Brought up to 0.999999. +% (11/16/83) HWT Brought up to 1.0. Upped max_strings, string_vacancies, +% pool_size, hash_size, and hash_prime, to agree with +% TOPS20-changes constants. +% (1/4/84) HWT Again, upped pool_size to 40000 for LaTeX. +% (2/18/84) HWT Made changes to use search path stuff in new ext.c. Now all +% the path specific stuff is localized to texpaths.h +% (6/6/84) HWT Brought up to 1.1. Upped pool_size and hash_size for LaTeX. +% (31/7/84) HWT Removed the forgetting of the full file name, so that +% switch-to-editor works for non-primary file. +% (11/16/84) RKF Brought up to 1.2 +% (12/26/84) RKF Brought up to 1.3, consulting changes already done by +% SVB@Purdue, rusty@sdcarl, and a related file from HWT +% (3/11/85) RKF Brought up to 1.3b +% (9/2/85) RKF Brought up to 1.5 (yep, missed 1.4) +% (1/30/86) PAM brought up to 2.0 +% (12/11/86) PAM commented out the patch which turns on debug. This is +% partly since debug is no longer necessary at this point of development +% but also because debug turns on range checking in the pc, and in +% recent months the pc range check has been giving bogus error +% messages. +% (2/27/87) PAM No change in working code, but noted places where SUNMakefile +% makes alterations for more efficient SUN code. +% (3/7/87) PAM Changed version number for TeX 2.1 +% (9/23/87) PAM Changed version number for TeX 2.3 +% (10/25/87) PAM Changed version number for TeX 2.5 +% (12/5/87) PAM Changed version number for TeX 2.7 +% (1/15/88) PAM Changed version number for TeX 2.9 +% (8/9/89) don SunOS changes for TeX 2.991; decreased some constants +% (9/10/89) don Major changes for 8-bit TeX beta test (version 2.992-eps) +% (10/6/89) don Now uptodate with TeX version 2.992 (\approx 3.0) +% (10/29/89) don Upped fontmax to 127 and fontmemsize to 40000 +% (1/23/90) don Fixed max_buf_stack logic (it was one too high) +% (9/6/90) don to Version 3.1 +% (1/30/91) don to Version 3.14 +% (9/19/91) don to Version 3.14a +% (1/25/92) don to Version 3.14b +% (3/15/92) don to Version 3.141 +% (6/15/92) don reversed the UNIXexit values (0 is success)(cf make) +% (2/26/93) don to Version 3.1415 +% (3/8/95) don to Version 3.14159 +% (4/2/97) don increased pool_size from 50000 to 60000 +% (and max_strings from 4000 to 6000 in ini_to_vir) +% (9/16/97) don increased buf_size from 500 to 5000 (without bothering +% to see why the implementation doesn't overflow buf_size gracefully) + +% Use this file as is to make an INITEX. To get production TeX, use the +% shell script ``ini_to_vir'' and re-TANGLE. + +% NOTE: the module numbers in this change file refer to Volume B. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [0] WEAVE: only print changes +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in} +@y +\def\botofcontents{\vskip 0pt plus 1fil minus 1.5in} +\let\maybe=\iffalse +\def\title{\TeX82 changes for SunOS} +\def\glob{13}\def\gglob{20, 26} % these are defined in module 1 +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.2] banner line +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d banner=='This is TeX, Version 3.14159' {printed when \TeX\ starts} +@y +@d banner=='This is TeX, Version 3.14159 for SunOS' {printed when \TeX\ starts} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.4] program header +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +Actually the heading shown here is not quite normal: The |program| line +does not mention any |output| file, because \ph\ would ask the \TeX\ user +to specify a file name if |output| were specified here. +@^system dependencies@> + +@d mtype==t@&y@&p@&e {this is a \.{WEB} coding trick:} +@y +@d mtype==t@&y@&p@&e {this is a \.{WEB} coding trick:} +@d standard_input==i@&n@&p@&u@&t {and another} +@z +@x +program TEX; {all file names are defined dynamically} +@y +program TEX(standard_input,output); {other file names are defined dynamically} +@z +@x +var @<Global variables@>@/ +@y +var @<Global variables@>@/ +@# +@\@=#include "ext.h"@>@\ {declarations for external C procedures} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.7] debug..gubed, stat..tats +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d debug==@{ {change this to `$\\{debug}\equiv\null$' when debugging} +@d gubed==@t@>@} {change this to `$\\{gubed}\equiv\null$' when debugging} +@y +@d debug==@{ {the trip test will use debugging} +@d gubed==@t@>@} +@z +@x +@d stat==@{ {change this to `$\\{stat}\equiv\null$' when gathering + usage statistics} +@d tats==@t@>@} {change this to `$\\{tats}\equiv\null$' when gathering + usage statistics} +@y +@d stat== +@d tats== +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.8] init..tini +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d init== {change this to `$\\{init}\equiv\.{@@\{}$' in the production version} +@d tini== {change this to `$\\{tini}\equiv\.{@@\}}$' in the production version} +@y +@d init== +@d tini== +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.9] compiler directives +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@{@&$C-,A+,D-@} {no range check, catch arithmetic overflow, no debug overhead} +@!debug @{@&$C+,D+@}@+ gubed {but turn everything on when debugging} +@y +@=(*$C-*)@> {no range check} +@!debug @=(*$C+*)@> @+ gubed {debug with range check (may cause bogus errors)} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.10] othercases, feature of Sun Pascal +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d othercases == others: {default for cases not listed explicitly} +@y +@d othercases == otherwise {default for cases not listed explicitly} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.11] compile-time constants +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@!mem_max=30000; {greatest index in \TeX's internal |mem| array; + must be strictly less than |max_halfword|; + must be equal to |mem_top| in \.{INITEX}, otherwise |>=mem_top|} +@!mem_min=0; {smallest index in \TeX's internal |mem| array; + must be |min_halfword| or more; + must be equal to |mem_bot| in \.{INITEX}, otherwise |<=mem_bot|} +@!buf_size=500; {maximum number of characters simultaneously present in + current lines of open files and in control sequences between + \.{\\csname} and \.{\\endcsname}; must not exceed |max_halfword|} +@!error_line=72; {width of context lines on terminal error messages} +@!half_error_line=42; {width of first lines of contexts in terminal + error messages; should be between 30 and |error_line-15|} +@!max_print_line=79; {width of longest text lines output; should be at least 60} +@!stack_size=200; {maximum number of simultaneous input sources} +@!max_in_open=6; {maximum number of input files and error insertions that + can be going on simultaneously} +@!font_max=75; {maximum internal font number; must not exceed |max_quarterword| + and must be at most |font_base+256|} +@!font_mem_size=20000; {number of words of |font_info| for all fonts} +@!param_size=60; {maximum number of simultaneous macro parameters} +@!nest_size=40; {maximum number of semantic levels simultaneously active} +@!max_strings=3000; {maximum number of strings; must not exceed |max_halfword|} +@!string_vacancies=8000; {the minimum number of characters that should be + available for the user's control sequences and font names, + after \TeX's own error messages are stored} +@!pool_size=32000; {maximum number of characters in strings, including all + error messages and help texts, and the names of all fonts and + control sequences; must exceed |string_vacancies| by the total + length of \TeX's own strings, which is currently about 23000} +@!save_size=600; {space for saving values outside of current group; must be + at most |max_halfword|} +@!trie_size=8000; {space for hyphenation patterns; should be larger for + \.{INITEX} than it is in production versions of \TeX} +@!trie_op_size=500; {space for ``opcodes'' in the hyphenation patterns} +@!dvi_buf_size=800; {size of the output buffer; must be a multiple of 8} +@!file_name_size=40; {file names shouldn't be longer than this} +@!pool_name='TeXformats:TEX.POOL '; + {string of length |file_name_size|; tells where the string pool appears} +@y +@!mem_max=30000; {greatest index in \TeX's internal |mem| array; + must be strictly less than |max_halfword|; + must be equal to |mem_top| in \.{INITEX}, otherwise |>=mem_top|} +@!mem_min=-32767; {smallest index in \TeX's internal |mem| array; + must be |min_halfword| or more; + must be equal to |mem_bot| in \.{INITEX}, otherwise |<=mem_bot|} +@!buf_size=5000; {maximum number of characters simultaneously present in + current lines of open files and in control sequences between + \.{\\csname} and \.{\\endcsname}; must not exceed |max_halfword|} +@!error_line=79; {width of context lines on terminal error messages} +@!half_error_line=50; {width of first lines of contexts in terminal + error messages; should be between 30 and |error_line-15|} +@!max_print_line=79; {width of longest text lines output; should be at least 60} +@!stack_size=200; {maximum number of simultaneous input sources} +@!max_in_open=15; {maximum number of input files and error insertions that + can be going on simultaneously} +@!font_max=127; {maximum internal font number; must not exceed |max_quarterword| + and must be at most |font_base+256|} +@!font_mem_size=40000; {number of words of |font_info| for all fonts} +@!param_size=60; {maximum number of simultaneous macro parameters} +@!nest_size=40; {maximum number of semantic levels simultaneously active} +@!max_strings=3000; {maximum number of strings; must not exceed |max_halfword|} +@!string_vacancies=8000; {the minimum number of characters that should be + available for the user's control sequences and font names, + after \TeX's own error messages are stored} +@!pool_size=60000; {maximum number of characters in strings, including all + error messages and help texts, and the names of all fonts and + control sequences; must exceed |string_vacancies| by the total + length of \TeX's own strings, which is currently about 23000} +@!save_size=600; {space for saving values outside of current group; must be + at most |max_halfword|} +@!trie_size=8000; {space for hyphenation patterns; should be larger for + \.{INITEX} than it is in production versions of \TeX} +@!trie_op_size=500; {space for ``opcodes'' in the hyphenation patterns} +@!dvi_buf_size=800; {size of the output buffer; must be a multiple of 8} +@!file_name_size=1024; {file names shouldn't be longer than this} +@!pool_name='tex.pool'; + {string of length |file_name_size|; the string pool name} +@.TeXformats@> +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [1.12] sensitive compile-time constants +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d mem_bot=0 {smallest index in the |mem| array dumped by \.{INITEX}; + must not be less than |mem_min|} +@d mem_top==30000 {largest index in the |mem| array dumped by \.{INITEX}; + must be substantially larger than |mem_bot| + and not greater than |mem_max|} +@d font_base=0 {smallest internal font number; must not be less + than |min_quarterword|} +@d hash_size=2100 {maximum number of control sequences; it should be at most + about |(mem_max-mem_min)/10|} +@d hash_prime=1777 {a prime number equal to about 85\pct! of |hash_size|} +@d hyph_size=307 {another prime; the number of \.{\\hyphenation} exceptions} +@y +@d mem_bot=-32767 {smallest index in the |mem| array dumped by \.{INITEX}; + must not be less than |mem_min|} +@d mem_top==30000 {largest index in the |mem| array dumped by \.{INITEX}; + must be substantially larger than |mem_bot| + and not greater than |mem_max|} +@d font_base=0 {smallest internal font number; must not be less + than |min_quarterword|} +@d hash_size=4000 {maximum number of control sequences; it should be at most + about |(mem_max-mem_min)/10|} +@d hash_prime=3443 {a prime number equal to about 85\pct! of |hash_size|} +@d hyph_size=307 {another prime; the number of \.{\\hyphenation} exceptions} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [2.23] allow any character that we can input to get in +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +for i:=0 to @'37 do xchr[i]:=' '; +for i:=@'177 to @'377 do xchr[i]:=' '; +@y +for i:=0 to @'37 do xchr[i]:=chr(i); +for i:=@'177 to @'377 do xchr[i]:=chr(i); +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.25] file types +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +The program actually makes use also of a third kind of file, called a +@y +The pc compiler on Berkeley {\mc UNIX} won't pack a range into one byte unless +the lower bound is |-128| or more, and the upper bound is |127| or less. +This applies to files, too. To make the program work with compiler range +checking turned on, we'll have to adjust |eight_bits| codes by sometimes +adding or subtracting |256|. +Note that |eight_bits| really takes 16 bits here. + +The program actually makes use also of a third kind of file, called a +@z +@x +@!alpha_file=packed file of text_char; {files that contain textual data} +@!byte_file=packed file of eight_bits; {files that contain binary data} +@y +@!alpha_file=t@&e@&x@&t; {files that contain textual data} +@!byte_file=packed file of -128..127; {files that contain binary data} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.26] add real_name_of_file array +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +is crucial for our purposes. We shall assume that |name_of_file| is a variable +of an appropriate type such that the \PASCAL\ run-time system being used to +implement \TeX\ can open a file whose external name is specified by +|name_of_file|. +@^system dependencies@> + +@<Glob...@>= +@!name_of_file:packed array[1..file_name_size] of char;@;@/ + {on some systems this may be a \&{record} variable} +@!name_length:0..file_name_size;@/{this many characters are actually + relevant in |name_of_file| (the rest are blank)} +@y +is crucial for our purposes. We shall assume that |name_of_file| is a variable +of an appropriate type such that the \PASCAL\ run-time system being used to +implement \TeX\ can open a file whose external name is specified by +|name_of_file|. +The Berkeley {\mc UNIX} version uses search paths to look for files to open. +We use |real_name_of_file| to hold the |name_of_file| with a directory +name from the path in front of it. +@^system dependencies@> + +@<Glob...@>= +@!name_of_file,@!real_name_of_file:packed array[1..file_name_size] of char; +@;@/ +@!name_length:0..file_name_size;@/{this many characters are actually + relevant in |name_of_file| (the rest are blank)} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.27] file opening +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ The \ph\ compiler with which the present version of \TeX\ was prepared has +extended the rules of \PASCAL\ in a very convenient way. To open file~|f|, +we can write +$$\vbox{\halign{#\hfil\qquad&#\hfil\cr +|reset(f,@t\\{name}@>,'/O')|&for input;\cr +|rewrite(f,@t\\{name}@>,'/O')|&for output.\cr}}$$ +The `\\{name}' parameter, which is of type `{\bf packed array +$[\langle\\{any}\rangle]$ of \\{char}}', stands for the name of +the external file that is being opened for input or output. +Blank spaces that might appear in \\{name} are ignored. + +The `\.{/O}' parameter tells the operating system not to issue its own +error messages if something goes wrong. If a file of the specified name +cannot be found, or if such a file cannot be opened for some other reason +(e.g., someone may already be trying to write the same file), we will have +|@!erstat(f)<>0| after an unsuccessful |reset| or |rewrite|. This allows +\TeX\ to undertake appropriate corrective action. +@:PASCAL H}{\ph@> +@^system dependencies@> + +\TeX's file-opening procedures return |false| if no file identified by +|name_of_file| could be opened. + +@d reset_OK(#)==erstat(#)=0 +@d rewrite_OK(#)==erstat(#)=0 + +@p function a_open_in(var f:alpha_file):boolean; + {open a text file for input} +begin reset(f,name_of_file,'/O'); a_open_in:=reset_OK(f); +end; +@# +function a_open_out(var f:alpha_file):boolean; + {open a text file for output} +begin rewrite(f,name_of_file,'/O'); a_open_out:=rewrite_OK(f); +end; +@# +function b_open_in(var f:byte_file):boolean; + {open a binary file for input} +begin reset(f,name_of_file,'/O'); b_open_in:=reset_OK(f); +end; +@# +function b_open_out(var f:byte_file):boolean; + {open a binary file for output} +begin rewrite(f,name_of_file,'/O'); b_open_out:=rewrite_OK(f); +end; +@# +function w_open_in(var f:word_file):boolean; + {open a word file for input} +begin reset(f,name_of_file,'/O'); w_open_in:=reset_OK(f); +end; +@# +function w_open_out(var f:word_file):boolean; + {open a word file for output} +begin rewrite(f,name_of_file,'/O'); w_open_out:=rewrite_OK(f); +end; +@y +@ The \ph\ compiler with which the present version of \TeX\ was prepared has +extended the rules of \PASCAL\ in a very convenient way for file opening. +Berkeley {\mc UNIX} \PASCAL\ isn't nearly as nice as \ph. +Normally, it bombs out if a file open fails. +An external C procedure, |test_access| is used to check whether or not the +open will work. It is declared in the ``ext.h'' include file, and it returns +|true| or |false|. The |name_of_file| global holds the file name whose access +is to be tested. +The first parameter for |test_access| is the access mode, +one of |read_access_mode| or |write_access_mode|. + +We also implement path searching in |test_access|: its second parameter is +one of the ``file path'' constants defined below. If |name_of_file| +doesn't start with |'/'| then |test_access| tries prepending pathnames +from the appropriate path list until success or the end of path list +is reached. +On return, |real_name_of_file| contains the original name with the path +that succeeded (if any) prepended. It is the name used in the various +open procedures. + +Note that |a_open_in| has been redefined to take an additional argument, +which should be one of the ``file path'' specifiers. +Since |b_open_in| is only used for \.{TFM} files, and +|w_open_in| is only used for format files, we don't need a path specifying +argument for them. +Path searching is not done for output files. + +@d read_access_mode=4 {``read'' mode for |test_access|} +@d write_access_mode=2 {``write'' mode for |test_access|} + +@d no_file_path=0 {no path searching should be done} +@d input_file_path=1 {path specifier for \.{\\input} files} +@d read_file_path=2 {path specifier for \.{\\read} files} +@d font_file_path=3 {path specifier for \.{TFM} files} +@d format_file_path=4 {path specifier for format files} +@d pool_file_path=5 {path specifier for the pool file} + +@p function a_open_in(var f:alpha_file;@!path_specifier:integer):boolean; + {open a text file for input} +var @!ok:boolean; +begin +if test_access(read_access_mode,path_specifier) then + begin reset(f,real_name_of_file); ok:=true@+end +else + ok:=false; +a_open_in:=ok; +end; +@# +function a_open_out(var f:alpha_file):boolean; + {open a text file for output} +var @!ok:boolean; +begin +if test_access(write_access_mode,no_file_path) then + begin rewrite(f,real_name_of_file); ok:=true @+end +else ok:=false; +a_open_out:=ok; +end; +@# +function b_open_in(var f:byte_file):boolean; + {open a binary file for input} +var @!ok:boolean; +begin +if test_access(read_access_mode,font_file_path) then + begin reset(f,real_name_of_file); ok:=true @+end +else ok:=false; +b_open_in:=ok; +end; +@# +function b_open_out(var f:byte_file):boolean; + {open a binary file for output} +var @!ok:boolean; +begin +if test_access(write_access_mode,no_file_path) then + begin rewrite(f,real_name_of_file); ok:=true @+end +else ok:=false; +b_open_out:=ok; +end; +@# +function w_open_in(var f:word_file):boolean; + {open a word file for input} +var @!ok:boolean; +begin +if test_access(read_access_mode,format_file_path) then + begin reset(f,real_name_of_file); ok:=true @+end +else ok:=false; +w_open_in:=ok; +end; +@# +function w_open_out(var f:word_file):boolean; + {open a word file for output} +var @!ok:boolean; +begin +if test_access(write_access_mode,no_file_path) then + begin rewrite(f,name_of_file); ok:=true @+end +else ok:=false; +w_open_out:=ok; +end; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.28] file closing +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +This makes |f| available to be opened again, if desired; and if |f| was used for +output, the |close| operation makes the corresponding external file appear +on the user's area, ready to be read. + +These procedures should not generate error messages if a file is +being closed before it has been successfully opened. + +@p procedure a_close(var f:alpha_file); {close a text file} +begin close(f); +end; +@# +procedure b_close(var f:byte_file); {close a binary file} +begin close(f); +end; +@# +procedure w_close(var f:word_file); {close a word file} +begin close(f); +end; +@y +This makes |f| available to be opened again, if desired; and if |f| was used for +output, the |close| operation makes the corresponding external file appear +on the user's area, ready to be read. + +With the pc library, files will be automatically closed when the program stops +and when one reopens them. +There is, however, the problem of opening a file and writing it, and then +wanting to read it again, but from a different file variable. +For this purpose we use external procedures |close_a|, |close_b|, and +|close_w|. + +@p procedure a_close(var f:alpha_file); {close a text file} +begin close_a(f); +end; +@# +procedure b_close(var f:byte_file); {close a binary file} +begin close_b(f); +end; +@# +procedure w_close(var f:word_file); {close a word file} +begin close_w(f); +end; + +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.31] faster version of input_ln +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +Since the inner loop of |input_ln| is part of \TeX's ``inner loop''---each +character of input comes in at this place---it is wise to reduce system +overhead by making use of special routines that read in an entire array +of characters at once, if such routines are available. The following +code uses standard \PASCAL\ to illustrate what needs to be done, but +finer tuning is often possible at well-developed \PASCAL\ sites. +@^inner loop@> + +@p function input_ln(var f:alpha_file;@!bypass_eoln:boolean):boolean; + {inputs the next line or returns |false|} +var last_nonblank:0..buf_size; {|last| with trailing blanks removed} +begin if bypass_eoln then if not eof(f) then get(f); + {input the first character of the line into |f^|} +last:=first; {cf.\ Matthew 19\thinspace:\thinspace30} +if eof(f) then input_ln:=false +else begin last_nonblank:=first; + while not eoln(f) do + begin if last>=max_buf_stack then + begin max_buf_stack:=last+1; + if max_buf_stack=buf_size then + @<Report overflow of the input buffer, and abort@>; + end; + buffer[last]:=xord[f^]; get(f); incr(last); + if buffer[last-1]<>" " then last_nonblank:=last; + end; + last:=last_nonblank; input_ln:=true; + end; +end; +@y +Since the inner loop of |input_ln| is part of \TeX's ``inner loop''---each +character of input comes in at this place---it is wise to reduce system +overhead by making use of special routines that read in an entire array +of characters at once. + +With Berkeley {\mc UNIX} we call an external C procedure, |line_read|. +That routine fills |buffer| from |first| onwards with the |xord|'ed values +of the next line, setting |last| appropriately. It will stop if +|last=buf_size|, and the following will cause an ``overflow'' abort. +We ignore the |bypass_eoln| argument, since the |line_read| procedure +will have handled bypassing the end-of-line in its previous call, if +there was one. + +If one uses |input_ln| on a file, the normal |read| +and |get| routines shouldn't be used, nor the |eof| and |eoln| tests. +End of file can be tested with the external function |test_eof|. +@^inner loop@> + + +@p function input_ln(var f:alpha_file;@!bypass_eoln:boolean):boolean; + {inputs the next line or returns |false|} +label done; +begin +last:=first; {cf.\ Matthew 19\thinspace:\thinspace30} +if test_eof(f) then input_ln:=false +else begin last:=first; + line_read(f,buf_size); + if last>max_buf_stack then begin + max_buf_stack:=last; + if max_buf_stack>=buf_size then + @<Report overflow of the input buffer, and abort@>; + end; + loop@+ begin if last=first then goto done; + if buffer[last-1]<>" " then goto done; + decr(last); + end; +done: input_ln:=true; + end; +end; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.32] term_in/out are input,output +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ The user's terminal acts essentially like other files of text, except +that it is used both for input and for output. When the terminal is +considered an input file, the file variable is called |term_in|, and when it +is considered an output file the file variable is |term_out|. +@^system dependencies@> + +@<Glob...@>= +@!term_in:alpha_file; {the terminal as an input file} +@!term_out:alpha_file; {the terminal as an output file} +@y +@ The user's terminal acts essentially like other files of text, except +that it is used both for input and for output. When the terminal is +considered an input file, the file is called |term_in|, and when it +is considered an output file the file is |term_out|. +For Berkeley {\mc UNIX} we use |standard_input| and |output| for these +files, as were declared in the program header. The former name +|standard_input| was defined using a .{WEB} trick so that `input' is +produced in the Pascal file. + +@d term_in==standard_input {the terminal as an input file} +@d term_out==output {the terminal as an output file} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.33] don't need to open terminal files +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ Here is how to open the terminal files +in \ph. The `\.{/I}' switch suppresses the first |get|. +@^system dependencies@> + +@d t_open_in==reset(term_in,'TTY:','/O/I') {open the terminal for text input} +@d t_open_out==rewrite(term_out,'TTY:','/O') {open the terminal for text output} +@y +@ Here is how to open the terminal files---do nothing. + +@d t_open_in == {input already open for text input} +@d t_open_out == {output already open for text output} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.34] flushing output +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +these operations can be specified in \ph: +@^system dependencies@> + +@d update_terminal == break(term_out) {empty the terminal output buffer} +@d clear_terminal == break_in(term_in,true) {clear the terminal input buffer} +@d wake_up_terminal == do_nothing {cancel the user's cancellation of output} +@y +these operations can be specified with Berkeley {\mc UNIX}: +@^system dependencies@> + +@d update_terminal == flush(output) +@d clear_terminal == {nothing necessary on UNIX} +@d wake_up_terminal == {nothing necessary on UNIX} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [3.37] rescanning the command line +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ The following program does the required initialization +without retrieving a possible command line. +It should be clear how to modify this routine to deal with command lines, +if the system permits them. +@^system dependencies@> + +@p function init_terminal:boolean; {gets the terminal input started} +label exit; +begin t_open_in; +loop@+begin wake_up_terminal; write(term_out,'**'); update_terminal; +@.**@> + if not input_ln(term_in,true) then {this shouldn't happen} + begin write_ln(term_out); + write(term_out,'! End of file on the terminal... why?'); +@.End of file on the terminal@> + init_terminal:=false; return; + end; + loc:=first; + while (loc<last)and(buffer[loc]=" ") do incr(loc); + if loc<last then + begin init_terminal:=true; + return; {return unless the line was all blank} + end; + write_ln(term_out,'Please type the name of your input file.'); + end; +exit:end; +@y +@ The following program does the required initialization +and also retrieves a possible command line. +@^system dependencies@> + +@p +function init_terminal:boolean; {gets the terminal input started} +label exit; + +var + dummy, i, j, k: integer; + arg: packed array[1..100] of char; + +begin + t_open_in; + if argc > 1 then begin + last := first; + for i := 1 to argc - 1 do begin + argv(i, arg); + j := 1; + k := 100; {find last non-blank char in arg} + while (k > 1) and (arg[k] = ' ') do@/ + decr(k); + while (j <= k) do begin + buffer[last] := xord[arg[j]]; + incr(j); incr(last); + end; + if k > 1 then begin + buffer[last] := xord[' ']; + incr(last); + end; + end; + if last > first then begin + loc := first; + init_terminal := true; + return; + end; + end; + loop@+begin + wake_up_terminal; write(term_out, '**'); update_terminal; +@.**@> + if not input_ln(term_in,true) then begin {this shouldn't happen} + write_ln(term_out); + write_ln(term_out, '! End of file on the terminal... why?'); +@.End of file on the terminal@> + init_terminal:=false; + return; + end; + + loc:=first; + while (loc<last)and(buffer[loc]=" ") do + incr(loc); + + if loc<last then begin + init_terminal:=true; + return; {return unless the line was all blank} + end; + write_ln(term_out, 'Please type the name of your input file.'); +@.Please type the name...@> + end; +exit: +end; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [4.38] string data to be offset -128 for packing +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d si(#) == # {convert from |ASCII_code| to |packed_ASCII_code|} +@d so(#) == # {convert from |packed_ASCII_code| to |ASCII_code|} + +@<Types...@>= +@!pool_pointer = 0..pool_size; {for variables that point into |str_pool|} +@!str_number = 0..max_strings; {for variables that point into |str_start|} +@!packed_ASCII_code = 0..255; {elements of |str_pool| array} +@y +@d si(#) == #-128 {convert from |ASCII_code| to |packed_ASCII_code|} +@d so(#) == #+128 {convert from |packed_ASCII_code| to |ASCII_code|} + +@<Types...@>= +@!pool_pointer = 0..pool_size; {for variables that point into |str_pool|} +@!str_number = 0..max_strings; {for variables that point into |str_start|} +@!packed_ASCII_code = -128..127; {elements of |str_pool| array} +@z +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [4.51] a_open_in of pool file needs path specifier +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +if a_open_in(pool_file) then +@y +if a_open_in(pool_file,pool_file_path) then +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [4.51,52,53] make TEX.POOL lowercase in messages +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +else bad_pool('! I can''t read TEX.POOL.') +@y +else bad_pool('! I can''t read tex.pool.') +@z +@x +begin if eof(pool_file) then bad_pool('! TEX.POOL has no check sum.'); +@y +begin if eof(pool_file) then bad_pool('! tex.pool has no check sum.'); +@z +@x + bad_pool('! TEX.POOL line doesn''t begin with two digits.'); +@y + bad_pool('! tex.pool line doesn''t begin with two digits.'); +@z +@x + bad_pool('! TEX.POOL check sum doesn''t have nine digits.'); +@y + bad_pool('! tex.pool check sum doesn''t have nine digits.'); +@z +@x +done: if a<>@$ then bad_pool('! TEX.POOL doesn''t match; TANGLE me again.'); +@y +done: if a<>@$ then bad_pool('! tex.pool doesn''t match; tangle me again.'); +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [6.84] switch-to-editor option +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +line ready to be edited. But such an extension requires some system +wizardry, so the present implementation simply types out the name of the +file that should be +edited and the relevant line number. +@^system dependencies@> + +There is a secret `\.D' option available when the debugging routines haven't +been commented~out. +@^debugging@> +@y +line ready to be edited. +We do this by calling the external procedure |calledit| with a pointer to +the filename, its length, and the line number. +However, here we just set up the variables that will be used as arguments, +since we don't want to do the switch-to-editor until after \TeX\ has closed +its files. +@^system dependencies@> + +There is a secret `\.D' option available when the debugging routines haven't +been commented~out. +@^debugging@> +@d edit_file==input_stack[base_ptr] +@z +@x +"E": if base_ptr>0 then + begin print_nl("You want to edit file "); +@.You want to edit file x@> + slow_print(input_stack[base_ptr].name_field); + print(" at line "); print_int(line); + interaction:=scroll_mode; jump_out; +@y +"E": if base_ptr>0 then + begin + ed_name_start:=str_start[edit_file.name_field]; + ed_name_length:=str_start[edit_file.name_field+1] - + str_start[edit_file.name_field]; + edit_line:=line; + jump_out; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [7.109] glue_ratio +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@!glue_ratio=real; {one-word representation of a glue expansion factor} +@y +@!glue_ratio=shortreal; {one-word representation of a glue expansion factor} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [8.110] ranges for quarter,half words +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +if the subrange is `|-128..127|'. + +The present implementation tries to accommodate as many variations as possible, +so it makes few assumptions. If integers having the subrange +`|min_quarterword..max_quarterword|' can be packed into a quarterword, +and if integers having the subrange `|min_halfword..max_halfword|' +can be packed into a halfword, everything should work satisfactorily. + +It is usually most efficient to have |min_quarterword=min_halfword=0|, +so one should try to achieve this unless it causes a severe problem. +The values defined here are recommended for most 32-bit computers. + +@d min_quarterword=0 {smallest allowable value in a |quarterword|} +@d max_quarterword=255 {largest allowable value in a |quarterword|} +@d min_halfword==0 {smallest allowable value in a |halfword|} +@d max_halfword==65535 {largest allowable value in a |halfword|} +@y +if the subrange is `|-128..127|'. + +For Berkeley {\mc UNIX} (SunOS) we need to do the |-128..127| kind of range. + +@d min_quarterword=-128 {smallest allowable value in a |quarterword|} +@d max_quarterword=127 {largest allowable value in a |quarterword|} +@d min_halfword==-32768 {smallest allowable value in a |halfword|} +@d max_halfword==32767 {largest allowable value in a |halfword|} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [11.165] fix the word "free" so that it doesn't conflict with a runtime proc +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +been included. (You may want to decrease the size of |mem| while you +@^debugging@> +are debugging.) +@y +been included. (You may want to decrease the size of |mem| while you +@^debugging@> +are debugging.) + +@d free==free_arr +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [12.186] glue_ratio fix +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +floating point underflow on the author's computer. +@^system dependencies@> +@^dirty \PASCAL@> + +@<Display the value of |glue_set(p)|@>= +g:=float(glue_set(p)); +if (g<>float_constant(0))and(glue_sign(p)<>normal) then + begin print(", glue set "); + if glue_sign(p)=shrinking then print("- "); + if abs(mem[p+glue_offset].int)<@'4000000 then print("?.?") + else if abs(g)>float_constant(20000) then + begin if g>float_constant(0) then print_char(">") + else print("< -"); + print_glue(20000*unity,glue_order(p),0); + end + else print_glue(round(unity*g),glue_order(p),0); +@^real multiplication@> + end +@y +floating point underflow on the author's computer. +For the {\mc VAX}, the only possible random value that could hurt is +a reserved value with 1 in the sign bit and 0 for the (excess) exponent. +Because the sign-plus-exponent is in the middle of the word, the chances +of this happening are miniscule, and ignored here. +@^system dependencies@> +@^dirty \PASCAL@> + +@<Display the value of |glue_set(p)|@>= +g:=float(glue_set(p)); +if (g<>float_constant(0))and(glue_sign(p)<>normal) then + begin print(", glue set "); + if glue_sign(p)=shrinking then print("- "); + if abs(float(glue_set(p)))>20000.0 then + begin if float(glue_set(p))>0 then print_char(">") + else print("< -"); + print_glue(20000*unity,glue_order(p),0); + end + else print_glue(round(float(glue_set(p))*unity),glue_order(p),0); +@^real multiplication@> + end +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [17.241] fix_date_and_time +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ The following procedure, which is called just before \TeX\ initializes its +input and output, establishes the initial values of the date and time. +@^system dependencies@> +Since standard \PASCAL\ cannot provide such information, something special +is needed. The program here simply specifies July 4, 1776, at noon; but +users probably want a better approximation to the truth. + +@p procedure fix_date_and_time; +begin time:=12*60; {minutes since midnight} +day:=4; {fourth day of the month} +month:=7; {seventh month of the year} +year:=1776; {Anno Domini} +end; +@y +@ The following procedure, which is called just before \TeX\ initializes its +input and output, establishes the initial values of the date and time. +It is calls an externally defined |date_and_time|, even though it could +be done from Pascal. +The external procedure also sets up interrupt catching. +@^system dependencies@> + +@p procedure fix_date_and_time; +begin + date_and_time(time,day,month,year); +end; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.513] area and extension rules +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ The file names we shall deal with for illustrative purposes have the +following structure: If the name contains `\.>' or `\.:', the file area +consists of all characters up to and including the final such character; +otherwise the file area is null. If the remaining file name contains +`\..', the file extension consists of all such characters from the first +remaining `\..' to the end, otherwise the file extension is null. +@^system dependencies@> + +We can scan such file names easily by using two global variables that keep track +of the occurrences of area and extension delimiters: + +@<Glob...@>= +@!area_delimiter:pool_pointer; {the most recent `\.>' or `\.:', if any} +@!ext_delimiter:pool_pointer; {the relevant `\..', if any} +@y +@ The file names we shall deal with for SunOS have the +following structure: If the name contains `\./', the file area +consists of all characters up to and including the final such character; +otherwise the file area is null. If the remaining file name contains +`\..', the file extension consists of all such characters from the first +remaining `\..' to the end, otherwise the file extension is null. +@^system dependencies@> + +We can scan such file names easily by using two global variables that keep +track of the occurrences of area and extension delimiters: + +@<Glob...@>= +@!area_delimiter:pool_pointer; {the most recent `\./', if any} +@!ext_delimiter:pool_pointer; {the most recent `\..', if any} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.514] TeX area directories +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d TEX_area=="TeXinputs:" +@.TeXinputs@> +@d TEX_font_area=="TeXfonts:" +@.TeXfonts@> +@y +Under Berkeley {\mc UNIX}, the default paths are specified in a separate +file, `\.{texpaths.h}'. The file opening procedures do path searching +based either on those default paths, or on paths given by the user +in ``environment'' variables. +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.516] more_name +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x + if (c=">")or(c=":") then +@y + if c="/" then +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.520] default format +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d format_default_length=20 {length of the |TEX_format_default| string} +@d format_area_length=11 {length of its area part} +@d format_ext_length=4 {length of its `\.{.fmt}' part} +@y +Under Berkeley {\mc UNIX} we don't give the area part, instead depending +on the path searching that will happen during file opening. + +@d format_default_length=9 {length of the |TEX_format_default| string} +@d format_area_length=0 {length of its area part} +@d format_ext_length=4 {length of its `\.{.fmt}' part} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.521] plain format location +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +TEX_format_default:='TeXformats:plain.fmt'; +@y +TEX_format_default:='plain.fmt'; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.524] format file opening: only try once, with path search +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x + pack_buffered_name(0,loc,j-1); {try first without the system file area} + if w_open_in(fmt_file) then goto found; + pack_buffered_name(format_area_length,loc,j-1); + {now try the system format file area} + if w_open_in(fmt_file) then goto found; +@y + pack_buffered_name(0,loc,j-1); + if w_open_in(fmt_file) then goto found; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.525] make_name_string +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +which simply makes a \TeX\ string from the value of |name_of_file|, should +ideally be changed to deduce the full name of file~|f|, which is the file +most recently opened, if it is possible to do this in a \PASCAL\ program. +@^system dependencies@> + +This routine might be called after string memory has overflowed, hence +we dare not use `|str_room|'. + +@p function make_name_string:str_number; +var k:1..file_name_size; {index into |name_of_file|} +begin if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or + (cur_length>0) then + make_name_string:="?" +else begin for k:=1 to name_length do append_char(xord[name_of_file[k]]); + make_name_string:=make_string; + end; +end; +@y +which simply makes a \TeX\ string from the value of |name_of_file|, should +ideally be changed to deduce the full name of file~|f|, which is the file +most recently opened, if it is possible to do this in a \PASCAL\ program. +With the Berkeley {\mc UNIX} version, we know that |real_name_of_file| +contains |name_of_file| prepended with the directory name that was found +by path searching. +If |real_name_of_file| starts with |'./'|, we don't use that part of the +name, since {\mc UNIX} users understand that. +@^system dependencies@> + +This routine might be called after string memory has overflowed, hence +we dare not use `|str_room|'. + +@p function make_name_string:str_number; +var k,@!kstart:1..file_name_size; {index into |name_of_file|} +begin +k:=1; +while (k<file_name_size) and (xord[real_name_of_file[k]]<>" ") do + incr(k); +name_length:=k-1; {the real |name_length|} +if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or + (cur_length>0) then + make_name_string:="?" +else begin + if (xord[real_name_of_file[1]]=".") and (xord[real_name_of_file[2]]="/") then + kstart:=3 + else + kstart:=1; + for k:=kstart to name_length do append_char(xord[real_name_of_file[k]]); + make_name_string:=make_string; + end +end; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.537] a_open_in of \input file needs path selector +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x + if a_open_in(cur_file) then goto done; + if cur_area="" then + begin pack_file_name(cur_name,TEX_area,cur_ext); + if a_open_in(cur_file) then goto done; + end; +@y + if a_open_in(cur_file,input_file_path) then goto done; + if cur_ext=".tex" then + begin pack_file_name(cur_name,cur_area,""); + if a_open_in(cur_file,input_file_path) then goto done; + end; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [29.537] get rid of return of name to string pool +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +if name=str_ptr-1 then {we can conserve string pool space now} + begin flush_string; name:=cur_name; + end; +@y +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [30.557] optimize kern_base_offset +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d kern_base_offset==256*(128+min_quarterword) +@y +@d kern_base_offset==0 {our |kern_flag| is zero} +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [30.563] opening tfm file: now path searching is done +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Set temp_int to value of first byte +@x +@ @<Open |tfm_file| for input@>= +file_opened:=false; +if aire="" then pack_file_name(nom,TEX_font_area,".tfm") +else pack_file_name(nom,aire,".tfm"); +if not b_open_in(tfm_file) then abort; +file_opened:=true +@y +@ Here we have to ``prime the pump'' for the |temp_int| trick explained below. + + @<Open |tfm_file| for input@>= +file_opened:=false; +pack_file_name(nom,aire,".tfm"); +if not b_open_in(tfm_file) then abort; +begin temp_int:=tfm_file^; + if temp_int<0 then temp_int:=temp_int+256; +end; +file_opened:=true +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [30.564] reading the tfm file +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@d fget==get(tfm_file) +@d fbyte==tfm_file^ +@y +For Berkeley {\mc UNIX} we had to make the |byte_file| type have data in the +range |-128..127|. +If the file byte contains |@'377|, we want to regard this as 255 in decimal. +However if we do |i:=tfm_file^| on that byte, where i is a signed integer, +then the result is |i=-1|. +File bytes with values |<@'200| are read properly. +The solution is to do the assignment as shown, and then add 256 to values +less than 0. +We could also assign to |eight_bits| values, but this causes an error if +runtime checking is turned on. +The integer |temp_int| will be added to global variables at the end, +where it won't disturb module numbering. + +@d fget==begin get(tfm_file); + temp_int:=tfm_file^; + if temp_int<0 then temp_int:=temp_int+256; + end +@d fbyte==temp_int +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [32.597] write_dvi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@p procedure write_dvi(@!a,@!b:dvi_index); +var k:dvi_index; +begin for k:=a to b do write(dvi_file,dvi_buf[k]); +end; +@y +For Berkeley {\mc UNIX}, this is going to be handled by an external procedure, +|writedvi|, which will do the output using |fwrite|. +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [49.1275] a_open_in of \read file needs path specifier +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x + if a_open_in(read_file[n]) then read_open[n]:=just_open; +@y + if a_open_in(read_file[n],read_file_path) then read_open[n]:=just_open; +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [51.1332] Delete ready_already; also add call to set_paths; +% also add call to exit() depending upon value of `history' +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@ Now this is really it: \TeX\ starts and ends here. + +The initial test involving |ready_already| should be deleted if the +\PASCAL\ runtime system is smart enough to detect such a ``mistake.'' +@y +@ Now this is really it: \TeX\ starts and ends here. + +Instead of testing |ready_already|, we give up the idea of a preloaded +core image in favor of silently loading a format file based on the +name by which this program has been invoked. For example, if the +program is being called \.{tex}, we will load \.{plain} format; +if \.{latex}, we will load \.{latex} format. On my machine the +loading of a format isn't too slow. (I use the new string capabilities +of Sun Pascal here; |my_name| will be declared {\bf varying} [100] +{\bf of\/} |char|.) + +At the end of the job, we look at |history| to decide the correct +exit code. We use 1 if |history <= warning_issued| and 0 otherwise. + +@d UNIXexit==e@&x@&i@&t +@z + +@x +t_open_out; {open the terminal for output} +if ready_already=314159 then goto start_of_TEX; +@y +t_open_out; {open the terminal for output} +set_paths; +@z + +@x +start_of_TEX: @<Initialize the output routines@>; +@y +start_of_TEX: argv(0,my_name); +if (my_name<>'initex')and(my_name<>'triptex') then + begin if my_name = 'tex' then name_of_file:='plain.fmt' + else name_of_file:=my_name+'.fmt'; + if w_open_in(fmt_file) then + if not load_fmt_file then + begin w_close(fmt_file); goto final_end; + end + else w_close(fmt_file); + end; +@<Initialize the output routines@>; +@z + +@x +final_end: ready_already:=0; +@y +final_end: ready_already:=0; +if (history <= warning_issued) then + UNIXexit(0) +else + UNIXexit(1); +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [51.1333] print new line before termination; switch to editor if nec. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x + slow_print(log_name); print_char("."); + end; + end; +@y + slow_print(log_name); print_char("."); + end; + end; +print_ln; +if (ed_name_start<>0) and (interaction>batch_mode) then + calledit(str_pool[ed_name_start],ed_name_length,edit_line); +@z + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% [54.1376] add temp_int and editor-switch variables to globals +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@x +@* \[54] System-dependent changes. +This section should be replaced, if necessary, by any special +modifications of the program +that are necessary to make \TeX\ work at a particular installation. +It is usually best to design your change file so that all changes to +previous sections preserve the section numbering; then everybody's version +will be consistent with the published program. More extensive changes, +which introduce new sections, can be inserted here; then only the index +itself will get a new section number. +@^system dependencies@> +@y +@* \[54] System-dependent changes. +Here is a temporary integer, used as a holder during reading and writing of +TFM files. +Also, the variable used omphaloskeptically. +Also, the variables that holds ``switch-to-editor'' information. +@^system dependencies@> + +@f varying == array + +@<Global...@>= +@!temp_int:integer; +@!my_name:varying [100] of char; +@!ed_name_start: pool_pointer; +@!ed_name_length,@!edit_line: integer; + +@ The |ed_name_start| will be set to point into |str_pool| somewhere after +its beginning if \TeX\ is supposed to switch to an editor on exit. + +@<Set init...@>= +ed_name_start:=0; + +@z diff --git a/systems/knuth/local/tex-sparc/plain.fmt b/systems/knuth/local/tex-sparc/plain.fmt Binary files differnew file mode 100644 index 0000000000..f9c7455f65 --- /dev/null +++ b/systems/knuth/local/tex-sparc/plain.fmt diff --git a/systems/knuth/local/tex-sparc/plain.log b/systems/knuth/local/tex-sparc/plain.log new file mode 100644 index 0000000000..6a7f9f18a3 --- /dev/null +++ b/systems/knuth/local/tex-sparc/plain.log @@ -0,0 +1,103 @@ +This is TeX, Version 3.14159 for SunOS (INITEX) 14 AUG 1998 08:06 +**plain \input local \dump +(/home/tex/dist/lib/plain.tex Preloading the plain format: codes, registers, +\maxdimen=\dimen10 +\hideskip=\skip10 +\centering=\skip11 +\p@=\dimen11 +\z@=\dimen12 +\z@skip=\skip12 +\voidb@x=\box10 + +parameters, +\smallskipamount=\skip13 +\medskipamount=\skip14 +\bigskipamount=\skip15 +\normalbaselineskip=\skip16 +\normallineskip=\skip17 +\normallineskiplimit=\dimen13 +\jot=\dimen14 +\interdisplaylinepenalty=\count23 +\interfootnotelinepenalty=\count24 + fonts, more fonts, +\itfam=\fam4 +\slfam=\fam5 +\bffam=\fam6 +\ttfam=\fam7 + macros, +\strutbox=\box11 +\mscount=\count25 +\tabs=\box12 +\tabsyet=\box13 +\tabsdone=\box14 + math definitions, +\rootbox=\box15 +\p@renwd=\dimen15 + output routines, +\headline=\toks10 +\footline=\toks11 +\footins=\insert254 +\topins=\insert253 + +hyphenation (/home/tex/dist/lib/hyphen.tex)) (/home/tex/local/lib/local.tex) +Beginning to dump on file plain.fmt + (preloaded format=plain 98.8.14) +1968 strings of total length 27846 +5013 memory locations dumped; current usage is 110&4900 +926 multiletter control sequences +\font\nullfont=nullfont +\font\tenrm=cmr10 +\font\preloaded=cmr9 +\font\preloaded=cmr8 +\font\sevenrm=cmr7 +\font\preloaded=cmr6 +\font\fiverm=cmr5 +\font\teni=cmmi10 +\font\preloaded=cmmi9 +\font\preloaded=cmmi8 +\font\seveni=cmmi7 +\font\preloaded=cmmi6 +\font\fivei=cmmi5 +\font\tensy=cmsy10 +\font\preloaded=cmsy9 +\font\preloaded=cmsy8 +\font\sevensy=cmsy7 +\font\preloaded=cmsy6 +\font\fivesy=cmsy5 +\font\tenex=cmex10 +\font\preloaded=cmss10 +\font\preloaded=cmssq8 +\font\preloaded=cmssi10 +\font\preloaded=cmssqi8 +\font\tenbf=cmbx10 +\font\preloaded=cmbx9 +\font\preloaded=cmbx8 +\font\sevenbf=cmbx7 +\font\preloaded=cmbx6 +\font\fivebf=cmbx5 +\font\tentt=cmtt10 +\font\preloaded=cmtt9 +\font\preloaded=cmtt8 +\font\preloaded=cmsltt10 +\font\tensl=cmsl10 +\font\preloaded=cmsl9 +\font\preloaded=cmsl8 +\font\tenit=cmti10 +\font\preloaded=cmti9 +\font\preloaded=cmti8 +\font\preloaded=cmti7 +\font\preloaded=cmu10 +\font\preloaded=cmmib10 +\font\preloaded=cmbsy10 +\font\preloaded=cmcsc10 +\font\preloaded=cmssbx10 +\font\preloaded=cmdunh10 +\font\preloaded=cmr7 at 14.51799pt +\font\preloaded=cmtt10 at 14.4pt +\font\preloaded=cmssbx10 at 14.4pt +\font\preloaded=manfnt +14787 words of font info for 50 preloaded fonts +14 hyphenation exceptions +Hyphenation trie of length 6075 has 181 ops out of 500 + 181 for language 0 +No pages of output. diff --git a/systems/knuth/local/tex-sparc/tex.pool b/systems/knuth/local/tex-sparc/tex.pool new file mode 100644 index 0000000000..c1358a0a41 --- /dev/null +++ b/systems/knuth/local/tex-sparc/tex.pool @@ -0,0 +1,1040 @@ +11buffer size +09pool size +17number of strings +03??? +13m2d5c2l5x2v5i +28End of file on the terminal! +02! +42(That makes 100 errors; please try again.) +02? +60Type <return> to proceed, S to scroll future error messages, +44R to run without stopping, Q to run quietly, +23I to insert something, +20E to edit your file, +561 or ... or 9 to ignore the next 1 to 9 tokens of input, +22H for help, X to quit. +13OK, entering +09batchmode +11nonstopmode +10scrollmode +03... +07insert> +44I have just deleted some text, as you asked. +48You can now delete more, or insert, or whatever. +50Sorry, I don't know how to help in this situation. +36Maybe you should try asking a human? +42Sorry, I already gave what help I could... +59An error might have occurred before I noticed any problems. +45``If all else fails, read the instructions.'' +02 ( +14Emergency stop +30TeX capacity exceeded, sorry [ +44If you really absolutely need more capacity, +35you can ask a wizard to enlarge me. +19This can't happen ( +59I'm broken. Please show this to someone who can fix can fix +35I can't go on meeting you like this +55One of your faux pas seems to have wounded me deeply... +59in fact, I'm barely conscious. Please fix it and try again. +12Interruption +09You rang? +60Try to insert some instructions for me (e.g.,`I\showlists'), +43unless you just want to quit by typing `X'. +16main memory size +24AVAIL list clobbered at +31Double-AVAIL list clobbered at +24Doubly free location at +12Bad flag at +14New busy locs: +05LINK( +05INFO( +02[] +10CLOBBERED. +04foul +03fil +06 plus +07 minus +03 [] +26Bad link, display aborted. +04etc. +18Unknown node type! +05unset +04box( +02)x +10, shifted +09 columns) +10, stretch +09, shrink +11, glue set +02- +03< - +05rule( +06insert +15, natural size +08; split( +14); float cost +04glue +09nonscript +05mskip +02mu +00 +08leaders +04kern +13 (for accent) +05mkern +04math +02on +03off +13, surrounded +11 (ligature +08penalty +13discretionary +11 replacing +04mark +07vadjust +08flushing +07copying +08vertical +10horizontal +12display math +02no +17internal vertical +21restricted horizontal +05 mode +18semantic nest size +04### +17 entered at line +10 (language +10:hyphenmin +18 (\output routine) +25### recent contributions: +10prevdepth +07ignored +11, prevgraf +05 line +12spacefactor +19, current language +28this will be denominator of: +08lineskip +12baselineskip +07parskip +16abovedisplayskip +16belowdisplayskip +21abovedisplayshortskip +21belowdisplayshortskip +08leftskip +09rightskip +07topskip +12splittopskip +07tabskip +09spaceskip +10xspaceskip +11parfillskip +10thinmuskip +09medmuskip +11thickmuskip +25[unknown glue parameter!] +04skip +06muskip +02pt +06output +08everypar +09everymath +12everydisplay +09everyhbox +09everyvbox +08everyjob +07everycr +07errhelp +04toks +08parshape +03box +04void +12current font +08textfont +10scriptfont +16scriptscriptfont +07catcode +06lccode +06uccode +06sfcode +08mathcode +12pretolerance +09tolerance +11linepenalty +13hyphenpenalty +15exhyphenpenalty +11clubpenalty +12widowpenalty +19displaywidowpenalty +13brokenpenalty +12binoppenalty +10relpenalty +17predisplaypenalty +18postdisplaypenalty +16interlinepenalty +20doublehyphendemerits +19finalhyphendemerits +11adjdemerits +03mag +15delimiterfactor +09looseness +04time +03day +05month +04year +14showboxbreadth +12showboxdepth +08hbadness +08vbadness +07pausing +13tracingonline +13tracingmacros +12tracingstats +17tracingparagraphs +12tracingpages +13tracingoutput +16tracinglostchars +15tracingcommands +15tracingrestores +06uchyph +13outputpenalty +13maxdeadcycles +09hangafter +15floatingpenalty +10globaldefs +03fam +10escapechar +17defaulthyphenchar +15defaultskewchar +11endlinechar +11newlinechar +08language +13lefthyphenmin +14righthyphenmin +14holdinginserts +17errorcontextlines +28[unknown integer parameter!] +05count +07delcode +09parindent +12mathsurround +13lineskiplimit +05hsize +05vsize +08maxdepth +13splitmaxdepth +11boxmaxdepth +05hfuzz +05vfuzz +18delimitershortfall +18nulldelimiterspace +11scriptspace +14predisplaysize +12displaywidth +13displayindent +12overfullrule +10hangindent +07hoffset +07voffset +16emergencystretch +26[unknown dimen parameter!] +05dimen +06EQUIV( +12notexpanded: +09hash size +06csname +09endcsname +11IMPOSSIBLE. +12NONEXISTENT. +06accent +07advance +15afterassignment +10aftergroup +10begingroup +04char +09delimiter +06divide +08endgroup +11expandafter +04font +09fontdimen +06halign +05hrule +12ignorespaces +10mathaccent +08mathchar +10mathchoice +08multiply +07noalign +10noboundary +08noexpand +04omit +07penalty +08prevgraf +07radical +04read +05relax +06setbox +03the +06valign +07vcenter +05vrule +09save size +15grouping levels +08curlevel +09retaining +09restoring +05SAVE( +28Incompatible magnification ( +02); +36 the previous value will be retained +58I can handle only one magnification ratio per job. So I've +59reverted to the magnification you used earlier on this run. +46Illegal magnification has been changed to 1000 +52The magnification ratio must be between 1 and 32768. +04ETC. +04BAD. +02-> +22begin-group character +20end-group character +21math shift character +26macro parameter character +22superscript character +20subscript character +25end of alignment template +12blank space +11the letter +14the character +23[unknown command code!] +02: +08Runaway +10definition +08argument +08preamble +04text +03<*> +09<insert> +06<read +02l. +11<argument> +11<template> +16<recently read> +19<to be read again> +16<inserted text> +09<output> +11<everypar> +12<everymath> +15<everydisplay> +12<everyhbox> +12<everyvbox> +11<everyjob> +10<everycr> +07<mark> +08<write> +16input stack size +05write +48(interwoven alignment preambles are not allowed) +17text input levels +03par +11Incomplete +34; all text was ignored after line +54A forbidden control sequence occurred in skipped text. +59This kind of error happens when you say `\if...' and forget +59the matching `\fi'. I've inserted a `\fi'; this might work. +53The file ended while I was skipping conditional text. +10File ended +32Forbidden control sequence found +16 while scanning +04 of +46I suspect you have forgotten a `}', causing me +41to read past where you wanted me to stop. +49I'll try to recover; but if the error is serious, +51you'd better type `E' or `X' now and fix your file. +03use +39Text line contains an invalid character +53A funny symbol that I can't read has just been input. +48Continue, and I'll forget that it ever happened. +37(Please type a command or say `\end') +38*** (job aborted, no legal \end found) +02=> +26Undefined control sequence +47The control sequence at the end of the top line +52of your error message was never \def'ed. If you have +55misspelled it (e.g., `\hobx'), type `I' and the correct +51spelling (e.g., `I\hbox'). Otherwise just continue, +45and I'll forget about whatever was undefined. +08Missing +09 inserted +53The control sequence marked <to be read again> should +42not appear between \csname and \endcsname. +05input +08endinput +07topmark +09firstmark +07botmark +14splitfirstmark +12splitbotmark +20parameter stack size +12Argument of +15 has an extra } +58I've run across a `}' that doesn't seem to match anything. +52For example, `\def\a#1{...}' and `\a}' would produce +54this error. If you simply proceed now, the `\par' that +52I've just inserted will cause me to report a runaway +54argument that might be the root of the problem. But if +57your `}' was spurious, just type `2' and it will go away. +23Paragraph ended before +13 was complete +58I suspect you've forgotten a `}', causing me to apply this +54control sequence to too much text. How can we recover? +59My plan is to forget the whole thing and hope for the best. +07Use of +29 doesn't match its definition +54If you say, e.g., `\def\a1{...}', then you must always +52put `1' after `\a', since control sequence names are +52made up of letters only. The macro here has not been +51followed by the required stuff, so I'm ignoring it. +02<- +18Missing { inserted +52A left brace was mandatory here, so I've put one in. +55You might want to delete and/or insert some corrections +48so that I will find a matching right brace soon. +54(If you're confused by all this, try typing `I}' now.) +23Incompatible glue units +52I'm going to assume that 1mu=1pt when they're mixed. +31Missing number, treated as zero +47A number should have been here; I inserted `0'. +54(If you can't figure out why I needed to see a number, +51look up `weird error' in the index to The TeXbook.) +11spacefactor +09prevdepth +10deadcycles +15insertpenalties +02wd +02ht +02dp +11lastpenalty +08lastkern +08lastskip +11inputlineno +07badness +09Improper +54You can refer to \spacefactor only in horizontal mode; +54you can refer to \prevdepth only in vertical mode; and +48neither of these is meaningful inside \write. So +52I'm forgetting what you said and using zero instead. +15You can't use ` +08' after +17Bad register code +44A register number must be between 0 and 255. +27I changed this one to zero. +18Bad character code +45A character number must be between 0 and 255. +10Bad number +51Since I expected to read a number between 0 and 15, +12Bad mathchar +46A mathchar number must be between 0 and 32767. +18Bad delimiter code +56A numeric delimiter code must be between 0 and 2^{27}-1. +28Improper alphabetic constant +56A one-character control sequence belongs after a ` mark. +37So I'm essentially inserting \0 here. +14Number too big +54I can only go up to 2147483647='17777777777="7FFFFFFF, +42so I'm using that number instead of yours. +04true +25Illegal unit of measure ( +18replaced by filll) +35I dddon't go any higher than filll. +02em +02ex +12mu inserted) +48The unit of measurement in math glue must be mu. +51To recover gracefully from this error, it's best to +52delete the erroneous units; e.g., type `2' to delete +45two letters. (See Chapter 27 of The TeXbook.) +02in +02pc +02cm +02mm +02bp +02dd +02cc +02sp +12pt inserted) +49Dimensions can be in units of em, ex, in, pt, pc, +50cm, mm, dd, cc, bp, or sp; but yours is a new one! +59I'll assume that you meant to say pt, for printer's points. +19Dimension too large +50I can't work with sizes bigger than about 19 feet. +46Continue and I'll use the largest value I can. +04plus +05minus +05width +06height +05depth +06number +12romannumeral +06string +07meaning +08fontname +07jobname +04 at +60Where was the left brace? You said something like `\def\a}', +43which I'm going to interpret as `\def\a{}'. +32You already have nine parameters +45I'm going to ignore the # sign you just used. +41Parameters must be numbered consecutively +57I've inserted the digit you should have used after the #. +36Type `1' to delete what you did use. +42Illegal parameter number in definition of +41You meant to type ## instead of #, right? +56Or maybe a } was forgotten somewhere earlier, and things +58are all screwed up? I'm going to assume that you meant ##. +49*** (cannot \read from terminal in nonstop modes) +18File ended within +33This \read has unbalanced braces. +02if +05ifcat +05ifnum +05ifdim +05ifodd +07ifvmode +07ifhmode +07ifmmode +07ifinner +06ifvoid +06ifhbox +06ifvbox +03ifx +05ifeof +06iftrue +07iffalse +06ifcase +02fi +02or +04else +06Extra +44I'm ignoring this; it doesn't match any \if. +06{true} +07{false} +23Missing = inserted for +48I was expecting to see `<', `=', or `>'. Didn't. +06{case +04.fmt +15input file name +19I can't find file ` +23I can't write on file ` +02'. +04.tex +20Please type another +45*** (job aborted, file error in nonstop mode) +04.dvi +20file name for output +06texput +04.log +02** +20transcript file name +02 +08nullfont +05Font +08 scaled +36 not loadable: Bad metric (TFM) file +42 not loadable: Metric (TFM) file not found +50I wasn't able to read the size data for this font, +40so I will ignore the font specification. +48[Wizards can fix TFM files using TFtoPL/PLtoTF.] +46You might try inserting a different font spec; +57e.g., type `I\font<same font id>=<substitute font name>'. +04.tfm +33 not loaded: Not enough room left +52I'm afraid I won't be able to make use of this font, +55because my memory for character-size data is too small. +51If you're really stuck, ask a wizard to enlarge me. +58Or maybe try `I\font<same font id>=<name of loaded font>'. +23Missing font identifier +42I was looking for a control sequence whose +42current meaning has been defined by \font. +10 has only +21 fontdimen parameters +51To increase the number of font parameters, you must +53use \fontdimen immediately after the \font is loaded. +11font memory +31Missing character: There is no +09 in font +12 TeX output +08vlistout +31Completed box being shipped out +21Memory usage before: +08 after: +19; still untouched: +31Huge page cannot be shipped out +50The page just created is more than 18 feet tall or +58more than 18 feet wide, so I suspect something went wrong. +35The following box has been deleted: +19No pages of output. +18Output written on +05 page +02, +08 bytes). +02to +06spread +09Underfull +05Loose +16 \hbox (badness +38) has occurred while \output is active +24) in paragraph at lines +24) in alignment at lines +02-- +19) detected at line +16Overfull \hbox ( +11pt too wide +21Tight \hbox (badness +05vpack +16 \vbox (badness +16Overfull \vbox ( +11pt too high +21Tight \vbox (badness +02{} +12displaystyle +09textstyle +11scriptstyle +17scriptscriptstyle +14Unknown style! +07mathord +06mathop +07mathbin +07mathrel +08mathopen +09mathclose +09mathpunct +09mathinner +08overline +09underline +04left +05right +06limits +08nolimits +20fraction, thickness +09= default +17, left-delimiter +18, right-delimiter +25 is undefined (character +54Somewhere in the math formula just ended, you used the +60stated character from an undefined font family. For example, +58plain TeX doesn't allow \it or \sl in subscripts. Proceed, +52and I'll try to forget that I needed that character. +06mlist1 +06mlist2 +06mlist3 +640234000122*4000133**3**344*0400400*000000234000111*1111112341011 +06mlist4 +12 inside $$'s +53Displays can use special alignments (like \eqalignno) +57only if nothing but the alignment itself is between $$'s. +58So I've deleted the formulas that preceded this alignment. +04span +02cr +04crcr +11endtemplate +24alignment tab character +40Missing # inserted in alignment preamble +50There should be exactly one # between &'s, when an +56\halign or \valign is being set up. In this case you had +47none, so I've put one in; maybe that will work. +29Only one # is allowed per tab +49more than one, so I'm ignoring all but the first. +04endv +40Extra alignment tab has been changed to +52You have given more \span or & marks than there were +58in the preamble to the \halign or \valign now in progress. +50So I'll assume that you meant to type \cr instead. +09256 spans +06align1 +06align0 +44Infinite glue shrinkage found in a paragraph +52The paragraph just ended includes some glue that has +54infinite shrinkability, e.g., `\hskip 0pt minus 1fil'. +54Such glue doesn't belong there---it allows a paragraph +59of any length to fit on one line. But it's safe to proceed, +55since the offensive shrinkability has been made finite. +05disc1 +05disc2 +02@@ +07: line +03 t= +06 -> @@ +07 via @@ +03 b= +03 p= +03 d= +10@firstpass +11@secondpass +14@emergencypass +09paragraph +05disc3 +05disc4 +13line breaking +05HYPH( +11hyphenation +16 will be flushed +48Hyphenation exceptions must contain only letters +51and hyphens. But continue; I'll forgive and forget. +12Not a letter +50Letters in \hyphenation words must have \lccode>0. +47Proceed; I'll ignore the character I just read. +20exception dictionary +18pattern memory ops +31pattern memory ops per language +14pattern memory +13Too late for +08patterns +53All patterns must be given before typesetting begins. +04Bad +17(See Appendix H.) +09Nonletter +17Duplicate pattern +07pruning +09vertbreak +48Infinite glue shrinkage found in box being split +52The box you are \vsplitting contains some infinitely +57shrinkable glue, e.g., `\vss' or `\vskip 0pt minus 1fil'. +59Such glue doesn't belong there; but you can safely proceed, +06vsplit +09 needs a +04vbox +44The box you are trying to split is an \hbox. +49I can't split such a box, so I'll leave it alone. +08pagegoal +09pagetotal +11pagestretch +14pagefilstretch +15pagefillstretch +16pagefilllstretch +10pageshrink +09pagedepth +04fill +05filll +17### current page: +28 (held over for next output) +13total height +13 goal height +06 adds +03, # +12 might split +15%% goal height= +12, max depth= +38Insertions can only be added to a vbox +40Tut tut: You're trying to \insert into a +41\box register that now contains an \hbox. +47Proceed, and I'll discard its present contents. +04page +45Infinite glue shrinkage found on current page +52The page about to be output contains some infinitely +03 g= +03 c= +38Infinite glue shrinkage inserted from +53The correction glue for page breaking with insertions +52must have finite shrinkability. But you may proceed, +07% split +04 to +15255 is not void +53You shouldn't use \box255 except in \output routines. +14Output loop--- +24 consecutive dead cycles +57I've concluded that your \output is awry; it never does a +55\shipout, so I'm shipping \box255 out myself. Next time +58increase \maxdeadcycles if you want me to be more patient! +25Unbalanced output routine +58Your sneaky output routine has problematic {'s and/or }'s. +41I can't handle that very well; good luck. +33Output routine didn't use all of +43Your \output commands should empty \box255, +34e.g., by saying `\shipout\box255'. +43Proceed; I'll discard its present contents. +18Missing $ inserted +56I've inserted a begin-math/end-math symbol since I think +48you left one out. Proceed, with fingers crossed. +05' in +50Sorry, but I'm not programmed to handle this case; +45I'll just pretend that you didn't ask for it. +49If you're in the wrong mode, you might be able to +58return to the right one by typing `I}' or `I$' or `I\par'. +03end +04dump +05hskip +04hfil +05hfill +03hss +07hfilneg +05vskip +04vfil +05vfill +03vss +07vfilneg +52I've inserted something that you may have forgotten. +32(See the <inserted text> above.) +48With luck, this will get me unwedged. But if you +55really didn't forget anything, try typing `2' now; then +56my insertion and my current dilemma will both disappear. +06right. +58Things are pretty mixed up, but I think the worst is over. +12Too many }'s +42You've closed more groups than you opened. +51Such booboos are generally harmless, so keep going. +10rightbrace +22Extra }, or forgotten +58I've deleted a group-closing symbol because it seems to be +59spurious, as in `$x}$'. But perhaps the } is legitimate and +59you forgot something else, as in `\hbox{$x}'. In such cases +58the way to recover is to insert both the forgotten and the +40deleted material, e.g., by typing `I$}'. +08moveleft +09moveright +05raise +05lower +04copy +07lastbox +04vtop +04hbox +07shipout +07leaders +08cleaders +08xleaders +35Leaders not followed by proper glue +56You should say `\leaders <box or rule><hskip or vskip>'. +50I found the <box or rule>, but there's no suitable +48<hskip or vskip>, so I'm ignoring these leaders. +34Sorry; this \lastbox will be void. +58Sorry...I usually can't take things from the current page. +37This \lastbox will therefore be void. +21Missing `to' inserted +48I'm working on `\vsplit<box number> to <dimen>'; +31will look for the <dimen> next. +31A <box> was supposed to be here +57I was expecting to see \hbox or \vbox or \copy or \box or +59something like that. So you might find something missing in +53your output. But keep trying; you can fix this later. +06indent +08noindent +26' here except with leaders +52To put a horizontal rule in an hbox or an alignment, +56you should use \leaders or \hrulefill (see The TeXbook). +10You can't +45I'm changing to \insert0; box 255 is special. +32Try `I\vskip-\lastskip' instead. +31Try `I\kern-\lastkern' instead. +46Perhaps you can make the output routine do it. +09unpenalty +06unkern +06unskip +06unhbox +07unhcopy +06unvbox +07unvcopy +34Incompatible list can't be unboxed +35Sorry, Pandora. (You sneaky devil.) +58I refuse to unbox an \hbox in vertical mode or vice versa. +40And I can't open any boxes in math mode. +13Illegal math +54Sorry: The third part of a discretionary break must be +57empty, in math formulas. I had to delete your third part. +30Discretionary list is too long +50Wow---I never thought anybody would tweak me here. +56You can't seriously need such a huge discretionary list? +27Improper discretionary list +54Discretionary lists must contain only boxes and kerns. +53The following discretionary sublist has been deleted: +18Missing } inserted +45I've put in what seems to be necessary to fix +44the current column of the current alignment. +43Try to go on, since this might almost work. +10Misplaced +55I can't figure out why you would want to use a tab mark +50here. If you just want an ampersand, the remedy is +52simple: Just type `I\&' now. But if some right brace +52up above has ended a previous alignment prematurely, +52you're probably due for more error messages, and you +57might try typing `S' now just to see what is salvageable. +57or \cr or \span just now. If something like a right brace +46I expect to see \noalign only after the \cr of +49an alignment. Proceed, and I'll ignore this case. +56I expect to see \omit only after tab marks or the \cr of +53I'm guessing that you meant to end an alignment here. +50I'm ignoring this, since I wasn't doing a \csname. +04eqno +05leqno +13displaylimits +42Limit controls must follow a math operator +57I'm ignoring this misplaced \limits or \nolimits command. +30Missing delimiter (. inserted) +52I was expecting to see something like `(' or `\{' or +55`\}' here. If you typed, e.g., `{' instead of `\{', you +57should probably delete the `{' by typing `1' now, so that +52braces don't get unbalanced. Otherwise just proceed. +54Acceptable delimiters are characters whose \delcode is +58nonnegative, or you can use `\delimiter <delimiter code>'. +11Please use +25 for accents in math mode +55I'm changing \accent to \mathaccent here; wish me luck. +59(Accents are not the same in formulas as they are in text.) +18Double superscript +43I treat `x^1^2' essentially like `x^1{}^2'. +16Double subscript +43I treat `x_1_2' essentially like `x_1{}_2'. +05above +04over +04atop +15abovewithdelims +14overwithdelims +14atopwithdelims +35Ambiguous; you need another { and } +55I'm ignoring this fraction specification, since I don't +52know whether a construction like `x \over y \over z' +53means `{x \over y} \over z' or `x \over {y \over z}'. +49I'm ignoring a \right that had no matching \left. +47Math formula deleted: Insufficient symbol fonts +50Sorry, but I can't typeset math unless \textfont 2 +50and \scriptfont 2 and \scriptscriptfont 2 have all +50the \fontdimen values needed in math symbol fonts. +50Math formula deleted: Insufficient extension fonts +50Sorry, but I can't typeset math unless \textfont 3 +50and \scriptfont 3 and \scriptscriptfont 3 have all +53the \fontdimen values needed in math extension fonts. +31Display math should end with $$ +59The `$' that I just saw supposedly matches a previous `$$'. +49So I shall assume that you typed `$$' both times. +07display +19Missing $$ inserted +04long +05outer +06global +03def +04gdef +04edef +04xdef +06prefix +29You can't use a prefix with ` +55I'll pretend you didn't say \long or \outer or \global. +06' or ` +08' with ` +49I'll pretend you didn't say \long or \outer here. +33Missing control sequence inserted +52Please don't say `\def cs{...}', say `\def\cs{...}'. +59I've inserted an inaccessible control sequence so that your +60definition will be completed without mixing me up too badly. +53You can recover graciously from this error, if you're +42careful; see exercise 27.2 in The TeXbook. +12inaccessible +03let +09futurelet +07chardef +11mathchardef +08countdef +08dimendef +07skipdef +09muskipdef +07toksdef +44You should have said `\read<number> to \cs'. +34I'm going to look for the \cs now. +14Invalid code ( +29), should be in the range 0.. +21), should be at most +54I'm going to use 0 instead of that illegal code value. +02by +19Arithmetic overflow +50I can't carry out that multiplication or division, +33since the result is out of range. +55I'm forgetting what you said and not changing anything. +57Sorry, \setbox is not allowed after \halign in a display, +45or between \accent and an accented character. +16Bad space factor +47I allow only values in the range 1..32767 here. +37I allow only nonnegative values here. +37Patterns can be loaded only by INITEX +10hyphenchar +08skewchar +04FONT +02at +06scaled +20Improper `at' size ( +21pt), replaced by 10pt +50I can only handle fonts at positive sizes that are +56less than 2048pt, so I've changed what you said to 10pt. +12select font +13errorstopmode +06openin +07closein +07message +10errmessage +31(That was another \errmessage.) +50This error message was generated by an \errmessage +43command, so I can't give any explicit help. +54Pretend that you're Hercule Poirot: Examine all clues, +41and deduce the truth by order and method. +09lowercase +09uppercase +04show +07showbox +07showthe +09showlists +57This isn't an error message; I'm just \showing something. +46Type `I\show...' to show more (e.g., \show\cs, +43\showthe\count10, \showbox255, \showlists). +54And type `I\tracingonline=1\show...' to show boxes and +57lists on your terminal as well as in the transcript file. +02> +09undefined +05macro +10long macro +11outer macro +17outer endtemplate +06> \box +02OK +26 (see the transcript file) +09 (INITEX) +29You can't dump inside a group +24`{...\dump}' is a no-no. +25 strings of total length +43 memory locations dumped; current usage is +30 multiletter control sequences +24 words of font info for +15 preloaded font +05\font +22 hyphenation exception +27Hyphenation trie of length +05 has +03 op +08 out of +14 for language +19 (preloaded format= +16format file name +26Beginning to dump on file +22Transcript written on +02 ) +13end occurred +24inside a group at level +05when +09 on line +16 was incomplete) +52(see the transcript file for additional information) +35(\dump is performed only by INITEX) +21debug # (-1 to exit): +07openout +08closeout +07special +09immediate +11setlanguage +20[unknown extension!] +04ext1 +12 (hyphenmin +08whatsit? +04ext2 +04ext3 +08endwrite +24Unbalanced write command +59On this page there's a \write with fewer real {'s than }'s. +04ext4 +16output file name +*461251401 diff --git a/systems/knuth/local/tex-sparc/trip1.in b/systems/knuth/local/tex-sparc/trip1.in new file mode 100644 index 0000000000..a93fd916c0 --- /dev/null +++ b/systems/knuth/local/tex-sparc/trip1.in @@ -0,0 +1,2 @@ + +\input trip diff --git a/systems/knuth/local/tex-sparc/trip2.in b/systems/knuth/local/tex-sparc/trip2.in new file mode 100644 index 0000000000..205d5cd650 --- /dev/null +++ b/systems/knuth/local/tex-sparc/trip2.in @@ -0,0 +1 @@ + &trip trip |