home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari FTP
/
ATARI_FTP_0693.zip
/
ATARI_FTP_0693
/
Tex
/
texsrc.arc
/
TEXD.H
< prev
next >
Wrap
C/C++ Source or Header
|
1988-09-14
|
12KB
|
387 lines
/* hacked up by David Dermott for MEGAMAX-c */
#include "tex.h"
#ifdef TRIP
#define MEMMAX 2999L
#define memmin 0L
#define bufsize 500L
#define errorline 64
#define halferrorlin 32
#define maxprintline 72
#define stacksize 200L
#define maxinopen 6
#define fontmax 75L
#define fontmemsize 20000L
#define paramsize 60L
#define nestsize 40L
#define maxstrings 3000L
#define stringvacanc 8000L
#define poolsize 32000L
#define savesize 600L
#define triesize 8000L
#define dvibufsize 1024
#define filenamesize 40
#define poolname "tex.pool"
#define MEMTOP 2999L
#else /* not TRIP */
#define MEMMAX 60000L
#define memmin 0L
#define bufsize 500L
#define errorline 79
#define halferrorlin 50
#define maxprintline 79
#define stacksize 200L
#define maxinopen 15
#define fontmax 100L
#define fontmemsize 30000L
#define paramsize 60L
#define nestsize 40L
#define maxstrings 4400L
#define stringvacanc 15000L
#define poolsize 45000L
#define savesize 2000L
#define triesize 8000L
#define dvibufsize 1024
#define filenamesize 40
#define poolname "tex.pool"
#define MEMTOP 50000L
#endif /* TRIP */
typedef quarterword ASCIIcode ;
typedef quarterword eightbits ;
typedef integer poolpointer ;
typedef integer strnumber ;
typedef integer scaled ;
typedef integer nonnegativei ;
typedef quarterword smallnumber ;
typedef quarterword twochoices ;
typedef quarterword fourchoices ;
typedef quarterword glueord ;
typedef struct { int modefield ;
halfword headfield, tailfield ;
integer pgfield, auxfield, mlfield ;
} liststaterec ;
typedef quarterword groupcode ;
typedef struct { quarterword statefield, indexfield ;
halfword startfield, locfield, limitfield, namefield ;
} instaterecor ;
typedef integer internalfont ;
typedef integer dviindex ;
typedef integer triepointer ;
typedef halfword hyphpointer ;
EXTERN integer bad ;
EXTERN ASCIIcode xord[128] ;
EXTERN char xchr[256] ;
EXTERN char nameoffile[filenamesize + 1], realnameoffi[filenamesize + 1] ;
EXTERN integer namelength ;
EXTERN ASCIIcode buffer[bufsize + 1] ;
EXTERN integer first ;
EXTERN integer last ;
EXTERN integer maxbufstack ;
/*EXTERN ASCIIcode strpool[poolsize + 1] ; */
EXTERN ASCIIcode *strpool ;
/*EXTERN poolpointer strstart[maxstrings + 1] ; */
EXTERN poolpointer *strstart ;
EXTERN poolpointer poolptr ;
EXTERN strnumber strptr ;
EXTERN poolpointer initpoolptr ;
EXTERN strnumber initstrptr ;
#ifdef INITEX
EXTERN alphafile poolfile ;
#endif /* INITEX */
EXTERN alphafile logfile ;
EXTERN quarterword selector ;
EXTERN quarterword dig[23] ;
EXTERN integer tally ;
EXTERN integer termoffset ;
EXTERN integer fileoffset ;
EXTERN ASCIIcode trickbuf[errorline + 1] ;
EXTERN integer trickcount ;
EXTERN integer firstcount ;
EXTERN quarterword interaction ;
EXTERN boolean deletionsall ;
EXTERN quarterword history ;
EXTERN int errorcount ;
EXTERN strnumber helpline[6] ;
EXTERN quarterword helpptr ;
EXTERN boolean useerrhelp ;
EXTERN integer interrupt ;
EXTERN boolean OKtointerrup ;
EXTERN boolean aritherror ;
EXTERN scaled remainder ;
EXTERN halfword tempptr ;
/*EXTERN memoryword zzzaa[memmax - memmin + 1] ; */
EXTERN memoryword *zzzaa ;
EXTERN halfword lomemmax ;
EXTERN halfword himemmin ;
EXTERN integer varused, dynused ;
EXTERN halfword avail ;
EXTERN halfword memend ;
EXTERN halfword rover ;
#ifdef DEBUG
/*EXTERN boolean zzzab[memmax - memmin + 1], *freearr ; */
EXTERN boolean *zzzab, *freearr ;
/*EXTERN boolean zzzac[memmax - memmin + 1], *wasfree ; */
EXTERN boolean *zzzac, *wasfree ;
EXTERN halfword wasmemend, waslomax, washimin ;
EXTERN boolean panicking ;
#endif /* DEBUG */
EXTERN integer fontinshortd ;
EXTERN integer depththresho ;
EXTERN integer breadthmax ;
EXTERN liststaterec nest[nestsize + 1] ;
EXTERN integer nestptr ;
EXTERN integer maxneststack ;
EXTERN liststaterec curlist ;
EXTERN int shownmode ;
EXTERN quarterword oldsetting ;
/*EXTERN memoryword zeqtb[5977] ; */
EXTERN memoryword *zeqtb ;
/*EXTERN quarterword zzzad[710], *xeqlevel ; */
EXTERN quarterword *zzzad, *xeqlevel ;
/*EXTERN twohalves zzzae[3267], *hash ; */
EXTERN twohalves *zzzae, *hash ;
EXTERN halfword hashused ;
EXTERN boolean nonewcontrol ;
EXTERN integer cscount ;
/*EXTERN memoryword savestack[savesize + 1] ; */
EXTERN memoryword *savestack ;
EXTERN integer saveptr ;
EXTERN integer maxsavestack ;
EXTERN quarterword curlevel ;
EXTERN groupcode curgroup ;
EXTERN integer curboundary ;
EXTERN integer magset ;
EXTERN eightbits curcmd ;
EXTERN halfword curchr ;
EXTERN halfword curcs ;
EXTERN halfword curtok ;
/*EXTERN instaterecor inputstack[stacksize + 1] ; */
EXTERN instaterecor *inputstack ;
EXTERN integer inputptr ;
EXTERN integer maxinstack ;
EXTERN instaterecor curinput ;
EXTERN integer inopen ;
EXTERN alphafile inputfile[maxinopen + 1] ;
EXTERN integer line ;
EXTERN integer linestack[maxinopen + 1] ;
EXTERN quarterword scannerstatu ;
EXTERN halfword warningindex ;
EXTERN halfword defref ;
EXTERN halfword paramstack[paramsize + 1] ;
EXTERN integer paramptr ;
EXTERN integer maxparamstac ;
EXTERN integer alignstate ;
EXTERN integer baseptr ;
EXTERN halfword parloc ;
EXTERN halfword partoken ;
EXTERN boolean forceeof ;
EXTERN halfword curmark[5] ;
EXTERN quarterword longstate ;
EXTERN halfword pstack[9] ;
EXTERN integer curval ;
EXTERN quarterword curvallevel ;
EXTERN smallnumber radix ;
EXTERN glueord curorder ;
EXTERN alphafile readfile[16] ;
EXTERN quarterword readopen[17] ;
EXTERN halfword condptr ;
EXTERN quarterword iflimit ;
EXTERN smallnumber curif ;
EXTERN integer ifline ;
EXTERN integer skipline ;
EXTERN strnumber curname ;
EXTERN strnumber curarea ;
EXTERN strnumber curext ;
EXTERN poolpointer areadelimite ;
EXTERN poolpointer extdelimiter ;
EXTERN ccharpointer TEXformatdef ;
EXTERN boolean nameinprogre ;
EXTERN strnumber jobname ;
EXTERN bytefile dvifile ;
EXTERN strnumber outputfilena ;
EXTERN strnumber logname ;
EXTERN bytefile tfmfile ;
/*EXTERN memoryword fontinfo[fontmemsize + 1] ; */
EXTERN memoryword *fontinfo ;
EXTERN integer fmemptr ;
EXTERN internalfont fontptr ;
/*EXTERN fourquarters fontcheck[fontmax + 1] ; */
EXTERN fourquarters *fontcheck ;
/*EXTERN scaled fontsize[fontmax + 1] ; */
EXTERN scaled *fontsize ;
/*EXTERN scaled fontdsize[fontmax + 1] ; */
EXTERN scaled *fontdsize ;
/*EXTERN halfword fontparams[fontmax + 1] ; */
EXTERN halfword *fontparams ;
/*EXTERN strnumber fontname[fontmax + 1] ; */
EXTERN strnumber *fontname ;
/*EXTERN strnumber fontarea[fontmax + 1] ; */
EXTERN strnumber *fontarea ;
/*EXTERN eightbits fontbc[fontmax + 1] ; */
EXTERN eightbits *fontbc ;
/*EXTERN eightbits fontec[fontmax + 1] ; */
EXTERN eightbits *fontec ;
/*EXTERN halfword fontglue[fontmax + 1] ; */
EXTERN halfword *fontglue ;
/*EXTERN boolean fontused[fontmax + 1] ; */
EXTERN boolean *fontused ;
/*EXTERN integer hyphenchar[fontmax + 1] ; */
EXTERN integer *hyphenchar ;
/*EXTERN integer skewchar[fontmax + 1] ; */
EXTERN integer *skewchar ;
/*EXTERN integer charbase[fontmax + 1] ; */
EXTERN integer *charbase ;
/*EXTERN integer widthbase[fontmax + 1] ; */
EXTERN integer *widthbase ;
/*EXTERN integer heightbase[fontmax + 1] ; */
EXTERN integer *heightbase ;
/*EXTERN integer depthbase[fontmax + 1] ; */
EXTERN integer *depthbase ;
/*EXTERN integer italicbase[fontmax + 1] ; */
EXTERN integer *italicbase ;
/*EXTERN integer ligkernbase[fontmax + 1] ; */
EXTERN integer *ligkernbase ;
/*EXTERN integer kernbase[fontmax + 1] ; */
EXTERN integer *kernbase ;
/*EXTERN integer extenbase[fontmax + 1] ; */
EXTERN integer *extenbase ;
/*EXTERN integer parambase[fontmax + 1] ; */
EXTERN integer *parambase ;
EXTERN fourquarters nullcharacte ;
EXTERN integer totalpages ;
EXTERN scaled maxv ;
EXTERN scaled maxh ;
EXTERN integer maxpush ;
EXTERN integer lastbop ;
EXTERN integer deadcycles ;
EXTERN boolean doingleaders ;
EXTERN quarterword c, f ;
EXTERN scaled ruleht, ruledp, rulewd ;
EXTERN halfword g ;
EXTERN integer lq, lr ;
EXTERN eightbits dvibuf[dvibufsize + 1] ;
EXTERN dviindex halfbuf ;
EXTERN dviindex dvilimit ;
EXTERN dviindex dviptr ;
EXTERN integer dvioffset ;
EXTERN integer dvigone ;
EXTERN halfword downptr, rightptr ;
EXTERN scaled dvih, dviv ;
EXTERN scaled curh, curv ;
EXTERN internalfont dvif ;
EXTERN integer curs ;
EXTERN scaled totalstretch[4], totalshrink[4] ;
EXTERN halfword adjusttail ;
EXTERN integer packbeginlin ;
EXTERN twohalves emptyfield ;
EXTERN fourquarters nulldelimite ;
EXTERN halfword curmlist ;
EXTERN smallnumber curstyle ;
EXTERN smallnumber cursize ;
EXTERN scaled curmu ;
EXTERN boolean mlistpenalti ;
EXTERN internalfont curf ;
EXTERN quarterword curc ;
EXTERN fourquarters curi ;
EXTERN integer magicoffset ;
EXTERN halfword curalign ;
EXTERN halfword curspan ;
EXTERN halfword curloop ;
EXTERN halfword alignptr ;
EXTERN halfword curhead, curtail ;
EXTERN halfword justbox ;
EXTERN halfword passive ;
EXTERN halfword printednode ;
EXTERN halfword passnumber ;
EXTERN scaled activewidth[7] ;
EXTERN scaled curactivewid[7] ;
EXTERN scaled background[7] ;
EXTERN scaled breakwidth[7] ;
EXTERN boolean noshrinkerro ;
EXTERN halfword curp ;
EXTERN boolean secondpass ;
EXTERN integer threshold ;
EXTERN scaled minimaldemer[4] ;
EXTERN scaled minimumdemer ;
EXTERN halfword bestplace[4] ;
EXTERN halfword bestplline[4] ;
EXTERN scaled discwidth ;
EXTERN halfword easyline ;
EXTERN halfword lastspeciall ;
EXTERN scaled firstwidth ;
EXTERN scaled secondwidth ;
EXTERN scaled firstindent ;
EXTERN scaled secondindent ;
EXTERN halfword bestbet ;
EXTERN integer fewestdemeri ;
EXTERN halfword bestline ;
EXTERN integer actualloosen ;
EXTERN integer linediff ;
EXTERN halfword hc[66] ;
EXTERN smallnumber hn ;
EXTERN halfword ha, hb ;
EXTERN internalfont hf ;
EXTERN ASCIIcode hu[64] ;
EXTERN integer hyfchar ;
EXTERN quarterword hyf[65] ;
EXTERN smallnumber hyphenpassed ;
/*EXTERN twohalves trie[triesize + 1] ; */
EXTERN twohalves *trie ;
EXTERN smallnumber hyfdistance[256] ;
EXTERN smallnumber hyfnum[256] ;
EXTERN quarterword hyfnext[256] ;
EXTERN strnumber hyphword[308] ;
EXTERN halfword hyphlist[308] ;
EXTERN hyphpointer hyphcount ;
#ifdef INITEX
EXTERN quarterword trieophash[511] ;
#endif /* INITEX */
EXTERN quarterword trieopptr ;
#ifdef INITEX
/*EXTERN ASCIIcode triec[triesize + 1] ; */
EXTERN ASCIIcode *triec ;
/*EXTERN quarterword trieo[triesize + 1] ; */
EXTERN quarterword *trieo ;
/*EXTERN triepointer triel[triesize + 1] ; */
EXTERN triepointer *triel ;
/*EXTERN triepointer trier[triesize + 1] ; */
EXTERN triepointer *trier ;
EXTERN triepointer trieptr ;
#endif /* INITEX */
#ifdef INITEX
/*EXTERN triepointer triehash[triesize + 1] ; */
EXTERN triepointer *triehash ;
#endif /* INITEX */
#ifdef INITEX
/*EXTERN boolean trietaken[triesize + 1] ; */
EXTERN boolean *trietaken ;
EXTERN triepointer triemin ;
#endif /* INITEX */
EXTERN triepointer triemax ;
EXTERN scaled bestheightpl ;
EXTERN halfword pagetail ;
EXTERN quarterword pagecontents ;
EXTERN scaled pagemaxdepth ;
EXTERN halfword bestpagebrea ;
EXTERN integer leastpagecos ;
EXTERN scaled bestsize ;
EXTERN scaled pagesofar[8] ;
EXTERN halfword lastglue ;
EXTERN integer lastpenalty ;
EXTERN scaled lastkern ;
EXTERN integer insertpenalt ;
EXTERN boolean outputactive ;
EXTERN halfword curbox ;
EXTERN halfword aftertoken ;
EXTERN boolean longhelpseen ;
EXTERN strnumber formatident ;
EXTERN wordfile fmtfile ;
EXTERN integer readyalready ;
EXTERN alphafile writefile[16] ;
EXTERN boolean writeopen[18] ;
EXTERN halfword writeloc ;
EXTERN poolpointer editnamestar ;
EXTERN integer editnameleng, editline, tfmtemp ;
EXTERN integer memtop;
EXTERN integer memmax;
#include "coerce.h"