home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 45
/
Amiga_Dream_45.iso
/
Amiga
/
Magazine
/
Dossier-LaTeX
/
AmiWeb2C.lha
/
source
/
web2c-6.1
/
web2c
/
lib
/
texmf.ch
< prev
next >
Wrap
Text File
|
1995-04-11
|
33KB
|
1,146 lines
Changes for TEXMF.C by Andreas Scherer, April 10, 1995.
@x l.9
#ifdef TeX
#include "texd.h"
#define dump_default_var TEXformatdefault
#define dump_default " plain.fmt"
#define dump_format " %s.fmt"
#define dump_ext_length 4
#define dump_default_length formatdefaultlength
#define virgin_program "virtex"
#define main_program texbody
#define edit_value tex_edit_value
#define edit_var "TEXEDIT"
#else /* not TeX */
#include "mfd.h"
#define dump_default_var MFbasedefault
#define dump_default " plain.base"
#define dump_format " %s.base"
#define dump_ext_length 5
#define dump_default_length basedefaultlength
#define virgin_program "virmf"
#define main_program main_body
#define edit_value mf_edit_value
#define edit_var "MFEDIT"
#endif /* not TeX */
@y
#ifdef TeX
#include "texd.h"
#define dump_default_var TEXformatdefault
#define dump_default " plain.fmt"
#define dump_format " %s.fmt"
#define dump_ext_length 4
#define dump_default_length formatdefaultlength
#define virgin_program "virtex"
#define main_program texbody
#define edit_value tex_edit_value
#define edit_var "TEXEDIT"
#elif defined (MF) /* not TeX, MetaFont or MetaPost */
#include "mfd.h"
#define dump_default_var MFbasedefault
#define dump_default " plain.base"
#define dump_format " %s.base"
#define dump_ext_length 5
#define dump_default_length basedefaultlength
#define virgin_program "virmf"
#define main_program main_body
#define edit_value mf_edit_value
#define edit_var "MFEDIT"
#else /* not MetaFont, but MetaPost */
#include "mpd.h"
#define dump_default_var MPmemdefault
#define dump_default " plain.mem"
#define dump_format " %s.mem"
#define dump_ext_length 4
#define dump_default_length memdefaultlength
#define virgin_program "inimp"
#define main_program main_body
#define edit_value mp_edit_value
#define edit_var "MPEDIT"
#endif /* MetaPost */
@z
@x l.39
extern struct tm *localtime ();
@y
#ifdef _AMIGA
#ifdef TeX
const unsigned char Version[] = "$VER: TeX 3.14159 ("__DATE__", "__TIME__")\n";
#elif defined (MF)
const unsigned char Version[] = "$VER: MetaFont 2.718 ("__DATE__", "__TIME__")\n";
#else
const unsigned char Version[] = "$VER: MetaPost 0.63 ("__DATE__", "__TIME__")\n";
#endif
#endif /* _AMIGA */
@z
@x l.67
main (ac, av)
int ac;
char *av[];
@y
main (
int ac,
char *av[])
@z
It's jolly hard to find some of these bugs.
@x l.71
gargc = ac;
@y
gargc = argc = ac;
@z
I would like to do `close_all' and `as_free_memory' in `uexit', but as the
respective module is used in `lib.lib' for all the other programs as well,
a special Cesque trick has to be applied. It is very important to keep the
correct sequence of `atexit' calls; these entries are called LIFO, and the
`amiga.c' module might do something with the allocated memory.
@x l.118
main_program ();
@y
#ifdef VARMEM
#ifdef TeX
setpaths (
TEXFORMATPATHBIT +
TEXINPUTPATHBIT +
TEXPOOLPATHBIT +
TFMFILEPATHBIT +
TEXCONFIGPATHBIT);
#elif defined (MF) /* Not TeX, MetaFont or MetaPost */
setpaths (
MFBASEPATHBIT +
MFINPUTPATHBIT +
MFPOOLPATHBIT +
MFCONFIGPATHBIT);
#else /* Not MetaFont, but MetaPost */
setpaths (
MPMEMPATHBIT +
MPINPUTPATHBIT +
MPPOOLPATHBIT +
MPCONFIGPATHBIT +
TFMFILEPATHBIT +
MFINPUTPATHBIT);
#endif /* MetaPost */
as_getsizes();
as_alloc_memory();
if(atexit(&as_free_memory)) { /* Can't happen. */
fprintf(stderr, "Exit trap failure! (as_free_memory)\n");
uexit(error_message_issued);
}
#endif /* VARMEM */
#if defined ( MF ) && defined ( AMIWIN ) && ! defined ( TRAP)
if(atexit(&close_all)) { /* Can't happen. */
fprintf(stderr, "Exit trap failure! (close_all)\n");
uexit(error_message_issued);
}
#endif /* MF and AMIWIN and !TRAP */
main_program ();
@z
@x l.169
catch_interrupt (arg)
int arg;
@y
catch_interrupt (
int arg)
@z
@x l.251
(void) fprintf (stderr, "Please ask a wizard to enlarge me.\n");
uexit (1);
@y
#ifdef VARMEM
(void) fprintf (stderr, "Please ask a wizard to enlarge me.\n");
#else
(void) fprintf (stderr, "Please alter the configuration file.\n");
#endif
uexit (error_message_issued);
@z
@x l.326
uexit (1);
@y
uexit (error_message_issued);
@z
@x l.339
uexit (1);
@y
uexit (error_message_issued);
@z
@x l.369
uexit (1);
@y
uexit (error_message_issued);
@z
@x l.393
swap_items (p, nitems, size)
char *p;
int nitems;
int size;
@y
swap_items (
char *p,
int nitems,
int size)
@z
@x l.455
uexit (1);
@y
uexit (error_message_issued);
@z
@x l.479
uexit (1);
@y
uexit (error_message_issued);
@z
@x l.502
uexit (1);
@y
uexit (error_message_issued);
@z
Add window support for the AmigaOS 2.1 and up.
@x l.570
#undef X11WIN
@y
#undef X11WIN
#undef AMIWIN
@z
@x l.609
#ifdef X11WIN
extern mf_x11_initscreen (), mf_x11_updatescreen ();
extern mf_x11_blankrectangle (), mf_x11_paintrow ();
#endif
@y
#ifdef X11WIN
extern mf_x11_initscreen (), mf_x11_updatescreen ();
extern mf_x11_blankrectangle (), mf_x11_paintrow ();
#endif
#ifdef AMIWIN
extern mf_ami_initscreen (), mf_ami_updatescreen ();
extern mf_ami_blankrectangle (), mf_ami_paintrow ();
#endif
@z
@x l.624
int (*mfwsw_initscreen) ();
int (*mfwsw_updatescrn) ();
int (*mfwsw_blankrect) ();
int (*mfwsw_paintrow) ();
@y
int (*mfwsw_initscreen)(void);
int (*mfwsw_updatescrn)(void);
int (*mfwsw_blankrect)(screencol,screencol,screenrow,screenrow);
int (*mfwsw_paintrow)(screenrow,pixelcolor,transspec,screencol);
@z
@x l.665
#ifdef X11WIN
{ "xterm", mf_x11_initscreen, mf_x11_updatescreen,
mf_x11_blankrectangle, mf_x11_paintrow },
#endif
@y
#ifdef AMIWIN
{ "amiterm", mf_ami_initscreen, mf_ami_updatescreen,
mf_ami_blankrectangle, mf_ami_paintrow },
#endif
@z
Open the Online Display even when MFTERM isn't set.
@x l.692
/* If MFTERM is set, use it. */
char *ttytype = getenv ("MFTERM");
if (ttytype == NULL)
{ /* If DISPLAY is set, we are X11; otherwise, who knows. */
boolean have_display = getenv ("DISPLAY") != NULL;
ttytype = have_display ? "xterm" : getenv ("TERM");
}
/* If we don't know kind of terminal this is, or if Metafont isn't
being run interactively, don't do any online output. */
if (ttytype == NULL || !isatty (fileno (stdout)))
return 0;
@y
/* If MFTERM is set, use it. */
char *ttytype = getenv("MFTERM");
#ifdef _AMIGA
char dummy_tty[] = "amiterm";
if (ttytype == NULL)
ttytype = dummy_tty;
#else
if (ttytype == NULL)
{ /* If DISPLAY is set, we are X11; otherwise, who knows. */
boolean have_display = getenv ("DISPLAY") != NULL;
ttytype = have_display ? "xterm" : getenv ("TERM");
}
/* If we don't know kind of terminal this is, or if Metafont isn't
being run interactively, don't do any online output. */
if (ttytype == NULL || !isatty (fileno (stdout)))
return 0;
#endif /* _AMIGA */
@z
@x l.808
#endif /* MF */
@y
#endif /* MF */
/*
* A runtime memory configuration is provided for all internal array sizes.
* This file is automatically included in the `extra' sources for TeX,
* MetaFont, and MetaPost.
*
* This code was written by Andreas Scherer, April 5, 1995.
*/
#ifdef VARMEM
#ifdef TeX
#define configname "tex.mcf"
#define CONFIGPATH TEXCONFIGPATH
as_parameter as_param[AS_NP] = {
{ "memmax", 30000 },
{ "bufsize", 500 },
{ "errorline", 72 },
{ "halferrorline", 42 },
{ "maxprintline", 79 },
{ "stacksize", 200 },
{ "maxinopen", 6 },
{ "fontmax", 75 },
{ "fontmemsize", 20000 },
{ "paramsize", 60 },
{ "nestsize", 40 },
{ "maxstrings", 3000 },
{ "poolsize", 32000 },
{ "savesize", 600 },
{ "triesize", 8000 },
{ "trieopsize", 500 },
{ "maxtrieop", 500 },
{ "dvibufsize", 100 },
{ "memtop", 30000 },
{ "hashsize", 2100 },
{ "hashprime", 1777 },
{ "hyphsize", 307 }
};
#elif defined (MF) /* Not TeX, MetaFont or MetaPost */
#define configname "mf.mcf"
#define CONFIGPATH MFCONFIGPATH
as_parameter as_param[AS_NP] = {
{ "memmax", 30000 },
{ "maxinternal", 100 },
{ "bufsize", 500 },
{ "errorline", 72 },
{ "halferrorline", 42 },
{ "maxprintline", 79 },
{ "screenwidth", 768 },
{ "screendepth", 1024 },
{ "stacksize", 30 },
{ "maxstrings", 2000 },
{ "poolsize", 32000 },
{ "movesize", 5000 },
{ "maxwiggle", 300 },
{ "gfbufsize", 100 },
{ "pathsize", 300 },
{ "bistacksize", 785 },
{ "headersize", 100 },
{ "ligtablesize", 5000 },
{ "maxkerns", 500 },
{ "maxfontdimen", 50 },
{ "memtop", 30000 },
{ "hashsize", 2100 },
{ "hashprime", 1777 },
{ "maxinopen", 6 },
{ "paramsize", 150 },
{ "scalefactor", 1 }
};
#else /* Not MetaFont, but MetaPost */
#define configname "mp.mcf"
#define CONFIGPATH MPCONFIGPATH
as_parameter as_param[AS_NP] = {
{ "memmax", 30000 },
{ "maxinternal", 100 },
{ "bufsize", 500 },
{ "errorline", 72 },
{ "halferrorline", 42 },
{ "maxprintline", 79 },
{ "emergencylinelength", 255 },
{ "stacksize", 30 },
{ "maxreadfiles", 4 },
{ "maxstrings", 2500 },
{ "stringsvacant", 1000 },
{ "poolsize", 32000 },
{ "fontmax", 50 },
{ "fontmemsize", 10000 },
{ "memtop", 30000 },
{ "hashsize", 2100 },
{ "hashprime", 1777 },
{ "maxinopen", 6 },
{ "paramsize", 150 },
{ "maxwritefiles", 4},
{ "pathsize", 300 },
{ "bistacksize", 785 },
{ "headersize", 100 },
{ "ligtablesize", 5000 },
{ "maxkerns", 500 },
{ "maxfontdimen", 50 },
};
#endif /* MetaPost */
#include "andyconfig.h"
#ifdef TeX
void as_memerr(void)
{
fprintf(stderr,"Insufficient memory for TeX - alter " configname "\n");
uexit(error_message_issued);
}
#elif defined (MF) /* Not TeX, MetaFont or MetaPost */
void as_memerr(void)
{
fprintf(stderr,"Insufficient memory for MetaFont - alter " configname "\n");
uexit(error_message_issued);
}
#else /* Not MetaFont, but MetaPost */
void as_memerr(void)
{
fprintf(stderr,"Insufficient memory for MetaPost - alter " configname "\n");
uexit(error_message_issued);
}
#endif /* MetaPost */
#define Alloc_Object(object,size,type) \
if (!(object=(type *)malloc((size)*sizeof(type)))) \
as_memerr()
#define Free_Object(A) if(A) free(A), A=NULL
void as_getsizes(void)
{
FILE *configfile;
char cmd[256],parm[256];
long val,index;
Alloc_Object ( nameoffile, PATHMAX + 1, char ) ;
vstrcpy ( nameoffile + 1 , configname ) ;
nameoffile [ 0 ] = ' ' ;
nameoffile [ strlen ( configname ) + 1 ] = ' ' ;
namelength = strlen ( configname ) ;
if ( aopenin ( configfile , CONFIGPATH ) )
{
while ( fgets(cmd, (size_t) 255, configfile) )
{
if ( strncmp(cmd, "set ", 4) == 0 )
{
if ( sscanf(cmd+4,"%s%d",parm,&val) == 2)
{
index = 0;
while ( index < AS_NP && strcmp(parm,as_param[index].pname) ) index++;
if ( index >= AS_NP )
{
fprintf(stderr,"Warning: unknown config option \"%s\" ignored\n",
parm);
}
else
{
as_param[index].pval=val;
}
}
}
}
aclose (configfile);
}
Free_Object ( nameoffile ) ;
#ifdef DEBUG
for (index = 0 ; index < AS_NP ; index++ )
fprintf(stderr, "%d\n", as_param[index].pval);
#endif
}
#ifdef TeX
void as_alloc_memory(void)
{
Alloc_Object(xord, 256, ASCIIcode);
Alloc_Object(xchr, 256, ASCIIcode);
Alloc_Object(nameoffile, PATHMAX + 1, char);
Alloc_Object(buffer, bufsize + 1, ASCIIcode);
Alloc_Object(strpool, poolsize + 1, packedASCIIcode);
Alloc_Object(strstart, maxstrings + 1, poolpointer);
Alloc_Object(dig, 23, char);
Alloc_Object(trickbuf, errorline + 1, ASCIIcode);
Alloc_Object(helpline, 6, strnumber);
Alloc_Object(zzzaa, memmax - memmin + 1, memoryword);
#ifdef DEBUG
Alloc_Object(zzzab, memmax - memmin + 1, boolean);
Alloc_Object(zzzac, memmax - memmin + 1, boolean);
#endif /* DEBUG */
Alloc_Object(nest, nestsize + 1, liststaterecord);
Alloc_Object(zeqtb, hashsize + 4007, memoryword); /* See texmemory.ch. */
Alloc_Object(zzzad, 844, quarterword); /* Seems to be a constant relation. */
Alloc_Object(zzzae, hashsize + 267, twohalves); /* See texmemory.ch. */
Alloc_Object(savestack, savesize + 1, memoryword);
Alloc_Object(inputstack, stacksize + 1, instaterecord);
Alloc_Object(inputfile, maxinopen + 1, alphafile);
Alloc_Object(linestack, maxinopen + 1, integer);
Alloc_Object(paramstack, paramsize + 1, halfword);
Alloc_Object(curmark, 5, halfword);
Alloc_Object(pstack, 9, halfword);
Alloc_Object(readfile, 16, alphafile);
Alloc_Object(readopen, 17, char);
Alloc_Object(fontinfo, fontmemsize + 1, memoryword);
Alloc_Object(fontcheck, fontmax + 1, fourquarters);
Alloc_Object(fontsize, fontmax + 1, scaled);
Alloc_Object(fontdsize, fontmax + 1, scaled);
Alloc_Object(fontparams, fontmax + 1, halfword);
Alloc_Object(fontname, fontmax + 1, strnumber);
Alloc_Object(fontarea, fontmax + 1, strnumber);
Alloc_Object(fontbc, fontmax + 1, eightbits);
Alloc_Object(fontec, fontmax + 1, eightbits);
Alloc_Object(fontglue, fontmax + 1, halfword);
Alloc_Object(fontused, fontmax + 1, boolean);
Alloc_Object(hyphenchar, fontmax + 1, integer);
Alloc_Object(skewchar, fontmax + 1, integer);
Alloc_Object(bcharlabel, fontmax + 1, fontindex);
Alloc_Object(fontbchar, fontmax + 1, short);
Alloc_Object(fontfalsebchar, fontmax + 1, short);
Alloc_Object(charbase, fontmax + 1, integer);
Alloc_Object(widthbase, fontmax + 1, integer);
Alloc_Object(heightbase, fontmax + 1, integer);
Alloc_Object(depthbase, fontmax + 1, integer);
Alloc_Object(italicbase, fontmax + 1, integer);
Alloc_Object(ligkernbase, fontmax + 1, integer);
Alloc_Object(kernbase, fontmax + 1, integer);
Alloc_Object(extenbase, fontmax + 1, integer);
Alloc_Object(parambase, fontmax + 1, integer);
Alloc_Object(dvibuf, dvibufsize + 1, eightbits);
Alloc_Object(totalstretch, 4, scaled);
Alloc_Object(totalshrink, 4, scaled);
Alloc_Object(activewidth, 7, scaled);
Alloc_Object(curactivewidth, 7, scaled);
Alloc_Object(background, 7, scaled);
Alloc_Object(breakwidth, 7, scaled);
Alloc_Object(minimaldemerits, 4, integer);
Alloc_Object(bestplace, 4, halfword);
Alloc_Object(bestplline, 4, halfword);
Alloc_Object(hc, 66, short);
Alloc_Object(hu, 64, short);
Alloc_Object(hyf, 65, char);
Alloc_Object(trietrl, triesize + 1, halfword);
Alloc_Object(trietro, triesize + 1, halfword);
Alloc_Object(trietrc, triesize + 1, quarterword);
Alloc_Object(hyfdistance, trieopsize + 1, smallnumber);
Alloc_Object(hyfnum, trieopsize + 1, smallnumber);
Alloc_Object(hyfnext, trieopsize + 1, trieopcode);
Alloc_Object(opstart, 256, integer);
Alloc_Object(hyphword, hyphsize + 1, strnumber); /* See texmemory.ch. */
Alloc_Object(hyphlist, hyphsize + 1, halfword); /* See texmemory.ch. */
#ifdef INITEX
Alloc_Object(zzzaf, trieopsize - negtrieopsize + 1, integer);
Alloc_Object(trieused, 256, trieopcode);
Alloc_Object(trieoplang, trieopsize + 1, ASCIIcode);
Alloc_Object(trieopval, trieopsize + 1, trieopcode);
Alloc_Object(triec, triesize + 1, packedASCIIcode);
Alloc_Object(trieo, triesize + 1, trieopcode);
Alloc_Object(triel, triesize + 1, triepointer);
Alloc_Object(trier, triesize + 1, triepointer);
Alloc_Object(triehash, triesize + 1, triepointer);
Alloc_Object(trietaken, triesize + 1, boolean);
Alloc_Object(triemin, 256, triepointer);
#endif /* INITEX */
Alloc_Object(pagesofar, 8, scaled);
Alloc_Object(writefile, 16, alphafile);
Alloc_Object(writeopen, 18, boolean);
}
void as_free_memory(void)
{
Free_Object(writeopen);
Free_Object(writefile);
Free_Object(pagesofar);
#ifdef INITEX
Free_Object(triemin);
Free_Object(trietaken);
Free_Object(triehash);
Free_Object(trier);
Free_Object(triel);
Free_Object(trieo);
Free_Object(triec);
Free_Object(trieopval);
Free_Object(trieoplang);
Free_Object(trieused);
Free_Object(zzzaf);
#endif /* INITEX */
Free_Object(hyphlist);
Free_Object(hyphword);
Free_Object(opstart);
Free_Object(hyfnext);
Free_Object(hyfnum);
Free_Object(hyfdistance);
Free_Object(trietrc);
Free_Object(trietro);
Free_Object(trietrl);
Free_Object(hyf);
Free_Object(hu);
Free_Object(hc);
Free_Object(bestplline);
Free_Object(bestplace);
Free_Object(minimaldemerits);
Free_Object(breakwidth);
Free_Object(background);
Free_Object(curactivewidth);
Free_Object(activewidth);
Free_Object(totalshrink);
Free_Object(totalstretch);
Free_Object(dvibuf);
Free_Object(parambase);
Free_Object(extenbase);
Free_Object(kernbase);
Free_Object(ligkernbase);
Free_Object(italicbase);
Free_Object(depthbase);
Free_Object(heightbase);
Free_Object(widthbase);
Free_Object(charbase);
Free_Object(fontfalsebchar);
Free_Object(fontbchar);
Free_Object(bcharlabel);
Free_Object(skewchar);
Free_Object(hyphenchar);
Free_Object(fontused);
Free_Object(fontglue);
Free_Object(fontec);
Free_Object(fontbc);
Free_Object(fontarea);
Free_Object(fontname);
Free_Object(fontparams);
Free_Object(fontdsize);
Free_Object(fontsize);
Free_Object(fontcheck);
Free_Object(fontinfo);
Free_Object(readopen);
Free_Object(readfile);
Free_Object(pstack);
Free_Object(curmark);
Free_Object(paramstack);
Free_Object(linestack);
Free_Object(inputfile);
Free_Object(inputstack);
Free_Object(savestack);
Free_Object(zzzae);
Free_Object(zzzad);
Free_Object(zeqtb);
Free_Object(nest);
#ifdef DEBUG
Free_Object(zzzac);
Free_Object(zzzab);
#endif /* DEBUG */
Free_Object(zzzaa);
Free_Object(helpline);
Free_Object(trickbuf);
Free_Object(dig);
Free_Object(strstart);
Free_Object(strpool);
Free_Object(buffer);
Free_Object(nameoffile);
Free_Object(xchr);
Free_Object(xord);
}
#elif defined (MF) /* Not TeX, MetaFont or MetaPost */
void as_alloc_memory(void)
{
Alloc_Object(xord, 256, ASCIIcode);
Alloc_Object(xchr, 256, ASCIIcode);
Alloc_Object(nameoffile, PATHMAX + 1, char);
Alloc_Object(buffer, bufsize + 1, ASCIIcode);
Alloc_Object(strpool, poolsize + 1, packedASCIIcode);
Alloc_Object(strstart, maxstrings + 1, poolpointer);
Alloc_Object(strref, maxstrings + 1, char);
Alloc_Object(dig, 23, char);
Alloc_Object(trickbuf, errorline + 1, ASCIIcode);
Alloc_Object(helpline, 6, strnumber);
Alloc_Object(twotothe, 31, integer);
Alloc_Object(speclog, 29, integer);
Alloc_Object(specatan, 27, angle);
Alloc_Object(randoms, 55, fraction);
Alloc_Object(mem, memmax + 1, memoryword);
#ifdef DEBUG
Alloc_Object(freearr, memmax + 1, boolean);
Alloc_Object(wasfree, memmax + 1, boolean);
#endif /* DEBUG */
Alloc_Object(internal, maxinternal + 1, scaled);
Alloc_Object(intname, maxinternal + 1, strnumber);
Alloc_Object(charclass, 256, char);
Alloc_Object(hash, 270 + hashsize, twohalves); /* See `mfmemory.ch'. */
Alloc_Object(eqtb, 270 + hashsize, twohalves); /* See `mfmemory.ch'. */
Alloc_Object(zzzaa, 2, smallnumber);
Alloc_Object(deltax, pathsize + 1, scaled);
Alloc_Object(deltay, pathsize + 1, scaled);
Alloc_Object(delta, pathsize + 1, scaled);
Alloc_Object(psi, pathsize + 1, angle);
Alloc_Object(theta, pathsize + 1, angle);
Alloc_Object(uu, pathsize + 1, fraction);
Alloc_Object(vv, pathsize + 1, angle);
Alloc_Object(ww, pathsize + 1, fraction);
Alloc_Object(move, movesize + 1, integer);
Alloc_Object(bisectstack, bistacksize + 1, integer);
Alloc_Object(octantdir, 9, strnumber);
Alloc_Object(before, maxwiggle + 1, scaled);
Alloc_Object(after, maxwiggle + 1, scaled);
Alloc_Object(nodetoround, maxwiggle + 1, halfword);
Alloc_Object(octantnumber, 9, char);
Alloc_Object(octantcode, 9, char);
Alloc_Object(ycorr, 9, char);
Alloc_Object(xycorr, 9, char);
Alloc_Object(zcorr, 9, char);
Alloc_Object(xcorr, 9, schar);
Alloc_Object(envmove, movesize + 1, integer);
Alloc_Object(windowopen, 16, boolean);
Alloc_Object(leftcol, 16, screencol);
Alloc_Object(rightcol, 16, screencol);
Alloc_Object(toprow, 16, screenrow);
Alloc_Object(botrow, 16, screenrow);
Alloc_Object(mwindow, 16, integer);
Alloc_Object(nwindow, 16, integer);
Alloc_Object(windowtime, 16, integer);
Alloc_Object(rowtransition, screenwidth + 1, screencol);
Alloc_Object(inputstack, stacksize + 1, instaterecord);
Alloc_Object(inputfile, maxinopen + 1, alphafile);
Alloc_Object(linestack, maxinopen + 1, integer);
Alloc_Object(paramstack, paramsize + 1, halfword);
Alloc_Object(zzzab, 2, integer);
Alloc_Object(zzzac, 2, halfword);
Alloc_Object(zzzad, 2, halfword);
Alloc_Object(tfmwidth, 256, scaled);
Alloc_Object(tfmheight, 256, scaled);
Alloc_Object(tfmdepth, 256, scaled);
Alloc_Object(tfmitalcorr, 256, scaled);
Alloc_Object(charexists, 256, boolean);
Alloc_Object(chartag, 256, char);
Alloc_Object(charremainder, 256, integer);
Alloc_Object(headerbyte, headersize + 1, short);
Alloc_Object(ligkern, ligtablesize + 1, fourquarters);
Alloc_Object(kern, maxkerns + 1, scaled);
Alloc_Object(exten, 256, fourquarters);
Alloc_Object(param, maxfontdimen + 1, scaled);
Alloc_Object(skiptable, 256, integer);
Alloc_Object(labelloc, 257, integer);
Alloc_Object(labelchar, 257, eightbits);
Alloc_Object(dimenhead, 5, halfword);
Alloc_Object(charptr, 256, integer);
Alloc_Object(gfdx, 256, integer);
Alloc_Object(gfdy, 256, integer);
Alloc_Object(gfbuf, gfbufsize + 1, eightbits);
}
void as_free_memory(void)
{
Free_Object(gfbuf);
Free_Object(gfdy);
Free_Object(gfdx);
Free_Object(charptr);
Free_Object(dimenhead);
Free_Object(labelchar);
Free_Object(labelloc);
Free_Object(skiptable);
Free_Object(param);
Free_Object(exten);
Free_Object(kern);
Free_Object(ligkern);
Free_Object(headerbyte);
Free_Object(charremainder);
Free_Object(chartag);
Free_Object(charexists);
Free_Object(tfmitalcorr);
Free_Object(tfmdepth);
Free_Object(tfmheight);
Free_Object(tfmwidth);
Free_Object(zzzad);
Free_Object(zzzac);
Free_Object(zzzab);
Free_Object(paramstack);
Free_Object(linestack);
Free_Object(inputfile);
Free_Object(inputstack);
Free_Object(rowtransition);
Free_Object(windowtime);
Free_Object(nwindow);
Free_Object(mwindow);
Free_Object(botrow);
Free_Object(toprow);
Free_Object(rightcol);
Free_Object(leftcol);
Free_Object(windowopen);
Free_Object(envmove);
Free_Object(xcorr);
Free_Object(zcorr);
Free_Object(xycorr);
Free_Object(ycorr);
Free_Object(octantcode);
Free_Object(octantnumber);
Free_Object(nodetoround);
Free_Object(after);
Free_Object(before);
Free_Object(octantdir);
Free_Object(bisectstack);
Free_Object(move);
Free_Object(ww);
Free_Object(vv);
Free_Object(uu);
Free_Object(theta);
Free_Object(psi);
Free_Object(delta);
Free_Object(deltay);
Free_Object(deltax);
Free_Object(zzzaa);
Free_Object(eqtb);
Free_Object(hash);
Free_Object(charclass);
Free_Object(intname);
Free_Object(internal);
#ifdef DEBUG
Free_Object(wasfree);
Free_Object(freearr);
#endif /* DEBUG */
Free_Object(mem);
Free_Object(randoms);
Free_Object(specatan);
Free_Object(speclog);
Free_Object(twotothe);
Free_Object(helpline);
Free_Object(trickbuf);
Free_Object(dig);
Free_Object(strref);
Free_Object(strstart);
Free_Object(strpool);
Free_Object(buffer);
Free_Object(nameoffile);
Free_Object(xchr);
Free_Object(xord);
}
#else /* Not MetaFont, but MetaPost */
void as_alloc_memory(void)
{
Alloc_Object(xord, 256, ASCIIcode);
Alloc_Object(xchr, 256, char);
Alloc_Object(nameoffile, PATHMAX + 1, char);
Alloc_Object(buffer, bufsize + 1, ASCIIcode);
Alloc_Object(strpool, poolsize + 1, poolASCIIcode);
Alloc_Object(strstart, maxstrings + 1, poolpointer);
Alloc_Object(nextstr, maxstrings + 1, strnumber);
Alloc_Object(strref, maxstrings + 1, char);
Alloc_Object(dig, 23, char);
Alloc_Object(trickbuf, errorline + 1, ASCIIcode);
Alloc_Object(helpline, 6, strnumber);
Alloc_Object(twotothe, 31, integer);
Alloc_Object(speclog, 29, integer);
Alloc_Object(specatan, 27, angle);
Alloc_Object(randoms, 55, fraction);
Alloc_Object(mem, memmax + 1, memoryword);
#ifdef DEBUG
Alloc_Object(freearr, memmax + 1, boolean);
Alloc_Object(wasfree, memmax + 1, boolean);
#endif /* DEBUG */
Alloc_Object(internal, maxinternal + 1, scaled);
Alloc_Object(intname, maxinternal + 1, strnumber);
Alloc_Object(charclass, 256, char);
Alloc_Object(hash, hashsize + 272, twohalves);
Alloc_Object(eqtb, hashsize + 272, twohalves);
Alloc_Object(zzzaa, 3, smallnumber);
Alloc_Object(zzzab, 3, smallnumber);
Alloc_Object(zzzac, 9, smallnumber);
Alloc_Object(deltax, pathsize + 1, scaled);
Alloc_Object(deltay, pathsize + 1, scaled);
Alloc_Object(delta, pathsize + 1, scaled);
Alloc_Object(psi, pathsize + 1, angle);
Alloc_Object(theta, pathsize + 1, angle);
Alloc_Object(uu, pathsize + 1, fraction);
Alloc_Object(vv, pathsize + 1, angle);
Alloc_Object(ww, pathsize + 1, fraction);
Alloc_Object(bbmin, 2, scaled);
Alloc_Object(bbmax, 2, scaled);
Alloc_Object(halfcos, 8, fraction);
Alloc_Object(dcos, 8, fraction);
Alloc_Object(grobjectsize, 8, smallnumber);
Alloc_Object(bisectstack, bistacksize + 1, integer);
Alloc_Object(inputstack, stacksize + 1, instaterecord);
Alloc_Object(inputfile, maxinopen + 1, alphafile);
Alloc_Object(linestack, maxinopen + 1, integer);
Alloc_Object(inamestack, maxinopen + 1, strnumber);
Alloc_Object(iareastack, maxinopen + 1, strnumber);
Alloc_Object(mpxname, maxinopen + 1, halfword);
Alloc_Object(paramstack, paramsize + 1, halfword);
Alloc_Object(MPmemdefault, 10, char);
Alloc_Object(oldfilename, PATHMAX + 1, char);
Alloc_Object(rdfile, maxreadfiles + 1, alphafile);
Alloc_Object(rdfname, maxreadfiles + 1, strnumber);
Alloc_Object(wrfile, maxwritefiles + 1, alphafile);
Alloc_Object(wrfname, maxwritefiles + 1, strnumber);
Alloc_Object(zzzad, 2, integer);
Alloc_Object(zzzae, 2, halfword);
Alloc_Object(zzzaf, 2, halfword);
Alloc_Object(tfmwidth, 256, scaled);
Alloc_Object(tfmheight, 256, scaled);
Alloc_Object(tfmdepth, 256, scaled);
Alloc_Object(tfmitalcorr, 256, scaled);
Alloc_Object(charexists, 256, boolean);
Alloc_Object(chartag, 256, char);
Alloc_Object(charremainder, 256, integer);
Alloc_Object(headerbyte, headersize + 1, short);
Alloc_Object(ligkern, ligtablesize + 1, fourquarters);
Alloc_Object(kern, maxkerns + 1, scaled);
Alloc_Object(exten, 256, fourquarters);
Alloc_Object(param, maxfontdimen + 1, scaled);
Alloc_Object(skiptable, 256, integer);
Alloc_Object(labelloc, 257, integer);
Alloc_Object(labelchar, 257, eightbits);
Alloc_Object(dimenhead, 5, halfword);
Alloc_Object(fontinfo, fontmemsize + 1, memoryword);
Alloc_Object(fontdsize, fontmax + 1, scaled);
Alloc_Object(fontname, fontmax + 1, strnumber);
Alloc_Object(fontpsname, fontmax + 1, strnumber);
Alloc_Object(fontbc, fontmax + 1, eightbits);
Alloc_Object(fontec, fontmax + 1, eightbits);
Alloc_Object(charbase, fontmax + 1, integer);
Alloc_Object(widthbase, fontmax + 1, integer);
Alloc_Object(heightbase, fontmax + 1, integer);
Alloc_Object(depthbase, fontmax + 1, integer);
Alloc_Object(fontsizes, fontmax + 1, halfword);
Alloc_Object(curfsize, fontmax + 1, halfword);
}
void as_free_memory(void)
{
Free_Object(curfsize);
Free_Object(fontsizes);
Free_Object(depthbase);
Free_Object(heightbase);
Free_Object(widthbase);
Free_Object(charbase);
Free_Object(fontec);
Free_Object(fontbc);
Free_Object(fontpsname);
Free_Object(fontname);
Free_Object(fontdsize);
Free_Object(fontinfo);
Free_Object(dimenhead);
Free_Object(labelchar);
Free_Object(labelloc);
Free_Object(skiptable);
Free_Object(param);
Free_Object(exten);
Free_Object(kern);
Free_Object(ligkern);
Free_Object(headerbyte);
Free_Object(charremainder);
Free_Object(chartag);
Free_Object(charexists);
Free_Object(tfmitalcorr);
Free_Object(tfmdepth);
Free_Object(tfmheight);
Free_Object(tfmwidth);
Free_Object(zzzaf);
Free_Object(zzzae);
Free_Object(zzzad);
Free_Object(wrfname);
Free_Object(wrfile);
Free_Object(rdfname);
Free_Object(rdfile);
Free_Object(oldfilename);
Free_Object(MPmemdefault);
Free_Object(paramstack);
Free_Object(mpxname);
Free_Object(iareastack);
Free_Object(inamestack);
Free_Object(linestack);
Free_Object(inputfile);
Free_Object(inputstack);
Free_Object(bisectstack);
Free_Object(grobjectsize);
Free_Object(dcos);
Free_Object(halfcos);
Free_Object(bbmax);
Free_Object(bbmin);
Free_Object(ww);
Free_Object(vv);
Free_Object(uu);
Free_Object(theta);
Free_Object(psi);
Free_Object(delta);
Free_Object(deltay);
Free_Object(deltax);
Free_Object(zzzac);
Free_Object(zzzab);
Free_Object(zzzaa);
Free_Object(eqtb);
Free_Object(hash);
Free_Object(charclass);
Free_Object(intname);
Free_Object(internal);
#ifdef DEBUG
Free_Object(wasfree);
Free_Object(freearr);
#endif /* DEBUG */
Free_Object(mem);
Free_Object(randoms);
Free_Object(specatan);
Free_Object(speclog);
Free_Object(twotothe);
Free_Object(helpline);
Free_Object(trickbuf);
Free_Object(dig);
Free_Object(strref);
Free_Object(nextstr);
Free_Object(strstart);
Free_Object(strpool);
Free_Object(buffer);
Free_Object(nameoffile);
Free_Object(xchr);
Free_Object(xord);
}
#endif /* MetaPost */
#endif /* VARMEM */
#ifdef MP
/****************************************************************
* The following code is needed by MetaPost but not MetaFont.
* It is copied from `mpext.c' and `site.h'.
*
* Here's the necessary legal stuff for this section:
****************************************************************/
/****************************************************************
Copyright 1990 - 1995 by AT&T Bell Laboratories.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the names of AT&T Bell Laboratories or
any of its entities not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission.
AT&T disclaims all warranties with regard to this software,
including all implied warranties of merchantability and fitness.
In no event shall AT&T be liable for any special, indirect or
consequential damages or any damages whatsoever resulting from
loss of use, data or profits, whether in an action of contract,
negligence or other tortious action, arising out of or in
connection with the use or performance of this software.
****************************************************************/
/*
* Command for translating MetaPost input to an mpx file
* (Can be overridden by an environment variable)
*/
#ifdef _AMIGA
#define MPXCOMMAND "rx ../mpware/makempx"
#define TROFFMPX "Sorry" /* No TROFF on Amiga */
#else
#define MPXCOMMAND "/usr/lib/mp/bin/makempx"
#define TROFFMPX "/usr/lib/mp/bin/troffmpx"
#endif
#define CMDLENGTH 300
/*
* Invoke makempx to make sure there is an up-to-date .mpx file
* for a given .mp file
*
* John Hobby 3/14/90
*/
boolean callmakempx(mpname, mpxname)
char *mpname, *mpxname;
{
char *cmd, *p, *q, *qlimit;
char buf[CMDLENGTH];
cmd = getenv("MPXCOMMAND");
if (cmd==NULL)
if (troffmode) cmd=TROFFMPX; else cmd=MPXCOMMAND;
q = buf;
qlimit = buf+CMDLENGTH-1;
for (p=cmd; *p!=0; p++)
if (q==qlimit) return 0; else *q++ = *p;
*q++ = ' ';
for (p=mpname+1; *p!=0 && *p!=' '; p++)
if (q==qlimit) return 0; else *q++ = *p;
*q++ = ' ';
for (p=mpxname+1; *p!=0 && *p!=' '; p++)
if (q==qlimit) return 0; else *q++ = *p;
*q = 0;
return system(buf)==0;
}
/****************************************************************
* End of MetaPost code. Switch back to standard disclaimer.
****************************************************************/
/* Read the Nth argument from the command line and return it in BUF as a
Pascal string, i.e., starting at index 1 and ending with a space. If
N is beyond the end of the command line, abort. */
/*
* CAVEAT UTILITOR: This `argv' implementation is DIFFERENT than
* the routine of the same name in the `main' module. It is a
* special edition for use with MetaPost only.
*/
void
argv P2C(int, n, string, buf)
{
if (n-1 >= argc) /* <= was `n>=argc' */
{
fprintf (stderr, "%s: Not enough arguments.\n", gargv[0]);
uexit (1);
}
strcpy (buf + 1, gargv[n-1]); /* <= was `gargv[n]' */
strcat (buf + 1, " ");
}
#endif /* MP */
@z