diff options
Diffstat (limited to 'Build/source/texk')
40 files changed, 5399 insertions, 5397 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index a41e05239c1..b24712b6605 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,5 +1,7 @@ 2010-03-28 Karl Berry <karl@tug.org> + * all files: no spaces before semicolons. + * loadfont.c, * tfmload.c, * virtualfont.c, diff --git a/Build/source/texk/dvipsk/afm2tfm.c b/Build/source/texk/dvipsk/afm2tfm.c index 8428ca53716..4c56b0091eb 100644 --- a/Build/source/texk/dvipsk/afm2tfm.c +++ b/Build/source/texk/dvipsk/afm2tfm.c @@ -55,9 +55,9 @@ #ifdef VMCMS #define interesting lookstr /* for 8 character truncation conflicts */ #include "dvipscms.h" -extern FILE *cmsfopen() ; -extern char ebcdic2ascii[] ; -extern char ascii2ebcdic[] ; +extern FILE *cmsfopen(); +extern char ebcdic2ascii[]; +extern char ascii2ebcdic[]; #ifdef fopen #undef fopen #endif @@ -72,9 +72,9 @@ extern FILE *fopen (); #endif struct encoding { - const char *name ; - const char *vec[256] ; -} ; + const char *name; + const char *vec[256]; +}; struct encoding staticencoding = { "TeX text", {"Gamma", "Delta", "Theta", "Lambda", "Xi", "Pi", "Sigma", @@ -98,202 +98,202 @@ struct encoding staticencoding = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "" } } ; + "", "", "", "", "", "", "" } }; /* * It's easier to put this in static storage and parse it as we go * than to build the structures ourselves. */ const char *staticligkern[] = { - "% LIGKERN space l =: lslash ; space L =: Lslash ;", - "% LIGKERN question quoteleft =: questiondown ;", - "% LIGKERN exclam quoteleft =: exclamdown ;", - "% LIGKERN hyphen hyphen =: endash ; endash hyphen =: emdash ;", - "% LIGKERN quoteleft quoteleft =: quotedblleft ;", - "% LIGKERN quoteright quoteright =: quotedblright ;", - "% LIGKERN space {} * ; * {} space ; zero {} * ; * {} zero ;", - "% LIGKERN one {} * ; * {} one ; two {} * ; * {} two ;", - "% LIGKERN three {} * ; * {} three ; four {} * ; * {} four ;", - "% LIGKERN five {} * ; * {} five ; six {} * ; * {} six ;", - "% LIGKERN seven {} * ; * {} seven ; eight {} * ; * {} eight ;", - "% LIGKERN nine {} * ; * {} nine ;", + "% LIGKERN space l =: lslash; space L =: Lslash;", + "% LIGKERN question quoteleft =: questiondown;", + "% LIGKERN exclam quoteleft =: exclamdown;", + "% LIGKERN hyphen hyphen =: endash; endash hyphen =: emdash;", + "% LIGKERN quoteleft quoteleft =: quotedblleft;", + "% LIGKERN quoteright quoteright =: quotedblright;", + "% LIGKERN space {} *; * {} space; zero {} *; * {} zero;", + "% LIGKERN one {} *; * {} one; two {} *; * {} two;", + "% LIGKERN three {} *; * {} three; four {} *; * {} four;", + "% LIGKERN five {} *; * {} five; six {} *; * {} six;", + "% LIGKERN seven {} *; * {} seven; eight {} *; * {} eight;", + "% LIGKERN nine {} *; * {} nine;", /* Kern accented characters the same way as their base. */ - "% LIGKERN Aacute <> A ; aacute <> a ;", - "% LIGKERN Acircumflex <> A ; acircumflex <> a ;", - "% LIGKERN Adieresis <> A ; adieresis <> a ;", - "% LIGKERN Agrave <> A ; agrave <> a ;", - "% LIGKERN Aring <> A ; aring <> a ;", - "% LIGKERN Atilde <> A ; atilde <> a ;", - "% LIGKERN Ccedilla <> C ; ccedilla <> c ;", - "% LIGKERN Eacute <> E ; eacute <> e ;", - "% LIGKERN Ecircumflex <> E ; ecircumflex <> e ;", - "% LIGKERN Edieresis <> E ; edieresis <> e ;", - "% LIGKERN Egrave <> E ; egrave <> e ;", - "% LIGKERN Iacute <> I ; iacute <> i ;", - "% LIGKERN Icircumflex <> I ; icircumflex <> i ;", - "% LIGKERN Idieresis <> I ; idieresis <> i ;", - "% LIGKERN Igrave <> I ; igrave <> i ;", - "% LIGKERN Ntilde <> N ; ntilde <> n ;", - "% LIGKERN Oacute <> O ; oacute <> o ;", - "% LIGKERN Ocircumflex <> O ; ocircumflex <> o ;", - "% LIGKERN Odieresis <> O ; odieresis <> o ;", - "% LIGKERN Ograve <> O ; ograve <> o ;", - "% LIGKERN Oslash <> O ; oslash <> o ;", - "% LIGKERN Otilde <> O ; otilde <> o ;", - "% LIGKERN Scaron <> S ; scaron <> s ;", - "% LIGKERN Uacute <> U ; uacute <> u ;", - "% LIGKERN Ucircumflex <> U ; ucircumflex <> u ;", - "% LIGKERN Udieresis <> U ; udieresis <> u ;", - "% LIGKERN Ugrave <> U ; ugrave <> u ;", - "% LIGKERN Yacute <> Y ; yacute <> y ;", - "% LIGKERN Ydieresis <> Y ; ydieresis <> y ;", - "% LIGKERN Zcaron <> Z ; zcaron <> z ;", + "% LIGKERN Aacute <> A; aacute <> a;", + "% LIGKERN Acircumflex <> A; acircumflex <> a;", + "% LIGKERN Adieresis <> A; adieresis <> a;", + "% LIGKERN Agrave <> A; agrave <> a;", + "% LIGKERN Aring <> A; aring <> a;", + "% LIGKERN Atilde <> A; atilde <> a;", + "% LIGKERN Ccedilla <> C; ccedilla <> c;", + "% LIGKERN Eacute <> E; eacute <> e;", + "% LIGKERN Ecircumflex <> E; ecircumflex <> e;", + "% LIGKERN Edieresis <> E; edieresis <> e;", + "% LIGKERN Egrave <> E; egrave <> e;", + "% LIGKERN Iacute <> I; iacute <> i;", + "% LIGKERN Icircumflex <> I; icircumflex <> i;", + "% LIGKERN Idieresis <> I; idieresis <> i;", + "% LIGKERN Igrave <> I; igrave <> i;", + "% LIGKERN Ntilde <> N; ntilde <> n;", + "% LIGKERN Oacute <> O; oacute <> o;", + "% LIGKERN Ocircumflex <> O; ocircumflex <> o;", + "% LIGKERN Odieresis <> O; odieresis <> o;", + "% LIGKERN Ograve <> O; ograve <> o;", + "% LIGKERN Oslash <> O; oslash <> o;", + "% LIGKERN Otilde <> O; otilde <> o;", + "% LIGKERN Scaron <> S; scaron <> s;", + "% LIGKERN Uacute <> U; uacute <> u;", + "% LIGKERN Ucircumflex <> U; ucircumflex <> u;", + "% LIGKERN Udieresis <> U; udieresis <> u;", + "% LIGKERN Ugrave <> U; ugrave <> u;", + "% LIGKERN Yacute <> Y; yacute <> y;", + "% LIGKERN Ydieresis <> Y; ydieresis <> y;", + "% LIGKERN Zcaron <> Z; zcaron <> z;", /* * These next are only included for deficient afm files that * have the lig characters but not the lig commands. */ - "% LIGKERN f i =: fi ; f l =: fl ; f f =: ff ; ff i =: ffi ;", - "% LIGKERN ff l =: ffl ;", - 0 } ; + "% LIGKERN f i =: fi; f l =: fl; f f =: ff; ff i =: ffi;", + "% LIGKERN ff l =: ffl;", + 0 }; /* * The above layout corresponds to TeX Typewriter Type and is compatible * with TeX Text because the position of ligatures is immaterial. */ -struct encoding *outencoding = 0 ; -struct encoding *inencoding = 0 ; +struct encoding *outencoding = 0; +struct encoding *inencoding = 0; char *outenname = NULL, *inenname = NULL;/* the file names for input and output encodings */ -int boundarychar = -1 ; /* the boundary character */ -int ignoreligkern ; /* do we look at ligkern info in the encoding? */ +int boundarychar = -1; /* the boundary character */ +int ignoreligkern; /* do we look at ligkern info in the encoding? */ /* * This is what we store Adobe data in. */ struct adobeinfo { - struct adobeinfo *next ; - int adobenum, texnum, width ; - const char *adobename ; - int llx, lly, urx, ury ; - struct lig *ligs ; - struct kern *kerns ; - struct adobeptr *kern_equivs ; - struct pcc *pccs ; - int wptr, hptr, dptr, iptr ; + struct adobeinfo *next; + int adobenum, texnum, width; + const char *adobename; + int llx, lly, urx, ury; + struct lig *ligs; + struct kern *kerns; + struct adobeptr *kern_equivs; + struct pcc *pccs; + int wptr, hptr, dptr, iptr; } *adobechars, *adobeptrs[256], *texptrs[256], - *uppercase[256], *lowercase[256] ; -int nexttex[256] ; /* for characters encoded multiple times in output */ + *uppercase[256], *lowercase[256]; +int nexttex[256]; /* for characters encoded multiple times in output */ /* * These are the eight ligature ops, in VPL terms and in METAFONT terms. */ const char *vplligops[] = { "LIG", "/LIG", "/LIG>", "LIG/", "LIG/>", "/LIG/", "/LIG/>", "/LIG/>>", 0 -} ; +}; const char *encligops[] = { "=:", "|=:", "|=:>", "=:|", "=:|>", "|=:|", "|=:|>", "|=:|>>", 0 -} ; +}; struct lig { - struct lig *next ; - const char *succ, *sub ; - short op, boundleft ; -} ; + struct lig *next; + const char *succ, *sub; + short op, boundleft; +}; struct kern { - struct kern *next ; - const char *succ ; - int delta ; -} ; + struct kern *next; + const char *succ; + int delta; +}; struct adobeptr { struct adobeptr *next; struct adobeinfo *ch; }; struct pcc { - struct pcc *next ; - const char * partname ; - int xoffset, yoffset ; -} ; - -FILE *afmin, *vplout, *tfmout ; -char inname[200], outname[200] ; /* names of input and output files */ -char tmpstr[200] ; /* a buffer for one string */ + struct pcc *next; + const char * partname; + int xoffset, yoffset; +}; + +FILE *afmin, *vplout, *tfmout; +char inname[200], outname[200]; /* names of input and output files */ +char tmpstr[200]; /* a buffer for one string */ #define INBUFSIZE 1024 char buffer[INBUFSIZE+10]; /* input buffer (modified while parsing) */ -char obuffer[INBUFSIZE+10] ; /* unmodified copy of input buffer */ -char *param ; /* current position in input buffer */ -const char *fontname = "Unknown" ; -const char *codingscheme = "Unspecified" ; +char obuffer[INBUFSIZE+10]; /* unmodified copy of input buffer */ +char *param; /* current position in input buffer */ +const char *fontname = "Unknown"; +const char *codingscheme = "Unspecified"; #ifdef VMCMS -char *ebfontname ; -char *ebcodingscheme ; +char *ebfontname; +char *ebcodingscheme; #endif -float italicangle = 0.0 ; -char fixedpitch ; -char makevpl ; -char pedantic ; -int xheight = 400 ; -int fontspace ; -int bc, ec ; -long cksum ; -float efactor = 1.0, slant = 0.0 ; -float capheight = 0.8 ; -char *efactorparam, *slantparam ; -double newslant ; -char titlebuf[500] ; +float italicangle = 0.0; +char fixedpitch; +char makevpl; +char pedantic; +int xheight = 400; +int fontspace; +int bc, ec; +long cksum; +float efactor = 1.0, slant = 0.0; +float capheight = 0.8; +char *efactorparam, *slantparam; +double newslant; +char titlebuf[500]; static void error(const char *s) { - (void)fprintf(stderr, "%s\n", s) ; + (void)fprintf(stderr, "%s\n", s); if (obuffer[0]) { - (void)fprintf(stderr, "%s\n", obuffer) ; + (void)fprintf(stderr, "%s\n", obuffer); while (param > buffer) { - (void)fprintf(stderr, " ") ; - param-- ; + (void)fprintf(stderr, " "); + param--; } - (void)fprintf(stderr, "^\n") ; + (void)fprintf(stderr, "^\n"); } if (*s == '!') - exit(1) ; + exit(1); } static int transform(register int x, register int y) { - register double acc ; - acc = efactor * x + slant *y ; - return (int)(acc>=0? floor(acc+0.5) : ceil(acc-0.5) ) ; + register double acc; + acc = efactor * x + slant *y; + return (int)(acc>=0? floor(acc+0.5) : ceil(acc-0.5) ); } static int texlive_getline(void) { - register char *p ; - register int c ; + register char *p; + register int c; - param = buffer ; + param = buffer; for (p=buffer; (c=getc(afmin)) != EOF;) { if (p - buffer >= INBUFSIZE) - error("! input line too long; perhaps input file is malformed?") ; - *p++ = c ; + error("! input line too long; perhaps input file is malformed?"); + *p++ = c; if (c == '\r') { - c = getc(afmin) ; + c = getc(afmin); if (c != EOF) { if (c == '\n') { - *p++ = c ; + *p++ = c; } else { - ungetc(c, afmin) ; + ungetc(c, afmin); } } - break ; + break; } else if (c == '\n') { - break ; + break; } } - *p = 0 ; - (void)strcpy(obuffer, buffer) ; + *p = 0; + (void)strcpy(obuffer, buffer); if (p == buffer && c == EOF) - return(0) ; + return(0); else - return(1) ; + return(1); } const char *interesting[] = { "FontName", "ItalicAngle", "IsFixedPitch", - "XHeight", "C", "KPX", "CC", "EncodingScheme", NULL} ; + "XHeight", "C", "KPX", "CC", "EncodingScheme", NULL}; #define FontName (0) #define ItalicAngle (1) #define IsFixedPitch (2) @@ -306,220 +306,220 @@ const char *interesting[] = { "FontName", "ItalicAngle", "IsFixedPitch", static int interest(const char *s) { - register const char **p ; - register int n ; + register const char **p; + register int n; for (p=interesting, n=0; *p; p++, n++) if (strcmp(s, *p)==0) - return(n) ; - return(NONE) ; + return(n); + return(NONE); } static char * mymalloc(unsigned long len) { - register char *p ; - int i ; + register char *p; + int i; #ifdef SMALLMALLOC if (len > 65500L) - error("! can't allocate more than 64K!") ; + error("! can't allocate more than 64K!"); #endif - p = (char *) malloc((unsigned)len) ; + p = (char *) malloc((unsigned)len); if (p==NULL) - error("! out of memory") ; + error("! out of memory"); for (i=0; i<len; i++) - p[i] = 0 ; - return(p) ; + p[i] = 0; + return(p); } static char * newstring(char *s) { - char *q = mymalloc((unsigned long)(strlen(s) + 1)) ; - (void)strcpy(q, s) ; - return q ; + char *q = mymalloc((unsigned long)(strlen(s) + 1)); + (void)strcpy(q, s); + return q; } static char * paramnewstring(void) { - register char *p, *q ; + register char *p, *q; - p = param ; + p = param; while (*p > ' ') - p++ ; + p++; if (*p != 0) - *p++ = 0 ; - q = newstring(param) ; + *p++ = 0; + q = newstring(param); while (*p && *p <= ' ') - p++ ; - param = p ; - return(q) ; + p++; + param = p; + return(q); } static char * paramstring(void) { - register char *p, *q ; + register char *p, *q; - p = param ; + p = param; while (*p > ' ') - p++ ; - q = param ; + p++; + q = param; if (*p != 0) - *p++ = 0 ; + *p++ = 0; while (*p && *p <= ' ') - p++ ; - param = p ; - return(q) ; + p++; + param = p; + return(q); } static int paramnum(void) { - register char *p ; - int i ; + register char *p; + int i; - p = paramstring() ; + p = paramstring(); if (sscanf(p, "%d", &i) != 1) - error("! integer expected") ; - return(i) ; + error("! integer expected"); + return(i); } static float paramfloat(void) { - register char *p ; - float i ; + register char *p; + float i; - p = paramstring() ; + p = paramstring(); if (sscanf(p, "%f", &i) != 1) - error("! number expected") ; - return(i) ; + error("! number expected"); + return(i); } static struct adobeinfo * newchar(void) { - register struct adobeinfo *ai ; - - ai = (struct adobeinfo *)mymalloc((unsigned long)sizeof(struct adobeinfo)) ; - ai->adobenum = -1 ; - ai->texnum = -1 ; - ai->width = -1 ; - ai->adobename = NULL ; - ai->llx = -1 ; - ai->lly = -1 ; - ai->urx = -1 ; - ai->ury = -1 ; - ai->ligs = NULL ; - ai->kerns = NULL ; - ai->kern_equivs = NULL ; - ai->pccs = NULL ; - ai->next = adobechars ; - adobechars = ai ; - return(ai) ; + register struct adobeinfo *ai; + + ai = (struct adobeinfo *)mymalloc((unsigned long)sizeof(struct adobeinfo)); + ai->adobenum = -1; + ai->texnum = -1; + ai->width = -1; + ai->adobename = NULL; + ai->llx = -1; + ai->lly = -1; + ai->urx = -1; + ai->ury = -1; + ai->ligs = NULL; + ai->kerns = NULL; + ai->kern_equivs = NULL; + ai->pccs = NULL; + ai->next = adobechars; + adobechars = ai; + return(ai); } static struct kern * newkern(void) { - register struct kern *nk ; + register struct kern *nk; - nk = (struct kern *)mymalloc((unsigned long)sizeof(struct kern)) ; - nk->next = NULL ; - nk->succ = NULL ; - nk->delta = 0 ; - return(nk) ; + nk = (struct kern *)mymalloc((unsigned long)sizeof(struct kern)); + nk->next = NULL; + nk->succ = NULL; + nk->delta = 0; + return(nk); } static struct pcc * newpcc(void) { - register struct pcc *np ; - - np = (struct pcc *)mymalloc((unsigned long)sizeof(struct pcc)) ; - np->next = NULL ; - np->partname = NULL ; - np->xoffset = 0 ; - np->yoffset = 0 ; - return(np) ; + register struct pcc *np; + + np = (struct pcc *)mymalloc((unsigned long)sizeof(struct pcc)); + np->next = NULL; + np->partname = NULL; + np->xoffset = 0; + np->yoffset = 0; + return(np); } static struct lig * newlig(void) { - register struct lig *nl ; - - nl = (struct lig *)mymalloc((unsigned long)sizeof(struct lig)) ; - nl->next = NULL ; - nl->succ = NULL ; - nl->sub = NULL ; - nl->op = 0 ; /* the default =: op */ - nl->boundleft = 0 ; - return(nl) ; + register struct lig *nl; + + nl = (struct lig *)mymalloc((unsigned long)sizeof(struct lig)); + nl->next = NULL; + nl->succ = NULL; + nl->sub = NULL; + nl->op = 0; /* the default =: op */ + nl->boundleft = 0; + return(nl); } static void expect(const char *s) { if (strcmp(paramstring(), s) != 0) { - (void)fprintf(stderr, "%s expected: ", s) ; - error("! syntax error") ; + (void)fprintf(stderr, "%s expected: ", s); + error("! syntax error"); } } static void handlechar(void) { /* an input line beginning with C */ - register struct adobeinfo *ai ; - register struct lig *nl ; - - ai = newchar() ; - ai->adobenum = paramnum() ; - expect(";") ; - expect("WX") ; - ai->width = transform(paramnum(),0) ; + register struct adobeinfo *ai; + register struct lig *nl; + + ai = newchar(); + ai->adobenum = paramnum(); + expect(";"); + expect("WX"); + ai->width = transform(paramnum(),0); if (ai->adobenum >= 0 && ai->adobenum < 256) { - adobeptrs[ai->adobenum] = ai ; + adobeptrs[ai->adobenum] = ai; } - expect(";") ; + expect(";"); /* Ignore vertical metrics information */ if (*param == 'W' && *(param + 1) == 'Y') { - expect("WY") ; - (void)paramnum() ; - expect(";") ; + expect("WY"); + (void)paramnum(); + expect(";"); } - expect("N") ; - ai->adobename = paramnewstring() ; - expect(";") ; - expect("B") ; - ai->llx = paramnum() ; - ai->lly = paramnum() ; - ai->llx = transform(ai->llx, ai->lly) ; - ai->urx = paramnum() ; - ai->ury = paramnum() ; - ai->urx = transform(ai->urx, ai->ury) ; + expect("N"); + ai->adobename = paramnewstring(); + expect(";"); + expect("B"); + ai->llx = paramnum(); + ai->lly = paramnum(); + ai->llx = transform(ai->llx, ai->lly); + ai->urx = paramnum(); + ai->ury = paramnum(); + ai->urx = transform(ai->urx, ai->ury); /* We need to avoid negative heights or depths. They break accents in math mode, among other things. */ if (ai->lly > 0) - ai->lly = 0 ; + ai->lly = 0; if (ai->ury < 0) - ai->ury = 0 ; - expect(";") ; + ai->ury = 0; + expect(";"); /* Now look for ligatures (which aren't present in fixedpitch fonts) */ while (*param == 'L' && !fixedpitch) { - expect("L") ; - nl = newlig() ; - nl->succ = paramnewstring() ; - nl->sub = paramnewstring() ; - nl->next = ai->ligs ; - ai->ligs = nl ; - expect(";") ; + expect("L"); + nl = newlig(); + nl->succ = paramnewstring(); + nl->sub = paramnewstring(); + nl->next = ai->ligs; + ai->ligs = nl; + expect(";"); } } static struct adobeinfo * findadobe(const char *p) { - register struct adobeinfo *ai ; + register struct adobeinfo *ai; for (ai=adobechars; ai; ai = ai->next) if (strcmp(p, ai->adobename)==0) - return(ai) ; - return(NULL) ; + return(ai); + return(NULL); } @@ -534,73 +534,73 @@ findadobe(const char *p) */ static void handlekern(void) { /* an input line beginning with KPX */ - register struct adobeinfo *ai ; - register char *p ; - register struct kern *nk ; + register struct adobeinfo *ai; + register char *p; + register struct kern *nk; - p = paramstring() ; - ai = findadobe(p) ; + p = paramstring(); + ai = findadobe(p); if (ai == NULL) - error("kern char not found") ; + error("kern char not found"); else { - nk = newkern() ; - nk->succ = paramnewstring() ; - nk->delta = transform(paramnum(),0) ; - nk->next = ai->kerns ; - ai->kerns = nk ; + nk = newkern(); + nk->succ = paramnewstring(); + nk->delta = transform(paramnum(),0); + nk->next = ai->kerns; + ai->kerns = nk; } } static void handleconstruct(void) { /* an input line beginning with CC */ - register struct adobeinfo *ai ; - register char *p ; - register struct pcc *np ; - register int n ; + register struct adobeinfo *ai; + register char *p; + register struct pcc *np; + register int n; struct pcc *npp = NULL; - p = paramstring() ; - ai = findadobe(p) ; + p = paramstring(); + ai = findadobe(p); if (ai == NULL) - error("! composite character name not found") ; - n = paramnum() ; - expect(";") ; + error("! composite character name not found"); + n = paramnum(); + expect(";"); while (n--) { - if (strcmp(paramstring(),"PCC") != 0) return ; + if (strcmp(paramstring(),"PCC") != 0) return; /* maybe I should expect("PCC") instead, but I'm playing it safe */ - np = newpcc() ; - np->partname = paramnewstring() ; - if (findadobe(np->partname)==NULL) return ; - np->xoffset = paramnum() ; - np->yoffset = paramnum() ; - np->xoffset = transform(np->xoffset, np->yoffset) ; - if (npp) npp->next = np ; - else ai->pccs = np ; - npp = np ; - expect(";") ; + np = newpcc(); + np->partname = paramnewstring(); + if (findadobe(np->partname)==NULL) return; + np->xoffset = paramnum(); + np->yoffset = paramnum(); + np->xoffset = transform(np->xoffset, np->yoffset); + if (npp) npp->next = np; + else ai->pccs = np; + npp = np; + expect(";"); } } -static struct encoding *readencoding(char *) ; +static struct encoding *readencoding(char *); #if 0 /* Not used */ static void makeaccentligs(void) { - register struct adobeinfo *ai, *aci ; - register char *p ; - register struct lig *nl ; + register struct adobeinfo *ai, *aci; + register char *p; + register struct lig *nl; for (ai=adobechars; ai; ai=ai->next) { - p = ai->adobename ; + p = ai->adobename; if (strlen(p)>2) if ((aci=findadobe(p+1)) && (aci->adobenum > 127)) { - nl = newlig() ; - nl->succ = mymalloc((unsigned long)2) ; - *(nl->succ + 1) = 0 ; - *(nl->succ) = *p ; - nl->sub = ai->adobename ; - nl->next = aci->ligs ; - aci->ligs = nl ; + nl = newlig(); + nl->succ = mymalloc((unsigned long)2); + *(nl->succ + 1) = 0; + *(nl->succ) = *p; + nl->sub = ai->adobename; + nl->next = aci->ligs; + aci->ligs = nl; } } } @@ -608,7 +608,7 @@ makeaccentligs(void) { static void readadobe(void) { - struct adobeinfo *ai ; + struct adobeinfo *ai; #ifdef VMCMS int i; #endif @@ -616,63 +616,63 @@ readadobe(void) { /* * We allocate a placeholder boundary char. */ - ai = newchar() ; - ai->adobenum = -1 ; - ai->adobename = "||" ; /* boundary character name */ + ai = newchar(); + ai->adobenum = -1; + ai->adobename = "||"; /* boundary character name */ while (texlive_getline()) { switch(interest(paramstring())) { case FontName: - fontname = paramnewstring() ; + fontname = paramnewstring(); #ifdef VMCMS /* fontname comes in as ebcdic but we need it asciified for tfm file so we save it in ebfontname and change it in fontname */ - ebfontname = newstring(fontname) ; + ebfontname = newstring(fontname); i=0; while(fontname[i] != '\0') { fontname[i]=ebcdic2ascii[fontname[i]]; i++; }; #endif - break ; + break; case EncodingScheme: - codingscheme = paramnewstring() ; + codingscheme = paramnewstring(); #ifdef VMCMS /* for codingscheme, we do the same as we did for fontname */ - ebcodingscheme = newstring(codingscheme) ; + ebcodingscheme = newstring(codingscheme); i=0; while(codingscheme[i] != '\0') { codingscheme[i]=ebcdic2ascii[codingscheme[i]]; i++; } #endif - break ; + break; case ItalicAngle: - italicangle = paramfloat() ; - break ; + italicangle = paramfloat(); + break; case IsFixedPitch: if (*param == 't' || *param == 'T') - fixedpitch = 1 ; + fixedpitch = 1; else - fixedpitch = 0 ; - break ; + fixedpitch = 0; + break; case XHeight: - xheight = paramnum() ; - break ; + xheight = paramnum(); + break; case C: - handlechar() ; - break ; + handlechar(); + break; case KPX: - handlekern() ; - break ; + handlekern(); + break; case CC: - handleconstruct() ; - break ; + handleconstruct(); + break; default: - break ; + break; } } - fclose(afmin) ; - afmin = 0 ; + fclose(afmin); + afmin = 0; } /* * Re-encode the adobe font. Assumes that the header file will @@ -681,31 +681,31 @@ default: static void handlereencoding(void) { if (inenname) { - int i ; - struct adobeinfo *ai ; - const char *p ; + int i; + struct adobeinfo *ai; + const char *p; - ignoreligkern = 1 ; - inencoding = readencoding(inenname) ; + ignoreligkern = 1; + inencoding = readencoding(inenname); for (i=0; i<256; i++) if (0 != (ai=adobeptrs[i])) { - ai->adobenum = -1 ; - adobeptrs[i] = NULL ; + ai->adobenum = -1; + adobeptrs[i] = NULL; } for (i=0; i<256; i++) { - p = inencoding->vec[i] ; + p = inencoding->vec[i]; if (p && *p && strcmp(p, ".notdef") != 0 && 0 != (ai = findadobe(p))) { - ai->adobenum = i ; - adobeptrs[i] = ai ; + ai->adobenum = i; + adobeptrs[i] = ai; } } - codingscheme = inencoding->name ; + codingscheme = inencoding->name; } - ignoreligkern = 0 ; + ignoreligkern = 0; if (outenname) { - outencoding = readencoding(outenname) ; + outencoding = readencoding(outenname); } else { - outencoding = readencoding((char *)0) ; + outencoding = readencoding((char *)0); } } @@ -718,24 +718,24 @@ handlereencoding(void) { static struct adobeinfo * revlist (struct adobeinfo *p) { - struct adobeinfo *q = 0, *t ; + struct adobeinfo *q = 0, *t; while (p) { - t = p->next ; - p->next = q ; - q = p ; - p = t ; + t = p->next; + p->next = q; + q = p; + p = t; } - return q ; + return q; } static void assignchars(void) { - register const char **p ; - register int i, j ; - register struct adobeinfo *ai, *pai ; - int nextfree = 128 ; - struct pcc *pcp ; + register const char **p; + register int i, j; + register struct adobeinfo *ai, *pai; + int nextfree = 128; + struct pcc *pcp; /* * First, we assign all those that match perfectly. @@ -744,12 +744,12 @@ assignchars(void) { if (*p && strcmp(*p, ".notdef") != 0 && (ai=findadobe(*p)) && (ai->adobenum >= 0 || ai->pccs != NULL)) { if (ai->texnum >= 0) - nexttex[i] = ai->texnum ; /* linked list */ - ai->texnum = i ; - texptrs[i] = ai ; + nexttex[i] = ai->texnum; /* linked list */ + ai->texnum = i; + texptrs[i] = ai; } if (pedantic) - return ; + return; /* * Next, we assign all the others, retaining the adobe positions, possibly * multiply assigning characters. Unless the output encoding was @@ -758,23 +758,23 @@ assignchars(void) { for (ai=adobechars; ai; ai=ai->next) if (ai->adobenum >= 0 && ai->adobenum <256 && ai->texnum < 0 && texptrs[ai->adobenum] == 0) { - ai->texnum = ai->adobenum ; - texptrs[ai->adobenum] = ai ; + ai->texnum = ai->adobenum; + texptrs[ai->adobenum] = ai; } /* * Finally, we map all remaining characters into free locations beginning * with 128, if we know how to construct those characters. We need to * make sure the component pieces are mapped. */ - adobechars = revlist(adobechars) ; + adobechars = revlist(adobechars); for (ai=adobechars; ai; ai=ai->next) if (ai->texnum<0 && (ai->adobenum>=0 || ai->pccs != NULL)) { while (texptrs[nextfree]) { - nextfree=(nextfree+1)&255 ; - if (nextfree==128) goto finishup ; /* all slots full */ + nextfree=(nextfree+1)&255; + if (nextfree==128) goto finishup; /* all slots full */ } - ai->texnum = nextfree ; - texptrs[nextfree] = ai ; + ai->texnum = nextfree; + texptrs[nextfree] = ai; } finishup: /* @@ -782,14 +782,14 @@ finishup: * components are not mapped, we unmap the composite character. */ for (i=0; i<256; i++) { - ai = texptrs[i] ; + ai = texptrs[i]; if (ai && ai->pccs != NULL && ai->texnum >= 0) { for (pcp = ai->pccs; pcp; pcp = pcp->next) { - pai = findadobe(pcp->partname) ; + pai = findadobe(pcp->partname); if (pai == NULL || pai->texnum < 0) { - texptrs[ai->texnum] = 0 ; - ai->texnum = -1 ; - break ; + texptrs[ai->texnum] = 0; + ai->texnum = -1; + break; } } } @@ -801,42 +801,42 @@ finishup: */ for (ai=adobechars; ai; ai=ai->next) if (ai->texnum >= 0 && ai->texnum < 256) { - j = -1 ; + j = -1; while (nexttex[ai->texnum] >= 0) { - i = nexttex[ai->texnum] ; - nexttex[ai->texnum] = j ; - j = ai->texnum ; - ai->texnum = i ; + i = nexttex[ai->texnum]; + nexttex[ai->texnum] = j; + j = ai->texnum; + ai->texnum = i; } - nexttex[ai->texnum] = j ; + nexttex[ai->texnum] = j; } } static void upmap(void) { /* Compute uppercase mapping, when making a small caps font */ - register struct adobeinfo *ai, *Ai ; - register const char *p ; - register char *q ; - register struct pcc *np, *nq ; - int i ; - char lwr[50] ; + register struct adobeinfo *ai, *Ai; + register const char *p; + register char *q; + register struct pcc *np, *nq; + int i; + char lwr[50]; /* JLH: changed some lines below to be ascii<->ebcdic independent any reason we don't use 'isupper'?. Looks like we should use isupper to me --karl. */ for (Ai=adobechars; Ai; Ai=Ai->next) { - p = Ai->adobename ; + p = Ai->adobename; if (isupper (*p)) { - q = lwr ; + q = lwr; for (; *p; p++) *q++ = TOLOWER (*p); *q = '\0'; /* changed this too! */ if (0 != (ai=findadobe(lwr))) { for (i = ai->texnum; i >= 0; i = nexttex[i]) - uppercase[i] = Ai ; + uppercase[i] = Ai; for (i = Ai->texnum; i >= 0; i = nexttex[i]) - lowercase[i] = ai ; + lowercase[i] = ai; } } } @@ -847,28 +847,28 @@ upmap(void) { /* Compute uppercase mapping, when making a small caps font */ if (0 != (ai=findadobe("germandbls"))) if (0 != (Ai=findadobe("S"))) { /* we also construct SS */ for (i=ai->texnum; i >= 0; i = nexttex[i]) - uppercase[i] = ai ; - ai->adobenum = -1 ; - ai->width = Ai->width << 1 ; - ai->llx = Ai->llx ; - ai->lly = Ai->lly ; - ai->urx = Ai->width + Ai->urx ; - ai->ury = Ai->ury ; - ai->kerns = Ai->kerns ; - np = newpcc() ; - np->partname = "S" ; - nq = newpcc() ; - nq->partname = "S" ; - nq->xoffset = Ai->width ; - np->next = nq ; - ai->pccs = np ; + uppercase[i] = ai; + ai->adobenum = -1; + ai->width = Ai->width << 1; + ai->llx = Ai->llx; + ai->lly = Ai->lly; + ai->urx = Ai->width + Ai->urx; + ai->ury = Ai->ury; + ai->kerns = Ai->kerns; + np = newpcc(); + np->partname = "S"; + nq = newpcc(); + nq->partname = "S"; + nq->xoffset = Ai->width; + np->next = nq; + ai->pccs = np; } if ((ai=findadobe("dotlessi"))) for (i=ai->texnum; i >= 0; i = nexttex[i]) - uppercase[i] = findadobe("I") ; + uppercase[i] = findadobe("I"); if ((ai=findadobe("dotlessj"))) for (i=ai->texnum; i >= 0; i = nexttex[i]) - uppercase[i] = findadobe("J") ; + uppercase[i] = findadobe("J"); } /* The logic above seems to work well enough, but it leaves useless characters * like `fi' and `fl' in the font if they were present initially, @@ -876,51 +876,51 @@ upmap(void) { /* Compute uppercase mapping, when making a small caps font */ /* Now we turn to computing the TFM file */ -int lf, lh, nw, nh, nd, ni, nl, nk, ne, np ; +int lf, lh, nw, nh, nd, ni, nl, nk, ne, np; static void write16(register short what) { - (void)fputc(what >> 8, tfmout) ; - (void)fputc(what & 255, tfmout) ; + (void)fputc(what >> 8, tfmout); + (void)fputc(what & 255, tfmout); } static void writearr(register long *p, register int n) { while (n) { - write16((short)(*p >> 16)) ; - write16((short)(*p & 65535)) ; - p++ ; - n-- ; + write16((short)(*p >> 16)); + write16((short)(*p & 65535)); + p++; + n--; } } static void makebcpl(register long *p, register const char *s, register int n) { - register long t ; - register long sc ; + register long t; + register long sc; if (strlen(s) < n) - n = strlen(s) ; - t = ((long)n) << 24 ; - sc = 16 ; + n = strlen(s); + t = ((long)n) << 24; + sc = 16; while (n > 0) { - t |= ((long)(*(unsigned const char *)s++)) << sc ; - sc -= 8 ; + t |= ((long)(*(unsigned const char *)s++)) << sc; + sc -= 8; if (sc < 0) { - *p++ = t ; - t = 0 ; - sc = 24 ; + *p++ = t; + t = 0; + sc = 24; } - n-- ; + n--; } - *p++ = t ; + *p++ = t; } -int source[257] ; -int unsort[257] ; +int source[257]; +int unsort[257]; /* * Next we need a routine to reduce the number of distinct dimensions @@ -933,83 +933,83 @@ int unsort[257] ; * borrow a neat algorithm from METAFONT to find the true optimum. * Memory location what[oldn] is set to 0x7fffffffL for convenience. */ -long nextd ; /* smallest value that will give a different mincover */ +long nextd; /* smallest value that will give a different mincover */ static int mincover(long *what, register long d) /* tells how many clusters result, given max difference d */ { - register int m ; - register long l ; - register long *p ; + register int m; + register long l; + register long *p; - nextd = 0x7fffffffL ; - p = what+1 ; - m = 1 ; + nextd = 0x7fffffffL; + p = what+1; + m = 1; while (*p<0x7fffffffL) { - m++ ; - l = *p ; - while (*++p <= l+d) ; - if (*p-l < nextd) nextd = *p-l ; + m++; + l = *p; + while (*++p <= l+d); + if (*p-l < nextd) nextd = *p-l; } - return (m) ; + return (m); } static void remap(long * what, int oldn, int newn) { - register int i, j ; - register long d, l ; + register int i, j; + register long d, l; - what[oldn] = 0x7fffffffL ; + what[oldn] = 0x7fffffffL; for (i=oldn-1; i>0; i--) { - d = what[i] ; + d = what[i]; for (j=i; what[j+1]<d; j++) { - what[j] = what[j+1] ; - source[j] = source[j+1] ; + what[j] = what[j+1]; + source[j] = source[j+1]; } - what[j] = d ; - source[j] = i ; + what[j] = d; + source[j] = i; } /* Tom, don't let me ever catch you using bubblesort again! -- Don */ - i = mincover(what, 0L) ; - d = nextd ; - while (mincover(what,d+d)>newn) d += d ; - while (mincover(what,d)>newn) d = nextd ; + i = mincover(what, 0L); + d = nextd; + while (mincover(what,d+d)>newn) d += d; + while (mincover(what,d)>newn) d = nextd; - i = 1 ; - j = 0 ; + i = 1; + j = 0; while (i<oldn) { - j++ ; - l = what[i] ; - unsort[source[i]] = j ; + j++; + l = what[i]; + unsort[source[i]] = j; while (what[++i] <= l+d) { - unsort[source[i]] = j ; - if (i-j == oldn-newn) d = 0 ; + unsort[source[i]] = j; + if (i-j == oldn-newn) d = 0; } - what[j] = (l+what[i-1])/2 ; + what[j] = (l+what[i-1])/2; } } static long checksum(void) { - int i ; - unsigned long s1 = 0, s2 = 0 ; - const char *p ; - struct adobeinfo *ai ; + int i; + unsigned long s1 = 0, s2 = 0; + const char *p; + struct adobeinfo *ai; for (i=0; i<256; i++) if (0 != (ai=adobeptrs[i])) { - s1 = ((s1 << 1) ^ (s1>>31)) ^ ai->width ; /* cyclic left shift */ + s1 = ((s1 << 1) ^ (s1>>31)) ^ ai->width; /* cyclic left shift */ s1 &= 0xffffffff; /* in case we're on a 64-bit machine */ for (p=ai->adobename; *p; p++) #ifndef VMCMS - s2 = (s2 * 3) + *p ; + s2 = (s2 * 3) + *p; #else - s2 = (s2 * 3) + ebcdic2ascii[*p] ; + s2 = (s2 * 3) + ebcdic2ascii[*p]; #endif } - s1 = (s1 << 1) ^ s2 ; - return s1 ; + s1 = (s1 << 1) ^ s2; + return s1; } /* @@ -1021,102 +1021,102 @@ static long scale(long what) { return(((what / 1000) << 20) + - (((what % 1000) << 20) + 500) / 1000) ; + (((what % 1000) << 20) + 500) / 1000); } long *header, *charinfo, *width, *height, *depth, *ligkern, *kern, *tparam, - *italic ; -long *tfmdata ; + *italic; +long *tfmdata; static void buildtfm(void) { - register int i, j ; - register struct adobeinfo *ai ; - - header = tfmdata ; - cksum = checksum() ; - header[0] = cksum ; - header[1] = 0xa00000 ; /* 10pt design size */ - makebcpl(header+2, codingscheme, 39) ; - makebcpl(header+12, fontname, 19) ; - lh = 17 ; - charinfo = header + lh ; - - for (i=0; i<256 && adobeptrs[i]==NULL; i++) ; - bc = i ; - for (i=255; i>=0 && adobeptrs[i]==NULL; i--) ; + register int i, j; + register struct adobeinfo *ai; + + header = tfmdata; + cksum = checksum(); + header[0] = cksum; + header[1] = 0xa00000; /* 10pt design size */ + makebcpl(header+2, codingscheme, 39); + makebcpl(header+12, fontname, 19); + lh = 17; + charinfo = header + lh; + + for (i=0; i<256 && adobeptrs[i]==NULL; i++); + bc = i; + for (i=255; i>=0 && adobeptrs[i]==NULL; i--); ec = i; if (ec < bc) - error("! no Adobe characters") ; + error("! no Adobe characters"); - width = charinfo + (ec - bc + 1) ; - width[0] = 0 ; - nw++ ; + width = charinfo + (ec - bc + 1); + width[0] = 0; + nw++; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) { - width[nw]=ai->width ; - for (j=1; width[j]!=ai->width; j++) ; - ai->wptr = j ; + width[nw]=ai->width; + for (j=1; width[j]!=ai->width; j++); + ai->wptr = j; if (j==nw) - nw++ ; + nw++; } if (nw>256) - error("! 256 chars with different widths") ; - depth = width + nw ; - depth[0] = 0 ; - nd = 1 ; + error("! 256 chars with different widths"); + depth = width + nw; + depth[0] = 0; + nd = 1; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) { - depth[nd] = -ai->lly ; - for (j=0; depth[j]!=-ai->lly; j++) ; - ai->dptr = j ; + depth[nd] = -ai->lly; + for (j=0; depth[j]!=-ai->lly; j++); + ai->dptr = j; if (j==nd) - nd++ ; + nd++; } if (nd > 16) { - remap(depth, nd, 16) ; - nd = 16 ; + remap(depth, nd, 16); + nd = 16; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) - ai->dptr = unsort[ai->dptr] ; + ai->dptr = unsort[ai->dptr]; } - height = depth + nd ; - height[0] = 0 ; - nh = 1 ; + height = depth + nd; + height[0] = 0; + nh = 1; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) { - height[nh]=ai->ury ; - for (j=0; height[j]!=ai->ury; j++) ; - ai->hptr = j ; + height[nh]=ai->ury; + for (j=0; height[j]!=ai->ury; j++); + ai->hptr = j; if (j==nh) - nh++ ; + nh++; } if (nh > 16) { - remap(height, nh, 16) ; - nh = 16 ; + remap(height, nh, 16); + nh = 16; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) - ai->hptr = unsort[ai->hptr] ; + ai->hptr = unsort[ai->hptr]; } - italic = height + nh ; - italic[0] = 0 ; - ni = 1 ; + italic = height + nh; + italic[0] = 0; + ni = 1; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) { - italic[ni] = ai->urx - ai->width ; + italic[ni] = ai->urx - ai->width; if (italic[ni]<0) - italic[ni] = 0 ; - for (j=0; italic[j]!=italic[ni]; j++) ; - ai->iptr = j ; + italic[ni] = 0; + for (j=0; italic[j]!=italic[ni]; j++); + ai->iptr = j; if (j==ni) - ni++ ; + ni++; } if (ni > 64) { - remap(italic, ni, 64) ; - ni = 64 ; + remap(italic, ni, 64); + ni = 64; for (i=bc; i<=ec; i++) if (0 != (ai=adobeptrs[i])) - ai->iptr = unsort[ai->iptr] ; + ai->iptr = unsort[ai->iptr]; } for (i=bc; i<=ec; i++) @@ -1124,65 +1124,65 @@ buildtfm(void) { charinfo[i-bc] = ((long)(ai->wptr)<<24) + ((long)(ai->hptr)<<20) + ((long)(ai->dptr)<<16) + - ((long)(ai->iptr)<<10) ; - - ligkern = italic + ni ; - nl = 0 ; /* ligatures and kerns omitted from raw Adobe font */ - kern = ligkern + nl ; - nk = 0 ; - - newslant = (double)slant - efactor * tan(italicangle*(3.1415926535/180.0)) ; - tparam = kern + nk ; - tparam[0] = (long)(FIXFACTOR * newslant + 0.5) ; - tparam[1] = scale((long)fontspace) ; - tparam[2] = (fixedpitch ? 0 : scale((long)(300*efactor+0.5))) ; - tparam[3] = (fixedpitch ? 0 : scale((long)(100*efactor+0.5))) ; - tparam[4] = scale((long)xheight) ; - tparam[5] = scale((long)(1000*efactor+0.5)) ; - np = 6 ; + ((long)(ai->iptr)<<10); + + ligkern = italic + ni; + nl = 0; /* ligatures and kerns omitted from raw Adobe font */ + kern = ligkern + nl; + nk = 0; + + newslant = (double)slant - efactor * tan(italicangle*(3.1415926535/180.0)); + tparam = kern + nk; + tparam[0] = (long)(FIXFACTOR * newslant + 0.5); + tparam[1] = scale((long)fontspace); + tparam[2] = (fixedpitch ? 0 : scale((long)(300*efactor+0.5))); + tparam[3] = (fixedpitch ? 0 : scale((long)(100*efactor+0.5))); + tparam[4] = scale((long)xheight); + tparam[5] = scale((long)(1000*efactor+0.5)); + np = 6; } static void writesarr(long *what, int len) { - register long *p ; - int i ; + register long *p; + int i; - p = what ; - i = len ; + p = what; + i = len; while (i) { - *p = scale(*p) ; - (void)scale(*p) ; /* need this kludge for some compilers */ - p++ ; - i-- ; + *p = scale(*p); + (void)scale(*p); /* need this kludge for some compilers */ + p++; + i--; } - writearr(what, len) ; + writearr(what, len); } static void writetfm(void) { - lf = 6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np ; - write16(lf) ; - write16(lh) ; - write16(bc) ; - write16(ec) ; - write16(nw) ; - write16(nh) ; - write16(nd) ; - write16(ni) ; - write16(nl) ; - write16(nk) ; - write16(ne) ; - write16(np) ; - writearr(header, lh) ; - writearr(charinfo, ec-bc+1) ; - writesarr(width, nw) ; - writesarr(height, nh) ; - writesarr(depth, nd) ; - writesarr(italic, ni) ; - writearr(ligkern, nl) ; - writesarr(kern, nk) ; - writearr(tparam, np) ; + lf = 6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np; + write16(lf); + write16(lh); + write16(bc); + write16(ec); + write16(nw); + write16(nh); + write16(nd); + write16(ni); + write16(nl); + write16(nk); + write16(ne); + write16(np); + writearr(header, lh); + writearr(charinfo, ec-bc+1); + writesarr(width, nw); + writesarr(height, nh); + writesarr(depth, nd); + writesarr(italic, ni); + writearr(ligkern, nl); + writesarr(kern, nk); + writearr(tparam, np); } /* OK, the TFM file is done! Now for our next trick, the VPL file. */ @@ -1193,39 +1193,39 @@ writetfm(void) { * We only do this if the xheight has a reasonable value. * (>50) */ -const char *accents[] = { "acute", "tilde", "caron", "dieresis", NULL} ; +const char *accents[] = { "acute", "tilde", "caron", "dieresis", NULL}; static int texheight(register struct adobeinfo *ai) { register const char **p; - register struct adobeinfo *aci, *acci ; - if (xheight <= 50 || *(ai->adobename + 1)) return (ai->ury) ; + register struct adobeinfo *aci, *acci; + if (xheight <= 50 || *(ai->adobename + 1)) return (ai->ury); /* that was the simple case */ for (p=accents; *p; p++) /* otherwise we look for accented letters */ if (0 != (aci=findadobe(*p))) { - strcpy(buffer,ai->adobename) ; - strcat(buffer,*p) ; + strcpy(buffer,ai->adobename); + strcat(buffer,*p); if (0 != (acci=findadobe(buffer))) - return (acci->ury - aci->ury + xheight) ; + return (acci->ury - aci->ury + xheight); } - return (ai->ury) ; + return (ai->ury); } /* modified tgr to eliminate varargs problems */ #define vout(s) fprintf(vplout, s) -int level ; /* the depth of parenthesis nesting in VPL file being written */ +int level; /* the depth of parenthesis nesting in VPL file being written */ static void vlevout(void) { - register int l = level ; - while (l--) vout(" ") ; + register int l = level; + while (l--) vout(" "); } static void vlevnlout(void) { - vout("\n") ; - vlevout() ; + vout("\n"); + vlevout(); } #define voutln(str) {fprintf(vplout,"%s\n",str);vlevout();} #define voutln2(f,s) {fprintf(vplout,f,s);vlevnlout();} @@ -1234,32 +1234,32 @@ vlevnlout(void) static void vleft(void) { - level++ ; - vout("(") ; + level++; + vout("("); } static void vright(void) { - level-- ; - voutln(")") ; + level--; + voutln(")"); } -int forceoctal = 0 ; +int forceoctal = 0; -char vcharbuf[6] ; +char vcharbuf[6]; static char * vchar(int c) { if (forceoctal == 0 && ISALNUM (c)) (void) sprintf(vcharbuf,"C %c", #ifndef VMCMS - c) ; + c); #else - ascii2ebcdic[c]) ; + ascii2ebcdic[c]); #endif - else (void) sprintf(vcharbuf,"O %o", (unsigned)c) ; - return (vcharbuf) ; + else (void) sprintf(vcharbuf,"O %o", (unsigned)c); + return (vcharbuf); } char vnamebuf[100]; @@ -1277,35 +1277,35 @@ vname(int c) static void writevpl(void) { - register int i, j, k ; - register struct adobeinfo *ai ; - register struct lig *nlig ; - register struct kern *nkern ; - register struct pcc *npcc ; - struct adobeinfo *asucc, *asub, *api ; + register int i, j, k; + register struct adobeinfo *ai; + register struct lig *nlig; + register struct kern *nkern; + register struct pcc *npcc; + struct adobeinfo *asucc, *asub, *api; struct adobeptr *kern_eq; - int xoff, yoff, ht ; - char unlabeled ; + int xoff, yoff, ht; + char unlabeled; - voutln2("(VTITLE Created by %s)", titlebuf) ; - voutln("(COMMENT Please edit that VTITLE if you edit this file)") ; + voutln2("(VTITLE Created by %s)", titlebuf); + voutln("(COMMENT Please edit that VTITLE if you edit this file)"); (void)sprintf(obuffer, "TeX-%s%s%s%s", outname, (efactor==1.0? "" : "-E"), (slant==0.0? "" : "-S"), - (makevpl==1? "" : "-CSC")) ; + (makevpl==1? "" : "-CSC")); if (strlen(obuffer)>19) { /* too long, will retain first 9 and last 10 */ - register char *p, *q ; - for (p = &obuffer[9], q = &obuffer[strlen(obuffer)-10] ; p<&obuffer[19]; - p++, q++) *p = *q ; - obuffer[19] = '\0' ; + register char *p, *q; + for (p = &obuffer[9], q = &obuffer[strlen(obuffer)-10]; p<&obuffer[19]; + p++, q++) *p = *q; + obuffer[19] = '\0'; } - voutln2("(FAMILY %s)" , obuffer) ; + voutln2("(FAMILY %s)" , obuffer); { - char tbuf[300] ; + char tbuf[300]; const char *base_encoding = #ifndef VMCMS - codingscheme ; + codingscheme; #else - ebcodingscheme ; + ebcodingscheme; #endif if (strcmp (outencoding->name, base_encoding) == 0) { @@ -1315,70 +1315,70 @@ writevpl(void) } if (strlen(tbuf) > 39) { - error("Coding scheme too long; shortening to 39 characters.") ; - tbuf[39] = 0 ; + error("Coding scheme too long; shortening to 39 characters."); + tbuf[39] = 0; } - voutln2("(CODINGSCHEME %s)", tbuf) ; + voutln2("(CODINGSCHEME %s)", tbuf); } - voutln("(DESIGNSIZE R 10.0)") ; - voutln("(DESIGNUNITS R 1000)") ; - voutln("(COMMENT DESIGNSIZE (1 em) IS IN POINTS)") ; - voutln("(COMMENT OTHER DIMENSIONS ARE MULTIPLES OF DESIGNSIZE/1000)") ; + voutln("(DESIGNSIZE R 10.0)"); + voutln("(DESIGNUNITS R 1000)"); + voutln("(COMMENT DESIGNSIZE (1 em) IS IN POINTS)"); + voutln("(COMMENT OTHER DIMENSIONS ARE MULTIPLES OF DESIGNSIZE/1000)"); /* Let vptovf compute the checksum. */ - /* voutln2("(CHECKSUM O %lo)",cksum ^ 0xffffffff) ; */ + /* voutln2("(CHECKSUM O %lo)",cksum ^ 0xffffffff); */ if (boundarychar >= 0) - voutln2("(BOUNDARYCHAR O %lo)", (unsigned long)boundarychar) ; - vleft() ; voutln("FONTDIMEN") ; + voutln2("(BOUNDARYCHAR O %lo)", (unsigned long)boundarychar); + vleft(); voutln("FONTDIMEN"); if (newslant) - voutln2("(SLANT R %f)", newslant) ; - voutln2("(SPACE D %d)", fontspace) ; + voutln2("(SLANT R %f)", newslant); + voutln2("(SPACE D %d)", fontspace); if (! fixedpitch) { - voutln2("(STRETCH D %d)", transform(200,0)) ; - voutln2("(SHRINK D %d)", transform(100,0)) ; + voutln2("(STRETCH D %d)", transform(200,0)); + voutln2("(SHRINK D %d)", transform(100,0)); } - voutln2("(XHEIGHT D %d)", xheight) ; - voutln2("(QUAD D %d)", transform(1000,0)) ; - voutln2("(EXTRASPACE D %d)", fixedpitch ? fontspace : transform(111, 0)) ; - vright() ; - vleft() ; voutln("MAPFONT D 0"); - voutln2("(FONTNAME %s)", outname) ; - /* voutln2("(FONTCHECKSUM O %lo)", (unsigned long)cksum) ; */ - vright() ; + voutln2("(XHEIGHT D %d)", xheight); + voutln2("(QUAD D %d)", transform(1000,0)); + voutln2("(EXTRASPACE D %d)", fixedpitch ? fontspace : transform(111, 0)); + vright(); + vleft(); voutln("MAPFONT D 0"); + voutln2("(FONTNAME %s)", outname); + /* voutln2("(FONTCHECKSUM O %lo)", (unsigned long)cksum); */ + vright(); if (makevpl>1) { - vleft() ; voutln("MAPFONT D 1"); - voutln2("(FONTNAME %s)", outname) ; - voutln2("(FONTAT D %d)", (int)(1000.0*capheight+0.5)) ; - /* voutln2("(FONTCHECKSUM O %lo)", (unsigned long)cksum) ; */ - vright() ; + vleft(); voutln("MAPFONT D 1"); + voutln2("(FONTNAME %s)", outname); + voutln2("(FONTAT D %d)", (int)(1000.0*capheight+0.5)); + /* voutln2("(FONTCHECKSUM O %lo)", (unsigned long)cksum); */ + vright(); } - for (i=0; i<256 && texptrs[i]==NULL; i++) ; - bc = i ; - for (i=255; i>=0 && texptrs[i]==NULL; i--) ; + for (i=0; i<256 && texptrs[i]==NULL; i++); + bc = i; + for (i=255; i>=0 && texptrs[i]==NULL; i--); ec = i; - vleft() ; voutln("LIGTABLE") ; - ai = findadobe("||") ; - unlabeled = 1 ; + vleft(); voutln("LIGTABLE"); + ai = findadobe("||"); + unlabeled = 1; for (nlig=ai->ligs; nlig; nlig=nlig->next) if (0 != (asucc=findadobe(nlig->succ))) { if (0 != (asub=findadobe(nlig->sub))) if (asucc->texnum>=0) if (asub->texnum>=0) { if (unlabeled) { - voutln("(LABEL BOUNDARYCHAR)") ; - unlabeled = 0 ; + voutln("(LABEL BOUNDARYCHAR)"); + unlabeled = 0; } for (j = asucc->texnum; j >= 0; j = nexttex[j]) { voutln4("(%s %s O %o)", vplligops[nlig->op], - vchar(j), (unsigned)asub->texnum) ; + vchar(j), (unsigned)asub->texnum); } } } - if (! unlabeled) voutln("(STOP)") ; + if (! unlabeled) voutln("(STOP)"); for (i=bc; i<=ec; i++) if ((ai=texptrs[i]) && ai->texnum == i) { - unlabeled = 1 ; + unlabeled = 1; if (uppercase[i]==NULL) /* omit ligatures from smallcap lowercase */ for (nlig=ai->ligs; nlig; nlig=nlig->next) if (0 != (asucc=findadobe(nlig->succ))) @@ -1387,14 +1387,14 @@ writevpl(void) if (asub->texnum>=0) { if (unlabeled) { for (j = ai->texnum; j >= 0; j = nexttex[j]) - voutln3("(LABEL %s)%s", vchar(j), vname(j)) ; - unlabeled = 0 ; + voutln3("(LABEL %s)%s", vchar(j), vname(j)); + unlabeled = 0; } for (j = asucc->texnum; j >= 0; j = nexttex[j]) { voutln4("(%s %s O %o)", vplligops[nlig->op], - vchar(j), (unsigned)asub->texnum) ; + vchar(j), (unsigned)asub->texnum); if (nlig->boundleft) - break ; + break; } } for (nkern = (uppercase[i] ? uppercase[i]->kerns : ai->kerns); @@ -1404,8 +1404,8 @@ writevpl(void) if (uppercase[j]==NULL) { if (unlabeled) { for (k = ai->texnum; k >= 0; k = nexttex[k]) - voutln3("(LABEL %s)%s", vchar(k), vname(k)) ; - unlabeled = 0 ; + voutln3("(LABEL %s)%s", vchar(k), vname(k)); + unlabeled = 0; } /* If other characters have the same kerns as this one, output the label here. This makes the TFM @@ -1415,88 +1415,88 @@ writevpl(void) kern_eq = kern_eq->next) { k = kern_eq->ch->texnum; if (k >= 0 && k < 256) - voutln3("(LABEL %s)%s", vchar(k), vname(k)) ; + voutln3("(LABEL %s)%s", vchar(k), vname(k)); } ai->kern_equivs = 0; /* Only output those labels once. */ if (uppercase[i]) { if (lowercase[j]) { for (k=lowercase[j]->texnum; k >= 0; k = nexttex[k]) voutln4("(KRN %s R %.1f)%s", vchar(k), - capheight*nkern->delta, vname(k)) ; + capheight*nkern->delta, vname(k)); } else voutln4("(KRN %s R %.1f)%s", - vchar(j), capheight*nkern->delta, vname(j)) ; + vchar(j), capheight*nkern->delta, vname(j)); } else { voutln4("(KRN %s R %d)%s", vchar(j), - nkern->delta, vname(j)) ; + nkern->delta, vname(j)); if (lowercase[j]) for (k=lowercase[j]->texnum; k >= 0; k = nexttex[k]) voutln4("(KRN %s R %.1f)%s", vchar(k), - capheight*nkern->delta, vname(k)) ; + capheight*nkern->delta, vname(k)); } } } - if (! unlabeled) voutln("(STOP)") ; + if (! unlabeled) voutln("(STOP)"); } - vright() ; + vright(); for (i=bc; i<=ec; i++) if (0 != (ai=texptrs[i])) { - vleft() ; fprintf(vplout, "CHARACTER %s", vchar(i)) ; + vleft(); fprintf(vplout, "CHARACTER %s", vchar(i)); if (*vcharbuf=='C') { - voutln("") ; + voutln(""); } else - voutln2(" (comment %s)", ai->adobename) ; + voutln2(" (comment %s)", ai->adobename); if (uppercase[i]) { - ai=uppercase[i] ; - voutln2("(CHARWD R %.1f)", capheight * (ai->width)) ; + ai=uppercase[i]; + voutln2("(CHARWD R %.1f)", capheight * (ai->width)); if (0 != (ht=texheight(ai))) - voutln2("(CHARHT R %.1f)", capheight * ht) ; + voutln2("(CHARHT R %.1f)", capheight * ht); if (ai->lly) - voutln2("(CHARDP R %.1f)", -capheight * ai->lly) ; + voutln2("(CHARDP R %.1f)", -capheight * ai->lly); if (ai->urx > ai->width) - voutln2("(CHARIC R %.1f)", capheight * (ai->urx - ai->width)) ; + voutln2("(CHARIC R %.1f)", capheight * (ai->urx - ai->width)); } else { - voutln2("(CHARWD R %d)", ai->width) ; + voutln2("(CHARWD R %d)", ai->width); if (0 != (ht=texheight(ai))) - voutln2("(CHARHT R %d)", ht) ; + voutln2("(CHARHT R %d)", ht); if (ai->lly) - voutln2("(CHARDP R %d)", -ai->lly) ; + voutln2("(CHARDP R %d)", -ai->lly); if (ai->urx > ai->width) - voutln2("(CHARIC R %d)", ai->urx - ai->width) ; + voutln2("(CHARIC R %d)", ai->urx - ai->width); } if (ai->adobenum != i || uppercase[i]) { - vleft() ; voutln("MAP") ; - if (uppercase[i]) voutln("(SELECTFONT D 1)") ; + vleft(); voutln("MAP"); + if (uppercase[i]) voutln("(SELECTFONT D 1)"); if (ai->pccs && ai->adobenum < 0) { - xoff = 0 ; yoff = 0 ; + xoff = 0; yoff = 0; for (npcc = ai->pccs; npcc; npcc=npcc->next) if (0 != (api=findadobe(npcc->partname))) if (api->texnum>=0) { if (npcc->xoffset != xoff) { if (uppercase[i]) { voutln2("(MOVERIGHT R %.1f)", - capheight * (npcc->xoffset - xoff)) ; + capheight * (npcc->xoffset - xoff)); } else voutln2("(MOVERIGHT R %d)", - npcc->xoffset - xoff) ; - xoff = npcc->xoffset ; + npcc->xoffset - xoff); + xoff = npcc->xoffset; } if (npcc->yoffset != yoff) { if (uppercase[i]) { voutln2("(MOVEUP R %.1f)", - capheight * (npcc->yoffset - yoff)) ; + capheight * (npcc->yoffset - yoff)); } else voutln2("(MOVEUP R %d)", - npcc->yoffset - yoff) ; - yoff = npcc->yoffset ; + npcc->yoffset - yoff); + yoff = npcc->yoffset; } - voutln2("(SETCHAR O %o)", (unsigned)api->adobenum) ; - xoff += texptrs[api->texnum]->width ; + voutln2("(SETCHAR O %o)", (unsigned)api->adobenum); + xoff += texptrs[api->texnum]->width; } - } else voutln2("(SETCHAR O %o)", (unsigned)ai->adobenum) ; - vright() ; + } else voutln2("(SETCHAR O %o)", (unsigned)ai->adobenum); + vright(); } - vright() ; + vright(); } - if (level) error("! I forgot to match the parentheses") ; + if (level) error("! I forgot to match the parentheses"); } #ifdef KPATHSEA @@ -1544,13 +1544,13 @@ static void usage(FILE *f) { (void)fprintf(f, - "afm2tfm 8.1, Copyright 1990-97 by Radical Eye Software\n") ; + "afm2tfm 8.1, Copyright 1990-97 by Radical Eye Software\n"); (void)fprintf(f, - "Usage: afm2tfm foo[.afm] [-O] [-u] [-v|-V bar[.vpl]]\n") ; + "Usage: afm2tfm foo[.afm] [-O] [-u] [-v|-V bar[.vpl]]\n"); (void)fprintf(f, - " [-e expansion] [-s slant] [-c capheight]\n") ; + " [-e expansion] [-s slant] [-c capheight]\n"); (void)fprintf(f, - " [-p|-t|-T encodingfile] [foo[.tfm]]\n") ; + " [-p|-t|-T encodingfile] [foo[.tfm]]\n"); } #endif @@ -1560,66 +1560,66 @@ static void openfiles(int argc, char **argv) { #ifndef KPATHSEA - register int lastext ; + register int lastext; #else const char *q; #endif - register int i ; - char *p ; - int arginc ; + register int i; + char *p; + int arginc; - tfmout = (FILE *)NULL ; + tfmout = (FILE *)NULL; if (argc == 1) { - usage(stdout) ; - exit(0) ; + usage(stdout); + exit(0); } #if defined(MSDOS) || defined(OS2) || defined(ATARIST) /* Make VPL file identical to that created under Unix */ - (void)sprintf(titlebuf, "afm2tfm %s", argv[1]) ; + (void)sprintf(titlebuf, "afm2tfm %s", argv[1]); #else #ifdef VMCMS /* Make VPL file identical to that created under Unix */ - (void)sprintf(titlebuf, "afm2tfm %s", argv[1]) ; + (void)sprintf(titlebuf, "afm2tfm %s", argv[1]); #else - (void)sprintf(titlebuf, "%s %s", argv[0], argv[1]) ; + (void)sprintf(titlebuf, "%s %s", argv[0], argv[1]); #endif #endif - (void)strcpy(inname, argv[1]) ; + (void)strcpy(inname, argv[1]); #ifdef KPATHSEA if (find_suffix(inname) == NULL) - (void)strcat(inname, ".afm") ; + (void)strcat(inname, ".afm"); #else - lastext = -1 ; + lastext = -1; for (i=0; inname[i]; i++) if (inname[i] == '.') - lastext = i ; + lastext = i; else if (inname[i] == '/' || inname[i] == ':') - lastext = -1 ; - if (lastext == -1) (void)strcat(inname, ".afm") ; + lastext = -1; + if (lastext == -1) (void)strcat(inname, ".afm"); #endif while (argc>2 && *argv[2]=='-') { - arginc = 2 ; - i = argv[2][1] ; + arginc = 2; + i = argv[2][1]; if (i == '/') - i = argv[2][2] - 32 ; /* /a ==> A for VMS */ + i = argv[2][2] - 32; /* /a ==> A for VMS */ switch (i) { -case 'V': makevpl++ ; -case 'v': makevpl++ ; +case 'V': makevpl++; +case 'v': makevpl++; CHECKARG3 - (void)strcpy(outname, argv[3]) ; + (void)strcpy(outname, argv[3]); #ifdef KPATHSEA if (find_suffix(outname) == NULL) - (void)strcat(outname, ".vpl") ; + (void)strcat(outname, ".vpl"); #else - lastext = -1 ; + lastext = -1; for (i=0; outname[i]; i++) if (outname[i] == '.') - lastext = i ; + lastext = i; else if (outname[i] == '/' || outname[i] == ':') - lastext = -1 ; - if (lastext == -1) (void)strcat(outname, ".vpl") ; + lastext = -1; + if (lastext == -1) (void)strcat(outname, ".vpl"); #endif #ifndef VMCMS #ifndef ATARIST @@ -1630,52 +1630,52 @@ case 'v': makevpl++ ; #else if ((vplout=fopen(outname, "w"))==NULL) #endif - error("! can't open vpl output file") ; - break ; + error("! can't open vpl output file"); + break; case 'e': CHECKARG3 if (sscanf(argv[3], "%f", &efactor)==0 || efactor<0.01) - error("! Bad extension factor") ; - efactorparam = argv[3] ; - break ; + error("! Bad extension factor"); + efactorparam = argv[3]; + break; case 'c': CHECKARG3 if (sscanf(argv[3], "%f", &capheight)==0 || capheight<0.01) - error("! Bad small caps height") ; - break ; + error("! Bad small caps height"); + break; case 's': CHECKARG3 if (sscanf(argv[3], "%f", &slant)==0) - error("! Bad slant parameter") ; - slantparam = argv[3] ; - break ; + error("! Bad slant parameter"); + slantparam = argv[3]; + break; case 'P': case 'p': CHECKARG3 - inenname = argv[3] ; - break ; + inenname = argv[3]; + break; case 'T': CHECKARG3 - inenname = outenname = argv[3] ; - break ; + inenname = outenname = argv[3]; + break; case 't': CHECKARG3 - outenname = argv[3] ; - break ; + outenname = argv[3]; + break; case 'O': - forceoctal = 1 ; - arginc = 1 ; - break ; + forceoctal = 1; + arginc = 1; + break; case 'u': - pedantic = 1 ; - arginc = 1 ; - break ; + pedantic = 1; + arginc = 1; + break; default: (void)fprintf(stderr, "Unknown option %s %s will be ignored.\n", - argv[2], argv[3]) ; + argv[2], argv[3]); } for (i=0; i<arginc; i++) { - (void)sprintf(titlebuf + strlen(titlebuf), " %s", argv[2]) ; - argv++ ; - argc-- ; + (void)sprintf(titlebuf + strlen(titlebuf), " %s", argv[2]); + argv++; + argc--; } } @@ -1683,24 +1683,24 @@ default: (void)fprintf(stderr, "Unknown option %s %s will be ignored.\n", afmin = kpse_open_file (inname, kpse_afm_format); #else /* ! KPATHSEA */ if ((afmin=fopen(inname, "r"))==NULL) - error("! can't open afm input file") ; + error("! can't open afm input file"); #endif /* KPATHSEA */ - (void)SET_BINARY(fileno(afmin)) ; + (void)SET_BINARY(fileno(afmin)); if (argc>3 || (argc==3 && *argv[2]=='-')) { - error("! need at most two non-option arguments") ; - usage(stderr) ; + error("! need at most two non-option arguments"); + usage(stderr); } - if (argc == 2) (void)strcpy(outname, inname) ; - else (void)strcpy(outname, argv[2]) ; + if (argc == 2) (void)strcpy(outname, inname); + else (void)strcpy(outname, argv[2]); #ifdef KPATHSEA if ((p = find_suffix(outname)) != NULL) *(p-1) = 0; - (void)strcat(outname, ".tfm") ; + (void)strcat(outname, ".tfm"); if (tfmout == NULL && (tfmout=fopen(outname, WRITEBIN))==NULL) - error("! can't open tfm output file") ; + error("! can't open tfm output file"); /* * Now we strip off any directory information, so we only use the * base name in the vf file. @@ -1709,27 +1709,27 @@ default: (void)fprintf(stderr, "Unknown option %s %s will be ignored.\n", p = find_suffix(outname); *(p-1) = 0; - q = xbasename(outname) ; + q = xbasename(outname); strcpy(tmpstr, q); /* be careful, q and outname are overlapping */ strcpy(outname, tmpstr); #else - lastext = -1 ; + lastext = -1; for (i=0; outname[i]; i++) if (outname[i] == '.') - lastext = i ; + lastext = i; else if (outname[i] == '/' || outname[i] == ':' || outname[i] == '\\') - lastext = -1 ; + lastext = -1; if (argc == 2) { - outname[lastext] = 0 ; - lastext = -1 ; + outname[lastext] = 0; + lastext = -1; } if (lastext == -1) { - lastext = strlen(outname) ; - (void)strcat(outname, ".tfm") ; + lastext = strlen(outname); + (void)strcat(outname, ".tfm"); } if (tfmout == NULL && (tfmout=fopen(outname, WRITEBIN))==NULL) - error("! can't open tfm output file") ; - outname[lastext] = 0 ; + error("! can't open tfm output file"); + outname[lastext] = 0; /* * Now we strip off any directory information, so we only use the * base name in the vf file. We accept any of /, :, or \ as directory @@ -1738,9 +1738,9 @@ default: (void)fprintf(stderr, "Unknown option %s %s will be ignored.\n", */ for (i=0, lastext=0; outname[i]; i++) if (outname[i] == '/' || outname[i] == ':' || outname[i] == '\\') - lastext = i + 1 ; + lastext = i + 1; if (lastext) - strcpy(outname, outname + lastext) ; + strcpy(outname, outname + lastext); #endif } /* @@ -1749,16 +1749,16 @@ default: (void)fprintf(stderr, "Unknown option %s %s will be ignored.\n", static struct kern * rmkernmatch(struct kern *k, char *s) { - struct kern *nkern ; + struct kern *nkern; while (k && strcmp(k->succ, s)==0) - k = k->next ; + k = k->next; if (k) { for (nkern = k; nkern; nkern = nkern->next) while (nkern->next && strcmp(nkern->next->succ, s)==0) - nkern->next = nkern->next->next ; + nkern->next = nkern->next->next; } - return k ; + return k; } /* * Recursive to one level. @@ -1769,18 +1769,18 @@ rmkern(char *s1, char *s2, struct adobeinfo *ai) if (ai == 0) { if (strcmp(s1, "*") == 0) { for (ai=adobechars; ai; ai = ai->next) - rmkern(s1, s2, ai) ; - return ; + rmkern(s1, s2, ai); + return; } else { - ai = findadobe(s1) ; + ai = findadobe(s1); if (ai == 0) - return ; + return; } } if (strcmp(s2, "*")==0) - ai->kerns = 0 ; /* drop them on the floor */ + ai->kerns = 0; /* drop them on the floor */ else - ai->kerns = rmkernmatch(ai->kerns, s2) ; + ai->kerns = rmkernmatch(ai->kerns, s2); } /* Make the kerning for character S1 equivalent to that for S2. @@ -1800,7 +1800,7 @@ addkern(char *s1, char *s2) ai2->kern_equivs = ap; } } -int sawligkern ; +int sawligkern; /* * Reads a ligkern line, if this is one. Assumes the first character * passed is `%'. @@ -1808,152 +1808,152 @@ int sawligkern ; static void checkligkern(char *s) { - char *oparam = param ; - char *mlist[5] ; - int n ; + char *oparam = param; + char *mlist[5]; + int n; - s++ ; + s++; while (*s && *s <= ' ') - s++ ; + s++; if (strncmp(s, "LIGKERN", 7)==0) { - sawligkern = 1 ; - s += 7 ; + sawligkern = 1; + s += 7; while (*s && *s <= ' ') - s++ ; - param = s ; + s++; + param = s; while (*param) { for (n=0; n<5;) { if (*param == 0) - break ; - mlist[n] = paramstring() ; + break; + mlist[n] = paramstring(); if (strcmp(mlist[n], ";") == 0) - break ; - n++ ; + break; + n++; } if (n > 4) - error("! too many parameters in lig kern data") ; + error("! too many parameters in lig kern data"); if (n < 3) - error("! too few parameters in lig kern data") ; + error("! too few parameters in lig kern data"); if (n == 3 && strcmp(mlist[1], "{}") == 0) { /* rmkern command */ - rmkern(mlist[0], mlist[2], (struct adobeinfo *)0) ; + rmkern(mlist[0], mlist[2], (struct adobeinfo *)0); } else if (n == 3 && strcmp(mlist[1], "<>") == 0) { /* addkern */ - addkern(mlist[0], mlist[2]) ; + addkern(mlist[0], mlist[2]); } else if (n == 3 && strcmp(mlist[0], "||") == 0 && strcmp(mlist[1], "=") == 0) { /* bc command */ - struct adobeinfo *ai = findadobe("||") ; + struct adobeinfo *ai = findadobe("||"); if (boundarychar != -1) - error("! multiple boundary character commands?") ; + error("! multiple boundary character commands?"); if (sscanf(mlist[2], "%d", &n) != 1) - error("! expected number assignment for boundary char") ; + error("! expected number assignment for boundary char"); if (n < 0 || n > 255) - error("! boundary character number must be 0..255") ; - boundarychar = n ; + error("! boundary character number must be 0..255"); + boundarychar = n; if (ai == 0) - error("! internal error: boundary char") ; - ai->texnum = n ; /* prime the pump, so to speak, for lig/kerns */ + error("! internal error: boundary char"); + ai->texnum = n; /* prime the pump, so to speak, for lig/kerns */ } else if (n == 4) { - int op = -1 ; - struct adobeinfo *ai ; + int op = -1; + struct adobeinfo *ai; for (n=0; encligops[n]; n++) if (strcmp(mlist[2], encligops[n])==0) { - op = n ; - break ; + op = n; + break; } if (op < 0) - error("! bad ligature op specified") ; + error("! bad ligature op specified"); if (0 != (ai = findadobe(mlist[0]))) { - struct lig *lig ; + struct lig *lig; if (findadobe(mlist[2])) /* remove coincident kerns */ - rmkern(mlist[0], mlist[1], ai) ; + rmkern(mlist[0], mlist[1], ai); if (strcmp(mlist[3], "||") == 0) - error("! you can't lig to the boundary character!") ; + error("! you can't lig to the boundary character!"); if (! fixedpitch) { /* fixed pitch fonts get *0* ligs */ for (lig=ai->ligs; lig; lig = lig->next) if (strcmp(lig->succ, mlist[1]) == 0) - break ; /* we'll re-use this structure */ + break; /* we'll re-use this structure */ if (lig == 0) { - lig = newlig() ; - lig->succ = newstring(mlist[1]) ; - lig->next = ai->ligs ; - ai->ligs = lig ; + lig = newlig(); + lig->succ = newstring(mlist[1]); + lig->next = ai->ligs; + ai->ligs = lig; } - lig->sub = newstring(mlist[3]) ; - lig->op = op ; + lig->sub = newstring(mlist[3]); + lig->op = op; if (strcmp(mlist[1], "||")==0) { - lig->boundleft = 1 ; + lig->boundleft = 1; if (strcmp(mlist[0], "||")==0) - error("! you can't lig boundarychar boundarychar!") ; + error("! you can't lig boundarychar boundarychar!"); } else - lig->boundleft = 0 ; + lig->boundleft = 0; } } } else - error("! bad form in LIGKERN command") ; + error("! bad form in LIGKERN command"); } } - param = oparam ; + param = oparam; } /* * Here we get a token from the AFM file. We parse just as much PostScript * as we expect to find in an encoding file. We allow commented lines and * names like 0, .notdef, _foo_. We do not allow //abc. */ -char smbuffer[100] ; /* for tokens */ +char smbuffer[100]; /* for tokens */ static char * gettoken(void) { - char *p, *q ; + char *p, *q; while (1) { while (param == 0 || *param == 0) { if (texlive_getline() == 0) - error("! premature end in encoding file") ; + error("! premature end in encoding file"); for (p=buffer; *p; p++) if (*p == '%') { if (ignoreligkern == 0) - checkligkern(p) ; - *p = 0 ; - break ; + checkligkern(p); + *p = 0; + break; } } while (*param && *param <= ' ') - param++ ; + param++; if (*param) { if (*param == '[' || *param == ']' || *param == '{' || *param == '}') { - smbuffer[0] = *param++ ; - smbuffer[1] = 0 ; - return smbuffer ; + smbuffer[0] = *param++; + smbuffer[1] = 0; + return smbuffer; } else if (*param == '/' || *param == '-' || *param == '_' || *param == '.' || ('0' <= *param && *param <= '9') || ('a' <= *param && *param <= 'z') || ('A' <= *param && *param <= 'Z')) { - smbuffer[0] = *param ; + smbuffer[0] = *param; for (p=param+1, q=smbuffer+1; *p == '-' || *p == '_' || *p == '.' || ('0' <= *p && *p <= '9') || ('a' <= *p && *p <= 'z') || ('A' <= *p && *p <= 'Z'); p++, q++) - *q = *p ; - *q = 0 ; - param = p ; - return smbuffer ; + *q = *p; + *q = 0; + param = p; + return smbuffer; } } } } static void getligkerndefaults(void) { - int i ; + int i; for (i=0; staticligkern[i]; i++) { - strcpy(buffer, staticligkern[i]) ; - strcpy(obuffer, staticligkern[i]) ; - param = buffer ; - checkligkern(buffer) ; + strcpy(buffer, staticligkern[i]); + strcpy(obuffer, staticligkern[i]); + param = buffer; + checkligkern(buffer); } } /* @@ -1963,63 +1963,63 @@ getligkerndefaults(void) { static struct encoding * readencoding(char *enc) { - char *p ; - int i ; + char *p; + int i; struct encoding *e = - (struct encoding *)mymalloc((unsigned long)sizeof(struct encoding)) ; + (struct encoding *)mymalloc((unsigned long)sizeof(struct encoding)); - sawligkern = 0 ; + sawligkern = 0; if (afmin) - error("! oops; internal afmin error") ; + error("! oops; internal afmin error"); if (enc) { #ifdef KPATHSEA afmin = kpse_open_file(enc, kpse_enc_format); #else - afmin = fopen(enc, "r") ; + afmin = fopen(enc, "r"); #endif - (void)SET_BINARY(fileno(afmin)) ; - param = 0 ; + (void)SET_BINARY(fileno(afmin)); + param = 0; if (afmin == 0) #ifdef KPATHSEA - FATAL1 ("couldn't open encoding file `%s'", enc) ; + FATAL1 ("couldn't open encoding file `%s'", enc); #else - error("! couldn't open that encoding file") ; + error("! couldn't open that encoding file"); #endif - p = gettoken() ; + p = gettoken(); if (*p != '/' || p[1] == 0) - error("! first token in encoding must be literal encoding name") ; - e->name = newstring(p+1) ; - p = gettoken() ; + error("! first token in encoding must be literal encoding name"); + e->name = newstring(p+1); + p = gettoken(); if (strcmp(p, "[")) - error("! second token in encoding must be mark ([) token") ; + error("! second token in encoding must be mark ([) token"); for (i=0; i<256; i++) { - p = gettoken() ; + p = gettoken(); if (*p != '/' || p[1] == 0) - error("! tokens 3 to 257 in encoding must be literal names") ; - e->vec[i] = newstring(p+1) ; + error("! tokens 3 to 257 in encoding must be literal names"); + e->vec[i] = newstring(p+1); } - p = gettoken() ; + p = gettoken(); if (strcmp(p, "]")) - error("! token 258 in encoding must be make-array (])") ; + error("! token 258 in encoding must be make-array (])"); while (texlive_getline()) { for (p=buffer; *p; p++) if (*p == '%') { if (ignoreligkern == 0) - checkligkern(p) ; - *p = 0 ; - break ; + checkligkern(p); + *p = 0; + break; } } - fclose(afmin) ; - afmin = 0 ; + fclose(afmin); + afmin = 0; if (ignoreligkern == 0 && sawligkern == 0) - getligkerndefaults() ; + getligkerndefaults(); } else { - e = &staticencoding ; - getligkerndefaults() ; + e = &staticencoding; + getligkerndefaults(); } - param = 0 ; - return e ; + param = 0; + return e; } /* * This routine prints out the line that needs to be added to psfonts.map. @@ -2028,31 +2028,31 @@ static void conspsfonts(void) { #ifndef VMCMS (void)printf("%s %s", outname, - fontname) ; + fontname); #else /* VM/CMS: fontname is ascii, so we use ebfontname */ (void)printf("%s %s", outname, - ebfontname) ; + ebfontname); #endif if (slantparam || efactorparam || inenname) { - (void)printf(" \"") ; + (void)printf(" \""); if (slantparam) - (void)printf(" %s SlantFont", slantparam) ; + (void)printf(" %s SlantFont", slantparam); if (efactorparam) - (void)printf(" %s ExtendFont", efactorparam) ; + (void)printf(" %s ExtendFont", efactorparam); if (inenname) - (void)printf(" %s ReEncodeFont", inencoding->name) ; - (void)printf(" \"") ; + (void)printf(" %s ReEncodeFont", inencoding->name); + (void)printf(" \""); if (inenname) - (void)printf(" <%s", inenname) ; + (void)printf(" <%s", inenname); } - (void)printf("\n") ; + (void)printf("\n"); } #ifndef VMS int #endif main(int argc, char **argv) { - int i ; + int i; #ifdef KPATHSEA kpse_set_program_name (argv[0], "afm2tfm"); @@ -2073,30 +2073,30 @@ main(int argc, char **argv) } #endif /* KPATHSEA */ for (i=0; i<256; i++) - nexttex[i] = -1 ; /* encoding chains have length 0 */ - tfmdata = (long *)mymalloc((unsigned long)40000L) ; - openfiles(argc, argv) ; - readadobe() ; + nexttex[i] = -1; /* encoding chains have length 0 */ + tfmdata = (long *)mymalloc((unsigned long)40000L); + openfiles(argc, argv); + readadobe(); if (fontspace == 0) { - struct adobeinfo *ai ; + struct adobeinfo *ai; if (0 != (ai = findadobe("space"))) - fontspace = ai->width ; + fontspace = ai->width; else if (adobeptrs[32]) - fontspace = adobeptrs[32]->width ; + fontspace = adobeptrs[32]->width; else - fontspace = transform(500, 0) ; + fontspace = transform(500, 0); } - handlereencoding() ; - buildtfm() ; - writetfm() ; - conspsfonts() ; + handlereencoding(); + buildtfm(); + writetfm(); + conspsfonts(); if (makevpl) { - assignchars() ; - if (makevpl>1) upmap() ; - writevpl() ; + assignchars(); + if (makevpl>1) upmap(); + writevpl(); } - return 0 ; + return 0; /*NOTREACHED*/ } diff --git a/Build/source/texk/dvipsk/bbox.c b/Build/source/texk/dvipsk/bbox.c index 64973259a75..5a321890e6a 100644 --- a/Build/source/texk/dvipsk/bbox.c +++ b/Build/source/texk/dvipsk/bbox.c @@ -14,292 +14,292 @@ #include "protos_add.h" typedef struct { - integer llx, lly, urx, ury ; -} bbchardesctype ; + integer llx, lly, urx, ury; +} bbchardesctype; typedef struct { - bbchardesctype *bbchardesc ; -} bbfontdesctype ; + bbchardesctype *bbchardesc; +} bbfontdesctype; typedef struct bbtft { - integer fontnum ; - bbfontdesctype *desc ; - struct bbtft *next ; -} bbfontmaptype ; + integer fontnum; + bbfontdesctype *desc; + struct bbtft *next; +} bbfontmaptype; -static bbfontmaptype *bbffont ; +static bbfontmaptype *bbffont; void bbtfmload(register fontdesctype *curfnt) { - register integer i, j ; - register integer li, cd = 0 ; - integer scaledsize ; - integer nw, nh, nd, ns, hd ; - integer bc, ec ; - integer nco = 0, ncw = 0, npc = 0, no_repeats = 0 ; - integer *scaled ; - integer *chardat ; + register integer i, j; + register integer li, cd = 0; + integer scaledsize; + integer nw, nh, nd, ns, hd; + integer bc, ec; + integer nco = 0, ncw = 0, npc = 0, no_repeats = 0; + integer *scaled; + integer *chardat; int font_level; integer pretend_no_chars; - integer slant = 0 ; - bbchardesctype *cc ; + integer slant = 0; + bbchardesctype *cc; register bbfontdesctype *bbcurfnt = - (bbfontdesctype *)mymalloc(sizeof(bbfontdesctype)) ; + (bbfontdesctype *)mymalloc(sizeof(bbfontdesctype)); - bbffont->desc = bbcurfnt ; - tfmopen(curfnt) ; + bbffont->desc = bbcurfnt; + tfmopen(curfnt); /* * Next, we read the font data from the tfm file, and store it in * our own arrays. */ - li = tfm16() ; + li = tfm16(); if (li!=0) { font_level = -1; - hd = tfm16() ; - bc = tfm16() ; ec = tfm16() ; - nw = tfm16() ; nh = tfm16(); nd = tfm16(); - ns = tfm16() ; - ns += tfm16() ; - ns += tfm16() ; - ns += tfm16() ; - li = tfm16() ; + hd = tfm16(); + bc = tfm16(); ec = tfm16(); + nw = tfm16(); nh = tfm16(); nd = tfm16(); + ns = tfm16(); + ns += tfm16(); + ns += tfm16(); + ns += tfm16(); + li = tfm16(); if (hd<2 || bc>ec+1 || ec>255 || nw>256 || nh>16 || nd>16) - badtfm("header") ; + badtfm("header"); } else { /* In an .ofm file */ - if (noomega) badtfm("length") ; + if (noomega) badtfm("length"); font_level = tfm16(); - li = tfm32() ; - hd = tfm32() ; - bc = tfm32() ; ec = tfm32() ; - nw = tfm32() ; nh = tfm32() ; nd = tfm32(); - ns = tfm32() ; - ns += tfm32() ; - ns += tfm32() ; - ns += tfm32() ; - li = tfm32() ; - li = tfm32() ; + li = tfm32(); + hd = tfm32(); + bc = tfm32(); ec = tfm32(); + nw = tfm32(); nh = tfm32(); nd = tfm32(); + ns = tfm32(); + ns += tfm32(); + ns += tfm32(); + ns += tfm32(); + li = tfm32(); + li = tfm32(); if (font_level>1 || hd<2 || bc<0 || ec<0 || nw<2 || nh<1 || nd<1 || ns<1 || bc>ec+1 || ec>65535 || nw>65536 || nh>256 || nd>256) - badtfm("header") ; + badtfm("header"); if (font_level==1) { - nco = tfm32() ; - ncw = tfm32() ; - npc = tfm32() ; + nco = tfm32(); + ncw = tfm32(); + npc = tfm32(); for (i=0; i<12; i++) li=tfm32(); } } - li = tfm32() ; + li = tfm32(); check_checksum (li, curfnt->checksum, curfnt->name); - li = tfm32() ; + li = tfm32(); pretend_no_chars=ec+1; if (pretend_no_chars<256) pretend_no_chars=256; bbcurfnt->bbchardesc = (bbchardesctype *) xmalloc(pretend_no_chars*sizeof(bbchardesctype)); for (i=2; i<((font_level==1)?nco-29:hd); i++) - li = tfm32() ; - chardat = (integer *) xmalloc(pretend_no_chars*sizeof(integer)) ; + li = tfm32(); + chardat = (integer *) xmalloc(pretend_no_chars*sizeof(integer)); for (i=0; i<pretend_no_chars; i++) - chardat[i] = -1 ; + chardat[i] = -1; for (i=bc; i<=ec; i++) { if (no_repeats>0) { - no_repeats-- ; + no_repeats--; } else if (font_level>=0) { - cd = tfm32() ; - li = tfm32() ; + cd = tfm32(); + li = tfm32(); if (font_level==1) { - no_repeats = tfm16() ; - for (j=0; j<(npc|1); j++) tfm16() ; - ncw -= 3 + npc/2 ; + no_repeats = tfm16(); + for (j=0; j<(npc|1); j++) tfm16(); + ncw -= 3 + npc/2; } } else { - cd = tfm16() ; - li = tfm16() ; + cd = tfm16(); + li = tfm16(); } - if (cd) chardat[i] = cd ; + if (cd) chardat[i] = cd; } if (font_level==1&&ncw!=0) { char *msg = concat ("Table size mismatch in ", curfnt->name); error(msg); free(msg); } - scaledsize = curfnt->scaledsize ; - scaled = (integer *) xmalloc((nh + nd)*sizeof(integer)) ; + scaledsize = curfnt->scaledsize; + scaled = (integer *) xmalloc((nh + nd)*sizeof(integer)); for (i=0; i<nw; i++) - tfm32() ; + tfm32(); for (i=0; i<nh + nd; i++) - scaled[i] = scalewidth(tfm32(), scaledsize) ; + scaled[i] = scalewidth(tfm32(), scaledsize); for (i=0; i<ns; i++) - tfm32() ; - slant = tfm32() ; - (void)fclose(tfmfile) ; + tfm32(); + slant = tfm32(); + (void)fclose(tfmfile); for (i=0; i<pretend_no_chars; i++) { - cc = &(bbcurfnt->bbchardesc[i]) ; + cc = &(bbcurfnt->bbchardesc[i]); if (chardat[i] != -1) { - halfword iw ; - int ih, id ; + halfword iw; + int ih, id; if (font_level>=0) { - iw = chardat[i] >> 16 ; - ih = (chardat[i] >> 8) & 255 ; - id = chardat[i] & 255 ; + iw = chardat[i] >> 16; + ih = (chardat[i] >> 8) & 255; + id = chardat[i] & 255; } else { - iw = chardat[i] >> 8 ; - ih = (chardat[i] >> 4) & 15 ; - id = chardat[i] & 15 ; + iw = chardat[i] >> 8; + ih = (chardat[i] >> 4) & 15; + id = chardat[i] & 15; } - if (iw>=nw || ih>=nh || id>=nd) badtfm("char info") ; - cc->ury = scaled[ih] ; - cc->lly = - scaled[nh + id] ; - cc->llx = 0 ; - cc->urx = curfnt->chardesc[i].TFMwidth ; + if (iw>=nw || ih>=nh || id>=nd) badtfm("char info"); + cc->ury = scaled[ih]; + cc->lly = - scaled[nh + id]; + cc->llx = 0; + cc->urx = curfnt->chardesc[i].TFMwidth; } else { - cc->llx = cc->lly = cc->urx = cc->ury = 0 ; + cc->llx = cc->lly = cc->urx = cc->ury = 0; } } if (slant) { for (i=0; i<pretend_no_chars; i++) { - cc = &(bbcurfnt->bbchardesc[i]) ; - li = scalewidth(cc->lly, slant) ; - if (slant > 0) cc->llx += li ; - else cc->urx += li ; - li = scalewidth(cc->ury, slant) ; - if (slant > 0) cc->urx += li ; - else cc->llx += li ; + cc = &(bbcurfnt->bbchardesc[i]); + li = scalewidth(cc->lly, slant); + if (slant > 0) cc->llx += li; + else cc->urx += li; + li = scalewidth(cc->ury, slant); + if (slant > 0) cc->urx += li; + else cc->llx += li; } } - free(chardat) ; - free(scaled) ; + free(chardat); + free(scaled); } -static integer llx, lly, urx, ury ; +static integer llx, lly, urx, ury; void bbspecial(integer h, integer v, int nbytes) { - float *r = bbdospecial(nbytes) ; + float *r = bbdospecial(nbytes); if (r) { /* convert from magnified PostScript units back to scaled points */ - real conv = 72.0 * (real)num / (real)den * (real)mag / 254000000.0 ; + real conv = 72.0 * (real)num / (real)den * (real)mag / 254000000.0; if (llx > h + r[0] / conv) - llx = (integer) (h + r[0] / conv) ; + llx = (integer) (h + r[0] / conv); if (lly > v - r[3] / conv) - lly = (integer) (v - r[3] / conv) ; + lly = (integer) (v - r[3] / conv); if (urx < h + r[2] / conv) - urx = (integer) (h + r[2] / conv) ; + urx = (integer) (h + r[2] / conv); if (ury < v - r[1] / conv) - ury = (integer) (v - r[1] / conv) ; + ury = (integer) (v - r[1] / conv); } } void bbdopage(void) { - register shalfword cmd ; - register bbchardesctype *bcd ; - register chardesctype *cd ; - register integer h ; - register fontmaptype *cfnt ; - bbfontmaptype *bbcfnt ; - integer fnt ; - integer mychar ; - int charmove ; - struct dvistack *sp = stack ; - integer v, w, x, y, z ; - register fontdesctype *curfnt = 0 ; - register bbfontdesctype *bbcurfnt = 0 ; + register shalfword cmd; + register bbchardesctype *bcd; + register chardesctype *cd; + register integer h; + register fontmaptype *cfnt; + bbfontmaptype *bbcfnt; + integer fnt; + integer mychar; + int charmove; + struct dvistack *sp = stack; + integer v, w, x, y, z; + register fontdesctype *curfnt = 0; + register bbfontdesctype *bbcurfnt = 0; - w = x = y = z = 0 ; - h = 0 ; v = 0 ; - llx = lly = 1000000000 ; - urx = ury = -1000000000 ; - charmove = 0 ; + w = x = y = z = 0; + h = 0; v = 0; + llx = lly = 1000000000; + urx = ury = -1000000000; + charmove = 0; while (1) { switch (cmd=dvibyte()) { -case 138: break ; +case 138: break; case 134: /* put2 */ - if (noomega) error("! synch") ; - mychar = dvibyte() ; - mychar = (mychar << 8) + dvibyte() ; - charmove = 0 ; - goto dochar ; + if (noomega) error("! synch"); + mychar = dvibyte(); + mychar = (mychar << 8) + dvibyte(); + charmove = 0; + goto dochar; case 129: /* set2 */ - if (noomega) error("! synch") ; - mychar = dvibyte() ; - mychar = (mychar << 8) + dvibyte() ; + if (noomega) error("! synch"); + mychar = dvibyte(); + mychar = (mychar << 8) + dvibyte(); charmove = 1; - goto dochar ; + goto dochar; case 133: /* put1 */ - mychar = dvibyte() ; - charmove = 0 ; - goto dochar ; -case 128: cmd = dvibyte() ; /* set1 command drops through to setchar */ + mychar = dvibyte(); + charmove = 0; + goto dochar; +case 128: cmd = dvibyte(); /* set1 command drops through to setchar */ default: /* these are commands 0 (setchar0) thru 127 (setchar127) */ - mychar = cmd ; - charmove = 1 ; + mychar = cmd; + charmove = 1; dochar: - cd = &(curfnt->chardesc[mychar]) ; - bcd = &(bbcurfnt->bbchardesc[mychar]) ; - if (h + bcd->llx < llx) llx = h + bcd->llx ; - if (h + bcd->urx > urx) urx = h + bcd->urx ; - if (v - bcd->ury < lly) lly = v - bcd->ury ; - if (v - bcd->lly > ury) ury = v - bcd->lly ; + cd = &(curfnt->chardesc[mychar]); + bcd = &(bbcurfnt->bbchardesc[mychar]); + if (h + bcd->llx < llx) llx = h + bcd->llx; + if (h + bcd->urx > urx) urx = h + bcd->urx; + if (v - bcd->ury < lly) lly = v - bcd->ury; + if (v - bcd->lly > ury) ury = v - bcd->lly; if (charmove) - h += cd->TFMwidth ; - break ; + h += cd->TFMwidth; + break; case 130: case 131: case 135: case 136: case 139: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: /* unimplemented or illegal commands */ - error("! synch") ; + error("! synch"); case 132: case 137: /* rules */ - { integer ry, rx ; - ry = signedquad() ; rx = signedquad() ; + { integer ry, rx; + ry = signedquad(); rx = signedquad(); if (rx>0 && ry>0) { - if (h < llx) llx = h ; - if (v - ry < lly) lly = v - ry ; - if (h + rx > urx) urx = h + rx ; - if (v > ury) ury = v ; + if (h < llx) llx = h; + if (v - ry < lly) lly = v - ry; + if (h + rx > urx) urx = h + rx; + if (v > ury) ury = v; } else - rx = 0 ; + rx = 0; if (cmd != 137) - h += rx ; - break ; + h += rx; + break; } case 141: /* push */ - sp->h = h ; sp->v = v ; - sp->w = w ; sp->x = x ; sp->y = y ; sp->z = z ; - if (++sp >= &stack[STACKSIZE]) error("! Out of stack space") ; - break ; + sp->h = h; sp->v = v; + sp->w = w; sp->x = x; sp->y = y; sp->z = z; + if (++sp >= &stack[STACKSIZE]) error("! Out of stack space"); + break; case 140: /* eop or end of virtual character */ - return ; + return; case 142: /* pop */ - if (--sp < stack) error("! More pops than pushes") ; - h = sp->h ; v = sp->v ; - w = sp->w ; x = sp->x ; y = sp->y ; z = sp->z ; - break ; -case 143: h += signedbyte() ; break ; -case 144: h += signedpair() ; break ; -case 145: h += signedtrio() ; break ; -case 146: h += signedquad() ; break ; -case 147: h += w ; break ; -case 148: h += (w = signedbyte()) ; break ; -case 149: h += (w = signedpair()) ; break ; -case 150: h += (w = signedtrio()) ; break ; -case 151: h += (w = signedquad()) ; break ; -case 152: h += x ; break ; -case 153: h += (x = signedbyte()) ; break ; -case 154: h += (x = signedpair()) ; break ; -case 155: h += (x = signedtrio()) ; break ; -case 156: h += (x = signedquad()) ; break ; -case 157: v += signedbyte() ; break ; -case 158: v += signedpair() ; break ; -case 159: v += signedtrio() ; break ; -case 160: v += signedquad() ; break ; -case 161: v += y ; break ; -case 162: v += (y = signedbyte()) ; break ; -case 163: v += (y = signedpair()) ; break ; -case 164: v += (y = signedtrio()) ; break ; -case 165: v += (y = signedquad()) ; break ; -case 166: v += z ; break ; -case 167: v += (z = signedbyte()) ; break ; -case 168: v += (z = signedpair()) ; break ; -case 169: v += (z = signedtrio()) ; break ; -case 170: v += (z = signedquad()) ; break ; + if (--sp < stack) error("! More pops than pushes"); + h = sp->h; v = sp->v; + w = sp->w; x = sp->x; y = sp->y; z = sp->z; + break; +case 143: h += signedbyte(); break; +case 144: h += signedpair(); break; +case 145: h += signedtrio(); break; +case 146: h += signedquad(); break; +case 147: h += w; break; +case 148: h += (w = signedbyte()); break; +case 149: h += (w = signedpair()); break; +case 150: h += (w = signedtrio()); break; +case 151: h += (w = signedquad()); break; +case 152: h += x; break; +case 153: h += (x = signedbyte()); break; +case 154: h += (x = signedpair()); break; +case 155: h += (x = signedtrio()); break; +case 156: h += (x = signedquad()); break; +case 157: v += signedbyte(); break; +case 158: v += signedpair(); break; +case 159: v += signedtrio(); break; +case 160: v += signedquad(); break; +case 161: v += y; break; +case 162: v += (y = signedbyte()); break; +case 163: v += (y = signedpair()); break; +case 164: v += (y = signedtrio()); break; +case 165: v += (y = signedquad()); break; +case 166: v += z; break; +case 167: v += (z = signedbyte()); break; +case 168: v += (z = signedpair()); break; +case 169: v += (z = signedtrio()); break; +case 170: v += (z = signedquad()); break; case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: @@ -310,61 +310,61 @@ case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: /* font selection commands */ - if (cmd < 235) fnt = cmd - 171 ; /* fntnum0 thru fntnum63 */ + if (cmd < 235) fnt = cmd - 171; /* fntnum0 thru fntnum63 */ else { - fnt = dvibyte() ; + fnt = dvibyte(); while (cmd-- > 235) - fnt = (fnt << 8) + dvibyte() ; + fnt = (fnt << 8) + dvibyte(); } for (cfnt=ffont; cfnt; cfnt = cfnt->next) - if (cfnt->fontnum == fnt) break ; - curfnt = cfnt->desc ; + if (cfnt->fontnum == fnt) break; + curfnt = cfnt->desc; for (bbcfnt=bbffont; bbcfnt; bbcfnt = bbcfnt->next) - if (bbcfnt->fontnum == fnt) goto fontfound ; - bbcfnt = (bbfontmaptype *)mymalloc(sizeof(bbfontmaptype)) ; - bbcfnt->fontnum = fnt ; - bbcfnt->next = bbffont ; - bbffont = bbcfnt ; - bbtfmload(curfnt) ; -fontfound: bbcurfnt = bbcfnt->desc ; - break ; + if (bbcfnt->fontnum == fnt) goto fontfound; + bbcfnt = (bbfontmaptype *)mymalloc(sizeof(bbfontmaptype)); + bbcfnt->fontnum = fnt; + bbcfnt->next = bbffont; + bbffont = bbcfnt; + bbtfmload(curfnt); +fontfound: bbcurfnt = bbcfnt->desc; + break; case 243: case 244: case 245: case 246: /*fntdef1 */ - skipover(cmd - 230) ; - skipover(dvibyte() + dvibyte()) ; - break ; -case 239: bbspecial(h, v, (int)dvibyte()) ; break ; -case 240: bbspecial(h, v, (int)twobytes()) ; break ; -case 241: bbspecial(h, v, (int)threebytes()) ; break ; -case 242: bbspecial(h, v, (int)signedquad()) ; break ; + skipover(cmd - 230); + skipover(dvibyte() + dvibyte()); + break; +case 239: bbspecial(h, v, (int)dvibyte()); break; +case 240: bbspecial(h, v, (int)twobytes()); break; +case 241: bbspecial(h, v, (int)threebytes()); break; +case 242: bbspecial(h, v, (int)signedquad()); break; } } } void findbb(integer bop) { - integer curpos = ftell(dvifile) ; - real conv = 72.0 * (real)num / (real)den * (real)mag / 254000000.0 ; - real off = 72.0 / conv ; - real margin = 1.0 / conv ; - real vsize = 792.0 / conv ; - real hadj = -72.0 * hoff / 4736286.72 ; - real vadj = 72.0 * voff / 4736286.72 ; + integer curpos = ftell(dvifile); + real conv = 72.0 * (real)num / (real)den * (real)mag / 254000000.0; + real off = 72.0 / conv; + real margin = 1.0 / conv; + real vsize = 792.0 / conv; + real hadj = -72.0 * hoff / 4736286.72; + real vadj = 72.0 * voff / 4736286.72; - fseek(dvifile, bop, 0) ; - bbdopage() ; - fseek(dvifile, curpos, 0) ; - lly = (int) (vsize - 2 * off - lly) ; - ury = (int) (vsize - 2 * off - ury) ; - llx = (int)floor((llx + off - margin) * conv - hadj + 0.5) ; - lly = (int)floor((lly + off + margin) * conv - vadj + 0.5) ; - urx = (int)floor((urx + off + margin) * conv - hadj + 0.5) ; - ury = (int)floor((ury + off - margin) * conv - vadj + 0.5) ; + fseek(dvifile, bop, 0); + bbdopage(); + fseek(dvifile, curpos, 0); + lly = (int) (vsize - 2 * off - lly); + ury = (int) (vsize - 2 * off - ury); + llx = (int)floor((llx + off - margin) * conv - hadj + 0.5); + lly = (int)floor((lly + off + margin) * conv - vadj + 0.5); + urx = (int)floor((urx + off + margin) * conv - hadj + 0.5); + ury = (int)floor((ury + off - margin) * conv - vadj + 0.5); /* no marks on the page? */ if (llx >= urx || lly <= ury) - llx = lly = urx = ury = 72 ; + llx = lly = urx = ury = 72; #ifdef SHORTINT - sprintf(nextstring, "%ld %ld %ld %ld", llx, ury, urx, lly) ; + sprintf(nextstring, "%ld %ld %ld %ld", llx, ury, urx, lly); #else - sprintf(nextstring, "%d %d %d %d", llx, ury, urx, lly) ; + sprintf(nextstring, "%d %d %d %d", llx, ury, urx, lly); #endif } diff --git a/Build/source/texk/dvipsk/color.c b/Build/source/texk/dvipsk/color.c index 75f992d702f..a4ee12b8b19 100644 --- a/Build/source/texk/dvipsk/color.c +++ b/Build/source/texk/dvipsk/color.c @@ -34,12 +34,12 @@ * these. */ static struct colorpage { - struct colorpage *next ; - integer boploc ; /* we use the bop loc as a page indicator */ - char *bg ; - char colordat[2] ; -} *colorhash[COLORHASH] ; -static char *cstack, *csp, *cend, *bg ; + struct colorpage *next; + integer boploc; /* we use the bop loc as a page indicator */ + char *bg; + char colordat[2]; +} *colorhash[COLORHASH]; +static char *cstack, *csp, *cend, *bg; /* * This routine sends a color command out. If the command is a * single `word' or starts with a double quote, we send it out @@ -50,50 +50,50 @@ static char *cstack, *csp, *cend, *bg ; void colorcmdout(char *s) { - char *p ; - char tempword[100] ; + char *p; + char tempword[100]; while (*s && *s <= ' ') - s++ ; + s++; if (*s == '"') { - cmdout(s+1) ; - return ; + cmdout(s+1); + return; } - for (p=s; *p && *p > ' '; p++) ; - for (; *p && *p <= ' '; p++) ; + for (p=s; *p && *p > ' '; p++); + for (; *p && *p <= ' '; p++); if (*p == 0) { - cmdout(s) ; - return ; + cmdout(s); + return; } - cmdout(p) ; - strcpy(tempword, "TeXcolor") ; + cmdout(p); + strcpy(tempword, "TeXcolor"); for (p=tempword + strlen(tempword); *s && *s > ' '; p++, s++) - *p = *s ; - *p = 0 ; - cmdout(tempword) ; - return ; + *p = *s; + *p = 0; + cmdout(tempword); + return; } /* * For a new dvi file, call this. Frees all allocated memory. */ #define DEFAULTCOLOR "Black" void initcolor(void) { - int i ; - struct colorpage *p, *q ; + int i; + struct colorpage *p, *q; for (i=0; i<COLORHASH; i++) { for (p=colorhash[i]; p; p = q) { - q = p->next ; - free(p) ; + q = p->next; + free(p); } - colorhash[i] = 0 ; + colorhash[i] = 0; } - cstack = (char *)mymalloc(INITCOLORLEN) ; - strcpy(cstack, "\n") ; - strcat(cstack, DEFAULTCOLOR) ; - csp = cstack + strlen(cstack) ; - cend = cstack + INITCOLORLEN - 3 ; /* for conservativeness */ - bg = 0 ; + cstack = (char *)mymalloc(INITCOLORLEN); + strcpy(cstack, "\n"); + strcat(cstack, DEFAULTCOLOR); + csp = cstack + strlen(cstack); + cend = cstack + INITCOLORLEN - 3; /* for conservativeness */ + bg = 0; } /* * This takes a call from predospecial to set the background color for @@ -105,9 +105,9 @@ background(char *bkgrnd) { if (bkgrnd && *bkgrnd) { if (strlen(bkgrnd) > MAXCOLORLEN) - error(" color name too long; ignored") ; + error(" color name too long; ignored"); else - strcpy(bg, bkgrnd) ; + strcpy(bg, bkgrnd); } } /* @@ -118,18 +118,18 @@ void pushcolor(char *p, Boolean outtops) { while (strlen(p) + csp > cend) { - int newlen = 3 * (cend - cstack) ; - char *newcs = (char *)mymalloc(newlen) ; - strcpy(newcs, cstack) ; - csp = newcs + (csp - cstack) ; - cend = newcs + newlen - 3 ; - cstack = newcs ; + int newlen = 3 * (cend - cstack); + char *newcs = (char *)mymalloc(newlen); + strcpy(newcs, cstack); + csp = newcs + (csp - cstack); + cend = newcs + newlen - 3; + cstack = newcs; } - *csp++ = '\n' ; - strcpy(csp, p) ; - csp += strlen(p) ; + *csp++ = '\n'; + strcpy(csp, p); + csp += strlen(p); if (outtops) { - colorcmdout(p) ; + colorcmdout(p); } } /* @@ -139,18 +139,18 @@ pushcolor(char *p, Boolean outtops) void popcolor(Boolean outtops) { - char *p = csp - 1 ; + char *p = csp - 1; while (p >= cstack && *p != '\n') - p-- ; + p--; if (p == cstack) - return ; /* We don't pop the last color as that is global */ - *p = 0 ; - csp = p ; - for (p--; p >= cstack && *p != '\n'; p--) ; - p++ ; + return; /* We don't pop the last color as that is global */ + *p = 0; + csp = p; + for (p--; p >= cstack && *p != '\n'; p--); + p++; if ( outtops ) { - colorcmdout(p) ; + colorcmdout(p); } } /* @@ -160,24 +160,24 @@ popcolor(Boolean outtops) void resetcolorstack(char * p, int outtops) { - char *q = csp - 1 ; + char *q = csp - 1; while (q > cstack && *q != '\n') - q-- ; + q--; if (q > cstack && outtops == 0) { #ifdef SHORTINT - (void)fprintf(stderr, "You've mistakenly made a global color change ") ; - (void)fprintf(stderr, "to %s within nested colors\n", p) ; - (void)fprintf(stderr, "on page %ld. Will try to recover.\n", pagenum) ; + (void)fprintf(stderr, "You've mistakenly made a global color change "); + (void)fprintf(stderr, "to %s within nested colors\n", p); + (void)fprintf(stderr, "on page %ld. Will try to recover.\n", pagenum); #else /* ~SHORTINT */ - (void)fprintf(stderr, "You've mistakenly made a global color change ") ; - (void)fprintf(stderr, "to %s within nested colors\n", p) ; - (void)fprintf(stderr, "on page %d. Will try to recover.\n", pagenum) ; + (void)fprintf(stderr, "You've mistakenly made a global color change "); + (void)fprintf(stderr, "to %s within nested colors\n", p); + (void)fprintf(stderr, "on page %d. Will try to recover.\n", pagenum); #endif /* ~SHORTINT */ } - csp = cstack ; - *csp = 0 ; - pushcolor(p, outtops) ; + csp = cstack; + *csp = 0; + pushcolor(p, outtops); } /* * This routine is a bit magic. It looks up the page in the current @@ -195,46 +195,46 @@ resetcolorstack(char * p, int outtops) void bopcolor(int outtops) { - integer pageloc = ftell(dvifile) ; - int h = pageloc % COLORHASH ; - struct colorpage *p = colorhash[h] ; + integer pageloc = ftell(dvifile); + int h = pageloc % COLORHASH; + struct colorpage *p = colorhash[h]; while (p) { if (p->boploc == pageloc) - break ; + break; else - p = p->next ; + p = p->next; } if (p) { - strcpy(cstack, p->colordat) ; - csp = cstack + strlen(cstack) ; - bg = p->bg ; + strcpy(cstack, p->colordat); + csp = cstack + strlen(cstack); + bg = p->bg; if (outtops && strcmp(bg, "White")!=0 && bg[0]) { - cmdout("gsave") ; - colorcmdout(bg) ; - cmdout("clippath fill grestore") ; + cmdout("gsave"); + colorcmdout(bg); + cmdout("clippath fill grestore"); } } else { p = (struct colorpage *)mymalloc((integer) - (strlen(cstack) + sizeof(struct colorpage) + MAXCOLORLEN)) ; - p->next = colorhash[h] ; - p->boploc = pageloc ; - strcpy(p->colordat, cstack) ; - p->bg = p->colordat + strlen(cstack) + 1 ; + (strlen(cstack) + sizeof(struct colorpage) + MAXCOLORLEN)); + p->next = colorhash[h]; + p->boploc = pageloc; + strcpy(p->colordat, cstack); + p->bg = p->colordat + strlen(cstack) + 1; if (bg) - strcpy(p->bg, bg) ; + strcpy(p->bg, bg); else - *(p->bg) = 0 ; - bg = p->bg ; - colorhash[h] = p ; + *(p->bg) = 0; + bg = p->bg; + colorhash[h] = p; } if (outtops) { - char *pp = csp - 1 ; + char *pp = csp - 1; while (pp >= cstack && *pp != '\n') - pp-- ; - pp++ ; + pp--; + pp++; if (strcmp(pp, DEFAULTCOLOR)!=0) { - colorcmdout(pp) ; + colorcmdout(pp); } } } diff --git a/Build/source/texk/dvipsk/debug.h b/Build/source/texk/dvipsk/debug.h index 63c4857526a..beeccd521c5 100644 --- a/Build/source/texk/dvipsk/debug.h +++ b/Build/source/texk/dvipsk/debug.h @@ -18,6 +18,6 @@ #ifndef KPATHSEA #define fopen my_real_fopen -extern FILE *my_real_fopen() ; +extern FILE *my_real_fopen(); #endif #endif /* DEBUG */ diff --git a/Build/source/texk/dvipsk/dopage.c b/Build/source/texk/dvipsk/dopage.c index d2ca326ac9c..436508db76b 100644 --- a/Build/source/texk/dvipsk/dopage.c +++ b/Build/source/texk/dvipsk/dopage.c @@ -26,275 +26,275 @@ * Most error checking is suppressed because the prescan has already * verified that the DVI data is OK....except for stack over/underflow. */ -struct dvistack stack[STACKSIZE] ; +struct dvistack stack[STACKSIZE]; #ifdef HPS -integer hhmem, vvmem ; -integer pushcount = 0 ; -Boolean PAGEUS_INTERUPPTUS = 0 ; -Boolean NEED_NEW_BOX = 0 ; -integer H_BREAK ; /* An empirical parameter for guessing line breaks; needs +integer hhmem, vvmem; +integer pushcount = 0; +Boolean PAGEUS_INTERUPPTUS = 0; +Boolean NEED_NEW_BOX = 0; +integer H_BREAK; /* An empirical parameter for guessing line breaks; needs dpi dependence */ #endif void dopage(void) { - register shalfword cmd ; - register integer p ; - register chardesctype *cd ; - register integer h ; - register fontmaptype *cfnt ; - register frametype *frp = frames ; - integer fnt ; + register shalfword cmd; + register integer p; + register chardesctype *cd; + register integer h; + register fontmaptype *cfnt; + register frametype *frp = frames; + integer fnt; integer mychar; - int charmove ; - struct dvistack *sp = stack ; - integer v, w, x, y, z ; - integer roundpos ; - integer thinspace ; - integer vertsmallspace ; + int charmove; + struct dvistack *sp = stack; + integer v, w, x, y, z; + integer roundpos; + integer thinspace; + integer vertsmallspace; #ifdef XENIX - integer iconv ; - integer viconv ; + integer iconv; + integer viconv; - iconv = (integer)(1.0 / conv + 0.5) ; - viconv = (integer)(1.0 / vconv + 0.5) ; + iconv = (integer)(1.0 / conv + 0.5); + viconv = (integer)(1.0 / vconv + 0.5); #else #ifdef __THINK__ - integer iconv ; - integer viconv ; + integer iconv; + integer viconv; - iconv = (integer)(1.0 / conv + 0.5) ; - viconv = (integer)(1.0 / vconv + 0.5) ; + iconv = (integer)(1.0 / conv + 0.5); + viconv = (integer)(1.0 / vconv + 0.5); #endif #endif #ifdef EMTEX - emclear() ; + emclear(); #endif - pageinit() ; + pageinit(); - bopcolor(1) ; - thinspace = (integer)(0.025*DPI/conv) ; /* 0.025 inches */ - vertsmallspace = (integer)(0.025*VDPI/vconv) ; /* 0.025 inches */ + bopcolor(1); + thinspace = (integer)(0.025*DPI/conv); /* 0.025 inches */ + vertsmallspace = (integer)(0.025*VDPI/vconv); /* 0.025 inches */ #ifdef HPS - if (HPS_FLAG) pagecounter++ ; - H_BREAK = (30 * DPI / 400 ) ; /* 30 seems to have worked well at 400 dpi */ + if (HPS_FLAG) pagecounter++; + H_BREAK = (30 * DPI / 400 ); /* 30 seems to have worked well at 400 dpi */ #endif - w = x = y = z = 0 ; - h = (integer) (DPI / conv * hoff / 4736286.72) ; - v = (integer) (DPI / conv * voff / 4736286.72) ; - hh = PixRound(h) ; - vv = PixRound(v) ; - curfnt = NULL ; - curpos = NULL ; - charmove = 0 ; + w = x = y = z = 0; + h = (integer) (DPI / conv * hoff / 4736286.72); + v = (integer) (DPI / conv * voff / 4736286.72); + hh = PixRound(h); + vv = PixRound(v); + curfnt = NULL; + curpos = NULL; + charmove = 0; beginloop: switch (cmd=dvibyte()) { -case 138: goto beginloop ; /* nop command does nuttin */ +case 138: goto beginloop; /* nop command does nuttin */ /* * For put1 commands, we subtract the width of the character before * dropping through to the normal character setting routines. This */ case 134: /* put2 */ - if (noomega) error("! synch") ; - mychar = dvibyte() ; - mychar = (mychar << 8) + dvibyte() ; - charmove = 0 ; - goto dochar ; + if (noomega) error("! synch"); + mychar = dvibyte(); + mychar = (mychar << 8) + dvibyte(); + charmove = 0; + goto dochar; case 129: /* set2 */ - if (noomega) error("! synch") ; - mychar = dvibyte() ; - mychar = (mychar << 8) + dvibyte() ; - charmove = 1 ; - goto dochar ; + if (noomega) error("! synch"); + mychar = dvibyte(); + mychar = (mychar << 8) + dvibyte(); + charmove = 1; + goto dochar; case 133: /* put1 */ - mychar = dvibyte() ; - charmove = 0 ; - goto dochar ; -case 128: cmd = dvibyte() ; /* set1 command drops through to setchar */ + mychar = dvibyte(); + charmove = 0; + goto dochar; +case 128: cmd = dvibyte(); /* set1 command drops through to setchar */ default: /* these are commands 0 (setchar0) thru 127 (setchar127) */ - mychar = cmd ; - charmove = 1 ; + mychar = cmd; + charmove = 1; dochar: #ifdef HPS if (HPS_FLAG && PAGEUS_INTERUPPTUS) { - HREF_COUNT-- ; - start_new_box() ; - PAGEUS_INTERUPPTUS = 0 ; + HREF_COUNT--; + start_new_box(); + PAGEUS_INTERUPPTUS = 0; } if (HPS_FLAG && NEED_NEW_BOX) { vertical_in_hps(); NEED_NEW_BOX = 0; } #endif - cd = &(curfnt->chardesc[mychar]) ; + cd = &(curfnt->chardesc[mychar]); if (cd->flags & EXISTS) { if (curfnt->loaded == 2) { /* virtual character being typeset */ if (charmove) { - sp->hh = hh + cd->pixelwidth ; - sp->h = h + cd->TFMwidth ; + sp->hh = hh + cd->pixelwidth; + sp->h = h + cd->TFMwidth; } else { - sp->hh = hh ; sp->h = h ; + sp->hh = hh; sp->h = h; } - sp->vv = vv ; sp-> v = v ; - sp->w = w ; sp->x = x ; sp->y = y ; sp->z = z ; - if (++sp >= &stack[STACKSIZE]) error("! Out of stack space") ; - w = x = y = z = 0 ; /* will be in relative units at new stack level */ - frp->curp = curpos ; - frp->curl = curlim ; - frp->ff = ffont ; - frp->curf = curfnt ; + sp->vv = vv; sp-> v = v; + sp->w = w; sp->x = x; sp->y = y; sp->z = z; + if (++sp >= &stack[STACKSIZE]) error("! Out of stack space"); + w = x = y = z = 0; /* will be in relative units at new stack level */ + frp->curp = curpos; + frp->curl = curlim; + frp->ff = ffont; + frp->curf = curfnt; if (++frp == &frames[MAXFRAME] ) - error("! virtual recursion stack overflow") ; - curpos = cd->packptr + 2 ; - curlim = curpos + (256*(long)(*cd->packptr)+(*(cd->packptr+1))) ; - ffont = curfnt->localfonts ; + error("! virtual recursion stack overflow"); + curpos = cd->packptr + 2; + curlim = curpos + (256*(long)(*cd->packptr)+(*(cd->packptr+1))); + ffont = curfnt->localfonts; if (ffont) { - curfnt = ffont->desc ; - thinspace = curfnt->thinspace ; + curfnt = ffont->desc; + thinspace = curfnt->thinspace; } else { - curfnt = NULL ; - thinspace = vertsmallspace ; + curfnt = NULL; + thinspace = vertsmallspace; } - goto beginloop ; + goto beginloop; } - drawchar(cd, mychar) ; + drawchar(cd, mychar); } if (charmove) { - h += cd->TFMwidth ; - hh += cd->pixelwidth ; + h += cd->TFMwidth; + hh += cd->pixelwidth; } - goto setmotion ; + goto setmotion; case 130: case 131: case 135: case 136: case 139: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: /* unimplemented or illegal commands */ - error("! synch") ; + error("! synch"); case 132: case 137: /* rules */ - { integer ry, rx , rxx, ryy ; - ry = signedquad() ; rx = signedquad() ; + { integer ry, rx , rxx, ryy; + ry = signedquad(); rx = signedquad(); if (rx>0 && ry>0) { if (curpos) { - rx = scalewidth(rx, (frp-1)->curf->scaledsize) ; - ry = scalewidth(ry, (frp-1)->curf->scaledsize) ; + rx = scalewidth(rx, (frp-1)->curf->scaledsize); + ry = scalewidth(ry, (frp-1)->curf->scaledsize); } - rxx = (int)(conv * rx + 0.9999999) ; - ryy = (int)(vconv * ry + 0.9999999) ; - drawrule(rxx, ryy) ; + rxx = (int)(conv * rx + 0.9999999); + ryy = (int)(vconv * ry + 0.9999999); + drawrule(rxx, ryy); } else - rxx = 0 ; - if (cmd == 137) goto beginloop ; - h += rx ; hh += rxx ; - goto setmotion ; + rxx = 0; + if (cmd == 137) goto beginloop; + h += rx; hh += rxx; + goto setmotion; } case 141: /* push */ #ifdef HPS - if (HPS_FLAG) pushcount++ ; + if (HPS_FLAG) pushcount++; /* if (HPS_FLAG && PAGEUS_INTERUPPTUS) { - HREF_COUNT-- ; - start_new_box() ; - PAGEUS_INTERUPPTUS = 0 ; + HREF_COUNT--; + start_new_box(); + PAGEUS_INTERUPPTUS = 0; } */ if (HPS_FLAG && NEED_NEW_BOX) { vertical_in_hps(); NEED_NEW_BOX = 0; } - /* printf("push %i, %i\n", pushcount, inHTMLregion) ; */ + /* printf("push %i, %i\n", pushcount, inHTMLregion); */ #endif - sp->hh = hh ; sp->vv = vv ; sp->h = h ; sp->v = v ; - sp->w = w ; sp->x = x ; sp->y = y ; sp->z = z ; - if (++sp >= &stack[STACKSIZE]) error("! Out of stack space") ; - goto beginloop ; + sp->hh = hh; sp->vv = vv; sp->h = h; sp->v = v; + sp->w = w; sp->x = x; sp->y = y; sp->z = z; + if (++sp >= &stack[STACKSIZE]) error("! Out of stack space"); + goto beginloop; case 140: /* eop or end of virtual character */ if (curpos == NULL) { /* eop */ #ifdef HPS - if (HPS_FLAG && inHTMLregion) PAGEUS_INTERUPPTUS = 1 ; + if (HPS_FLAG && inHTMLregion) PAGEUS_INTERUPPTUS = 1; /* printf("Page interrupted"); */ #endif break; } - --frp ; - curfnt = frp->curf ; - thinspace = (curfnt) ? curfnt->thinspace : vertsmallspace ; - ffont = frp->ff ; - curlim = frp->curl ; - curpos = frp->curp ; + --frp; + curfnt = frp->curf; + thinspace = (curfnt) ? curfnt->thinspace : vertsmallspace; + ffont = frp->ff; + curlim = frp->curl; + curpos = frp->curp; if (hh < (sp-1)->hh+2 && hh > (sp-1)->hh-2) (sp-1)->hh = hh; /* retain `intelligence' of pixel width, if close */ /* falls through */ case 142: /* pop */ #ifdef HPS - pushcount-- ; - /* printf("pop %i\n", pushcount) ; */ + pushcount--; + /* printf("pop %i\n", pushcount); */ #endif - if (--sp < stack) error("! More pops than pushes") ; + if (--sp < stack) error("! More pops than pushes"); #ifdef HPS if (HPS_FLAG) { - hhmem = hh ; vvmem = vv ; + hhmem = hh; vvmem = vv; } #endif - hh = sp->hh ; vv = sp->vv ; h = sp->h ; v = sp->v ; - w = sp->w ; x = sp->x ; y = sp->y ; z = sp->z ; + hh = sp->hh; vv = sp->vv; h = sp->h; v = sp->v; + w = sp->w; x = sp->x; y = sp->y; z = sp->z; #ifdef HPS if (HPS_FLAG && inHTMLregion && (hhmem - hh > H_BREAK) && (pushcount > 0) && (pushcount < current_pushcount)) - end_current_box() ; + end_current_box(); #endif - goto beginloop ; + goto beginloop; case 143: /* right1 */ - p = signedbyte() ; goto horizontalmotion ; + p = signedbyte(); goto horizontalmotion; case 144: /* right2 */ - p = signedpair() ; goto horizontalmotion ; + p = signedpair(); goto horizontalmotion; case 145: /* right3 */ - p = signedtrio() ; goto horizontalmotion ; + p = signedtrio(); goto horizontalmotion; case 146: /* right4 */ - p = signedquad() ; goto horizontalmotion ; + p = signedquad(); goto horizontalmotion; case 147: /* w0 */ - p = w ; goto horizontalmotion ; + p = w; goto horizontalmotion; case 148: /* w1 */ - p = w = signedbyte() ; goto horizontalmotion ; + p = w = signedbyte(); goto horizontalmotion; case 149: /* w2 */ - p = w = signedpair() ; goto horizontalmotion ; + p = w = signedpair(); goto horizontalmotion; case 150: /* w3 */ - p = w = signedtrio() ; goto horizontalmotion ; + p = w = signedtrio(); goto horizontalmotion; case 151: /* w4 */ - p = w = signedquad() ; goto horizontalmotion ; + p = w = signedquad(); goto horizontalmotion; case 152: /* x0 */ - p = x ; goto horizontalmotion ; + p = x; goto horizontalmotion; case 153: /* x1 */ - p = x = signedbyte() ; goto horizontalmotion ; + p = x = signedbyte(); goto horizontalmotion; case 154: /* x2 */ - p = x = signedpair() ; goto horizontalmotion ; + p = x = signedpair(); goto horizontalmotion; case 155: /* x3 */ - p = x = signedtrio() ; goto horizontalmotion ; + p = x = signedtrio(); goto horizontalmotion; case 156: /* x4 */ - p = x = signedquad() ; goto horizontalmotion ; + p = x = signedquad(); goto horizontalmotion; case 157: /* down1 */ - p = signedbyte() ; goto verticalmotion ; + p = signedbyte(); goto verticalmotion; case 158: /* down2 */ - p = signedpair() ; goto verticalmotion ; + p = signedpair(); goto verticalmotion; case 159: /* down3 */ - p = signedtrio() ; goto verticalmotion ; + p = signedtrio(); goto verticalmotion; case 160: /* down4 */ - p = signedquad() ; goto verticalmotion ; + p = signedquad(); goto verticalmotion; case 161: /* y0 */ - p = y ; goto verticalmotion ; + p = y; goto verticalmotion; case 162: /* y1 */ - p = y = signedbyte() ; goto verticalmotion ; + p = y = signedbyte(); goto verticalmotion; case 163: /* y2 */ - p = y = signedpair() ; goto verticalmotion ; + p = y = signedpair(); goto verticalmotion; case 164: /* y3 */ - p = y = signedtrio() ; goto verticalmotion ; + p = y = signedtrio(); goto verticalmotion; case 165: /* y4 */ - p = y = signedquad() ; goto verticalmotion ; + p = y = signedquad(); goto verticalmotion; case 166: /* z0 */ - p = z ; goto verticalmotion ; + p = z; goto verticalmotion; case 167: /* z1 */ - p = z = signedbyte() ; goto verticalmotion ; + p = z = signedbyte(); goto verticalmotion; case 168: /* z2 */ - p = z = signedpair() ; goto verticalmotion ; + p = z = signedpair(); goto verticalmotion; case 169: /* z3 */ - p = z = signedtrio() ; goto verticalmotion ; + p = z = signedtrio(); goto verticalmotion; case 170: /* z4 */ - p = z = signedquad() ; goto verticalmotion ; + p = z = signedquad(); goto verticalmotion; case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: @@ -305,37 +305,37 @@ case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: /* font selection commands */ - if (cmd < 235) fnt = cmd - 171 ; /* fntnum0 thru fntnum63 */ + if (cmd < 235) fnt = cmd - 171; /* fntnum0 thru fntnum63 */ else { - fnt = dvibyte() ; + fnt = dvibyte(); while (cmd-- > 235) - fnt = (fnt << 8) + dvibyte() ; + fnt = (fnt << 8) + dvibyte(); } for (cfnt=ffont; cfnt; cfnt = cfnt->next) - if (cfnt->fontnum == fnt) break ; - curfnt = cfnt->desc ; - thinspace = curfnt->thinspace ; - goto beginloop ; + if (cfnt->fontnum == fnt) break; + curfnt = cfnt->desc; + thinspace = curfnt->thinspace; + goto beginloop; case 243: case 244: case 245: case 246: /*fntdef1 */ - skipover(cmd - 230) ; - skipover(dvibyte() + dvibyte()) ; - goto beginloop ; + skipover(cmd - 230); + skipover(dvibyte() + dvibyte()); + goto beginloop; case 239: /* xxx1 */ - p = dvibyte() ; - dospecial(p) ; - goto beginloop ; + p = dvibyte(); + dospecial(p); + goto beginloop; case 240: /* xxx2 */ - p = twobytes() ; - dospecial(p) ; - goto beginloop ; + p = twobytes(); + dospecial(p); + goto beginloop; case 241: /* xxx3 */ - p = threebytes() ; - dospecial(p) ; - goto beginloop ; + p = threebytes(); + dospecial(p); + goto beginloop; case 242: /* xxx4 */ - p = signedquad() ; - dospecial(p) ; - goto beginloop ; + p = signedquad(); + dospecial(p); + goto beginloop; /* * The calculations here are crucial to the appearance of the document. @@ -347,22 +347,22 @@ case 242: /* xxx4 */ verticalmotion: /* vertical motion cases */ if (curpos) - p = scalewidth(p, (frp-1)->curf->scaledsize) ; - v += p ; - if (p >= vertsmallspace) vv = VPixRound(v) ; - else if (p <= -vertsmallspace) vv = VPixRound(v) ; + p = scalewidth(p, (frp-1)->curf->scaledsize); + v += p; + if (p >= vertsmallspace) vv = VPixRound(v); + else if (p <= -vertsmallspace) vv = VPixRound(v); else - { vv += VPixRound(p) ; - roundpos = VPixRound(v) ; - if (roundpos - vv > vmaxdrift) vv = roundpos - vmaxdrift ; - else if (vv - roundpos > vmaxdrift) vv = roundpos + vmaxdrift ; + { vv += VPixRound(p); + roundpos = VPixRound(v); + if (roundpos - vv > vmaxdrift) vv = roundpos - vmaxdrift; + else if (vv - roundpos > vmaxdrift) vv = roundpos + vmaxdrift; } #ifdef HPS /* printf("Doing vertical motion: p = %i, v = %i, vv = %i\n",p,v,vv); */ - /* printf("inHTMLregion %i\n", inHTMLregion) ; */ + /* printf("inHTMLregion %i\n", inHTMLregion); */ if (HPS_FLAG && inHTMLregion) NEED_NEW_BOX = 1 /* vertical_in_hps() */; #endif - goto beginloop ; + goto beginloop; /* * Horizontal motion is analogous. We know the exact width of each * character in pixels. Kerning is distinguished from space between @@ -372,21 +372,21 @@ verticalmotion: horizontalmotion: /* horizontal motion cases */ if (curpos) - p = scalewidth(p, (frp-1)->curf->scaledsize) ; - h += p ; + p = scalewidth(p, (frp-1)->curf->scaledsize); + h += p; if (p >= thinspace || p <= -6 * thinspace) { - hh = PixRound(h) ; goto beginloop ; + hh = PixRound(h); goto beginloop; } - else hh += PixRound(p) ; + else hh += PixRound(p); #ifdef HPS /* printf("Doing horizontal motion: p = %i, h = %i, hh = %i\n",p,h,hh); */ #endif setmotion: - roundpos = PixRound(h) ; - if (roundpos - hh > maxdrift) { hh = roundpos - maxdrift ; } - else if (hh - roundpos > maxdrift) { hh = roundpos + maxdrift ; } -goto beginloop ; + roundpos = PixRound(h); + if (roundpos - hh > maxdrift) { hh = roundpos - maxdrift; } + else if (hh - roundpos > maxdrift) { hh = roundpos + maxdrift; } +goto beginloop; } /* end of the big switch */ - pageend() ; + pageend(); } diff --git a/Build/source/texk/dvipsk/dosection.c b/Build/source/texk/dvipsk/dosection.c index 0a33ee63bdc..426ca5d70e8 100644 --- a/Build/source/texk/dvipsk/dosection.c +++ b/Build/source/texk/dvipsk/dosection.c @@ -7,9 +7,9 @@ */ #include "protos.h" -static int psfont ; +static int psfont; #ifdef HPS -int pagecounter ; +int pagecounter; #endif /* @@ -18,76 +18,76 @@ int pagecounter ; void dosection(sectiontype *s, int c) { - charusetype *cu ; - integer prevptr ; - int np ; - int k ; - integer thispage = 0 ; + charusetype *cu; + integer prevptr; + int np; + int k; + integer thispage = 0; char buf[104]; - dopsfont(s) ; + dopsfont(s); #ifdef HPS if (HPS_FLAG) pagecounter = 0; #endif if (multiplesects) { - setup() ; + setup(); } - cmdout("TeXDict") ; - cmdout("begin") ; - numout(hpapersize) ; - numout(vpapersize) ; - doubleout(mag) ; - numout((integer)DPI) ; - numout((integer)VDPI) ; - sprintf(buf, "(%.99s)", fulliname) ; - cmdout(buf) ; - cmdout("@start") ; + cmdout("TeXDict"); + cmdout("begin"); + numout(hpapersize); + numout(vpapersize); + doubleout(mag); + numout((integer)DPI); + numout((integer)VDPI); + sprintf(buf, "(%.99s)", fulliname); + cmdout(buf); + cmdout("@start"); if (multiplesects) - cmdout("bos") ; + cmdout("bos"); /* * We insure raster is even-word aligned, because download might want that. */ if (bytesleft & 1) { - bytesleft-- ; - raster++ ; + bytesleft--; + raster++; } - cleanres() ; - cu = (charusetype *) (s + 1) ; - psfont = 1 ; + cleanres(); + cu = (charusetype *) (s + 1); + psfont = 1; while (cu->fd) { if (cu->psfused) - cu->fd->psflag = EXISTS ; - download(cu++, psfont++) ; + cu->fd->psflag = EXISTS; + download(cu++, psfont++); } - fonttableout() ; + fonttableout(); if (! multiplesects) { - cmdout("end") ; - setup() ; + cmdout("end"); + setup(); } for (cu=(charusetype *)(s+1); cu->fd; cu++) - cu->fd->psflag = 0 ; + cu->fd->psflag = 0; while (c > 0) { - c-- ; - prevptr = s->bos ; + c--; + prevptr = s->bos; if (! reverse) - (void)fseek(dvifile, (long)prevptr, 0) ; - np = s->numpages ; + (void)fseek(dvifile, (long)prevptr, 0); + np = s->numpages; while (np-- != 0) { if (reverse) - (void)fseek(dvifile, (long)prevptr, 0) ; - pagenum = signedquad() ; + (void)fseek(dvifile, (long)prevptr, 0); + pagenum = signedquad(); if ((evenpages && (pagenum & 1)) || (oddpages && (pagenum & 1)==0) || (pagelist && !InPageList(pagenum))) { if (reverse) { - skipover(36) ; - prevptr = signedquad()+1 ; + skipover(36); + prevptr = signedquad()+1; } else { - skipover(40) ; - skippage() ; - skipnop() ; + skipover(40); + skippage(); + skipnop(); } - ++np ; /* this page wasn't counted for s->numpages */ + ++np; /* this page wasn't counted for s->numpages */ continue; } /* @@ -95,75 +95,75 @@ dosection(sectiontype *s, int c) * small, so we do it quick. */ if (! quiet) { - int t = pagenum, i = 0 ; + int t = pagenum, i = 0; if (t < 0) { - t = -t ; - i++ ; + t = -t; + i++; } do { - i++ ; - t /= 10 ; - } while (t > 0) ; + i++; + t /= 10; + } while (t > 0); if (pagecopies < 20) - i += pagecopies - 1 ; + i += pagecopies - 1; if (i + prettycolumn > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } - prettycolumn += i + 1 ; + prettycolumn += i + 1; #ifdef SHORTINT - (void)fprintf(stderr, "[%ld", pagenum) ; + (void)fprintf(stderr, "[%ld", pagenum); #else /* ~SHORTINT */ - (void)fprintf(stderr, "[%d", pagenum) ; + (void)fprintf(stderr, "[%d", pagenum); #endif /* ~SHORTINT */ - (void)fflush(stderr) ; + (void)fflush(stderr); } - skipover(36) ; - prevptr = signedquad()+1 ; + skipover(36); + prevptr = signedquad()+1; for (k=0; k<pagecopies; k++) { if (k == 0) { if (pagecopies > 1) - thispage = ftell(dvifile) ; + thispage = ftell(dvifile); } else { - (void)fseek(dvifile, (long)thispage, 0) ; + (void)fseek(dvifile, (long)thispage, 0); if (prettycolumn + 1 > STDOUTSIZE) { - (void)fprintf(stderr, "\n") ; - prettycolumn = 0 ; + (void)fprintf(stderr, "\n"); + prettycolumn = 0; } - (void)fprintf(stderr, ".") ; - (void)fflush(stderr) ; - prettycolumn++ ; + (void)fprintf(stderr, "."); + (void)fflush(stderr); + prettycolumn++; } - dopage() ; + dopage(); } if (! quiet) { - (void)fprintf(stderr, "] ") ; - (void)fflush(stderr) ; - prettycolumn += 2 ; + (void)fprintf(stderr, "] "); + (void)fflush(stderr); + prettycolumn += 2; } if (! reverse) - (void)skipnop() ; + (void)skipnop(); } } if (! multiplesects && ! disablecomments) { - newline() ; - (void)fprintf(bitfile, "%%%%Trailer\n") ; + newline(); + (void)fprintf(bitfile, "%%%%Trailer\n"); } if (multiplesects) { if (! disablecomments) { - newline() ; - (void)fprintf(bitfile, "%%DVIPSSectionTrailer\n") ; + newline(); + (void)fprintf(bitfile, "%%DVIPSSectionTrailer\n"); } - cmdout("eos") ; - cmdout("end") ; + cmdout("eos"); + cmdout("end"); } #ifdef HPS - if (HPS_FLAG) cmdout("\nend") ; /* close off HPSDict */ + if (HPS_FLAG) cmdout("\nend"); /* close off HPSDict */ #endif if (multiplesects && ! disablecomments) { - newline() ; - (void)fprintf(bitfile, "%%DVIPSEndSection\n") ; - linepos = 0 ; + newline(); + (void)fprintf(bitfile, "%%DVIPSEndSection\n"); + linepos = 0; } } /* @@ -216,10 +216,10 @@ InstallPL(integer pslow, integer pshigh) int ParsePages(register char *s) { - register int c ; /* current character */ + register int c; /* current character */ register integer n = 0, /* current numeric value */ innumber; /* true => gathering a number */ - integer ps_low = 0, ps_high = 0 ; + integer ps_low = 0, ps_high = 0; int range, /* true => saw a range indicator */ negative = 0; /* true => number being built is negative */ diff --git a/Build/source/texk/dvipsk/dospecial.c b/Build/source/texk/dvipsk/dospecial.c index 63fefbf4ac8..e68470913f8 100644 --- a/Build/source/texk/dvipsk/dospecial.c +++ b/Build/source/texk/dvipsk/dospecial.c @@ -20,12 +20,12 @@ extern int system(); */ #include "protos.h" -static int specialerrors = 20 ; +static int specialerrors = 20; struct bangspecial { - struct bangspecial *next ; - char actualstuff[1] ; /* more space will actually be allocated */ -} *bangspecials = NULL ; + struct bangspecial *next; + char actualstuff[1]; /* more space will actually be allocated */ +} *bangspecials = NULL; void specerror(const char *s) @@ -35,85 +35,85 @@ specerror(const char *s) && !kpse_tex_hush ("special") #endif ) { - error(s) ; - specialerrors-- ; + error(s); + specialerrors--; } else if (specialerrors == 0 #ifdef KPATHSEA && !kpse_tex_hush ("special") #endif ) { - error("more errors in special, being ignored . . .") ; + error("more errors in special, being ignored . . ."); error("(perhaps dvips doesn't support your macro package?)"); - specialerrors-- ; + specialerrors--; } } static void outputstring(register char *p) { - (void)putc('\n', bitfile) ; + (void)putc('\n', bitfile); while(*p) { - (void)putc(*p, bitfile) ; - p++ ; + (void)putc(*p, bitfile); + p++; } - (void)putc('\n', bitfile) ; + (void)putc('\n', bitfile); } static void trytobreakout(register char *p) { - register int i ; - register int instring = 0 ; - int lastc = 0 ; + register int i; + register int instring = 0; + int lastc = 0; - i = 0 ; - (void)putc('\n', bitfile) ; + i = 0; + (void)putc('\n', bitfile); if(*p == '%') { while(*p) { - (void)putc(*p, bitfile) ; - p++ ; + (void)putc(*p, bitfile); + p++; } - (void)putc('\n', bitfile) ; - return ; + (void)putc('\n', bitfile); + return; } while (*p) { if (i > 65 && *p == ' ' && instring == 0) { - (void)putc('\n', bitfile) ; - i = 0 ; + (void)putc('\n', bitfile); + i = 0; } else { - (void)putc(*p, bitfile) ; - i++ ; + (void)putc(*p, bitfile); + i++; } if (*p == '(' && lastc != '\\') - instring = 1 ; + instring = 1; else if (*p == ')' && lastc != '\\') - instring = 0 ; - lastc = *p ; - p++ ; + instring = 0; + lastc = *p; + p++; } - (void)putc('\n', bitfile) ; + (void)putc('\n', bitfile); } static void dobs(register struct bangspecial *q) { if (q) { - dobs(q->next) ; - trytobreakout(q->actualstuff) ; + dobs(q->next); + trytobreakout(q->actualstuff); } } void outbangspecials(void) { if (bangspecials) { - cmdout("TeXDict") ; - cmdout("begin") ; - cmdout("@defspecial\n") ; - dobs(bangspecials) ; - cmdout("\n@fedspecial") ; - cmdout("end") ; + cmdout("TeXDict"); + cmdout("begin"); + cmdout("@defspecial\n"); + dobs(bangspecials); + cmdout("\n@fedspecial"); + cmdout("end"); } } @@ -181,9 +181,9 @@ char Tolower(register char c) { if ('A' <= c && c <= 'Z') - return(c+32) ; + return(c+32); else - return(c) ; + return(c); } #endif #endif /* IBM: VM/CMS */ @@ -192,91 +192,91 @@ Tolower(register char c) int IsSame(const char *a, const char *b) { - for( ; *a != '\0'; ) { + for(; *a != '\0'; ) { if( TOLOWER(*a) != TOLOWER(*b) ) return( 0 ); - a++ ; - b++ ; + a++; + b++; } return( *b == '\0' ); } -char *KeyStr ; /* Key and ... */ -const char *ValStr ; /* ... String values found */ -long ValInt ; /* Integer value found */ -float ValNum ; /* Number or Dimension value found */ +char *KeyStr; /* Key and ... */ +const char *ValStr; /* ... String values found */ +long ValInt; /* Integer value found */ +float ValNum; /* Number or Dimension value found */ char * GetKeyVal(char *str, int *tno) /* returns NULL if none found, else next scan point */ /* str : starting point for scan */ /* tno : table entry number of keyword, or -1 if keyword not found */ { - register char *s ; - register int i ; - register char t ; + register char *s; + register int i; + register char t; - for (s=str; *s <= ' ' && *s; s++) ; /* skip over blanks */ + for (s=str; *s <= ' ' && *s; s++); /* skip over blanks */ if (*s == '\0') - return (NULL) ; - KeyStr = s ; - while (*s>' ' && *s!='=') s++ ; + return (NULL); + KeyStr = s; + while (*s>' ' && *s!='=') s++; if (0 != (t = *s)) - *s++ = 0 ; + *s++ = 0; for(i=0; i<NKEYS; i++) if( IsSame(KeyStr, KeyTab[i].Entry) ) - goto found ; + goto found; *tno = -1; - return (s) ; + return (s); -found: *tno = i ; +found: *tno = i; if (KeyTab[i].Type == None) - return (s) ; + return (s); if (t && t <= ' ') { - for (; *s <= ' ' && *s; s++) ; /* now look for the value part */ + for (; *s <= ' ' && *s; s++); /* now look for the value part */ if ((t = *s)=='=') - s++ ; + s++; } - ValStr = "" ; + ValStr = ""; if ( t == '=' ) { while (*s <= ' ' && *s) - s++ ; + s++; if (*s=='\'' || *s=='\"') - t = *s++ ; /* get string delimiter */ - else t = ' ' ; - ValStr = s ; + t = *s++; /* get string delimiter */ + else t = ' '; + ValStr = s; while (*s!=t && *s) - s++ ; + s++; if (*s) - *s++ = 0 ; + *s++ = 0; } switch (KeyTab[i].Type) { case Integer: if(sscanf(ValStr,"%ld",&ValInt)!=1) { sprintf(errbuf,"Non-integer value (%s) given for keyword %s", - ValStr, KeyStr) ; - specerror(errbuf) ; - ValInt = 0 ; + ValStr, KeyStr); + specerror(errbuf); + ValInt = 0; } - break ; + break; case Number: case Dimension: if(sscanf(ValStr,"%f",&ValNum)!=1) { sprintf(errbuf,"Non-numeric value (%s) given for keyword %s", - ValStr, KeyStr) ; - specerror(errbuf) ; - ValNum = 0.0 ; + ValStr, KeyStr); + specerror(errbuf); + ValNum = 0.0; } if (KeyTab[i].Type==Dimension) { if (curfnt==NULL) - error("! No font selected") ; - ValNum = ValNum * ((double)curfnt->scaledsize) * conv * 72 / DPI ; + error("! No font selected"); + ValNum = ValNum * ((double)curfnt->scaledsize) * conv * 72 / DPI; } - break ; - default: break ; + break; + default: break; } - return (s) ; + return (s); } /* @@ -291,9 +291,9 @@ found: *tno = i ; void predospecial(integer numbytes, Boolean scanning) { - register char *p = nextstring ; - register int i = 0 ; - int j ; + register char *p = nextstring; + register int i = 0; + int j; static int omega_specials = 0; if (nextstring + numbytes > maxstring) { @@ -303,31 +303,31 @@ predospecial(integer numbytes, Boolean scanning) error("! Integer overflow in predospecial"); exit(1); } - p = nextstring = mymalloc(1000 + 2 * numbytes) ; - maxstring = nextstring + 2 * numbytes + 700 ; + p = nextstring = mymalloc(1000 + 2 * numbytes); + maxstring = nextstring + 2 * numbytes + 700; } for (i=numbytes; i>0; i--) #ifdef VMCMS /* IBM: VM/CMS */ - *p++ = ascii2ebcdic[(char)dvibyte()] ; + *p++ = ascii2ebcdic[(char)dvibyte()]; #else #ifdef MVSXA /* IBM: MVS/XA */ - *p++ = ascii2ebcdic[(char)dvibyte()] ; + *p++ = ascii2ebcdic[(char)dvibyte()]; #else - *p++ = (char)dvibyte() ; + *p++ = (char)dvibyte(); #endif /* IBM: VM/CMS */ #endif if (pprescan) - return ; + return; while (p[-1] <= ' ' && p > nextstring) - p-- ; /* trim trailing blanks */ - if (p==nextstring) return ; /* all blank is no-op */ - *p = 0 ; - p = nextstring ; + p--; /* trim trailing blanks */ + if (p==nextstring) return; /* all blank is no-op */ + *p = 0; + p = nextstring; while (*p <= ' ') - p++ ; + p++; #ifdef DEBUG if (dd(D_SPECIAL)) - (void)fprintf(stderr, "Preprocessing special: %s\n", p) ; + (void)fprintf(stderr, "Preprocessing special: %s\n", p); #endif /* @@ -344,111 +344,111 @@ case 'o': } return; } - break ; + break; case 'l': if (strncmp(p, "landscape", 9)==0) { if (hpapersize || vpapersize) error( - "both landscape and papersize specified: ignoring landscape") ; + "both landscape and papersize specified: ignoring landscape"); else - landscape = 1 ; - return ; + landscape = 1; + return; } - break ; + break; case 'p': - if (strncmp(p, "pos:", 4)==0) return ; /* positional specials */ + if (strncmp(p, "pos:", 4)==0) return; /* positional specials */ if (strncmp(p, "papersize", 9)==0) { - p += 9 ; + p += 9; while (*p == '=' || *p == ' ') - p++ ; + p++; if (hpapersize == 0 || vpapersize == 0) { if (landscape) { error( - "both landscape and papersize specified: ignoring landscape") ; - landscape = 0 ; + "both landscape and papersize specified: ignoring landscape"); + landscape = 0; } - handlepapersize(p, &hpapersize, &vpapersize) ; + handlepapersize(p, &hpapersize, &vpapersize); } - return ; + return; } - break ; + break; case 'x': - if (strncmp(p, "xtex:", 5)==0) return ; - break ; + if (strncmp(p, "xtex:", 5)==0) return; + break; case 's': - if (strncmp(p, "src:", 4)==0) return ; /* source specials */ - break ; + if (strncmp(p, "src:", 4)==0) return; /* source specials */ + break; case 'h': if (strncmp(p, "header", 6)==0) { - char *q, *r, *pre = NULL, *post = NULL ; - p += 6 ; + char *q, *r, *pre = NULL, *post = NULL; + p += 6; while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0) - p++ ; + p++; if(*p == '{') { p++; while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0) p++; - q = p ; + q = p; while (*p != '}' && *p != 0) p++; - r = p-1 ; + r = p-1; while ((*r <= ' ' || *r == ')') && r >= q) - r-- ; - if (*p != 0) p++ ; - r[1] = 0 ; /* q is the file name */ + r--; + if (*p != 0) p++; + r[1] = 0; /* q is the file name */ while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0) - p++ ; + p++; if(strncmp(p, "pre", 3) == 0) { - int bracecount = 1, num_bytes = 0 ; + int bracecount = 1, num_bytes = 0; while(*p != '{' && *p != 0) - p++ ; + p++; if (*p != 0) p++; for(r = p; *r != 0; r++) { - if (*r == '{') bracecount++ ; - else if (*r == '}') bracecount-- ; - if (bracecount == 0) break ; - num_bytes++ ; + if (*r == '{') bracecount++; + else if (*r == '}') bracecount--; + if (bracecount == 0) break; + num_bytes++; } pre = (char *)malloc(num_bytes+1); - r = pre ; + r = pre; for (j=0; j < num_bytes; j++) *r++ = *p++; *r = 0; if (*p != 0) p++; } while ((*p <= ' ' || *p == '=' || *p == '(') && *p != 0) - p++ ; + p++; if(strncmp(p, "post", 4) == 0) { - int bracecount = 1, num_bytes = 0 ; + int bracecount = 1, num_bytes = 0; while(*p != '{' && *p != 0) - p++ ; + p++; if (*p != 0) p++; for(r = p; *r != 0; r++) { - if (*r == '{') bracecount++ ; - else if (*r == '}') bracecount-- ; - if (bracecount == 0) break ; - num_bytes++ ; + if (*r == '{') bracecount++; + else if (*r == '}') bracecount--; + if (bracecount == 0) break; + num_bytes++; } post = (char *)malloc(num_bytes+1); - r = post ; + r = post; for (j=0; j < num_bytes; j++) *r++ = *p++; *r = 0; } if (strlen(q) > 0) - (void)add_header_general(q, pre, post) ; + (void)add_header_general(q, pre, post); } else { - q = p ; /* we will remove enclosing parentheses */ - p = p + strlen(p) - 1 ; + q = p; /* we will remove enclosing parentheses */ + p = p + strlen(p) - 1; while ((*p <= ' ' || *p == ')') && p >= q) - p-- ; - p[1] = 0 ; + p--; + p[1] = 0; if (p >= q) - (void)add_header(q) ; + (void)add_header(q); } } - break ; + break; /* IBM: color - added section here for color header and color history */ /* using strncmp in this fashion isn't perfect; if later someone wants to introduce a verb like colorspace, well, just checking @@ -456,42 +456,42 @@ case 'h': --tgr */ case 'b': if (strncmp(p, "background", 10) == 0) { - usescolor = 1 ; - p += 10 ; - while ( *p && *p <= ' ' ) p++ ; - background(p) ; - return ; + usescolor = 1; + p += 10; + while ( *p && *p <= ' ' ) p++; + background(p); + return; } - break ; + break; case 'c': if (strncmp(p, "color", 5) == 0) { - usescolor = 1 ; - p += 5 ; - while ( *p && *p <= ' ' ) p++ ; + usescolor = 1; + p += 5; + while ( *p && *p <= ' ' ) p++; if (strncmp(p, "push", 4) == 0 ) { - p += 4 ; - while ( *p && *p <= ' ' ) p++ ; - pushcolor(p, 0) ; + p += 4; + while ( *p && *p <= ' ' ) p++; + pushcolor(p, 0); } else if (strncmp(p, "pop", 3) == 0 ) { - popcolor(0) ; + popcolor(0); } else { - resetcolorstack(p,0) ; + resetcolorstack(p,0); } } /* IBM: color - end changes */ - break ; + break; case '!': { - register struct bangspecial *q ; - p++ ; + register struct bangspecial *q; + p++; q = (struct bangspecial *)mymalloc((integer) - (sizeof(struct bangspecial) + strlen(p))) ; - (void)strcpy(q->actualstuff, p) ; - q->next = bangspecials ; - bangspecials = q ; - usesspecial = 1 ; - return ; + (sizeof(struct bangspecial) + strlen(p))); + (void)strcpy(q->actualstuff, p); + q->next = bangspecials; + bangspecials = q; + usesspecial = 1; + return; } - break ; + break; default: #if 0 { @@ -499,41 +499,41 @@ default: return; } #endif - break ; + break; } - usesspecial = 1 ; /* now the special prolog will be sent */ + usesspecial = 1; /* now the special prolog will be sent */ if (scanning && *p != '"' && (p=GetKeyVal(p, &j)) != NULL && j==0 && *ValStr != '`') /* Don't bother to scan compressed files. */ - scanfontcomments(ValStr) ; + scanfontcomments(ValStr); } int maccess(char *s) { - FILE *f = search(figpath, s, "r") ; + FILE *f = search(figpath, s, "r"); if (f) - (*close_file) (f) ; - return (f != 0) ; + (*close_file) (f); + return (f != 0); } -const char *tasks[] = { 0, "iff2ps", "tek2ps" } ; +const char *tasks[] = { 0, "iff2ps", "tek2ps" }; -static char psfile[511] ; +static char psfile[511]; void dospecial(integer numbytes) { - register char *p = nextstring ; - register int i = 0 ; - int j, systemtype = 0 ; - register const char *q ; - Boolean psfilewanted = 1 ; - const char *task = 0 ; - char cmdbuf[111] ; + register char *p = nextstring; + register int i = 0; + int j, systemtype = 0; + register const char *q; + Boolean psfilewanted = 1; + const char *task = 0; + char cmdbuf[111]; #ifdef HPS if (HPS_FLAG && PAGEUS_INTERUPPTUS) { - HREF_COUNT-- ; - start_new_box() ; - PAGEUS_INTERUPPTUS = 0 ; + HREF_COUNT--; + start_new_box(); + PAGEUS_INTERUPPTUS = 0; } if (HPS_FLAG && NEED_NEW_BOX) { vertical_in_hps(); @@ -541,27 +541,27 @@ if (HPS_FLAG && NEED_NEW_BOX) { } #endif if (nextstring + numbytes > maxstring) - error("! out of string space in dospecial") ; + error("! out of string space in dospecial"); for (i=numbytes; i>0; i--) #ifdef VMCMS /* IBM: VM/CMS */ - *p++ = ascii2ebcdic[(char)dvibyte()] ; + *p++ = ascii2ebcdic[(char)dvibyte()]; #else #ifdef MVSXA /* IBM: MVS/XA */ - *p++ = ascii2ebcdic[(char)dvibyte()] ; + *p++ = ascii2ebcdic[(char)dvibyte()]; #else - *p++ = (char)dvibyte() ; + *p++ = (char)dvibyte(); #endif /* IBM: VM/CMS */ #endif while (p[-1] <= ' ' && p > nextstring) - p-- ; /* trim trailing blanks */ - if (p==nextstring) return ; /* all blank is no-op */ - *p = 0 ; - p = nextstring ; + p--; /* trim trailing blanks */ + if (p==nextstring) return; /* all blank is no-op */ + *p = 0; + p = nextstring; while (*p <= ' ') - p++ ; + p++; #ifdef DEBUG if (dd(D_SPECIAL)) - (void)fprintf(stderr, "Processing special: %s\n", p) ; + (void)fprintf(stderr, "Processing special: %s\n", p); #endif switch (*p) { @@ -569,30 +569,30 @@ case 'o': if (strncmp(p, "om:", 3)==0) { /* Omega specials ignored */ return; } - break ; + break; case 'e': if (strncmp(p, "em:", 3)==0) { /* emTeX specials in emspecial.c */ emspecial(p); return; } - break ; + break; case 'p': - if (strncmp(p, "pos:", 4)==0) return ; /* positional specials */ + if (strncmp(p, "pos:", 4)==0) return; /* positional specials */ if (strncmp(p, "ps:", 3)==0) { - psflush() ; /* now anything can happen. */ + psflush(); /* now anything can happen. */ if (p[3]==':') { if (strncmp(p+4, "[nobreak]", 9) == 0) { - hvpos() ; - outputstring(&p[13]) ; + hvpos(); + outputstring(&p[13]); } else if (strncmp(p+4, "[begin]", 7) == 0) { - hvpos() ; - trytobreakout(&p[11]) ; + hvpos(); + trytobreakout(&p[11]); } else if (strncmp(p+4, "[end]", 5) == 0) trytobreakout(&p[9]); else trytobreakout(&p[4]); } else if (strncmp(p+3, " plotfile ", 10) == 0) { - char *sfp ; - hvpos() ; + char *sfp; + hvpos(); p += 13; /* * Fixed to allow popen input for plotfile @@ -601,9 +601,9 @@ case 'p': while (*p == ' ') p++; if (*p == '"') { p++; - for (sfp = p; *sfp && *sfp != '"'; sfp++) ; + for (sfp = p; *sfp && *sfp != '"'; sfp++); } else { - for (sfp = p; *sfp && *sfp != ' '; sfp++) ; + for (sfp = p; *sfp && *sfp != ' '; sfp++); } *sfp = '\0'; if (*p == '`') @@ -612,27 +612,27 @@ case 'p': figcopyfile (p, 0); /* End TJD changes */ } else { - hvpos() ; + hvpos(); trytobreakout(&p[3]); - psflush() ; - hvpos() ; + psflush(); + hvpos(); } return; } if (strncmp(p, "papersize", 9) == 0) - return ; + return; #ifdef TPIC if (strncmp(p, "pn ", 3) == 0) {setPenSize(p+2); return;} if (strncmp(p, "pa ", 3) == 0) {addPath(p+2); return;} #endif - break ; + break; case 'l': - if (strncmp(p, "landscape", 9)==0) return ; - break ; + if (strncmp(p, "landscape", 9)==0) return; + break; case '!': - return ; + return; case 'h': - if (strncmp(p, "header", 6)==0) return ; + if (strncmp(p, "header", 6)==0) return; #ifdef HPS if (strncmp(p, "html:", 5)==0) { if (! HPS_FLAG) return; @@ -672,60 +672,60 @@ case 'h': case 'w': case 'W': if (strncmp(p+1, "arning", 6) == 0) { - static int maxwarns = 50 ; + static int maxwarns = 50; if (maxwarns > 0) { - error(p) ; - maxwarns-- ; + error(p); + maxwarns--; } else if (maxwarns == 0) { - error(". . . rest of warnings suppressed") ; - maxwarns-- ; + error(". . . rest of warnings suppressed"); + maxwarns--; } - return ; + return; } #ifdef TPIC if (strcmp(p, "wh") == 0) {whitenLast(); return;} #endif - break ; + break; case 'b': if ( strncmp(p, "background", 10) == 0 ) - return ; /* already handled in prescan */ + return; /* already handled in prescan */ #ifdef TPIC if (strcmp(p, "bk") == 0) {blackenLast(); return;} #endif - break ; + break; case 'c': if (strncmp(p, "color", 5) == 0) { - p += 5 ; - while ( *p && *p <= ' ' ) p++ ; + p += 5; + while ( *p && *p <= ' ' ) p++; if (strncmp(p, "push", 4) == 0 ) { - p += 4 ; - while ( *p && *p <= ' ' ) p++ ; + p += 4; + while ( *p && *p <= ' ' ) p++; pushcolor(p,1); } else if (strncmp(p, "pop", 3) == 0 ) { - popcolor(1) ; + popcolor(1); } else { - resetcolorstack(p,1) ; + resetcolorstack(p,1); } - return ; + return; } /* IBM: color - end changes*/ - break ; + break; case 'f': #ifdef TPIC if (strcmp(p, "fp") == 0) {flushPath(0); return;} #endif - break ; + break; case 'i': #ifdef TPIC if (strcmp(p, "ip") == 0) {flushPath(1); return;} /* tpic 2.0 */ if (strncmp(p, "ia ", 3) == 0) {arc(p+2, 1); return;} /* tpic 2.0 */ #endif - break ; + break; case 'd': #ifdef TPIC if (strncmp(p, "da ", 3) == 0) {flushDashed(p+2, 0); return;} if (strncmp(p, "dt ", 3) == 0) {flushDashed(p+2, 1); return;} #endif - break ; + break; case 's': if (strncmp(p, "src:", 4) == 0) return; /* source specials */ #ifdef TPIC @@ -734,25 +734,25 @@ case 's': if (strcmp(p, "sh") == 0) {shadeLast(p+2); return;} /* tpic 2.0 */ if (strncmp(p, "sh ", 3) == 0) {shadeLast(p+3); return;} /* tpic 2.0 */ #endif - break ; + break; case 'a': #ifdef TPIC if (strncmp(p, "ar ", 3) == 0) {arc(p+2, 0); return;} /* tpic 2.0 */ #endif - break ; + break; case 't': #ifdef TPIC if (strncmp(p, "tx ", 3) == 0) {SetShade(p+3); return;} #endif - break ; + break; case '"': - hvpos() ; - cmdout("@beginspecial") ; - cmdout("@setspecial") ; - trytobreakout(p+1) ; - cmdout("\n@endspecial") ; - return ; - break ; + hvpos(); + cmdout("@beginspecial"); + cmdout("@setspecial"); + trytobreakout(p+1); + cmdout("\n@endspecial"); + return; + break; default: #if 0 { @@ -762,7 +762,7 @@ default: return; } #endif - break ; + break; } /* At last we get to the key/value conventions */ psfile[0] = '\0'; @@ -774,66 +774,66 @@ default: case -1: /* for compatability with old conventions, we allow a file name * to be given without the 'psfile=' keyword */ if (!psfile[0] && maccess(KeyStr)==0) /* yes we can read it */ - (void)strcpy(psfile,KeyStr) ; + (void)strcpy(psfile,KeyStr); else { if (strlen(KeyStr) < 40) { sprintf(errbuf, "Unknown keyword (%s) in \\special will be ignored", - KeyStr) ; + KeyStr); } else { sprintf(errbuf, "Unknown keyword (%.40s...) in \\special will be ignored", - KeyStr) ; + KeyStr); } - specerror(errbuf) ; + specerror(errbuf); } - break ; + break; case 0: case 1: case 2: /* psfile */ if (psfile[0]) { sprintf(errbuf, "More than one \\special %s given; %s ignored", - "psfile", ValStr) ; - specerror(errbuf) ; + "psfile", ValStr); + specerror(errbuf); } - else (void)strcpy(psfile,ValStr) ; - task = tasks[j] ; - break ; + else (void)strcpy(psfile,ValStr); + task = tasks[j]; + break; default: /* most keywords are output as PostScript procedure calls */ if (KeyTab[j].Type == Integer) numout((integer)ValInt); else if (KeyTab[j].Type == String) for (q=ValStr; *q; q++) - scout(*q) ; - else if (KeyTab[j].Type == None) ; + scout(*q); + else if (KeyTab[j].Type == None); else { /* Number or Dimension */ - ValInt = (integer)(ValNum<0? ValNum-0.5 : ValNum+0.5) ; + ValInt = (integer)(ValNum<0? ValNum-0.5 : ValNum+0.5); if (ValInt-ValNum < 0.001 && ValInt-ValNum > -0.001) - numout((integer)ValInt) ; + numout((integer)ValInt); else { - (void)sprintf(cmdbuf, "%f", ValNum) ; - cmdout(cmdbuf) ; + (void)sprintf(cmdbuf, "%f", ValNum); + cmdout(cmdbuf); } } (void)sprintf(cmdbuf, "@%s", KeyStr); - cmdout(cmdbuf) ; + cmdout(cmdbuf); } cmdout("@setspecial"); if(psfile[0]) { if (task == 0) { - systemtype = (psfile[0]=='`') ; - figcopyfile(psfile+systemtype, systemtype) ; + systemtype = (psfile[0]=='`'); + figcopyfile(psfile+systemtype, systemtype); } else { - fprintf (stderr, "dvips: iff2ps and tek2ps are not supported.\n") ; + fprintf (stderr, "dvips: iff2ps and tek2ps are not supported.\n"); } } else if (psfilewanted #ifdef KPATHSEA && !kpse_tex_hush ("special") #endif ) - specerror("No \\special psfile was given; figure will be blank") ; + specerror("No \\special psfile was given; figure will be blank"); - cmdout("@endspecial") ; + cmdout("@endspecial"); } /* @@ -841,77 +841,77 @@ default: * Currently we only deal with psfile's or PSfiles and only those * that do not use rotations. */ -static float rbbox[4] ; +static float rbbox[4]; float * bbdospecial(int nbytes) { - char *p = nextstring ; - int i, j ; - char seen[NKEYS] ; - float valseen[NKEYS] ; + char *p = nextstring; + int i, j; + char seen[NKEYS]; + float valseen[NKEYS]; if (nextstring + nbytes > maxstring) { - p = nextstring = mymalloc(1000 + 2 * nbytes) ; - maxstring = nextstring + 2 * nbytes + 700 ; + p = nextstring = mymalloc(1000 + 2 * nbytes); + maxstring = nextstring + 2 * nbytes + 700; } if (nextstring + nbytes > maxstring) - error("! out of string space in bbdospecial") ; + error("! out of string space in bbdospecial"); for (i=nbytes; i>0; i--) #ifdef VMCMS /* IBM: VM/CMS */ - *p++ = ascii2ebcdic[(char)dvibyte()] ; + *p++ = ascii2ebcdic[(char)dvibyte()]; #else #ifdef MVSXA /* IBM: MVS/XA */ - *p++ = ascii2ebcdic[(char)dvibyte()] ; + *p++ = ascii2ebcdic[(char)dvibyte()]; #else - *p++ = (char)dvibyte() ; + *p++ = (char)dvibyte(); #endif /* IBM: VM/CMS */ #endif while (p[-1] <= ' ' && p > nextstring) - p-- ; /* trim trailing blanks */ - if (p==nextstring) return NULL ; /* all blank is no-op */ - *p = 0 ; - p = nextstring ; + p--; /* trim trailing blanks */ + if (p==nextstring) return NULL; /* all blank is no-op */ + *p = 0; + p = nextstring; while (*p && *p <= ' ') - p++ ; + p++; if (strncmp(p, "psfile", 6)==0 || strncmp(p, "PSfile", 6)==0) { float originx = 0, originy = 0, hscale = 1, vscale = 1, - hsize = 0, vsize = 0 ; + hsize = 0, vsize = 0; for (j=0; j<NKEYS; j++) - seen[j] = 0 ; - j = 0 ; + seen[j] = 0; + j = 0; while ((p=GetKeyVal(p, &j))) { if (j >= 0 && j < NKEYS && KeyTab[j].Type == Number) { - seen[j]++ ; - valseen[j] = ValNum ; + seen[j]++; + valseen[j] = ValNum; } } /* * This code mimics what happens in @setspecial. */ if (seen[3]) - hsize = valseen[3] ; + hsize = valseen[3]; if (seen[4]) - vsize = valseen[4] ; + vsize = valseen[4]; if (seen[5]) - originx = valseen[5] ; + originx = valseen[5]; if (seen[6]) - originy = valseen[6] ; + originy = valseen[6]; if (seen[7]) - hscale = valseen[7] / 100.0 ; + hscale = valseen[7] / 100.0; if (seen[8]) - vscale = valseen[8] / 100.0 ; + vscale = valseen[8] / 100.0; if (seen[10] && seen[12]) - hsize = valseen[12] - valseen[10] ; + hsize = valseen[12] - valseen[10]; if (seen[11] && seen[13]) - vsize = valseen[13] - valseen[11] ; + vsize = valseen[13] - valseen[11]; if (seen[14] || seen[15]) { if (seen[14] && seen[15] == 0) { - hscale = vscale = valseen[14] / (10.0 * hsize) ; + hscale = vscale = valseen[14] / (10.0 * hsize); } else if (seen[15] && seen[14] == 0) { - hscale = vscale = valseen[15] / (10.0 * vsize) ; + hscale = vscale = valseen[15] / (10.0 * vsize); } else { - hscale = valseen[14] / (10.0 * hsize) ; - vscale = valseen[15] / (10.0 * vsize) ; + hscale = valseen[14] / (10.0 * hsize); + vscale = valseen[15] / (10.0 * vsize); } } /* at this point, the bounding box in PostScript units relative to @@ -919,11 +919,11 @@ bbdospecial(int nbytes) originx originy originx+hsize*hscale originy+vsize*vscale We'll let the bbox routine handle the remaining math. */ - rbbox[0] = originx ; - rbbox[1] = originy ; - rbbox[2] = originx+hsize*hscale ; - rbbox[3] = originy+vsize*vscale ; - return rbbox ; + rbbox[0] = originx; + rbbox[1] = originy; + rbbox[2] = originx+hsize*hscale; + rbbox[3] = originy+vsize*vscale; + return rbbox; } - return 0 ; + return 0; } diff --git a/Build/source/texk/dvipsk/download.c b/Build/source/texk/dvipsk/download.c index 29d612abdb0..d0e41ebc74e 100644 --- a/Build/source/texk/dvipsk/download.c +++ b/Build/source/texk/dvipsk/download.c @@ -16,174 +16,174 @@ */ #include "protos.h" -static unsigned char dummyend[8] = { 252 } ; +static unsigned char dummyend[8] = { 252 }; /* * We have a routine that downloads an individual character. */ -static int lastccout ; +static int lastccout; static void downchar(chardesctype *c, shalfword cc) { - register long i, j ; - register halfword cheight, cwidth ; - register long k ; - register quarterword *p ; - register halfword cmd ; - register shalfword xoff, yoff ; - halfword wwidth = 0 ; - register long len ; - int smallchar ; + register long i, j; + register halfword cheight, cwidth; + register long k; + register quarterword *p; + register halfword cmd; + register shalfword xoff, yoff; + halfword wwidth = 0; + register long len; + int smallchar; - p = c->packptr ; - cmd = *p++ ; + p = c->packptr; + cmd = *p++; if (cmd & 4) { if ((cmd & 7) == 7) { - cwidth = getlong(p) ; - cheight = getlong(p + 4) ; - xoff = getlong(p + 8) ; - yoff = getlong(p + 12) ; - p += 16 ; + cwidth = getlong(p); + cheight = getlong(p + 4); + xoff = getlong(p + 8); + yoff = getlong(p + 12); + p += 16; } else { - cwidth = p[0] * 256 + p[1] ; - cheight = p[2] * 256 + p[3] ; - xoff = p[4] * 256 + p[5] ; /* N.B.: xoff, yoff are signed halfwords */ - yoff = p[6] * 256 + p[7] ; - p += 8 ; + cwidth = p[0] * 256 + p[1]; + cheight = p[2] * 256 + p[3]; + xoff = p[4] * 256 + p[5]; /* N.B.: xoff, yoff are signed halfwords */ + yoff = p[6] * 256 + p[7]; + p += 8; } } else { - cwidth = *p++ ; - cheight = *p++ ; - xoff = *p++ ; - yoff = *p++ ; + cwidth = *p++; + cheight = *p++; + xoff = *p++; + yoff = *p++; if (xoff > 127) - xoff -= 256 ; + xoff -= 256; if (yoff > 127) - yoff -= 256 ; + yoff -= 256; } if (c->flags & BIGCHAR) - smallchar = 0 ; + smallchar = 0; else - smallchar = 5 ; + smallchar = 5; if (compressed) { - len = getlong(p) ; - p += 4 ; + len = getlong(p); + p += 4; } else { - wwidth = (cwidth + 15) / 16 ; - i = 2 * cheight * (long)wwidth ; + wwidth = (cwidth + 15) / 16; + i = 2 * cheight * (long)wwidth; if (i <= 0) - i = 2 ; - i += smallchar ; + i = 2; + i += smallchar; if (mbytesleft < i) { if (mbytesleft >= RASTERCHUNK) - (void) free((char *) mraster) ; + (void) free((char *) mraster); if (RASTERCHUNK > i) { - mraster = (quarterword *)mymalloc((integer)RASTERCHUNK) ; - mbytesleft = RASTERCHUNK ; + mraster = (quarterword *)mymalloc((integer)RASTERCHUNK); + mbytesleft = RASTERCHUNK; } else { - k = i + i / 4 ; - mraster = (quarterword *)mymalloc((integer)k) ; - mbytesleft = k ; + k = i + i / 4; + mraster = (quarterword *)mymalloc((integer)k); + mbytesleft = k; } } k = i; while (k > 0) - mraster[--k] = 0 ; - unpack(p, (halfword *)mraster, cwidth, cheight, cmd) ; - p = mraster ; - len = i - smallchar ; + mraster[--k] = 0; + unpack(p, (halfword *)mraster, cwidth, cheight, cmd); + p = mraster; + len = i - smallchar; } if (cheight == 0 || cwidth == 0 || len == 0) { - cwidth = 1 ; - cheight = 1 ; - wwidth = 1 ; - len = 2 ; + cwidth = 1; + cheight = 1; + wwidth = 1; + len = 2; if (compressed) - p = dummyend ; /* CMD(END); see repack.c */ + p = dummyend; /* CMD(END); see repack.c */ else - mraster[0] = 0 ; + mraster[0] = 0; } if (smallchar) { - p[len] = cwidth ; - p[len + 1] = cheight ; - p[len + 2] = xoff + 128 ; - p[len + 3] = yoff + 128 ; - p[len + 4] = c->pixelwidth ; + p[len] = cwidth; + p[len + 1] = cheight; + p[len + 2] = xoff + 128; + p[len + 3] = yoff + 128; + p[len + 4] = c->pixelwidth; } else /* * Now we actually send out the data. */ - specialout('[') ; + specialout('['); if (compressed) { - specialout('<') ; - mhexout(p, len + smallchar) ; - specialout('>') ; + specialout('<'); + mhexout(p, len + smallchar); + specialout('>'); } else { - i = (cwidth + 7) / 8 ; + i = (cwidth + 7) / 8; if (i * cheight > 65520) { - long bc = 0 ; - specialout('<') ; + long bc = 0; + specialout('<'); for (j=0; j<cheight; j++) { if (bc + i > 65520) { - specialout('>') ; - specialout('<') ; - bc = 0 ; + specialout('>'); + specialout('<'); + bc = 0; } - mhexout(p, i) ; - bc += i ; - p += 2*wwidth ; + mhexout(p, i); + bc += i; + p += 2*wwidth; } - specialout('>') ; + specialout('>'); } else { - specialout('<') ; + specialout('<'); if (2 * wwidth == i) - mhexout(p, ((long)cheight) * i + smallchar) ; + mhexout(p, ((long)cheight) * i + smallchar); else { for (j=0; j<cheight; j++) { - mhexout(p, i) ; - p += 2*wwidth ; + mhexout(p, i); + p += 2*wwidth; } if (smallchar) - mhexout(p, (long)smallchar) ; + mhexout(p, (long)smallchar); } - specialout('>') ; + specialout('>'); } } if (smallchar == 0) { - numout((integer)cwidth) ; - numout((integer)cheight) ; - numout((integer)xoff + 128) ; /* not all these casts needed. */ - numout((integer)yoff + 128) ; - numout((integer)(c->pixelwidth)) ; + numout((integer)cwidth); + numout((integer)cheight); + numout((integer)xoff + 128); /* not all these casts needed. */ + numout((integer)yoff + 128); + numout((integer)(c->pixelwidth)); } if (lastccout + 1 == cc) { - cmdout("I") ; + cmdout("I"); } else { - numout((integer)cc) ; - cmdout("D") ; + numout((integer)cc); + cmdout("D"); } - lastccout = cc ; + lastccout = cc; } /* * Output the literal name of the font change command with PostScript index n */ static char goodnames[] = - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ; + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; void makepsname(register char *s, register int n) { - n-- ; - *s++ = 'F' + n / (sizeof(goodnames)-1) ; - *s++ = goodnames[n % (sizeof(goodnames)-1)] ; - *s++ = 0 ; + n--; + *s++ = 'F' + n / (sizeof(goodnames)-1); + *s++ = goodnames[n % (sizeof(goodnames)-1)]; + *s++ = 0; } void lfontout(int n) { char buf[10]; - char *b = buf ; - *b++ = '/' ; - makepsname(b, n) ; + char *b = buf; + *b++ = '/'; + makepsname(b, n); cmdout(buf); } @@ -193,59 +193,59 @@ lfontout(int n) void download(charusetype *p, int psfont) { - register int b, i ; - register halfword bit ; - register chardesctype *c ; - int cc, maxcc = -1, numcc ; - double fontscale ; - char name[10] ; - lastccout = -5 ; - name[0] = '/' ; - makepsname(name + 1, psfont) ; - curfnt = p->fd ; - curfnt->psname = psfont ; + register int b, i; + register halfword bit; + register chardesctype *c; + int cc, maxcc = -1, numcc; + double fontscale; + char name[10]; + lastccout = -5; + name[0] = '/'; + makepsname(name + 1, psfont); + curfnt = p->fd; + curfnt->psname = psfont; if (curfnt->resfont) { - struct resfont *rf = curfnt->resfont ; + struct resfont *rf = curfnt->resfont; int non_empty=0; for (b=0; b<16; b++) if(p->bitmap[b] !=0) non_empty =1; if(non_empty==0 && curfnt->codewidth==1) return; - cmdout(name) ; + cmdout(name); /* following code re-arranged - Rob Hutchings 1992Apr02 */ - c = curfnt->chardesc + 255 ; - cc = 255 ; - numcc = 0 ; - i = 0 ; + c = curfnt->chardesc + 255; + cc = 255; + numcc = 0; + i = 0; for (b=15; b>=0; b--) { for (bit=1; bit; bit<<=1) { if (p->bitmap[b] & bit) { if (i > 0) { - numout((integer)i) ; - specialout('[') ; - i = 0 ; + numout((integer)i); + specialout('['); + i = 0; } - numout((integer)c->pixelwidth) ; - c->flags |= EXISTS ; - numcc++ ; + numout((integer)c->pixelwidth); + c->flags |= EXISTS; + numcc++; } else { - i++ ; - c->flags &= ~EXISTS ; + i++; + c->flags &= ~EXISTS; } - c-- ; - cc-- ; + c--; + cc--; } } if (i > 0) { - numout((integer)i) ; - specialout('[') ; + numout((integer)i); + specialout('['); } - specialout ('{') ; + specialout ('{'); if (rf->specialinstructions) - cmdout(rf->specialinstructions) ; - specialout ('}') ; - numout((integer)numcc) ; + cmdout(rf->specialinstructions); + specialout ('}'); + numout((integer)numcc); /* * This code has been bogus for a long time. The fix is * straightforward. The input, curfnt->scaledsize, is the @@ -256,42 +256,42 @@ download(charusetype *p, int psfont) * account magnification, num/den, output resolution, and so on. * Sorry this bug has been in here so long. -tgr */ - fontscale = curfnt->scaledsize * conv ; - (void)sprintf(nextstring, "%g", fontscale) ; - cmdout(nextstring) ; - (void)strcpy(nextstring, "/") ; - (void)strcat(nextstring, rf->PSname) ; - cmdout(nextstring) ; + fontscale = curfnt->scaledsize * conv; + (void)sprintf(nextstring, "%g", fontscale); + cmdout(nextstring); + (void)strcpy(nextstring, "/"); + (void)strcat(nextstring, rf->PSname); + cmdout(nextstring); /* end of changed section - Rob */ - cmdout("rf") ; - rf->sent = 1 ; - return ; + cmdout("rf"); + rf->sent = 1; + return; } /* * Here we calculate the largest character actually used, and * send it as a parameter to df. */ - cc = 0 ; - numcc = 0 ; + cc = 0; + numcc = 0; for (b=0; b<16; b++) { for (bit=32768; bit!=0; bit>>=1) { if (p->bitmap[b] & bit) { - maxcc = cc ; - numcc++ ; + maxcc = cc; + numcc++; } - cc++ ; + cc++; } } if (numcc <= 0) - return ; - fontscale = ((double)(curfnt->scaledsize)) / 65536.0 ; - fontscale *= (mag/1000.0) ; - newline() ; + return; + fontscale = ((double)(curfnt->scaledsize)) / 65536.0; + fontscale *= (mag/1000.0); + newline(); fprintf(bitfile, "%%DVIPSBitmapFont: %s %s %g %d\n", name+1, curfnt->name, - fontscale, numcc) ; - cmdout(name) ; - numout((integer)numcc) ; - numout((integer)maxcc + 1) ; + fontscale, numcc); + cmdout(name); + numout((integer)numcc); + numout((integer)maxcc + 1); /* * If we need to scale the font, we say so by using dfs * instead of df, and we give it a scale factor. We also @@ -299,33 +299,33 @@ download(charusetype *p, int psfont) * fonts is ugly, and this is the best we can probably do. */ if (curfnt->dpi != curfnt->loadeddpi) { - numout((integer)curfnt->dpi) ; - numout((integer)curfnt->loadeddpi) ; + numout((integer)curfnt->dpi); + numout((integer)curfnt->loadeddpi); if (curfnt->alreadyscaled == 0) { for (b=0, c=curfnt->chardesc; b<256; b++, c++) c->pixelwidth = (c->pixelwidth * - (long)curfnt->dpi * 2 + curfnt->loadeddpi) / (2 * curfnt->loadeddpi) ; - curfnt->alreadyscaled = 1 ; + (long)curfnt->dpi * 2 + curfnt->loadeddpi) / (2 * curfnt->loadeddpi); + curfnt->alreadyscaled = 1; } - cmdout("dfs") ; + cmdout("dfs"); } else - cmdout("df") ; - c = curfnt->chardesc ; - cc = 0 ; + cmdout("df"); + c = curfnt->chardesc; + cc = 0; for (b=0; b<16; b++) { for (bit=32768; bit; bit>>=1) { if (p->bitmap[b] & bit) { - downchar(c, cc) ; - c->flags |= EXISTS ; + downchar(c, cc); + c->flags |= EXISTS; } else - c->flags &= ~EXISTS ; - c++ ; - cc++ ; + c->flags &= ~EXISTS; + c++; + cc++; } } - cmdout("E") ; - newline() ; - fprintf(bitfile, "%%EndDVIPSBitmapFont\n") ; + cmdout("E"); + newline(); + fprintf(bitfile, "%%EndDVIPSBitmapFont\n"); } /* * Magic code to deal with PostScript font partial downloading. @@ -333,34 +333,34 @@ download(charusetype *p, int psfont) * structures. We rely on writet1 to load the encodings for us. */ static struct seenEncodings { - struct seenEncodings *next ; - const char *name ; - const char **glyphs ; -} *seenEncodings ; + struct seenEncodings *next; + const char *name; + const char **glyphs; +} *seenEncodings; #define MAX_CHAR_CODE 256 /* * Load a new encoding and return the array of glyphs as a vector. * Linear search. */ static const char **getEncoding(char *encoding) { - struct seenEncodings *p = seenEncodings ; + struct seenEncodings *p = seenEncodings; while (p != 0) if (strcmp(encoding, p->name) == 0) - break ; + break; else - p = p->next ; + p = p->next; if (p == 0) { - int i ; - p = (struct seenEncodings *)mymalloc(sizeof(struct seenEncodings)) ; - p->next = seenEncodings ; - seenEncodings = p ; - p->name = xstrdup(encoding) ; - p->glyphs = (const char **)mymalloc((MAX_CHAR_CODE+1) * sizeof(char *)) ; + int i; + p = (struct seenEncodings *)mymalloc(sizeof(struct seenEncodings)); + p->next = seenEncodings; + seenEncodings = p; + p->name = xstrdup(encoding); + p->glyphs = (const char **)mymalloc((MAX_CHAR_CODE+1) * sizeof(char *)); for (i=0; i<MAX_CHAR_CODE; i++) - p->glyphs[i] = ".notdef" ; - load_enc(encoding, p->glyphs) ; + p->glyphs[i] = ".notdef"; + load_enc(encoding, p->glyphs); } - return p->glyphs ; + return p->glyphs; } /* * When partially downloading a type 1 font, sometimes the font uses @@ -373,17 +373,17 @@ static const char **getEncoding(char *encoding) { * If no glyphs have been added, extraGlyphs is null. In all cases, * the memory allocated for this is in extraGlyphSpace. */ -static char *extraGlyphs = 0 ; +static char *extraGlyphs = 0; #ifdef DOWNLOAD_USING_PDFTEX -static char *extraGlyphSpace = 0 ; -static int extraGlyphSize = 0 ; -static int glyphSizeUsed = 0 ; +static char *extraGlyphSpace = 0; +static int extraGlyphSize = 0; +static int glyphSizeUsed = 0; /* * We want to make sure we pass in null or "/" but never "". */ static void clearExtraGlyphList(void) { - glyphSizeUsed = 0 ; - extraGlyphs = 0 ; + glyphSizeUsed = 0; + extraGlyphs = 0; } /* * Add the glyph name; make sure it hasn't been added already. @@ -391,26 +391,26 @@ static void clearExtraGlyphList(void) { * and *then* see if it's already there and if it is un-add it. */ static void addGlyph(const char *glyphName) { - int len = strlen(glyphName) ; - char *startOfAdd = 0 ; + int len = strlen(glyphName); + char *startOfAdd = 0; if (len + glyphSizeUsed + 3 > extraGlyphSize) { - extraGlyphSize = 2 * (extraGlyphSize + len + 100) ; - extraGlyphSpace = (char *) xrealloc(extraGlyphSpace, extraGlyphSize) ; + extraGlyphSize = 2 * (extraGlyphSize + len + 100); + extraGlyphSpace = (char *) xrealloc(extraGlyphSpace, extraGlyphSize); } - extraGlyphs = extraGlyphSpace ; + extraGlyphs = extraGlyphSpace; if (glyphSizeUsed == 0) { - startOfAdd = extraGlyphs + glyphSizeUsed ; - extraGlyphs[glyphSizeUsed++] = '/' ; /* leading / */ + startOfAdd = extraGlyphs + glyphSizeUsed; + extraGlyphs[glyphSizeUsed++] = '/'; /* leading / */ } else { - startOfAdd = extraGlyphs + glyphSizeUsed - 1 ; + startOfAdd = extraGlyphs + glyphSizeUsed - 1; } - strcpy(extraGlyphs + glyphSizeUsed, glyphName) ; - glyphSizeUsed += len ; - extraGlyphs[glyphSizeUsed++] = '/' ; /* trailing / */ - extraGlyphs[glyphSizeUsed] = 0 ; + strcpy(extraGlyphs + glyphSizeUsed, glyphName); + glyphSizeUsed += len; + extraGlyphs[glyphSizeUsed++] = '/'; /* trailing / */ + extraGlyphs[glyphSizeUsed] = 0; if (strstr(extraGlyphs, startOfAdd) != startOfAdd) { /* already there! */ - glyphSizeUsed = startOfAdd - extraGlyphs + 1 ; /* kill the second copy */ - extraGlyphs[glyphSizeUsed] = 0 ; + glyphSizeUsed = startOfAdd - extraGlyphs + 1; /* kill the second copy */ + extraGlyphs[glyphSizeUsed] = 0; } } #endif @@ -425,73 +425,73 @@ downpsfont(charusetype *p, charusetype *all) #ifdef DOWNLOAD_USING_PDFTEX static unsigned char grid[256]; #endif - int GridCount ; + int GridCount; register int b; - register halfword bit ; - register chardesctype *c ; - struct resfont *rf ; + register halfword bit; + register chardesctype *c; + struct resfont *rf; int cc; int j; - curfnt = p->fd ; - rf = curfnt->resfont ; + curfnt = p->fd; + rf = curfnt->resfont; if (rf == 0 || rf->Fontfile == NULL) - return ; + return; for (; all->fd; all++) if (all->fd->resfont && strcmp(rf->PSname, all->fd->resfont->PSname) == 0) - break ; + break; if (all != p) - return ; + return; if (rf->sent == 2) /* sent as header, from a PS file */ - return ; + return; for (j=0; downloadedpsnames[j] && j < unused_top_of_psnames; j++) { if (strcmp (downloadedpsnames[j], rf->PSname) == 0) return; } if (all->fd == 0) - error("! internal error in downpsfont") ; + error("! internal error in downpsfont"); if (!partialdownload) { - infont = all->fd->resfont->PSname ; + infont = all->fd->resfont->PSname; copyfile(all->fd->resfont->Fontfile); - infont = 0 ; + infont = 0; return; } for (cc=0; cc<256; cc++) - grid[cc] = 0 ; + grid[cc] = 0; #ifdef DOWNLOAD_USING_PDFTEX - clearExtraGlyphList() ; + clearExtraGlyphList(); #endif for (; all->fd; all++) { if (all->fd->resfont == 0 || strcmp(rf->PSname, all->fd->resfont->PSname)) - continue ; - curfnt = all->fd ; + continue; + curfnt = all->fd; #ifdef DOWNLOAD_USING_PDFTEX if (curfnt->resfont->Vectfile) { - const char **glyphs = getEncoding(curfnt->resfont->Vectfile) ; - c = curfnt->chardesc + 255 ; - cc = 255 ; + const char **glyphs = getEncoding(curfnt->resfont->Vectfile); + c = curfnt->chardesc + 255; + cc = 255; for (b=15; b>=0; b--) { for (bit=1; bit; bit<<=1) { if (all->bitmap[b] & bit) { - addGlyph(glyphs[cc]) ; + addGlyph(glyphs[cc]); } - c-- ; - cc-- ; + c--; + cc--; } } } else { #endif - c = curfnt->chardesc + 255 ; - cc = 255 ; + c = curfnt->chardesc + 255; + cc = 255; for (b=15; b>=0; b--) { for (bit=1; bit; bit<<=1) { if (all->bitmap[b] & bit) { grid[cc]=1; } - c-- ; - cc-- ; + c--; + cc--; } } #ifdef DOWNLOAD_USING_PDFTEX @@ -506,7 +506,7 @@ downpsfont(charusetype *p, charusetype *all) } } if(GridCount!=0 || extraGlyphs) { - newline() ; + newline(); if (! disablecomments) (void)fprintf(bitfile, "%%%%BeginFont: %s\n", rf->PSname); #ifdef DOWNLOAD_USING_PDFTEX @@ -517,11 +517,11 @@ downpsfont(charusetype *p, charusetype *all) exit(1); if (!quiet) { if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } (void)fprintf(stderr, "<%s>", realnameoffile); - prettycolumn += strlen(realnameoffile) + 2 ; + prettycolumn += strlen(realnameoffile) + 2; } if (! disablecomments) (void)fprintf(bitfile, "%%%%EndFont \n"); @@ -531,22 +531,22 @@ downpsfont(charusetype *p, charusetype *all) void dopsfont(sectiontype *fs) { - charusetype *cu ; + charusetype *cu; - cu = (charusetype *) (fs + 1) ; + cu = (charusetype *) (fs + 1); #ifdef DOWNLOAD_USING_PDFTEX while (cu->fd) { if (cu->psfused) - cu->fd->psflag = EXISTS ; - downpsfont(cu++, (charusetype *)(fs + 1)) ; + cu->fd->psflag = EXISTS; + downpsfont(cu++, (charusetype *)(fs + 1)); } #else line = getmem(BUFSIZ); tmpline=line; while (cu->fd) { if (cu->psfused) - cu->fd->psflag = EXISTS ; - downpsfont(cu++, (charusetype *)(fs + 1)) ; + cu->fd->psflag = EXISTS; + downpsfont(cu++, (charusetype *)(fs + 1)); } loadbase = ~FLG_LOAD_BASE; FirstCharB=UnDefineChars(FirstCharB); diff --git a/Build/source/texk/dvipsk/dpicheck.c b/Build/source/texk/dvipsk/dpicheck.c index 78e2311416d..69a6d445a42 100644 --- a/Build/source/texk/dvipsk/dpicheck.c +++ b/Build/source/texk/dvipsk/dpicheck.c @@ -9,50 +9,50 @@ */ #include "protos.h" -static integer existsizes[30] = { 0 , 99999999 } ; -static int checkdpi ; +static integer existsizes[30] = { 0 , 99999999 }; +static int checkdpi; /* * This routine adds some sizes to `existsizes'. */ void addsiz(int rhsize) { - register integer *p ; - long t, hsize ; + register integer *p; + long t, hsize; - hsize = rhsize ; - for (p=existsizes; *p < hsize; p++) ; + hsize = rhsize; + for (p=existsizes; *p < hsize; p++); if (*p == hsize) - return ; + return; do { - t = *p ; - *p++ = hsize ; - hsize = t ; - } while (hsize) ; + t = *p; + *p++ = hsize; + hsize = t; + } while (hsize); } void adddpi(int hsize) { - long a, b, c ; - int i ; + long a, b, c; + int i; - addsiz(hsize) ; - addsiz((int)((hsize * 116161L + 53020L) / 106040L)) ; - a = hsize ; - b = 0 ; - c = 1 ; + addsiz(hsize); + addsiz((int)((hsize * 116161L + 53020L) / 106040L)); + a = hsize; + b = 0; + c = 1; for (i=0; i<9; i++) { - b = 6 * b + (a % 5) * c ; - a = a + a / 5 ; - c = c * 5 ; + b = 6 * b + (a % 5) * c; + a = a + a / 5; + c = c * 5; if (b > c) { - b -= c ; - a++ ; + b -= c; + a++; } if (b + b >= c) - addsiz((int)(a+1)) ; + addsiz((int)(a+1)); else - addsiz((int)a) ; + addsiz((int)a); } } /* @@ -61,18 +61,18 @@ adddpi(int hsize) halfword dpicheck(halfword dpi) { - integer i ; - integer margin = 1 + dpi / 500 ; + integer i; + integer margin = 1 + dpi / 500; if (! checkdpi) { - adddpi(DPI) ; - checkdpi = 1 ; + adddpi(DPI); + checkdpi = 1; } - for (i=0; existsizes[i] < dpi; i++) ; + for (i=0; existsizes[i] < dpi; i++); if (existsizes[i]-dpi <= margin) - return(existsizes[i]) ; + return(existsizes[i]); else if (dpi-existsizes[i-1] <= margin) - return(existsizes[i-1]) ; + return(existsizes[i-1]); else - return(dpi) ; + return(dpi); } diff --git a/Build/source/texk/dvipsk/drawPS.c b/Build/source/texk/dvipsk/drawPS.c index c5457902a16..b23a75e27ee 100644 --- a/Build/source/texk/dvipsk/drawPS.c +++ b/Build/source/texk/dvipsk/drawPS.c @@ -273,11 +273,11 @@ flushDashedPath(int dotted, double inchesPerDash) int nipd = (integer) convPS((int) inchesPerDash); if (nipd == 0) - nipd = 1 ; + nipd = 1; if (pathLen < 2) { error("Path less than 2 points - ignored"); - pathLen = 0 ; + pathLen = 0; return; } @@ -307,10 +307,10 @@ flushDashedPath(int dotted, double inchesPerDash) else ndashes += 1; } else if (ndashes < 1) - ndashes = 1 ; + ndashes = 1; ipd = delta / ndashes; if (ipd <= 0.0) - ipd = 1.0 ; + ipd = 1.0; cmdout("["); if (dotted) { doubleout(penSize); @@ -341,7 +341,7 @@ flushPath(int invis) if (pathLen < 2) { error("Path less than 2 points - ignored"); - pathLen = 0 ; + pathLen = 0; return; } @@ -460,12 +460,12 @@ flushDashed(char *cp, int dotted) void flushSpline(char *cp) { /* as exact as psdit!!! */ - register long i ; + register long i; register double dxi, dyi, dxi1, dyi1; if (*cp) { double inchesPerDash; - int ipd ; + int ipd; if (sscanf(cp, "%lg ", &inchesPerDash) != 1) { error ("Illegal format for dotted/dashed spline"); @@ -657,7 +657,7 @@ zPixRound(register double x, /* in DVI units */ ) /* return rounded number of pixels */ { return ((x * mag * (double)convDPI / - (1000.0 * tpicRESOLUTION))) ; + (1000.0 * tpicRESOLUTION))); } #endif /* TPIC */ diff --git a/Build/source/texk/dvipsk/dviinput.c b/Build/source/texk/dvipsk/dviinput.c index 6d5b230ce87..1371bdaab4b 100644 --- a/Build/source/texk/dvipsk/dviinput.c +++ b/Build/source/texk/dvipsk/dviinput.c @@ -14,76 +14,76 @@ void abortpage(void) { - error("! unexpected eof on DVI file") ; + error("! unexpected eof on DVI file"); } shalfword /* the value returned is, however, between 0 and 255 */ dvibyte(void) { - register shalfword i ; + register shalfword i; if (curpos) { - if (curpos>=curlim) return((shalfword)140) ; - return (*curpos++) ; + if (curpos>=curlim) return((shalfword)140); + return (*curpos++); } if ((i=getc(dvifile))==EOF) - abortpage() ; - return(i) ; + abortpage(); + return(i); } halfword twobytes(void) { - register halfword i ; - i = dvibyte() ; - return(i*256+dvibyte()) ; } + register halfword i; + i = dvibyte(); + return(i*256+dvibyte()); } integer threebytes(void) { - register integer i ; - i = twobytes() ; - return(i*256+dvibyte()) ; } + register integer i; + i = twobytes(); + return(i*256+dvibyte()); } shalfword signedbyte(void) { - register shalfword i ; + register shalfword i; if (curpos) { if (curpos>=curlim) - error("! unexpected end of virtual packet") ; - i = *curpos++ ; + error("! unexpected end of virtual packet"); + i = *curpos++; } else if ((i=getc(dvifile))==EOF) - abortpage() ; - if (i<128) return(i) ; - else return(i-256) ; + abortpage(); + if (i<128) return(i); + else return(i-256); } shalfword signedpair(void) { - register shalfword i ; - i = signedbyte() ; - return(i*256+dvibyte()) ; + register shalfword i; + i = signedbyte(); + return(i*256+dvibyte()); } integer signedtrio(void) { - register integer i ; - i = signedpair() ; - return(i*256+dvibyte()) ; + register integer i; + i = signedpair(); + return(i*256+dvibyte()); } integer signedquad(void) { - register integer i ; - i = signedpair() ; - return(i*65536+twobytes()) ; + register integer i; + i = signedpair(); + return(i*65536+twobytes()); } void skipover(int i) { - while (i-->0) (void)dvibyte() ; + while (i-->0) (void)dvibyte(); } diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c index 95259ab05a3..fe6f0283f6d 100644 --- a/Build/source/texk/dvipsk/dvips.c +++ b/Build/source/texk/dvipsk/dvips.c @@ -18,7 +18,7 @@ #else /* ! KPATHSEA */ #include <stdlib.h> /* for malloc, etc. */ #if !defined(SYSV) && !defined(WIN32) -extern char *strtok() ; /* some systems don't have this in strings.h */ +extern char *strtok(); /* some systems don't have this in strings.h */ #endif #if defined(WIN32) #include <io.h> @@ -61,70 +61,70 @@ extern char *strtok() ; /* some systems don't have this in strings.h */ /* PS fonts fully downloaded as headers */ char *downloadedpsnames[DOWNLOADEDPSSIZE]; -int unused_top_of_psnames ; /* unused top number of downloadedpsnames[#] */ -fontdesctype *fonthead ; /* list of all fonts mentioned so far */ -fontdesctype *curfnt ; /* the currently selected font */ -sectiontype *sections ; /* sections to process document in */ -Boolean partialdownload = 1 ; /* turn on partial downloading */ -Boolean manualfeed ; /* manual feed? */ -Boolean compressed ; /* compressed? */ -Boolean downloadpspk ; /* use PK for downloaded PS fonts? */ -Boolean safetyenclose ; /* enclose in save/restore for stupid spoolers? */ -Boolean removecomments = 0 ; /* remove comments from included PS? */ -Boolean nosmallchars ; /* disable small char optimization for X4045? */ -Boolean cropmarks ; /* add cropmarks? */ -Boolean abspage = 0 ; /* are page numbers absolute? */ -Boolean tryepsf = 0 ; /* should we try to make it espf? */ -int secure = 1 ; /* make safe for suid */ +int unused_top_of_psnames; /* unused top number of downloadedpsnames[#] */ +fontdesctype *fonthead; /* list of all fonts mentioned so far */ +fontdesctype *curfnt; /* the currently selected font */ +sectiontype *sections; /* sections to process document in */ +Boolean partialdownload = 1; /* turn on partial downloading */ +Boolean manualfeed; /* manual feed? */ +Boolean compressed; /* compressed? */ +Boolean downloadpspk; /* use PK for downloaded PS fonts? */ +Boolean safetyenclose; /* enclose in save/restore for stupid spoolers? */ +Boolean removecomments = 0; /* remove comments from included PS? */ +Boolean nosmallchars; /* disable small char optimization for X4045? */ +Boolean cropmarks; /* add cropmarks? */ +Boolean abspage = 0; /* are page numbers absolute? */ +Boolean tryepsf = 0; /* should we try to make it espf? */ +int secure = 1; /* make safe for suid */ int secure_option = 0; /* set by -R */ -int collatedcopies = 1 ; /* how many collated copies? */ -int sectioncopies = 1 ; /* how many times to repeat each section? */ -integer pagecopies = 1 ; /* how many times to repeat each page? */ -shalfword linepos = 0 ; /* where are we on the line being output? */ -integer maxpages ; /* the maximum number of pages */ -Boolean notfirst, notlast ; /* true if a first page was specified */ -Boolean evenpages, oddpages ; /* true if doing only even/only odd pages */ -Boolean pagelist ; /* true if using page ranges */ -Boolean sendcontrolD ; /* should we send a control D at end? */ -Boolean shiftlowchars ; /* shift [0-32, 127] characters higher? */ -integer firstpage ; /* the number of the first page if specified */ -integer lastpage ; -integer firstseq ; -integer lastseq ; -integer hpapersize, vpapersize ; /* horizontal and vertical paper size */ -integer hoff, voff ; /* horizontal and vertical offsets */ +int collatedcopies = 1; /* how many collated copies? */ +int sectioncopies = 1; /* how many times to repeat each section? */ +integer pagecopies = 1; /* how many times to repeat each page? */ +shalfword linepos = 0; /* where are we on the line being output? */ +integer maxpages; /* the maximum number of pages */ +Boolean notfirst, notlast; /* true if a first page was specified */ +Boolean evenpages, oddpages; /* true if doing only even/only odd pages */ +Boolean pagelist; /* true if using page ranges */ +Boolean sendcontrolD; /* should we send a control D at end? */ +Boolean shiftlowchars; /* shift [0-32, 127] characters higher? */ +integer firstpage; /* the number of the first page if specified */ +integer lastpage; +integer firstseq; +integer lastseq; +integer hpapersize, vpapersize; /* horizontal and vertical paper size */ +integer hoff, voff; /* horizontal and vertical offsets */ integer maxsecsize = 0; /* the maximum size of a section */ -integer firstboploc ; /* where the first bop is */ -Boolean sepfiles ; /* each section in its own file? */ -int numcopies ; /* number of copies of each page to print */ -const char *oname ; /* output file name */ -char *iname ; /* dvi file name */ -char *fulliname ; /* same, with current working directory */ -char *strings ; /* strings for program */ -char *nextstring, *maxstring ; /* string pointers */ -FILE *dvifile, *bitfile ; /* dvi and output files */ -quarterword *curpos ; /* current position in virtual character packet */ -quarterword *curlim ; /* final byte in virtual character packet */ -fontmaptype *ffont ; /* first font in current frame */ -real conv ; /* conversion ratio, pixels per DVI unit */ -real vconv ; /* conversion ratio, pixels per DVI unit */ -real alpha ; /* conversion ratio, DVI unit per TFM unit */ -double mag ; /* the magnification of this document */ -integer num, den ; /* the numerator and denominator */ -int overridemag ; /* substitute for mag value in DVI file? */ -int actualdpi = DEFRES ; /* the actual resolution of the printer */ -int vactualdpi = DEFRES ; /* the actual resolution of the printer */ -int maxdrift ; /* max pixels away from true rounded position */ -int vmaxdrift ; /* max pixels away from true rounded position */ -char *paperfmt ; /* command-line paper format */ -int landscape = 0 ; /* landscape mode */ -integer fontmem ; /* memory remaining in printer */ -integer pagecount ; /* page counter for the sections */ -integer pagenum ; /* the page number we currently look at */ -long bytesleft ; /* number of bytes left in raster */ -quarterword *raster ; /* area for raster manipulations */ -integer hh, vv ; /* horizontal and vertical pixel positions */ -Boolean noomega = 0 ; /* Omega extensions are enabled */ +integer firstboploc; /* where the first bop is */ +Boolean sepfiles; /* each section in its own file? */ +int numcopies; /* number of copies of each page to print */ +const char *oname; /* output file name */ +char *iname; /* dvi file name */ +char *fulliname; /* same, with current working directory */ +char *strings; /* strings for program */ +char *nextstring, *maxstring; /* string pointers */ +FILE *dvifile, *bitfile; /* dvi and output files */ +quarterword *curpos; /* current position in virtual character packet */ +quarterword *curlim; /* final byte in virtual character packet */ +fontmaptype *ffont; /* first font in current frame */ +real conv; /* conversion ratio, pixels per DVI unit */ +real vconv; /* conversion ratio, pixels per DVI unit */ +real alpha; /* conversion ratio, DVI unit per TFM unit */ +double mag; /* the magnification of this document */ +integer num, den; /* the numerator and denominator */ +int overridemag; /* substitute for mag value in DVI file? */ +int actualdpi = DEFRES; /* the actual resolution of the printer */ +int vactualdpi = DEFRES; /* the actual resolution of the printer */ +int maxdrift; /* max pixels away from true rounded position */ +int vmaxdrift; /* max pixels away from true rounded position */ +char *paperfmt; /* command-line paper format */ +int landscape = 0; /* landscape mode */ +integer fontmem; /* memory remaining in printer */ +integer pagecount; /* page counter for the sections */ +integer pagenum; /* the page number we currently look at */ +long bytesleft; /* number of bytes left in raster */ +quarterword *raster; /* area for raster manipulations */ +integer hh, vv; /* horizontal and vertical pixel positions */ +Boolean noomega = 0; /* Omega extensions are enabled */ /*-----------------------------------------------------------------------* * The PATH definitions cannot be defined on the command line because so many @@ -134,7 +134,7 @@ Boolean noomega = 0 ; /* Omega extensions are enabled */ #include "vms_gcc_paths.h" #endif -const char *infont ; /* is the file we are downloading a font? */ +const char *infont; /* is the file we are downloading a font? */ #ifndef KPATHSEA #ifdef ATARIST # define TFMPATH "." @@ -144,12 +144,12 @@ const char *infont ; /* is the file we are downloading a font? */ # define HEADERPATH "." # define CONFIGPATH "." #endif -char *tfmpath = TFMPATH ; /* pointer to directories for tfm files */ -char *pkpath = PKPATH ; /* pointer to directories for pk files */ -char *vfpath = VFPATH ; /* pointer to directories for vf files */ -char *figpath = FIGPATH ; /* pointer to directories for figure files */ -char *headerpath = HEADERPATH ; /* pointer to directories for header files */ -char *configpath = CONFIGPATH ; /* where to find config files */ +char *tfmpath = TFMPATH; /* pointer to directories for tfm files */ +char *pkpath = PKPATH; /* pointer to directories for pk files */ +char *vfpath = VFPATH; /* pointer to directories for vf files */ +char *figpath = FIGPATH; /* pointer to directories for figure files */ +char *headerpath = HEADERPATH; /* pointer to directories for header files */ +char *configpath = CONFIGPATH; /* where to find config files */ #ifndef PICTPATH #ifndef __THINK__ #define PICTPATH "." @@ -157,39 +157,39 @@ char *configpath = CONFIGPATH ; /* where to find config files */ #define PICTPATH ":" #endif #endif -char *pictpath = PICTPATH ; /* where IFF/etc. pictures are found */ +char *pictpath = PICTPATH; /* where IFF/etc. pictures are found */ #ifdef SEARCH_SUBDIRECTORIES -char *fontsubdirpath = FONTSUBDIRPATH ; +char *fontsubdirpath = FONTSUBDIRPATH; #endif #endif /* ! KPATHSEA */ #ifdef FONTLIB -char *flipath = FLIPATH ; /* pointer to directories for fli files */ -char *fliname = FLINAME ; /* pointer to names of fli files */ +char *flipath = FLIPATH; /* pointer to directories for fli files */ +char *fliname = FLINAME; /* pointer to names of fli files */ #endif -integer swmem ; /* font memory in the PostScript printer */ -int quiet ; /* should we only print errors to stderr? */ -int filter ; /* act as filter default output to stdout, +integer swmem; /* font memory in the PostScript printer */ +int quiet; /* should we only print errors to stderr? */ +int filter; /* act as filter default output to stdout, default input to stdin? */ -int dvips_debug_flag ; /* output config and map files to stderr if 1 */ -int prettycolumn ; /* the column we are at when running pretty */ -int gargc ; /* global argument count */ -char **gargv ; /* global argument vector */ -int totalpages = 0 ; /* total number of pages */ -Boolean reverse ; /* are we going reverse? */ -Boolean usesPSfonts ; /* do we use local PostScript fonts? */ -Boolean usesspecial ; /* do we use \special? */ -Boolean headers_off ; /* do we send headers or not? */ -Boolean usescolor ; /* IBM: color - do we use colors? */ -const char *headerfile ; /* default header file */ -char *warningmsg ; /* a message to write, if set in config file */ -Boolean multiplesects ; /* more than one section? */ -Boolean disablecomments ; /* should we suppress any EPSF comments? */ -char *printer ; /* what printer to send this to? */ -char *mfmode ; /* default MF mode */ -char *mflandmode ; /* allow an optional landscape mode def */ +int dvips_debug_flag; /* output config and map files to stderr if 1 */ +int prettycolumn; /* the column we are at when running pretty */ +int gargc; /* global argument count */ +char **gargv; /* global argument vector */ +int totalpages = 0; /* total number of pages */ +Boolean reverse; /* are we going reverse? */ +Boolean usesPSfonts; /* do we use local PostScript fonts? */ +Boolean usesspecial; /* do we use \special? */ +Boolean headers_off; /* do we send headers or not? */ +Boolean usescolor; /* IBM: color - do we use colors? */ +const char *headerfile; /* default header file */ +char *warningmsg; /* a message to write, if set in config file */ +Boolean multiplesects; /* more than one section? */ +Boolean disablecomments; /* should we suppress any EPSF comments? */ +char *printer; /* what printer to send this to? */ +char *mfmode; /* default MF mode */ +char *mflandmode; /* allow an optional landscape mode def */ int mfmode_option; /* set by -mode command-line option */ int oname_option; /* set by -o option */ -frametype frames[MAXFRAME] ; /* stack for virtual fonts */ +frametype frames[MAXFRAME]; /* stack for virtual fonts */ integer pagecost; /* memory used on the page being prescanned */ int delchar; /* characters to delete from prescanned page */ integer fsizetol; /* max dvi units error for psfile font sizes */ @@ -197,12 +197,12 @@ Boolean includesfonts; /* are fonts used in included psfiles? */ fontdesctype *fonthd[MAXFONTHD];/* list headers for included fonts of 1 name */ int nextfonthd; /* next unused fonthd[] index */ char xdig[256]; /* table for reading hexadecimal digits */ -char banner[] = BANNER ; /* our startup message */ -char banner2[] = BANNER2 ; /* our second startup message */ -Boolean noenv = 0 ; /* ignore PRINTER envir variable? */ -Boolean dopprescan = 0 ; /* do we do a scan before the prescan? */ -struct papsiz *papsizes ; /* all available paper size */ -int headersready ; /* ready to check headers? */ +char banner[] = BANNER; /* our startup message */ +char banner2[] = BANNER2; /* our second startup message */ +Boolean noenv = 0; /* ignore PRINTER envir variable? */ +Boolean dopprescan = 0; /* do we do a scan before the prescan? */ +struct papsiz *papsizes; /* all available paper size */ +int headersready; /* ready to check headers? */ #if defined(MSDOS) || defined(OS2) || defined(ATARIST) char *mfjobname = NULL; /* name of mfjob file if given */ FILE *mfjobfile = NULL; /* mfjob file for font making instructions */ @@ -215,7 +215,7 @@ int qargc; char *qargv[32]; char queryoptions; #ifdef HPS -Boolean HPS_FLAG = 0 ; +Boolean HPS_FLAG = 0; #endif /* Declare the routine to get the current working directory. */ @@ -297,7 +297,7 @@ static const char *helparr[] = { /*"- Interactive query of options", */ " # = number f = file s = string * = suffix, `0' to turn off", " c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)", -" l = comma-separated list of page ranges (e.g., 1-4,7-9)", 0} ; +" l = comma-separated list of page ranges (e.g., 1-4,7-9)", 0}; void help(int status) @@ -327,7 +327,7 @@ freememforpsnames(void) * character is !, it aborts the job. */ -static char *progname ; +static char *progname; void error_with_perror(const char *s, const char *fname) @@ -335,7 +335,7 @@ error_with_perror(const char *s, const char *fname) if (prettycolumn > 0) fprintf(stderr,"\n"); prettycolumn = 0; - (void)fprintf(stderr, "%s: %s", progname, s) ; + (void)fprintf(stderr, "%s: %s", progname, s); if (fname) { putc (' ', stderr); perror (fname); @@ -344,11 +344,11 @@ error_with_perror(const char *s, const char *fname) } if (*s=='!') { - freememforpsnames() ; + freememforpsnames(); if (bitfile != NULL) { - cleanprinter() ; + cleanprinter(); } - exit(1) ; /* fatal */ + exit(1); /* fatal */ } } @@ -402,45 +402,45 @@ check_checksum(unsigned c1, unsigned c2, const char *name) * is when repacking *huge* characters anyway. */ #ifdef DEBUG -static integer totalalloc = 0 ; +static integer totalalloc = 0; #endif char * mymalloc(integer n) { - char *p ; + char *p; #ifdef SMALLMALLOC if (n > 65500L) - error("! can't allocate more than 64K!") ; + error("! can't allocate more than 64K!"); #endif if (n <= 0) /* catch strange 0 mallocs in flib.c without breaking code */ - n = 1 ; + n = 1; #ifdef DEBUG - totalalloc += n ; + totalalloc += n; if (dd(D_MEM)) { #ifdef SHORTINT - fprintf(stderr, "Alloc %ld\n", n) ; + fprintf(stderr, "Alloc %ld\n", n); #else - fprintf(stderr, "Alloc %d\n", n) ; + fprintf(stderr, "Alloc %d\n", n); #endif } #endif - p = (char *) malloc(n) ; + p = (char *) malloc(n); if (p == NULL) - error("! no memory") ; - return p ; + error("! no memory"); + return p; } void morestrings(void) { - strings = mymalloc((integer)STRINGSIZE) ; - nextstring = strings ; - maxstring = strings + STRINGSIZE - 200 ; - *nextstring++ = 0 ; + strings = mymalloc((integer)STRINGSIZE); + nextstring = strings; + maxstring = strings + STRINGSIZE - 200; + *nextstring++ = 0; } void checkstrings(void) { if (nextstring - strings > STRINGSIZE / 2) - morestrings() ; + morestrings(); } /* * Initialize sets up all the globals and data structures. @@ -460,23 +460,23 @@ initialize(void) i = 10; for (s="abcdef"; *s!=0; s++) xdig[(int)*s] = i++; - for(i=0 ; i < DOWNLOADEDPSSIZE; i++) + for(i=0; i < DOWNLOADEDPSSIZE; i++) downloadedpsnames[i] = NULL; unused_top_of_psnames = 0; - morestrings() ; - maxpages = 100000 ; - numcopies = 1 ; - iname = fulliname = strings ; - bitfile = NULL ; - bytesleft = 0 ; - swmem = SWMEM ; - oname = OUTPATH ; - sendcontrolD = 0 ; - shiftlowchars = 0 ; - multiplesects = 0 ; - disablecomments = 0 ; - maxdrift = -1 ; - vmaxdrift = -1 ; + morestrings(); + maxpages = 100000; + numcopies = 1; + iname = fulliname = strings; + bitfile = NULL; + bytesleft = 0; + swmem = SWMEM; + oname = OUTPATH; + sendcontrolD = 0; + shiftlowchars = 0; + multiplesects = 0; + disablecomments = 0; + maxdrift = -1; + vmaxdrift = -1; dontmakefont = !MAKE_TEX_PK_BY_DEFAULT; } /* @@ -485,47 +485,47 @@ initialize(void) char * newstring(const char *s) { - int l ; - char *q ; + int l; + char *q; if (s == NULL) - return(NULL) ; - l = strlen(s) ; + return(NULL); + l = strlen(s); if (nextstring + l >= maxstring) - morestrings() ; + morestrings(); if (nextstring + l >= maxstring) - error("! out of string space") ; - (void)strcpy(nextstring, s) ; - q = nextstring ; - nextstring += l + 1 ; - return(q) ; + error("! out of string space"); + (void)strcpy(nextstring, s); + q = nextstring; + nextstring += l + 1; + return(q); } void newoutname(void) { - static int seq = 0 ; - static char *seqptr = 0 ; - char *p, *q ; + static int seq = 0; + static char *seqptr = 0; + char *p, *q; if (oname == 0 || *oname == 0) - error("! need an output file name to specify separate files") ; + error("! need an output file name to specify separate files"); if (*oname != '!' && *oname != '|') { if (seqptr == 0) { - q = newstring(oname) ; + q = newstring(oname); for (p = q; *p; p++) /* find last dot after last slash */ if (*p == '.') - seqptr = p + 1 ; + seqptr = p + 1; else if (*p == '/') - seqptr = 0 ; + seqptr = 0; #ifdef DOSISH else if (*p == '\\') - seqptr = 0 ; + seqptr = 0; #endif if (seqptr == 0) - seqptr = p ; - nextstring += 5 ; /* make room for the number, up to five digits */ - oname = q ; + seqptr = p; + nextstring += 5; /* make room for the number, up to five digits */ + oname = q; } - sprintf(seqptr, "%03d", ++seq) ; + sprintf(seqptr, "%03d", ++seq); } } /* @@ -536,16 +536,16 @@ VOID * revlist(VOID *p) { struct list { - struct list *next ; - } *pp = (struct list *)p, *qq = 0, *tt ; + struct list *next; + } *pp = (struct list *)p, *qq = 0, *tt; while (pp) { - tt = pp->next ; - pp->next = qq ; - qq = pp ; - pp = tt ; + tt = pp->next; + pp->next = qq; + qq = pp; + pp = tt; } - return (VOID *)qq ; + return (VOID *)qq; } /* this asks for a new set of arguments from the command line */ void @@ -573,11 +573,11 @@ int main(int argc, char **argv) #endif { - int i, lastext = -1 ; + int i, lastext = -1; #ifdef MVSXA - int firstext = -1 ; + int firstext = -1; #endif - sectiontype *sects ; + sectiontype *sects; #ifdef KPATHSEA kpse_set_program_name (argv[0], "dvips"); @@ -585,14 +585,14 @@ main(int argc, char **argv) #endif #ifdef __THINK__ - argc = dcommand(&argv) ; /* do I/O stream redirection */ + argc = dcommand(&argv); /* do I/O stream redirection */ #endif #ifdef VMS /* Grab the command-line buffer */ short len_arg; $DESCRIPTOR( verb_dsc, "DVIPS "); /* assume the verb is always DVIPS */ struct dsc$descriptor_d temp_dsc = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_D, 0}; - progname = &thh[0] ; + progname = &thh[0]; strcpy(progname,"DVIPS%ERROR"); lib$get_foreign( &temp_dsc, 0, &len_arg, 0); /* Get the command line */ @@ -600,20 +600,20 @@ main(int argc, char **argv) len_arg += verb_dsc.dsc$w_length; /* update the length */ temp_dsc.dsc$a_pointer[len_arg] = '\0'; /* terminate the string */ gargv = &temp_dsc.dsc$a_pointer; /* point to the buffer */ - gargc = 1 ; /* only one big argv */ + gargc = 1; /* only one big argv */ #else - progname = argv[0] ; - gargv = argv ; - gargc = argc ; + progname = argv[0]; + gargv = argv; + gargc = argc; /* we sneak a look at the first arg in case it's debugging */ #ifdef DEBUG if (argc > 1 && strncmp(argv[1], "-d", 2)==0) { if (argv[1][2]==0 && argc > 2) { if (sscanf(argv[2], "%d", &debug_flag)==0) - debug_flag = 0 ; + debug_flag = 0; } else { if (sscanf(argv[1]+2, "%d", &debug_flag)==0) - debug_flag = 0 ; + debug_flag = 0; } } #if defined(KPATHSEA) && defined(KPSE_DEBUG) @@ -643,35 +643,35 @@ Primary author of Dvips: T. Rokicki."); exit (0); } if (argc == 2 && strncmp(argv[1], "-?", 2) == 0) { - printf("%s %s\n", banner, banner2) ; + printf("%s %s\n", banner, banner2); help(0); exit(0); } if (argc == 2 && strncmp(argv[1], "-v", 2) == 0) { - printf("%s %s\n", banner, banner2) ; + printf("%s %s\n", banner, banner2); exit(0); } } #endif #endif - dvips_debug_flag = 0 ; + dvips_debug_flag = 0; { /* for compilers incompatible with c99 */ - char *s = (char *)getenv ("DVIPSDEBUG") ; + char *s = (char *)getenv ("DVIPSDEBUG"); if (s) { - dvips_debug_flag = 1 ; - free (s) ; + dvips_debug_flag = 1; + free (s); } else { - s = (char *) getenv ("KPATHSEA_DEBUG") ; + s = (char *) getenv ("KPATHSEA_DEBUG"); if (s) { - dvips_debug_flag = 1 ; - free (s) ; + dvips_debug_flag = 1; + free (s); } } } - initialize() ; - checkenv(0) ; - getdefaults(CONFIGFILE) ; - getdefaults((char *)0) ; + initialize(); + checkenv(0); + getdefaults(CONFIGFILE); + getdefaults((char *)0); /* * This next whole big section of code is straightforward; we just scan * the options. An argument can either immediately follow its option letter @@ -681,41 +681,41 @@ Primary author of Dvips: T. Rokicki."); */ #ifdef VMS vmscli(void); - papsizes = (struct papsiz *)revlist((void *)papsizes) ; /* Added by PWD 21-Mar-1997 */ + papsizes = (struct papsiz *)revlist((void *)papsizes); /* Added by PWD 21-Mar-1997 */ #else queryoptions = 0; do { for (i=1; i<argc; i++) { if (*argv[i]=='-') { - char *p=argv[i]+2 ; - char c=argv[i][1] ; + char *p=argv[i]+2; + char c=argv[i][1]; switch (c) { case '-': queryoptions = 1; break; case 'a': - dopprescan = (*p != '0') ; - break ; + dopprescan = (*p != '0'); + break; case 'b': if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &pagecopies)==0) - error("! Bad number of page copies option (-b).") ; + error("! Bad number of page copies option (-b)."); if (pagecopies < 1 || pagecopies > 1000) - error("! can only print one to a thousand page copies") ; - break ; + error("! can only print one to a thousand page copies"); + break; case 'c' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &numcopies)==0) - error("! Bad number of copies option (-c).") ; - break ; + error("! Bad number of copies option (-c)."); + break; case 'd' : #ifdef DEBUG { - int old_debug = debug_flag ; - static int warned_already = 0 ; + int old_debug = debug_flag; + static int warned_already = 0; if (*p == 0 && argv[i+1]) p = argv[++i]; @@ -723,130 +723,130 @@ case 'd' : error("! Bad debug option (-d)."); if (debug_flag != old_debug && warned_already++ == 0) { fprintf(stderr, - "I found a debug option that was not the first argument to the dvips\n") ; + "I found a debug option that was not the first argument to the dvips\n"); fprintf(stderr, - "command. Some debugging output may have been lost because of this.\n") ; + "command. Some debugging output may have been lost because of this.\n"); } break; } #else - error("not compiled in debug mode") ; - break ; + error("not compiled in debug mode"); + break; #endif /* DEBUG */ case 'e' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &maxdrift)==0 || maxdrift<0) - error("! Bad maxdrift option (-e).") ; + error("! Bad maxdrift option (-e)."); vmaxdrift = maxdrift; - break ; + break; case 'f' : - filter = (*p != '0') ; + filter = (*p != '0'); if (filter) - oname = "" ; - noenv = 1 ; - sendcontrolD = 0 ; - break ; + oname = ""; + noenv = 1; + sendcontrolD = 0; + break; case 'u' : { - char PSname[300] ; + char PSname[300]; if (*p == 0 && argv[i+1]) - p = argv[++i] ; - strcpy(PSname, p) ; + p = argv[++i]; + strcpy(PSname, p); if (!strchr(PSname, '.')) - strcat(PSname, ".map") ; /* default extension */ + strcat(PSname, ".map"); /* default extension */ if (PSname[0] == '+') - getpsinfo(PSname+1) ; + getpsinfo(PSname+1); else - psmapfile = strdup(PSname) ; /* a cute small memory leak (just as in 'p' option handling in resident.c) */ + psmapfile = strdup(PSname); /* a cute small memory leak (just as in 'p' option handling in resident.c) */ } - break ; + break; case 'h' : case 'H' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (strcmp(p, "-") == 0) - headers_off = 1 ; + headers_off = 1; else - (void)add_header(p) ; - break ; + (void)add_header(p); + break; case 'i': - sepfiles = (*p != '0') ; + sepfiles = (*p != '0'); if (sepfiles && maxsecsize == 0) { maxsecsize = 1; /* default section size to one page/file */ } - break ; + break; case 'j': - partialdownload = (*p != '0') ; - break ; + partialdownload = (*p != '0'); + break; case 'k': - cropmarks = (*p != '0') ; - break ; + cropmarks = (*p != '0'); + break; case 'R': if (*p == '0') { - secure = 0 ; + secure = 0; } else if (*p == '2') { - secure = 2 ; + secure = 2; } else { - secure = 1 ; + secure = 1; } if (secure) - secure_option = 1 ; /* Never used */ - break ; + secure_option = 1; /* Never used */ + break; case 'S': if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &maxsecsize)==0) - error("! Bad section size arg (-S).") ; - break ; + error("! Bad section size arg (-S)."); + break; case 'm' : if (STREQ (p, "ode") && argv[i+1]) { mfmode = argv[++i]; mfmode_option = 1; } else - manualfeed = (*p != '0') ; - break ; + manualfeed = (*p != '0'); + break; case 'n' : if (STREQ (p, "oomega")) { - noomega = 1 ; + noomega = 1; } else { if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; #ifdef SHORTINT if (sscanf(p, "%ld", &maxpages)==0) #else /* ~SHORTINT */ if (sscanf(p, "%d", &maxpages)==0) #endif /* ~SHORTINT */ - error("! Bad number of pages option (-n).") ; + error("! Bad number of pages option (-n)."); } - break ; + break; case 'o' : if (*p == 0 && argv[i+1] && (STREQ (argv[i+1], "-") || argv[i+1][0] != '-')) - p = argv[++i] ; + p = argv[++i]; oname_option = 1; - oname = p ; - noenv = 1 ; - sendcontrolD = 0 ; + oname = p; + noenv = 1; + sendcontrolD = 0; #if defined(MSDOS) || defined(OS2) if (*oname && oname[strlen(oname)-1] == ':') oname[strlen(oname)-1] = 0; /* strip ':' off */ #endif - break ; + break; case 'O' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; - handlepapersize(p, &hoff, &voff) ; - break ; + p = argv[++i]; + handlepapersize(p, &hoff, &voff); + break; case 'T' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; - handlepapersize(p, &hpapersize, &vpapersize) ; + p = argv[++i]; + handlepapersize(p, &hpapersize, &vpapersize); if (landscape) { error( - "both landscape and papersize specified; ignoring landscape") ; - landscape = 0 ; + "both landscape and papersize specified; ignoring landscape"); + landscape = 0; } - break ; + break; case 'p' : #if defined(MSDOS) || defined(OS2) || defined(ATARIST) /* check for emTeX job file (-pj=filename) */ @@ -860,264 +860,264 @@ case 'p' : /* must be page number instead */ #endif if (*p == 'p') { /* a -pp specifier for a page list? */ - p++ ; + p++; if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (ParsePages(p)) - error("! Bad page list specifier (-pp).") ; - pagelist = 1 ; - break ; + error("! Bad page list specifier (-pp)."); + pagelist = 1; + break; } if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (*p == '=') { - abspage = 1 ; - p++ ; + abspage = 1; + p++; } #ifdef SHORTINT switch(sscanf(p, "%ld.%ld", &firstpage, &firstseq)) { #else /* ~SHORTINT */ switch(sscanf(p, "%d.%d", &firstpage, &firstseq)) { #endif /* ~SHORTINT */ -case 1: firstseq = 0 ; -case 2: break ; +case 1: firstseq = 0; +case 2: break; default: #ifdef KPATHSEA - error(concat3 ("! Bad first page option (-p ", p, ").")) ; + error(concat3 ("! Bad first page option (-p ", p, ").")); #else - error("! Bad first page option (-p).") ; + error("! Bad first page option (-p)."); #endif } - notfirst = 1 ; - break ; + notfirst = 1; + break; case 'l': if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (*p == '=') { - abspage = 1 ; - p++ ; + abspage = 1; + p++; } #ifdef SHORTINT switch(sscanf(p, "%ld.%ld", &lastpage, &lastseq)) { #else /* ~SHORTINT */ switch(sscanf(p, "%d.%d", &lastpage, &lastseq)) { #endif /* ~SHORTINT */ -case 1: lastseq = 0 ; -case 2: break ; +case 1: lastseq = 0; +case 2: break; default: #ifdef KPATHSEA - error(concat3 ("! Bad last page option (-l ", p, ").")) ; + error(concat3 ("! Bad last page option (-l ", p, ").")); #else - error("! Bad last page option (-l).") ; + error("! Bad last page option (-l)."); #endif } - notlast = 1 ; - break ; + notlast = 1; + break; case 'A': - oddpages = 1 ; - break ; + oddpages = 1; + break; case 'B': - evenpages = 1 ; - break ; + evenpages = 1; + break; case 'q' : case 'Q' : - quiet = (*p != '0') ; - break ; + quiet = (*p != '0'); + break; case 'r' : - reverse = (*p != '0') ; - break ; + reverse = (*p != '0'); + break; case 't' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (strcmp(p, "landscape") == 0) { if (hpapersize || vpapersize) error( - "both landscape and papersize specified; ignoring landscape") ; + "both landscape and papersize specified; ignoring landscape"); else - landscape = 1 ; + landscape = 1; } else - paperfmt = p ; - break ; + paperfmt = p; + break; case 'v': printf ("%s %s\n", banner, banner2); exit (0); break; case 'x' : case 'y' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%lg", &mag)==0 || mag < 1 || mag > 1000000) - error("! Bad magnification parameter (-x or -y).") ; - overridemag = (c == 'x' ? 1 : -1) ; - break ; + error("! Bad magnification parameter (-x or -y)."); + overridemag = (c == 'x' ? 1 : -1); + break; case 'C' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &collatedcopies)==0) - error("! Bad number of collated copies option (-C).") ; - break ; + error("! Bad number of collated copies option (-C)."); + break; case 'D' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &actualdpi)==0 || actualdpi < 10 || actualdpi > 10000) - error("! Bad dpi parameter (-D).") ; + error("! Bad dpi parameter (-D)."); vactualdpi = actualdpi; /* If we had the mode from config.ps, don't use it. If they specified one with -mode, keep it. */ if (!mfmode_option) mfmode = NULL; - break ; + break; case 'E' : - tryepsf = (*p != '0') ; + tryepsf = (*p != '0'); removecomments = disablecomments = 0; if (tryepsf && maxsecsize == 0) - maxsecsize = 1 ; - break ; + maxsecsize = 1; + break; case 'K' : - removecomments = (*p != '0') ; - break ; + removecomments = (*p != '0'); + break; case 'U' : - nosmallchars = (*p != '0') ; - break ; + nosmallchars = (*p != '0'); + break; case 'X' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &actualdpi)==0 || actualdpi < 10 || actualdpi > 10000) - error("! Bad dpi parameter (-D).") ; - break ; + error("! Bad dpi parameter (-D)."); + break; case 'Y' : if (*p == 0 && argv[i+1]) - p = argv[++i] ; + p = argv[++i]; if (sscanf(p, "%d", &vactualdpi)==0 || vactualdpi < 10 || vactualdpi > 10000) - error("! Bad dpi parameter (-D).") ; + error("! Bad dpi parameter (-D)."); vactualdpi = vactualdpi; - break ; + break; case 'F' : - sendcontrolD = (*p != '0') ; - break ; + sendcontrolD = (*p != '0'); + break; case 'G' : shiftlowchars = (*p != '0'); break; case 'M': - dontmakefont = (*p != '0') ; + dontmakefont = (*p != '0'); #ifdef KPATHSEA kpse_set_program_enabled (kpse_pk_format, !dontmakefont, kpse_src_cmdline); #endif - break ; + break; case 'N' : - disablecomments = (*p != '0') ; - break ; + disablecomments = (*p != '0'); + break; case 'P' : { - struct papsiz *opapsiz = papsizes ; - struct papsiz *npapsiz ; - papsizes = 0 ; + struct papsiz *opapsiz = papsizes; + struct papsiz *npapsiz; + papsizes = 0; if (*p == 0 && argv[i+1]) - p = argv[++i] ; - printer = p ; - noenv = 1 ; + p = argv[++i]; + printer = p; + noenv = 1; if (!getdefaults("")) { /* If no config file, default the output name. */ oname = concat ("| lpr -P", printer); } - npapsiz = opapsiz ; + npapsiz = opapsiz; while (npapsiz && npapsiz->next) - npapsiz = npapsiz->next ; + npapsiz = npapsiz->next; if (npapsiz) { - npapsiz->next = papsizes ; - papsizes = opapsiz ; + npapsiz->next = papsizes; + papsizes = opapsiz; } } - break ; + break; case 's': - safetyenclose = (*p != '0') ; - break ; + safetyenclose = (*p != '0'); + break; case 'V': - downloadpspk = (*p != '0') ; - break ; + downloadpspk = (*p != '0'); + break; case 'Z': - compressed = (*p != '0') ; - break ; + compressed = (*p != '0'); + break; #ifdef HPS case 'z': - HPS_FLAG = (*p != '0') ; - break ; + HPS_FLAG = (*p != '0'); + break; #endif case '?': - break ; /* We print the banner and help msg below. */ + break; /* We print the banner and help msg below. */ default: #ifdef KPATHSEA error(concat3 ("! Invalid option `", argv[i], "'. Try --help for more information.")); #else error( - "! Bad option, not one of acdefhijklmnopqrstxyzABCDEFKMNOPSTUXYZ?") ; + "! Bad option, not one of acdefhijklmnopqrstxyzABCDEFKMNOPSTUXYZ?"); #endif } } else { if (*iname == 0) { - register char *p ; + register char *p; - lastext = 0 ; - iname = nextstring ; - p = argv[i] ; + lastext = 0; + iname = nextstring; + p = argv[i]; if (NAME_BEGINS_WITH_DEVICE(p)) { /* get past DOSISH drive */ - *nextstring++ = *p++ ; - *nextstring++ = *p++ ; + *nextstring++ = *p++; + *nextstring++ = *p++; } while (*p) { - *nextstring = *p++ ; + *nextstring = *p++; if (*nextstring == '.') - lastext = nextstring - iname ; + lastext = nextstring - iname; else if (IS_DIR_SEP(*nextstring)) - lastext = 0 ; - nextstring++ ; + lastext = 0; + nextstring++; } - *nextstring++ = '.' ; - *nextstring++ = 'd' ; - *nextstring++ = 'v' ; - *nextstring++ = 'i' ; - *nextstring++ = 0 ; + *nextstring++ = '.'; + *nextstring++ = 'd'; + *nextstring++ = 'v'; + *nextstring++ = 'i'; + *nextstring++ = 0; } else #ifdef KPATHSEA error(concat3("! Second input filename (", argv[i], - ") specified.")) ; + ") specified.")); #else - error("! Two input file names specified.") ; + error("! Two input file names specified."); #endif } } if (noenv == 0) { - register char *p ; - struct papsiz *opapsiz = papsizes ; - papsizes = 0 ; + register char *p; + struct papsiz *opapsiz = papsizes; + papsizes = 0; if (0 != (p = getenv("PRINTER"))) { #if defined(MSDOS) || defined(OS2) - strcpy(nextstring, p) ; - strcat(nextstring, ".cfg") ; + strcpy(nextstring, p); + strcat(nextstring, ".cfg"); #else - strcpy(nextstring, "config.") ; - strcat(nextstring, p) ; + strcpy(nextstring, "config."); + strcat(nextstring, p); #endif - getdefaults(nextstring) ; + getdefaults(nextstring); } { - struct papsiz *npapsiz = opapsiz ; + struct papsiz *npapsiz = opapsiz; while (npapsiz && npapsiz->next) - npapsiz = npapsiz->next ; + npapsiz = npapsiz->next; if (npapsiz) { - npapsiz->next = papsizes ; - papsizes = opapsiz ; + npapsiz->next = papsizes; + papsizes = opapsiz; } } } - papsizes = (struct papsiz *)revlist((void *)papsizes) ; + papsizes = (struct papsiz *)revlist((void *)papsizes); if (queryoptions != 0) { /* get new options */ - (void)fprintf(stderr, "%s %s\n", banner, banner2) ; - help(1) ; + (void)fprintf(stderr, "%s %s\n", banner, banner2); + help(1); queryargs(); if (qargc == 1) queryoptions = 0; @@ -1127,7 +1127,7 @@ default: argv=qargv; } } - } while (queryoptions != 0) ; + } while (queryoptions != 0); #endif #if defined(KPATHSEA) && defined(KPSE_DEBUG) && defined(DEBUG) /* this should really be part of a subroutine */ if (dd(D_FILES)) KPSE_DEBUG_SET (KPSE_DEBUG_FOPEN); @@ -1137,7 +1137,7 @@ default: if (dd(D_EXPAND)) KPSE_DEBUG_SET (KPSE_DEBUG_EXPAND); if (dd(D_SEARCH)) KPSE_DEBUG_SET (KPSE_DEBUG_SEARCH); #endif /* KPATHSEA && KPSE_DEBUG && DEBUG */ - checkenv(1) ; + checkenv(1); #ifdef KPATHSEA kpse_init_prog ("DVIPS", actualdpi, mfmode, "cmr10"); kpse_make_tex_discard_errors = quiet; @@ -1150,42 +1150,42 @@ default: * the hash chain. We do this by reversing the lists, adding them * to the front, and then reversing them again. */ - revpslists() ; - getpsinfo((char *)NULL) ; - revpslists() ; + revpslists(); + getpsinfo((char *)NULL); + revpslists(); if (dvips_debug_flag) { if (!quiet) - (void)fprintf(stderr, "\n%s %s\n", banner, banner2) ; - prettycolumn = 0 ; + (void)fprintf(stderr, "\n%s %s\n", banner, banner2); + prettycolumn = 0; } else { if (!quiet) - (void)fprintf(stderr, "%s %s\n", banner, banner2) ; + (void)fprintf(stderr, "%s %s\n", banner, banner2); } if (*iname) { - dvifile = fopen(iname, READBIN) ; + dvifile = fopen(iname, READBIN); /* * Allow names like a.b. */ if (dvifile == 0) { - iname[strlen(iname)-4] = 0 ; /* remove the .dvi suffix */ - dvifile = fopen(iname, READBIN) ; + iname[strlen(iname)-4] = 0; /* remove the .dvi suffix */ + dvifile = fopen(iname, READBIN); } } if (oname[0] == '-' && oname[1] == 0) - oname = "" ; + oname = ""; else if (*oname == 0 && ! filter && *iname) { /* determine output name from input name */ - oname = nextstring ; + oname = nextstring; #ifndef VMCMS /* get stuff before LAST "." */ - lastext = strlen(iname) - 1 ; + lastext = strlen(iname) - 1; while (iname[lastext] != '.' && lastext > 0) - lastext-- ; + lastext--; if (iname[lastext] != '.') - lastext = strlen(iname) - 1 ; + lastext = strlen(iname) - 1; #else /* for VM/CMS we take the stuff before FIRST "." */ - lastext = strchr(iname,'.') - iname ; + lastext = strchr(iname,'.') - iname; if ( lastext <= 0 ) /* if no '.' in "iname" */ - lastext = strlen(iname) -1 ; + lastext = strlen(iname) -1; #endif #ifdef MVSXA /* IBM: MVS/XA */ if (strchr(iname, '(') != NULL && @@ -1197,7 +1197,7 @@ default: if (strrchr(iname, '.') != NULL) { lastext = strrchr(iname, '.') - iname - 1; } - else lastext = strlen(iname) - 1 ; + else lastext = strlen(iname) - 1; if (strchr(iname, '\'') != NULL) firstext = strchr(iname, '.') - iname + 1; else firstext = 0; @@ -1208,28 +1208,28 @@ default: #else for (i=0; i<=lastext; i++) #endif - *nextstring++ = iname[i] ; + *nextstring++ = iname[i]; if (iname[lastext] != '.') - *nextstring++ = '.' ; + *nextstring++ = '.'; #ifndef VMCMS - *nextstring++ = 'p' ; - *nextstring++ = 's' ; + *nextstring++ = 'p'; + *nextstring++ = 's'; #else /* might as well keep things uppercase */ - *nextstring++ = 'P' ; - *nextstring++ = 'S' ; + *nextstring++ = 'P'; + *nextstring++ = 'S'; #endif - *nextstring++ = 0 ; + *nextstring++ = 0; /* * Now we check the name, and `throw away' any prefix information. * This means throwing away anything before (and including) a colon * or slash. */ { - const char *p = NAME_BEGINS_WITH_DEVICE(oname) ? oname + 2 : oname ; + const char *p = NAME_BEGINS_WITH_DEVICE(oname) ? oname + 2 : oname; for (oname=p; *p && p[1]; p++) if (IS_DIR_SEP(*p)) - oname = p + 1 ; + oname = p + 1; } } #ifdef DEBUG @@ -1239,15 +1239,15 @@ default: #else /* ~SHORTINT */ (void)fprintf(stderr,"input file %s output file %s swmem %d\n", #endif /* ~SHORTINT */ - iname, oname, swmem) ; + iname, oname, swmem); #ifndef KPATHSEA - (void)fprintf(stderr,"tfm path %s\npk path %s\n", tfmpath, pkpath) ; - (void)fprintf(stderr,"fig path %s\nvf path %s\n", figpath, vfpath) ; + (void)fprintf(stderr,"tfm path %s\npk path %s\n", tfmpath, pkpath); + (void)fprintf(stderr,"fig path %s\nvf path %s\n", figpath, vfpath); (void)fprintf(stderr,"config path %s\nheader path %s\n", - configpath, headerpath) ; + configpath, headerpath); #endif #ifdef FONTLIB - (void)fprintf(stderr,"fli path %s\nfli names %s\n", flipath, fliname) ; + (void)fprintf(stderr,"fli path %s\nfli names %s\n", flipath, fliname); #endif } /* dd(D_PATHS) */ #endif /* DEBUG */ @@ -1255,72 +1255,72 @@ default: * Now we try to open the dvi file. */ if (!quiet && warningmsg) - error(warningmsg) ; - headersready = 1 ; - headerfile = (compressed? CHEADERFILE : HEADERFILE) ; - (void)add_header(headerfile) ; + error(warningmsg); + headersready = 1; + headerfile = (compressed? CHEADERFILE : HEADERFILE); + (void)add_header(headerfile); if (*iname != 0) { - fulliname = nextstring ; + fulliname = nextstring; #ifndef IGNORE_CWD if (!IS_DIR_SEP(*iname) && !NAME_BEGINS_WITH_DEVICE(iname)) { getcwd(nextstring, MAXPATHLEN + 2); - while (*nextstring++) ; + while (*nextstring++); #ifdef VMS /* VMS doesn't need the '/' character appended */ nextstring--; /* so just back up one byte. */ #else - *(nextstring-1) = '/' ; + *(nextstring-1) = '/'; #endif } #endif - strcpy(nextstring,iname) ; - while (*nextstring++) ; /* advance nextstring past iname */ + strcpy(nextstring,iname); + while (*nextstring++); /* advance nextstring past iname */ } else if (filter) { - dvifile = stdin ; + dvifile = stdin; if (O_BINARY && !isatty(fileno(stdin))) - SET_BINARY(fileno(stdin)) ; + SET_BINARY(fileno(stdin)); } else { #ifdef KPATHSEA fprintf (stderr, "dvips: Missing DVI file argument (or -f).\n"); fprintf (stderr, "dvips: Try --help for more information.\n"); #else - help(1) ; + help(1); #endif - exit(1) ; + exit(1); } if (dvifile==NULL) { error_with_perror("DVI file can't be opened:", iname); exit(1); } if (fseek(dvifile, 0L, 0) < 0) - error("! DVI file must not be a pipe.") ; + error("! DVI file must not be a pipe."); - initcolor() ; + initcolor(); #ifdef FONTLIB fliload(); /* read the font libaries */ #endif /* * Now we do our main work. */ - swmem += fontmem ; + swmem += fontmem; if (maxdrift < 0) { if (actualdpi <= 599) - maxdrift = actualdpi / 100 ; + maxdrift = actualdpi / 100; else if (actualdpi < 1199) - maxdrift = actualdpi / 200 + 3 ; + maxdrift = actualdpi / 200 + 3; else - maxdrift = actualdpi / 400 + 6 ; + maxdrift = actualdpi / 400 + 6; } if (vmaxdrift < 0) { if (vactualdpi <= 599) - vmaxdrift = vactualdpi / 100 ; + vmaxdrift = vactualdpi / 100; else if (vactualdpi < 1199) - vmaxdrift = vactualdpi / 200 + 3 ; + vmaxdrift = vactualdpi / 200 + 3; else - vmaxdrift = vactualdpi / 400 + 6 ; + vmaxdrift = vactualdpi / 400 + 6; } if (dopprescan) - pprescanpages() ; - prescanpages() ; + pprescanpages(); + prescanpages(); #if defined MSDOS || defined OS2 || defined(ATARIST) if (mfjobfile != (FILE*)NULL) { char answer[5]; @@ -1333,104 +1333,104 @@ default: } #endif if (includesfonts) - (void)add_header(IFONTHEADER) ; + (void)add_header(IFONTHEADER); if (usesPSfonts) - (void)add_header(PSFONTHEADER) ; + (void)add_header(PSFONTHEADER); if (usesspecial) - (void)add_header(SPECIALHEADER) ; + (void)add_header(SPECIALHEADER); if (usescolor) /* IBM: color */ - (void)add_header(COLORHEADER) ; + (void)add_header(COLORHEADER); #ifdef HPS if (HPS_FLAG) - (void)add_header(HPSHEADER) ; + (void)add_header(HPSHEADER); #endif - sects = sections ; - totalpages *= collatedcopies ; + sects = sections; + totalpages *= collatedcopies; if (sects == NULL || sects->next == NULL) { - sectioncopies = collatedcopies ; - collatedcopies = 1 ; + sectioncopies = collatedcopies; + collatedcopies = 1; } else { if (! sepfiles) - multiplesects = 1 ; + multiplesects = 1; } - totalpages *= pagecopies ; + totalpages *= pagecopies; if (tryepsf) { if (paperfmt || landscape || manualfeed || collatedcopies > 1 || numcopies > 1 || cropmarks || *iname == 0 || (totalpages > 1 && !(sepfiles && maxsecsize == 1))) { - error("Can't make it EPSF, sorry") ; - tryepsf = 0 ; + error("Can't make it EPSF, sorry"); + tryepsf = 0; } } #ifdef HPS if (HPS_FLAG) - set_bitfile("head.tmp", 0) ; + set_bitfile("head.tmp", 0); #endif if (! sepfiles) { - initprinter(sections) ; - outbangspecials() ; + initprinter(sections); + outbangspecials(); } for (i=0; i<collatedcopies; i++) { - sects = sections ; + sects = sections; while (sects != NULL) { if (sepfiles) { - newoutname() ; + newoutname(); if (! quiet) { if (prettycolumn + strlen(oname) + 6 > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } - (void)fprintf(stderr, "(-> %s) ", oname) ; - prettycolumn += strlen(oname) + 6 ; + (void)fprintf(stderr, "(-> %s) ", oname); + prettycolumn += strlen(oname) + 6; } #ifdef HPS if (HPS_FLAG) - set_bitfile("head.tmp", 0) ; + set_bitfile("head.tmp", 0); #endif - initprinter(sects) ; - outbangspecials() ; + initprinter(sects); + outbangspecials(); } else if (! quiet) { if (prettycolumn > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } - (void)fprintf(stderr, ". ") ; - prettycolumn += 2 ; + (void)fprintf(stderr, ". "); + prettycolumn += 2; } - (void)fflush(stderr) ; - dosection(sects, sectioncopies) ; - sects = sects->next ; + (void)fflush(stderr); + dosection(sects, sectioncopies); + sects = sects->next; if (sepfiles) { #ifdef HPS if (HPS_FLAG) - finish_hps() ; + finish_hps(); #endif - cleanprinter() ; + cleanprinter(); } } } - freememforpsnames() ; + freememforpsnames(); if (! sepfiles) { #ifdef HPS if (HPS_FLAG) - finish_hps() ; + finish_hps(); #endif - cleanprinter() ; + cleanprinter(); } if (! quiet) - (void)fprintf(stderr, "\n") ; + (void)fprintf(stderr, "\n"); #ifdef DEBUG if (dd(D_MEM)) { #ifdef SHORTINT - fprintf(stderr, "Total memory allocated: %ld\n", totalalloc) ; + fprintf(stderr, "Total memory allocated: %ld\n", totalalloc); #else - fprintf(stderr, "Total memory allocated: %d\n", totalalloc) ; + fprintf(stderr, "Total memory allocated: %d\n", totalalloc); #endif } #endif - return 0 ; + return 0; /*NOTREACHED*/ } #ifdef VMS diff --git a/Build/source/texk/dvipsk/dvips.h b/Build/source/texk/dvipsk/dvips.h index 34fd8368034..4070f4d4955 100644 --- a/Build/source/texk/dvipsk/dvips.h +++ b/Build/source/texk/dvipsk/dvips.h @@ -29,7 +29,7 @@ #endif #endif #if defined(lint) && defined(sun) -extern char *sprintf() ; +extern char *sprintf(); #endif #include "paths.h" #include "debug.h" @@ -92,14 +92,14 @@ typedef int integer; typedef char boolean; #endif typedef double real; -typedef short shalfword ; -typedef unsigned short halfword ; -typedef unsigned char quarterword ; +typedef short shalfword; +typedef unsigned short halfword; +typedef unsigned char quarterword; #ifdef WIN32 #define Boolean boolean #else #ifndef __THINK__ -typedef short Boolean ; +typedef short Boolean; #endif #endif /* @@ -125,12 +125,12 @@ typedef short Boolean ; */ #define RESHASHPRIME (73) struct resfont { - struct resfont *next ; + struct resfont *next; char *Keyname, *PSname, *TeXname, *Fontfile, *Vectfile; - char *specialinstructions ; - char *downloadheader ; /* possibly multiple files */ - quarterword sent ; -} ; + char *specialinstructions; + char *downloadheader; /* possibly multiple files */ + quarterword sent; +}; /* * A chardesc describes an individual character. Before the fonts are @@ -138,11 +138,11 @@ struct resfont { * with the following meanings: */ typedef struct tcd { - integer TFMwidth ; - quarterword *packptr ; - shalfword pixelwidth ; - quarterword flags, flags2 ; -} chardesctype ; + integer TFMwidth; + quarterword *packptr; + shalfword pixelwidth; + quarterword flags, flags2; +} chardesctype; #define EXISTS (1) #define PREVPAGE (2) #define THISPAGE (4) @@ -164,49 +164,49 @@ typedef struct tcd { * psfile. It can be 0, PREVPAGE, THISPAGE, or EXISTS. */ typedef struct tfd { - integer checksum, scaledsize, designsize, thinspace ; - halfword dpi, loadeddpi ; - halfword alreadyscaled ; - halfword psname ; - halfword loaded ; + integer checksum, scaledsize, designsize, thinspace; + halfword dpi, loadeddpi; + halfword alreadyscaled; + halfword psname; + halfword loaded; quarterword psflag; - quarterword codewidth ; - integer maxchars ; - char *name, *area ; - struct resfont *resfont ; - struct tft *localfonts ; - struct tfd *next ; + quarterword codewidth; + integer maxchars; + char *name, *area; + struct resfont *resfont; + struct tft *localfonts; + struct tfd *next; struct tfd *nextsize; char *scalename; - chardesctype *chardesc ; -} fontdesctype ; + chardesctype *chardesc; +} fontdesctype; /* A fontmap associates a fontdesc with a font number. */ typedef struct tft { - integer fontnum ; - fontdesctype *desc ; - struct tft *next ; -} fontmaptype ; + integer fontnum; + fontdesctype *desc; + struct tft *next; +} fontmaptype; /* Virtual fonts require a `macro' capability that is implemented by * using a stack of `frames'. */ typedef struct { - quarterword *curp, *curl ; - fontdesctype *curf ; - fontmaptype *ff ; -} frametype ; + quarterword *curp, *curl; + fontdesctype *curf; + fontmaptype *ff; +} frametype; /* * The next type holds the font usage information in a 256-bit table; * there's a 1 for each character that was used in a section. */ typedef struct { - fontdesctype *fd ; - halfword psfused ; - halfword bitmap[16] ; -} charusetype ; + fontdesctype *fd; + halfword psfused; + halfword bitmap[16]; +} charusetype; /* Next we want to record the relevant data for a section. A section is * a largest portion of the document whose font usage does not overflow @@ -219,17 +219,17 @@ typedef struct { * the second phase. */ typedef struct t { - integer bos ; - struct t *next ; - halfword numpages ; -} sectiontype ; + integer bos; + struct t *next; + halfword numpages; +} sectiontype; /* * Sections are actually represented not by sectiontype but by a more * complex data structure of variable size, having the following layout: - * sectiontype sect ; - * charusetype charuse[numfonts] ; - * fontdesctype *sentinel = NULL ; + * sectiontype sect; + * charusetype charuse[numfonts]; + * fontdesctype *sentinel = NULL; * (Here numfonts is the number of bitmap fonts currently defined.) * Since we can't declare this or take a sizeof it, we build it and * manipulate it ourselves (see the end of the prescan routine). @@ -238,12 +238,12 @@ typedef struct t { * This is how we build up headers and other lists. */ struct header_list { - struct header_list *next ; - const char *Hname ; - char *precode ; - char *postcode ; - char name[1] ; -} ; + struct header_list *next; + const char *Hname; + char *precode; + char *postcode; + char name[1]; +}; /* * Some machines define putlong in their library. * We get around this here. @@ -253,11 +253,11 @@ struct header_list { * Information on available paper sizes is stored here. */ struct papsiz { - struct papsiz *next ; - integer xsize, ysize ; - const char *name ; - const char *specdat ; -} ; + struct papsiz *next; + integer xsize, ysize; + const char *name; + const char *specdat; +}; #ifdef MVSXA /* IBM: MVS/XA */ /* this is where we fix problems with conflicts for truncation of long names (we might only do this if LONGNAME not set but ...) */ @@ -265,7 +265,7 @@ struct papsiz { # define flushDashedPath flshDshdPth /* conflict with flushDash */ # define PageList PgList /* re-definition conflict with pagelist */ /* adding ascii2ebcdic conversion table to extern */ - extern char ascii2ebcdic[] ; + extern char ascii2ebcdic[]; #endif /* IBM: MVS/XA */ #ifdef VMCMS /* IBM: VM/CMS */ /* this is where we fix problems with conflicts for truncation @@ -273,9 +273,9 @@ struct papsiz { # define pprescanpages pprscnpgs /* confict with pprescan */ # define flushDashedPath flshDshdPth /* conflict with flushDash */ /* adding ascii2ebcdic conversion table to extern */ - extern char ascii2ebcdic[] ; + extern char ascii2ebcdic[]; /* redefining fopen for VMCMS, see DVIPSCMS.C */ - extern FILE *cmsfopen() ; + extern FILE *cmsfopen(); # ifdef fopen # undef fopen # endif diff --git a/Build/source/texk/dvipsk/emspecial.c b/Build/source/texk/dvipsk/emspecial.c index 8b455d4c94d..59fe6154f47 100644 --- a/Build/source/texk/dvipsk/emspecial.c +++ b/Build/source/texk/dvipsk/emspecial.c @@ -19,7 +19,7 @@ #define FALSE 0 #endif -static long emmax = 161 ; +static long emmax = 161; /* * We define these seek constants if they don't have their @@ -33,12 +33,12 @@ static long emmax = 161 ; #endif struct empt { - struct empt *next ; + struct empt *next; shalfword point; integer x, y; }; -static struct empt **empoints = NULL ; +static struct empt **empoints = NULL; boolean emused = FALSE; /* true if em points used on this page */ integer emx, emy; @@ -67,50 +67,50 @@ emclear(void) int i; if (emused && empoints) for (i=0; i<emmax; i++) - empoints[i] = 0 ; - emused = FALSE ; + empoints[i] = 0; + emused = FALSE; } /* put an empoint into the empoints array */ struct empt * emptput(shalfword point, integer x, integer y) { - struct empt *p ; - int start ; + struct empt *p; + int start; emused = TRUE; - start = point % emmax ; - p = empoints[start] ; + start = point % emmax; + p = empoints[start]; while ( p ) { if ( p->point == point ) break; - p = p->next ; + p = p->next; } if (p == 0) { - p = (struct empt *)mymalloc(sizeof(struct empt)) ; - p->next = empoints[start] ; - empoints[start] = p ; + p = (struct empt *)mymalloc(sizeof(struct empt)); + p->next = empoints[start]; + empoints[start] = p; } p->point = point; p->x = x; p->y = y; - return(p) ; + return(p); } /* get an empoint from the empoints array */ struct empt * emptget(shalfword point) { - struct empt *p ; + struct empt *p; int start; start = point % emmax; if (emused == TRUE) { - p = empoints[start] ; + p = empoints[start]; while (p) { if (p->point == point) - return p ; - p = p->next ; + return p; + p = p->next; } } sprintf(errbuf,"!em: point %d not defined",point); @@ -147,7 +147,7 @@ char *emp; void emgraph(); #endif - hvpos() ; + hvpos(); for (emp = p+3; *emp && isspace(*emp); emp++); /* skip blanks */ if (strncmp(emp, "linewidth", 9) == 0) { /* code for linewidth */ @@ -160,7 +160,7 @@ void emgraph(); #ifdef DEBUG if (dd(D_SPECIAL)) (void)fprintf(stderr, "em special: Linewidth set to %.1f dots\n", - emwidth) ; + emwidth); #endif } else { sprintf(errbuf,"Unknown em: special width"); @@ -202,7 +202,7 @@ void emgraph(); else if (strncmp(emp, "point", 5) == 0) { if (empoints == NULL) { empoints = - (struct empt **)mymalloc((integer)emmax * sizeof(struct empt *)) ; + (struct empt **)mymalloc((integer)emmax * sizeof(struct empt *)); emused = TRUE; emclear(); } @@ -216,7 +216,7 @@ void emgraph(); #else (void)fprintf(stderr, "em special: Point %d is %d,%d\n", #endif - empoint->point, empoint->x, empoint->y) ; + empoint->point, empoint->x, empoint->y); #endif } else if (strncmp(emp, "line", 4) == 0) { @@ -243,14 +243,14 @@ void emgraph(); #ifdef DEBUG if (dd(D_SPECIAL)) (void)fprintf(stderr, "em special: Line from point %d to point %d\n", - empoint1, empoint2) ; + empoint1, empoint2); #endif cmdout("np"); if (emwidth!=-1.0) { #ifdef DEBUG if (dd(D_SPECIAL)) (void)fprintf(stderr,"em special: Linewidth temporarily set to %.1f dots\n", - emwidth) ; + emwidth); #endif strcpy(emstr,"currentlinewidth"); cmdout(emstr); @@ -272,14 +272,14 @@ void emgraph(); } } else if (strncmp(emp, "message", 7) == 0) { - (void)fprintf(stderr, "em message: %s\n", emp+7) ; + (void)fprintf(stderr, "em message: %s\n", emp+7); } else if (strncmp(emp, "graph", 5) == 0) { int i; for (emp = emp+5; *emp && isspace(*emp); emp++); /* skip blanks */ - for (i=0; *emp && !isspace(*emp) && !(*emp==',') ; emp++) { + for (i=0; *emp && !isspace(*emp) && !(*emp==','); emp++) { if (strlen(emstr) - 2 >= sizeof(emstr)) { - fprintf(stderr, "em:graph: special too long, truncating\n") ; + fprintf(stderr, "em:graph: special too long, truncating\n"); break; } emstr[i++] = *emp; /* copy filename */ @@ -288,14 +288,14 @@ void emgraph(); /* now get optional width and height */ emwidth = emheight = -1.0; /* no dimension is <= 0 */ for (; *emp && ( isspace(*emp) || (*emp==',') ); emp++) - ; /* skip blanks and comma */ + ; /* skip blanks and comma */ if (*emp) { sscanf(emp, "%f%2s", &emwidth, emunit); /* read width */ emwidth = emunits(emwidth,emunit); /* convert to pixels */ for (; *emp && (*emp=='.'||isdigit(*emp)||isalpha(*emp)); emp++) - ; /* skip width dimension */ + ; /* skip width dimension */ for (; *emp && ( isspace(*emp) || (*emp==',') ); emp++) - ; /* skip blanks and comma */ + ; /* skip blanks and comma */ if (*emp) { sscanf(emp, "%f%2s", &emheight, emunit); /* read height */ emheight = emunits(emheight,emunit)*vactualdpi/actualdpi; @@ -305,13 +305,13 @@ void emgraph(); emgraph(emstr,emwidth,emheight); } else { - (void)fprintf(stderr, "em:graph: no file given\n") ; + (void)fprintf(stderr, "em:graph: no file given\n"); } } else { sprintf(errbuf, "Unknown em: command (%s) in \\special will be ignored", p); - specerror(errbuf) ; + specerror(errbuf); } return; } @@ -657,15 +657,15 @@ void imagehead(char *filename, int wide, int high, float emwidth, float emheight) { - char *fullname = NULL, *name ; + char *fullname = NULL, *name; if (!quiet) { #ifdef KPATHSEA - fullname = (char *)kpse_find_file (filename, pictpath, 0) ; + fullname = (char *)kpse_find_file (filename, pictpath, 0); #endif if (!fullname) - name = filename ; + name = filename; else - name = fullname ; + name = fullname; if (strlen(name) + prettycolumn > STDOUTSIZE) { fprintf(stderr,"\n"); prettycolumn = 0; @@ -676,7 +676,7 @@ imagehead(char *filename, int wide, int high, if (fullname) free (fullname); } hvpos(); - nlcmdout("@beginspecial @setspecial") ; + nlcmdout("@beginspecial @setspecial"); if (!disablecomments) { cmdout("%%BeginDocument: em:graph"); cmdout(filename); @@ -705,10 +705,10 @@ void imagetail(void) { if (!disablecomments) { - (void)fprintf(bitfile, "\n%%%%EndDocument\n") ; + (void)fprintf(bitfile, "\n%%%%EndDocument\n"); linepos = 0; } - nlcmdout("@endspecial") ; + nlcmdout("@endspecial"); if (!quiet) { (void)fprintf(stderr,">"); (void)fflush(stderr); @@ -933,7 +933,7 @@ mspgraph(FILE *f, char *filename, float emwidth, float emheight) sprintf(errbuf, "em:graph: Unknown MSP File Type"); specerror(errbuf); } - imagetail() ; + imagetail(); } /* ------------------------------------------------------------------------ */ @@ -1026,7 +1026,7 @@ rle4read(FILE *f, int w, int b, char *s) } if (rle_dx) { - for ( ; rle_dx>1; rle_dx-=2) { + for (; rle_dx>1; rle_dx-=2) { s++; i++; } @@ -1064,12 +1064,12 @@ rle4read(FILE *f, int w, int b, char *s) ch = ((ch>>4)&0x0f) | ((ch<<4)&0xf0); /* swap order */ i++; *s = (*s & 0xf0) | (ch & 0x0f); - s++ ; + s++; hi = TRUE; cnt--; } /* we are about to place the high 4 bits */ - for ( ; cnt>1 && i<=limit ; cnt-=2) { /* place the whole bytes */ + for (; cnt>1 && i<=limit; cnt-=2) { /* place the whole bytes */ i++; *s++ = ch; } @@ -1101,7 +1101,7 @@ rle8read(FILE *f, int w, int b, char *s) } if (rle_dx) { - for ( ; rle_dx > 0; rle_dx--) { + for (; rle_dx > 0; rle_dx--) { s++; i++; } @@ -1130,7 +1130,7 @@ rle8read(FILE *f, int w, int b, char *s) } } else { /* cnt is repeat count */ - for ( ; cnt>0 && i<=limit; cnt--) { + for (; cnt>0 && i<=limit; cnt--) { i++; *s++ = ch; } @@ -1318,10 +1318,10 @@ bmpgraph(FILE *f, char *filename, float emwidth, float emheight) if (bmih.bitcount == 1) { if (isblack[0]) - for (j = 0; j < ewidth ; j++) + for (j = 0; j < ewidth; j++) pshexa[j] = line[j]; else - for (j = 0; j < ewidth ; j++) + for (j = 0; j < ewidth; j++) pshexa[j] = ~line[j]; pshexa[ewidth-1] |= emask; } @@ -1359,7 +1359,7 @@ bmpgraph(FILE *f, char *filename, float emwidth, float emheight) newline(); mhexout((unsigned char *) pshexa,(long)tobyte(bmih.width)); } - imagetail() ; + imagetail(); free(pshexa); free(line); } diff --git a/Build/source/texk/dvipsk/finclude.c b/Build/source/texk/dvipsk/finclude.c index 76a6f6b9f2c..11e0252761f 100644 --- a/Build/source/texk/dvipsk/finclude.c +++ b/Build/source/texk/dvipsk/finclude.c @@ -15,7 +15,7 @@ #else #include <ctype.h> #if !defined(SYSV) && !defined(WIN32) -extern char *strtok() ; /* some systems don't have this in strings.h */ +extern char *strtok(); /* some systems don't have this in strings.h */ #endif #define ISXGIGIT isxdigit #endif @@ -45,8 +45,8 @@ ifontdef(char *name, char *area, fp = newfontdesc((integer)0, scsize, dssize, name, area); fp->scalename = scname; - fp->next = fonthead ; - fonthead = fp ; + fp->next = fonthead; + fonthead = fp; return fp; } /* @@ -56,7 +56,7 @@ ifontdef(char *name, char *area, void setfamily(fontdesctype *f) { - int i ; + int i; fontmem -= DICTITEMCOST; for (i=0; i<nextfonthd; i++) @@ -67,10 +67,10 @@ setfamily(fontdesctype *f) return; } if (nextfonthd==MAXFONTHD) - error("! Too many fonts in included psfiles") ; - fontmem -= NAMECOST + strlen(f->name) + strlen(f->area) ; - fonthd[nextfonthd++] = f ; - f->nextsize = NULL ; + error("! Too many fonts in included psfiles"); + fontmem -= NAMECOST + strlen(f->name) + strlen(f->area); + fonthd[nextfonthd++] = f; + f->nextsize = NULL; } /* * Convert file name s to a pair of new strings in the string pool. @@ -85,13 +85,13 @@ getname(char *s) a = NULL; for (p=s; *p!=0; p++) if (*p=='/') - a = p+1 ; - if (a==NULL) *nextstring++ = 0 ; - else { sav = *a ; - *a = 0 ; - (void) newstring(s) ; - *a = sav ; - s = a ; + a = p+1; + if (a==NULL) *nextstring++ = 0; + else { sav = *a; + *a = 0; + (void) newstring(s); + *a = sav; + s = a; } return newstring(s); } @@ -106,27 +106,27 @@ getname(char *s) void includechars(fontdesctype *f, char *s) { - int b, c, d ; - int l = strlen(s) ; + int b, c, d; + int l = strlen(s); while (l > 0 && (s[l-1] == '\n' || s[l-1] == '\r')) - s[--l] = 0 ; + s[--l] = 0; if (!ISXDIGIT(s[0]) || !ISXDIGIT(s[1]) || s[2]!=':' || strspn(s+3,"0123456789ABCDEFabcdef") < l-3) { - fprintf(stderr, "%s\n", s) ; - error("Bad syntax in included font usage table") ; - return ; + fprintf(stderr, "%s\n", s); + error("Bad syntax in included font usage table"); + return; } - c = (xdig[(int)(s[0])] << 4) + xdig[(int)(s[1])] ; - s += 2 ; + c = (xdig[(int)(s[0])] << 4) + xdig[(int)(s[1])]; + s += 2; while (*++s) { - d = xdig[(int)*s] ; + d = xdig[(int)*s]; for (b=8; b!=0; b>>=1) { if ((d&b)!=0) { - pagecost ++ ; - (void) prescanchar(&f->chardesc[c]) ; + pagecost ++; + (void) prescanchar(&f->chardesc[c]); } - if (++c==256) return ; + if (++c==256) return; } } } @@ -158,13 +158,13 @@ scan1fontcomment(char *p) DVIperBP = actualdpi/(72.0*conv) * (mag/1000.0); p = strtok(p, " "); if (p==NULL) return; - area = nextstring ; /* tentatively in the string pool */ + area = nextstring; /* tentatively in the string pool */ name = getname(p); q = strtok((char *)0, " "); if (p==NULL || (scsize=(integer)(atof(q)*DVIperBP))==0) { fprintf(stderr, "%s\n",p); error("No scaled size for included font"); - nextstring = area ; /* remove from string pool */ + nextstring = area; /* remove from string pool */ return; } scname = q; @@ -172,7 +172,7 @@ scan1fontcomment(char *p) if (p==NULL || (dssize=(integer)(atof(q)*DVIperBP))==0) { fprintf(stderr, "%s\n",p); error("No design size for included font"); - nextstring = area ; + nextstring = area; return; } q = strtok((char *)0, " "); @@ -262,31 +262,31 @@ scan_fontnames(char *str, const char *psfile) if(re != NULL) { if (re->sent != 2) { if (re->Fontfile) { - add_header(re->Fontfile) ; + add_header(re->Fontfile); } else if (re->downloadheader) { /* this code borrowed from residentfont() in resident.c */ - char *cp = re->downloadheader ; - char *q ; + char *cp = re->downloadheader; + char *q; - infont = re->PSname ; + infont = re->PSname; while (1) { - q = cp ; + q = cp; while (*cp && *cp != ' ') - cp++ ; + cp++; if (*cp) { - *cp = 0 ; - add_header(q) ; - *cp++ = ' ' ; + *cp = 0; + add_header(q); + *cp++ = ' '; } else { - add_header(q) ; - break ; + add_header(q); + break; } - infont = 0 ; + infont = 0; } } - infont = 0 ; + infont = 0; } - re->sent = 2 ; + re->sent = 2; if (unused_top_of_psnames < DOWNLOADEDPSSIZE) { downloadedpsnames[unused_top_of_psnames] = xstrdup (re->PSname); unused_top_of_psnames++; @@ -324,9 +324,9 @@ void scanfontusage(char *p, const char *psfile) { if (strncmp(p, "%%DocumentFonts: ",17) == 0) { - p += 17 ; + p += 17; while (*p && *p <= ' ') - p++ ; + p++; if(!strncmp(p,"(atend)",7)) { check_atend = 1; } else { @@ -334,9 +334,9 @@ scanfontusage(char *p, const char *psfile) fc_state = 1; } } else if (strncmp(p, "%%DocumentNeededFonts: ",23)==0) { - p += 23 ; + p += 23; while (*p && *p <= ' ') - p++ ; + p++; if(!strncmp(p,"(atend)",7)) { check_atend = 1; } else { @@ -347,9 +347,9 @@ scanfontusage(char *p, const char *psfile) scan_fontnames(p+3,psfile); fc_state = 1; } else if (strncmp(p, "%%DocumentNeededResources: ",27) == 0) { - p += 27 ; + p += 27; while (*p && *p <= ' ') - p++ ; + p++; if(!strncmp(p,"(atend)",7)) { check_atend = 1; } else { @@ -357,9 +357,9 @@ scanfontusage(char *p, const char *psfile) fc_state = 2; } } else if (fc_state == 2 && strncmp(p,"%%+",3) == 0) { - p += 3 ; + p += 3; while (*p && *p <= ' ') - p++ ; + p++; if(!strncmp(p,"font ",5)) scan_fontnames(p+5,psfile); fc_state = 2; } else { @@ -378,8 +378,8 @@ scanfontcomments(const char *filename) char p[500]; char *r; FILE *f; - integer truecost = pagecost ; - Boolean trueknown = 0 ; + integer truecost = pagecost; + Boolean trueknown = 0; fontdesctype *oldcf = curfnt; #ifdef DEBUG @@ -392,13 +392,13 @@ scanfontcomments(const char *filename) /* * Allow scanning of ` commands. Better return same results both times. */ - f = popen(filename+1, "r") ; - to_close = USE_PCLOSE ; + f = popen(filename+1, "r"); + to_close = USE_PCLOSE; } else { - f = search(figpath, filename, READ) ; + f = search(figpath, filename, READ); } if (f) { - (void)SET_BINARY(fileno(f)) ; + (void)SET_BINARY(fileno(f)); fc_state = 0; check_atend = 0; while (fgets(p,500,f) && p[0]=='%' && @@ -406,13 +406,13 @@ scanfontcomments(const char *filename) if (strncmp(p, "%*Font:", 7) == 0) { scan1fontcomment(p+7); } else if (strncmp(p, "%%VMusage:", 9) == 0) { - truecost += scanvm(p+10) ; - trueknown = 1 ; + truecost += scanvm(p+10); + trueknown = 1; } scanfontusage(p,filename); } if (trueknown) - pagecost = truecost ; + pagecost = truecost; if(check_atend) { #ifdef DEBUG @@ -427,7 +427,7 @@ scanfontcomments(const char *filename) fgets(p,500,f); /* throw away a partial line. */ /* find %%Trailer */ - while((r=fgets(p,500,f)) && strncmp(p,"%%Trailer",9)) ; + while((r=fgets(p,500,f)) && strncmp(p,"%%Trailer",9)); /* look for specs that were deferred to the trailer. */ if(r != NULL) { @@ -444,7 +444,7 @@ scanfontcomments(const char *filename) } #endif /* DEBUG */ } - close_file(f) ; + close_file(f); } curfnt = oldcf; } @@ -455,13 +455,13 @@ scanfontcomments(const char *filename) Boolean okascmd(char *ss) { - register int c = 0 ; - register char *s = ss ; + register int c = 0; + register char *s = ss; while (*s) if (*s<' ' || *s>126 || ++c==30) - return(0) ; - return(strcspn(ss,"()<>[]{}%/") == c) ; + return(0); + return(strcspn(ss,"()<>[]{}%/") == c); } /* * Output font area and font name strings as a literal string @@ -469,19 +469,19 @@ okascmd(char *ss) void nameout(char *area, char *name) { - char buf[30] ; - char *s ; + char buf[30]; + char *s; if (*area==0 && okascmd(name)) { - (void)sprintf(buf, "/%s", name) ; + (void)sprintf(buf, "/%s", name); cmdout(name); } else { for (s=area; *s; s++) - scout(*s) ; + scout(*s); for (s=name; *s; s++) - scout(*s) ; + scout(*s); stringend(); - cmdout("cvn") ; + cmdout("cvn"); } } /* diff --git a/Build/source/texk/dvipsk/flib.c b/Build/source/texk/dvipsk/flib.c index 0766f849a92..471cef01f4e 100644 --- a/Build/source/texk/dvipsk/flib.c +++ b/Build/source/texk/dvipsk/flib.c @@ -47,10 +47,10 @@ Boolean flib = 0; /* non zero if reading a font library */ halfword pkdouble(void) { - register halfword i ; - i = pkbyte() ; - i = i * 256 + pkbyte() ; - return(i) ; + register halfword i; + i = pkbyte(); + i = i * 256 + pkbyte(); + return(i); } /* * fliload opens each font library, then reads in its @@ -60,15 +60,15 @@ pkdouble(void) void fliload(void) { - int i ; + int i; halfword version1, version2; Boolean needext; char fontname[50]; - char name[50] ; + char name[50]; char *fli; unsigned long dpi; halfword len, numsizes, numfonts; - halfword numflib = 0 ; + halfword numflib = 0; struct fli_lib *lib=NULL, *next_lib=NULL; struct fli_size *size; struct fli_entry *entry; @@ -136,7 +136,7 @@ fliload(void) lib->size = size; lib->next = (struct fli_lib *)NULL; - for ( ;numsizes>0; numsizes--, size++) { + for (;numsizes>0; numsizes--, size++) { /* for each font size in this library */ (void)pkdouble(); /* length of size entry - ignore */ numfonts = pkdouble(); /* number of fonts */ @@ -147,10 +147,10 @@ fliload(void) (void)fprintf(stderr,"Font library %s size %.5gdpi has %d font%s\n", name, dpi/65536.0, numfonts, numfonts!=1 ? "s" : ""); #endif /* DEBUG */ - size->size = dpi ; - size->entries = numfonts ; - size->entry = entry ; - for ( ;numfonts > 0; numfonts--, entry++) { + size->size = dpi; + size->entries = numfonts; + size->entry = entry; + for (;numfonts > 0; numfonts--, entry++) { /* read each entry */ (void)pkquad(); /* ignore length of font */ entry->offset = pkquad(); /* offset to font */ @@ -204,23 +204,23 @@ flisearch(char *n, halfword dpi) #endif /* DEBUG */ for (lib = firstlib; lib != (struct fli_lib *)NULL; lib = lib->next ) { /* for each font library */ - numsizes = lib->sizes ; - size = lib->size ; + numsizes = lib->sizes; + size = lib->size; #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr," Searching %s\n", lib->name); #endif /* DEBUG */ for (; numsizes>0; numsizes--, size++) { /* for each font size in this library */ - dpi1 = (halfword)((size->size+32768L)/65536) ; + dpi1 = (halfword)((size->size+32768L)/65536); if ( dpi1 == dpi ) { /* if correct size then search for font */ #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr, " Checking size %ddpi\n",dpi1); #endif /* DEBUG */ - entry = size->entry ; - for (numfonts=size->entries ;numfonts > 0; numfonts--, entry++) { + entry = size->entry; + for (numfonts=size->entries;numfonts > 0; numfonts--, entry++) { if (strcmp(entry->name,n)==0) { /* if correct font name then look for it in cache */ found = 0; @@ -251,9 +251,9 @@ flisearch(char *n, halfword dpi) fli_cache[0]->lib = lib; fli_cache[0]->fp = pkfile; } - flib = 1 ; /* tell loadfont() not to close it */ + flib = 1; /* tell loadfont() not to close it */ /* then seek font within library */ - (void)sprintf(name,"%s %s %ddpi",lib->name, n, dpi1) ; + (void)sprintf(name,"%s %s %ddpi",lib->name, n, dpi1); if ( fseek(pkfile,entry->offset,0) ) badpk("couldn't seek font"); /* make sure it is a PK font */ @@ -288,43 +288,43 @@ flisearch(char *n, halfword dpi) char * fliparse(char *path, char *name) { - char *p, *prevp ; /* pointers to path */ - char *n, *prevn ; /* pointers to name */ - char *s ; + char *p, *prevp; /* pointers to path */ + char *n, *prevn; /* pointers to name */ + char *s; - p = path ; - n = name ; - s = path ; + p = path; + n = name; + s = path; while (*s) { - prevp = p ; - prevn = n ; + prevp = p; + prevn = n; while (*s && *s != PATHSEP) { /* copy till PATHSEP */ *p++ = *s; *n++ = *s; s++; } - *n = '\0' ; + *n = '\0'; if (*s) s++; /* skip PATHSEP */ if ( *prevn=='\0' || prevn[strlen(prevn)-1] == DIRSEP ) { - n = prevn ; /* ignore name if it is dir */ + n = prevn; /* ignore name if it is dir */ if (*prevn) p--; /* backup over DIRSEP */ *p++ = PATHSEP; - prevp = p ; + prevp = p; } else { - p = prevp ; /* ignore path if it is library name */ + p = prevp; /* ignore path if it is library name */ *n++ = PATHSEP; - prevn = n ; + prevn = n; } } - *p = '\0' ; - *n = '\0' ; + *p = '\0'; + *n = '\0'; if (n!=name && *--n==PATHSEP) *n = '\0'; /* remove trailing PATHSEP from name */ if (p!=path && *--p==PATHSEP) diff --git a/Build/source/texk/dvipsk/fontdef.c b/Build/source/texk/dvipsk/fontdef.c index b36a769c4c2..254a43112cc 100644 --- a/Build/source/texk/dvipsk/fontdef.c +++ b/Build/source/texk/dvipsk/fontdef.c @@ -21,53 +21,53 @@ fontdesctype* newfontdesc(integer cksum, integer scsize, integer dssize, char *name, char *area) { - register fontdesctype *fp ; + register fontdesctype *fp; - fp = (fontdesctype *)mymalloc((integer)sizeof(fontdesctype)) ; - fp->chardesc = (chardesctype *)mymalloc(256*(integer)sizeof(chardesctype)) ; - fp->maxchars = 256 ; - fp->psname = 0 ; - fp->loaded = 0 ; - fp->checksum = cksum ; - fp->scaledsize = scsize ; - fp->designsize = dssize ; - fp->thinspace = scsize / 6 ; - fp->scalename = NULL ; - fp->psflag = 0 ; - fp->codewidth = 1 ; + fp = (fontdesctype *)mymalloc((integer)sizeof(fontdesctype)); + fp->chardesc = (chardesctype *)mymalloc(256*(integer)sizeof(chardesctype)); + fp->maxchars = 256; + fp->psname = 0; + fp->loaded = 0; + fp->checksum = cksum; + fp->scaledsize = scsize; + fp->designsize = dssize; + fp->thinspace = scsize / 6; + fp->scalename = NULL; + fp->psflag = 0; + fp->codewidth = 1; fp->name = name; #ifdef VMCMS /* IBM: VM/CMS */ { - int i ; - for ( i=0 ; fp->name[i] ; i++ ) - fp->name[i] = ascii2ebcdic[ fp->name[i] ] ; + int i; + for ( i=0; fp->name[i]; i++ ) + fp->name[i] = ascii2ebcdic[ fp->name[i] ]; } #else #ifdef MVSXA /* IBM: MVS/XA */ { - int i ; - for ( i=0 ; fp->name[i] ; i++ ) - fp->name[i] = ascii2ebcdic[ fp->name[i] ] ; + int i; + for ( i=0; fp->name[i]; i++ ) + fp->name[i] = ascii2ebcdic[ fp->name[i] ]; } #endif /* IBM: MVS/XA */ #endif /* IBM: VM/CMS */ fp->area = area; - fp->resfont = NULL ; - fp->localfonts = NULL ; + fp->resfont = NULL; + fp->localfonts = NULL; #ifdef KPATHSEA fp->dpi = kpse_magstep_fix ((halfword)(mag*(float)fp->scaledsize*DPI/ - ((float)fp->designsize*1000.0)+0.5), DPI, NULL) ; + ((float)fp->designsize*1000.0)+0.5), DPI, NULL); #else fp->dpi = dpicheck((halfword)(mag*fp->scaledsize*DPI/ - ((float)fp->designsize*1000.0)+0.5)) ; + ((float)fp->designsize*1000.0)+0.5)); #endif - fp->loadeddpi = fp->dpi ; + fp->loadeddpi = fp->dpi; #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr,"Defining font (%s) %s at %.1fpt\n", - area, name, (real)scsize/(alpha*0x100000)) ; + area, name, (real)scsize/(alpha*0x100000)); #endif /* DEBUG */ - return fp ; + return fp; } /* * Try to find a font with a given name and approximate scaled size, returning @@ -83,22 +83,22 @@ matchfont(char *name, char *area, integer scsize, char *scname) register fontdesctype *fp; register integer smin, smax; - smin = scsize - fsizetol ; - smax = scsize + fsizetol ; + smin = scsize - fsizetol; + smax = scsize + fsizetol; for (fp=fonthead; fp; fp=fp->next) if (smin < fp->scaledsize && fp->scaledsize < smax && strcmp(name,fp->name)==0 && strcmp(area,fp->area)==0) { if (scname == NULL) { if (fp->scalename!=NULL || scsize==fp->scaledsize) - break ; + break; } else { if (fp->scalename==NULL || strcmp(scname,fp->scalename)==0) - break ; + break; } } #ifdef DEBUG if (dd(D_FONTS) && fp) - (void)fprintf(stderr,"(Already known.)\n") ; + (void)fprintf(stderr,"(Already known.)\n"); #endif /* DEBUG */ return fp; } @@ -109,52 +109,52 @@ matchfont(char *name, char *area, integer scsize, char *scname) void fontdef(int siz) { - register integer i, j, fn ; - register fontdesctype *fp ; - register fontmaptype *cfnt ; - char *name, *area ; - integer cksum, scsize, dssize ; + register integer i, j, fn; + register fontdesctype *fp; + register fontmaptype *cfnt; + char *name, *area; + integer cksum, scsize, dssize; - fn = dvibyte() ; + fn = dvibyte(); while (siz-- > 1) - fn = (fn << 8) + dvibyte() ; + fn = (fn << 8) + dvibyte(); for (cfnt=ffont; cfnt; cfnt = cfnt->next) - if (cfnt->fontnum == fn) goto alreadydefined ; - cfnt = (fontmaptype *)mymalloc((integer)sizeof(fontmaptype)) ; - cfnt->next = ffont ; - ffont = cfnt ; - cfnt->fontnum = fn ; - cksum = signedquad() ; - scsize = signedquad() ; - dssize = signedquad() ; - i = dvibyte() ; j = dvibyte() ; + if (cfnt->fontnum == fn) goto alreadydefined; + cfnt = (fontmaptype *)mymalloc((integer)sizeof(fontmaptype)); + cfnt->next = ffont; + ffont = cfnt; + cfnt->fontnum = fn; + cksum = signedquad(); + scsize = signedquad(); + dssize = signedquad(); + i = dvibyte(); j = dvibyte(); if (nextstring + i + j > maxstring) - error("! out of string space") ; - area = nextstring ; + error("! out of string space"); + area = nextstring; for (; i>0; i--) - *nextstring++ = dvibyte() ; - *nextstring++ = 0 ; - name = nextstring ; + *nextstring++ = dvibyte(); + *nextstring++ = 0; + name = nextstring; for (; j>0; j--) - *nextstring++ = dvibyte() ; - *nextstring++ = 0 ; - fp = matchfont(name, area, scsize, (char *)0) ; + *nextstring++ = dvibyte(); + *nextstring++ = 0; + fp = matchfont(name, area, scsize, (char *)0); if (fp) { - nextstring = name ; - fp->checksum = cksum ; + nextstring = name; + fp->checksum = cksum; } else { - fp = newfontdesc(cksum, scsize, dssize, name, area) ; - fp->next = fonthead ; - fonthead = fp ; + fp = newfontdesc(cksum, scsize, dssize, name, area); + fp->next = fonthead; + fonthead = fp; } - cfnt->desc = fp ; - return ; + cfnt->desc = fp; + return; alreadydefined: /* A DVI file will not define a font twice; but we may be scanning * a font definition twice because a new section has started, * or because of collated copies. */ - skipover(12) ; - skipover(dvibyte()+dvibyte()) ; + skipover(12); + skipover(dvibyte()+dvibyte()); } /* @@ -166,17 +166,17 @@ alreadydefined: int skipnop(void) { - register int cmd ; + register int cmd; while (1) { switch(cmd=dvibyte()) { -case 138: break ; -case 239: skipover((int)dvibyte()) ; break ; /* xxx1 */ -case 240: skipover((int)twobytes()) ; break ; /* xxx2 */ -case 241: skipover((int)threebytes()) ; break ; /* xxx3 */ -case 242: skipover((int)signedquad()) ; break ; /* xxx4 */ -case 243: case 244: case 245: case 246: fontdef(cmd-242) ; break ; -default: return cmd ; +case 138: break; +case 239: skipover((int)dvibyte()); break; /* xxx1 */ +case 240: skipover((int)twobytes()); break; /* xxx2 */ +case 241: skipover((int)threebytes()); break; /* xxx3 */ +case 242: skipover((int)signedquad()); break; /* xxx4 */ +case 243: case 244: case 245: case 246: fontdef(cmd-242); break; +default: return cmd; } } } diff --git a/Build/source/texk/dvipsk/header.c b/Build/source/texk/dvipsk/header.c index e915418ea7a..ee5214861b8 100644 --- a/Build/source/texk/dvipsk/header.c +++ b/Build/source/texk/dvipsk/header.c @@ -12,7 +12,7 @@ * headers down. */ #include "dvips.h" /* The copyright notice in that file is included too! */ -struct header_list *header_head ; +struct header_list *header_head; /* * The external declarations: */ @@ -31,25 +31,25 @@ add_name(const char *s, struct header_list **what) int add_name_general(const char *s, struct header_list **what, char *pre, char *post) { - struct header_list *p, *q ; + struct header_list *p, *q; - for (p = *what ; p != NULL; p = p->next) + for (p = *what; p != NULL; p = p->next) if (strcmp(p->name, s)==0) - return 0 ; + return 0; q = (struct header_list *)mymalloc((integer)(sizeof(struct header_list) - + strlen(s))) ; - q->Hname = infont ; - q->next = NULL ; - q->precode = pre ; - q->postcode = post ; - strcpy(q->name, s) ; + + strlen(s))); + q->Hname = infont; + q->next = NULL; + q->precode = pre; + q->postcode = post; + strcpy(q->name, s); if (*what == NULL) - *what = q ; + *what = q; else { - for (p = *what; p->next != NULL; p = p->next) ; - p->next = q ; + for (p = *what; p->next != NULL; p = p->next); + p->next = q; } - return 1 ; + return 1; } /* * This function checks the virtual memory usage of a header file. @@ -59,12 +59,12 @@ add_name_general(const char *s, struct header_list **what, char *pre, char *post void checkhmem(const char *s, char *pre, char *post) { - FILE *f ; + FILE *f; - f = search(headerpath, s, READBIN) ; + f = search(headerpath, s, READBIN); if (pre || post) { if (f==NULL) - f = search(figpath, s, READBIN) ; + f = search(figpath, s, READBIN); } if (f==0) { char *msg = concat ("! Couldn't find header file: ", s); @@ -73,37 +73,37 @@ checkhmem(const char *s, char *pre, char *post) msg = concat (msg, "\nAbsolute and ../relative paths are denied in -R2 mode."); } - error(msg) ; + error(msg); } else { - int len, i, j ; - long mem = -1 ; - char buf[1024] ; + int len, i, j; + long mem = -1; + char buf[1024]; - len = fread(buf, sizeof(char), 1024, f) ; + len = fread(buf, sizeof(char), 1024, f); for (i=0; i<len-20; i++) if (buf[i]=='%' && strncmp(buf+i, "%%VMusage:", 10)==0) { if (sscanf(buf+i+10, "%d %ld", &j, &mem) != 2) - mem = -1 ; - break ; + mem = -1; + break; } if (mem == -1) { - mem = 0 ; + mem = 0; while (len > 0) { - mem += len ; - len = fread(buf, sizeof(char), 1024, f) ; + mem += len; + len = fread(buf, sizeof(char), 1024, f); } } if (mem < 0) - mem = DNFONTCOST ; - (*close_file) (f) ; + mem = DNFONTCOST; + (*close_file) (f); #ifdef DEBUG if (dd(D_HEADER)) (void)fprintf(stderr, "Adding header file \"%s\" %ld\n", - s, mem) ; + s, mem); #endif - fontmem -= mem ; + fontmem -= mem; if (fontmem > 0) /* so we don't count it twice. */ - swmem -= mem ; + swmem -= mem; } } /* @@ -120,59 +120,59 @@ add_header(const char *s) int add_header_general(const char *s, char *pre, char *post) { - int r ; + int r; - r = add_name_general(s, &header_head, pre, post) ; + r = add_name_general(s, &header_head, pre, post); if (r) { if (headersready == 1) { - struct header_list *p = header_head ; + struct header_list *p = header_head; while (p) { - checkhmem(p->name, p->precode, p->postcode) ; - p = p->next ; + checkhmem(p->name, p->precode, p->postcode); + p = p->next; } - headersready = 2 ; + headersready = 2; } else if (headersready == 2) { - checkhmem(s, pre, post) ; + checkhmem(s, pre, post); } } - return r ; + return r; } /* * This routine runs down a list, returning each in order. */ -static struct header_list *CUR_head = NULL ; +static struct header_list *CUR_head = NULL; char * get_name(struct header_list **what) { if (what && *what) { - char *p = (*what)->name ; - infont = (*what)->Hname ; - CUR_head = *what ; - *what = (*what)->next ; - return p ; + char *p = (*what)->name; + infont = (*what)->Hname; + CUR_head = *what; + *what = (*what)->next; + return p; } else - return 0 ; + return 0; } /* * This routine actually sends the headers. */ void send_headers(void) { - struct header_list *p = header_head ; - char *q ; + struct header_list *p = header_head; + char *q; while (0 != (q=get_name(&p))) { #ifdef DEBUG if (dd(D_HEADER)) - (void)fprintf(stderr, "Sending header file \"%s\"\n", q) ; + (void)fprintf(stderr, "Sending header file \"%s\"\n", q); #endif #ifdef HPS if (HPS_FLAG) { - if (strcmp(q,"target.dct")==0) noprocset = 1 ; + if (strcmp(q,"target.dct")==0) noprocset = 1; } #endif - copyfile_general(q, CUR_head) ; + copyfile_general(q, CUR_head); } - infont = NULL ; + infont = NULL; } diff --git a/Build/source/texk/dvipsk/hps.c b/Build/source/texk/dvipsk/hps.c index e0652f4f0df..0303b1e720e 100644 --- a/Build/source/texk/dvipsk/hps.c +++ b/Build/source/texk/dvipsk/hps.c @@ -28,19 +28,19 @@ #endif #define NAME 0 #define HREF 1 -#define skip_space(s) for( ; *s == ' ' ; s++) ; +#define skip_space(s) for(; *s == ' '; s++); -Boolean inHTMLregion = 0 ; -Boolean NO_ERROR = 1 ; -Boolean HPS_ERROR = 0 ; -integer HREF_COUNT ; -Boolean ISHREF = 0 ; -Boolean POPPED = 0 ; -Boolean PUSHED = 0 ; +Boolean inHTMLregion = 0; +Boolean NO_ERROR = 1; +Boolean HPS_ERROR = 0; +integer HREF_COUNT; +Boolean ISHREF = 0; +Boolean POPPED = 0; +Boolean PUSHED = 0; -char *current_name ; -int current_type ; -int current_pushcount ; +char *current_name; +int current_type; +int current_pushcount; #define GoTo 0 @@ -48,48 +48,48 @@ int current_pushcount ; #define Launch 2 typedef struct rectangle { - double llx ; /* lower left x coor */ - double lly ; /* lower left y coor */ - double urx ; /* upper right x coor */ - double ury ; /* upper right y coor */ - } dvipsRectangle ; + double llx; /* lower left x coor */ + double lly; /* lower left y coor */ + double urx; /* upper right x coor */ + double ury; /* upper right y coor */ + } dvipsRectangle; typedef struct hps_link { - int action ; /* GoTo, GoToR, or Launch */ - char *file ; /* PDF-style system-independent filename - unused now */ - dvipsRectangle rect ; /* rectangle for location of link */ - int border[5] ; /* Border info --- with dashes*/ - int srcpg ; /* Page of location */ - int page ; /* Page of destination --- left out is same as srcpg */ - int vert_dest ; /* Vertical position of destination on page */ - double color[3] ; /* color: length of array gives colorspace (3 <=> RGB)*/ - char *title ; /* Title of link */ - } Hps_link ; + int action; /* GoTo, GoToR, or Launch */ + char *file; /* PDF-style system-independent filename - unused now */ + dvipsRectangle rect; /* rectangle for location of link */ + int border[5]; /* Border info --- with dashes*/ + int srcpg; /* Page of location */ + int page; /* Page of destination --- left out is same as srcpg */ + int vert_dest; /* Vertical position of destination on page */ + double color[3]; /* color: length of array gives colorspace (3 <=> RGB)*/ + char *title; /* Title of link */ + } Hps_link; struct nlist { /* hashtable entry */ - struct nlist *next ; /* next entry in chain */ - char *name ; /* defined name */ - Hps_link *defn ; /* Link associated with name */ - } ; + struct nlist *next; /* next entry in chain */ + char *name; /* defined name */ + Hps_link *defn; /* Link associated with name */ + }; typedef struct rect_list { /* linked list of rectangles */ - struct rect_list *next ; /* next rectangle in the chain */ - dvipsRectangle rect ; - } Rect_list ; + struct rect_list *next; /* next rectangle in the chain */ + dvipsRectangle rect; + } Rect_list; -Rect_list *current_rect_list ; +Rect_list *current_rect_list; #define HASHSIZE 1223 -static struct nlist *link_targets[HASHSIZE] ; /* names .... */ -static struct nlist *link_sources[HASHSIZE] ; /* hrefs .... */ +static struct nlist *link_targets[HASHSIZE]; /* names .... */ +static struct nlist *link_sources[HASHSIZE]; /* hrefs .... */ #ifdef KPATHSEA #define dup_str xstrdup #else -char *dup_str() ; /* duplicate a string */ +char *dup_str(); /* duplicate a string */ #endif -Boolean noprocset ; /* Leave out BeginProc and EndProc comments */ +Boolean noprocset; /* Leave out BeginProc and EndProc comments */ /* This was hardcoded to letter size. The denominator converts scaled points to big points (65536*72.27/72). */ #undef PAGESIZE /* HP-UX 10 defines for itself. */ @@ -101,64 +101,64 @@ Boolean noprocset ; /* Leave out BeginProc and EndProc comments */ /* For later use * static char *dest_key[9] = {"Fit", "FitB", "FitW", "FitH", "FitBH" - "FitR", "FitV", "FitBV", "XYZ"} ; + "FitR", "FitV", "FitBV", "XYZ"}; */ -char *hs = NULL ; /* html string to be handled */ -char *url_name = NULL ; /* url between double quotes */ +char *hs = NULL; /* html string to be handled */ +char *url_name = NULL; /* url between double quotes */ /* parse anchor into link */ void do_html(char *s) { - Hps_link *nl ; - url_name = (char *)malloc(strlen(s)+1) ; - hs = s ; - HREF_COUNT = 0 ; - skip_space(hs) ; /* skip spaces */ + Hps_link *nl; + url_name = (char *)malloc(strlen(s)+1); + hs = s; + HREF_COUNT = 0; + skip_space(hs); /* skip spaces */ if ( TOLOWER(*hs) == 'a') { /* valid start */ - POPPED = FALSE ; + POPPED = FALSE; if (inHTMLregion) { error("previous html not closed with /A"); return; } else { - inHTMLregion = TRUE ; - current_rect_list = NULL ; + inHTMLregion = TRUE; + current_rect_list = NULL; } - hs++ ; - skip_space(hs) ; + hs++; + skip_space(hs); while(*hs != '\0') { /* parse for names and href */ if (!href_or_name()) { - error("Bad HMTL:") ; - error(s) ; - error("!") ; - break ; + error("Bad HMTL:"); + error(s); + error("!"); + break; } - skip_space(hs) ; + skip_space(hs); } } else if ( (*hs == '/') && (TOLOWER(hs[1]) == 'a') ) { if (!inHTMLregion) { - error("In html, /A found without previous A") ; + error("In html, /A found without previous A"); return; } else { - inHTMLregion = FALSE ; + inHTMLregion = FALSE; } if (current_type == HREF && current_name[0] != '#') { if ((nl = lookup_link(current_name, current_type)->defn)) { - nl->rect.urx = dvi_to_hps_conv(hh, HORIZONTAL) ; - nl->rect.ury = dvi_to_hps_conv(vv, VERTICAL)-FUDGE+12.0 ; + nl->rect.urx = dvi_to_hps_conv(hh, HORIZONTAL); + nl->rect.ury = dvi_to_hps_conv(vv, VERTICAL)-FUDGE+12.0; stamp_external(current_name,nl); /* Broken lines ? */ } else { error("!Null lookup"); } } else { if ((nl = lookup_link(current_name, current_type)->defn)) { - nl->rect.urx = dvi_to_hps_conv(hh, HORIZONTAL) ; - nl->rect.ury = dvi_to_hps_conv(vv, VERTICAL)-FUDGE+12.0 ; + nl->rect.urx = dvi_to_hps_conv(hh, HORIZONTAL); + nl->rect.ury = dvi_to_hps_conv(vv, VERTICAL)-FUDGE+12.0; if (current_type) { - stamp_hps(nl) ; /* Put link info right where special is */ - print_rect_list() ; /* print out rectangles */ + stamp_hps(nl); /* Put link info right where special is */ + print_rect_list(); /* print out rectangles */ } } else { error("!Null lookup"); @@ -166,71 +166,71 @@ do_html(char *s) } } else { - error( "No A in html special") ; - error(s) ; - /*error("!") ;*/ + error( "No A in html special"); + error(s); + /*error("!");*/ } - return ; + return; } int href_or_name(void) { if ((strncmp(hs, "href", 4) == 0) || (strncmp(hs, "HREF", 4) == 0)) { - ISHREF = TRUE ; + ISHREF = TRUE; } else if ((strncmp(hs, "name", 4) == 0) || (strncmp(hs, "NAME", 4) == 0)) { - ISHREF = FALSE ; + ISHREF = FALSE; } else { - error("Not valid href or name html reference") ; - return(HPS_ERROR) ; + error("Not valid href or name html reference"); + return(HPS_ERROR); } - if(!parseref()) return(HPS_ERROR) ; + if(!parseref()) return(HPS_ERROR); if (url_name) { if( ISHREF ) { - do_link(url_name, HREF) ; - } else do_link(url_name, NAME) ; + do_link(url_name, HREF); + } else do_link(url_name, NAME); } else { - error("No string in qoutes ") ; - return(HPS_ERROR) ; + error("No string in qoutes "); + return(HPS_ERROR); } - return(NO_ERROR) ; + return(NO_ERROR); } int parseref(void) { - int i = 0 ; - for(i=0 ; i++ < 4 ; hs++) ; /* skip href or name in html string */ - skip_space(hs) ; + int i = 0; + for(i=0; i++ < 4; hs++); /* skip href or name in html string */ + skip_space(hs); if (*hs == '=' ) { - hs++ ; + hs++; } else { - error("No equal sign") ; - return(HPS_ERROR) ; + error("No equal sign"); + return(HPS_ERROR); } - if(!get_string()) return(HPS_ERROR) ; - return(NO_ERROR) ; /* extract stuff between double quotes */ + if(!get_string()) return(HPS_ERROR); + return(NO_ERROR); /* extract stuff between double quotes */ } int get_string(void) { - char *v = url_name ; + char *v = url_name; - skip_space(hs) ; - /* hash_name() ; */ + skip_space(hs); + /* hash_name(); */ if (*hs == '"') { - for(hs++ ; *hs != '"' && *hs != '\0' ; *v++ = *hs++) ; /* need to esc " */ + for(hs++; *hs != '"' && *hs != '\0'; *v++ = *hs++); /* need to esc " */ if(*hs == '"') { - hs++ ; - *v++ = '\0' ; - return(NO_ERROR) ; + hs++; + *v++ = '\0'; + return(NO_ERROR); } else { - error("Improper href. Missing closing double quote") ; - return(HPS_ERROR) ; + error("Improper href. Missing closing double quote"); + return(HPS_ERROR); } } else { - error("Improper href. Missing opening double quote") ; - return(HPS_ERROR) ; + error("Improper href. Missing opening double quote"); + return(HPS_ERROR); } } @@ -238,47 +238,47 @@ int do_link(char *s, int type) { - Hps_link *p ; + Hps_link *p; if (HREF_COUNT++ > 0) { - error("!HTML string contains more than one href") ; - return(HPS_ERROR) ; + error("!HTML string contains more than one href"); + return(HPS_ERROR); } - p = (Hps_link *)malloc(sizeof(*p)) ; - p->action = GoTo ; - p->title = (char *)malloc(strlen(s)+1) ; - p->title = s ; - p->srcpg = pagecounter ; - p->rect.llx = dvi_to_hps_conv(hh, HORIZONTAL) ; - p->rect.lly = dvi_to_hps_conv(vv, VERTICAL)-FUDGE ; - p->rect.urx = -1.0 ; - p->rect.ury = -1.0 ; - p->vert_dest = -1 ; - p->page = -1 ; - p->color[0] = 0 ; - p->color[1] = 0 ; /* Blue links */ - p->color[2] = 1 ; - p->border[0] = 1 ; /* horizontal corner radius */ - p->border[1] = 1 ; /* vertical corner radius */ - p->border[2] = 1 ; /* box line width */ - p->border[3] = 3 ; /* dash on size */ - p->border[4] = 3 ; /* dash off size */ - - current_name = (char *)malloc(strlen(s)+1) ; - current_name = s ; - current_type = type ; - current_pushcount = pushcount ; - install_link(s, p, type) ; - return(NO_ERROR) ; + p = (Hps_link *)malloc(sizeof(*p)); + p->action = GoTo; + p->title = (char *)malloc(strlen(s)+1); + p->title = s; + p->srcpg = pagecounter; + p->rect.llx = dvi_to_hps_conv(hh, HORIZONTAL); + p->rect.lly = dvi_to_hps_conv(vv, VERTICAL)-FUDGE; + p->rect.urx = -1.0; + p->rect.ury = -1.0; + p->vert_dest = -1; + p->page = -1; + p->color[0] = 0; + p->color[1] = 0; /* Blue links */ + p->color[2] = 1; + p->border[0] = 1; /* horizontal corner radius */ + p->border[1] = 1; /* vertical corner radius */ + p->border[2] = 1; /* box line width */ + p->border[3] = 3; /* dash on size */ + p->border[4] = 3; /* dash off size */ + + current_name = (char *)malloc(strlen(s)+1); + current_name = s; + current_type = type; + current_pushcount = pushcount; + install_link(s, p, type); + return(NO_ERROR); } unsigned int hash_string(char *s) { - unsigned hashval ; - for (hashval = 0 ; *s != '\0' ; s++) - hashval = *s + 31 * hashval ; - return hashval % HASHSIZE ; + unsigned hashval; + for (hashval = 0; *s != '\0'; s++) + hashval = *s + 31 * hashval; + return hashval % HASHSIZE; } /* lookup a hashed name */ @@ -286,75 +286,75 @@ hash_string(char *s) struct nlist * lookup_link(char *s, int type) { - struct nlist *np ; + struct nlist *np; - for(np = type ? link_sources[hash_string(s)] : link_targets[hash_string(s)] ; - np != NULL ; np = np -> next) + for(np = type ? link_sources[hash_string(s)] : link_targets[hash_string(s)]; + np != NULL; np = np -> next) if (strcmp(s, np->name) == 0) - return np ; /* found */ - return NULL ; /* not found */ + return np; /* found */ + return NULL; /* not found */ } struct nlist * install_link(char *name, Hps_link *defn, int type) { - struct nlist *np ; - unsigned hashval ; - np = (struct nlist *)malloc(sizeof(*np)) ; + struct nlist *np; + unsigned hashval; + np = (struct nlist *)malloc(sizeof(*np)); if (np == NULL || (np->name = dup_str(name)) == NULL) - return NULL ; - hashval = hash_string(name) ; - np->next = type ? link_sources[hashval] : link_targets[hashval] ; - (type ? link_sources : link_targets)[hashval] = np ; + return NULL; + hashval = hash_string(name); + np->next = type ? link_sources[hashval] : link_targets[hashval]; + (type ? link_sources : link_targets)[hashval] = np; if ((np->defn = link_dup(defn)) == NULL) - return NULL ; - return np ; + return NULL; + return np; } #ifndef KPATHSEA char * dup_str(char *w) /* make a duplicate of s */ { - char *p ; - p = (char *)malloc(strlen(w)+1) ; + char *p; + p = (char *)malloc(strlen(w)+1); if (p != NULL) - strcpy(p,w) ; - return p ; + strcpy(p,w); + return p; } #endif Hps_link * link_dup(Hps_link *s) /* make a duplicate link */ { - Hps_link *p ; + Hps_link *p; - p = (Hps_link *) malloc(sizeof(*p)) ; + p = (Hps_link *) malloc(sizeof(*p)); if (p != NULL) - p = s ; - return p ; + p = s; + return p; } double dvi_to_hps_conv(int i, int dir) { - double hps_coor ; + double hps_coor; /* Convert dvi integers into proper hps coordinates Take into account magnification and resolution that dvi file was produced at */ - hps_coor = dir ? (((i * 72.0) / vactualdpi) +MARGIN) : (PAGESIZE - ((i * 72.0) / (vactualdpi)) - MARGIN ) ; - return(hps_coor) ; + hps_coor = dir ? (((i * 72.0) / vactualdpi) +MARGIN) : (PAGESIZE - ((i * 72.0) / (vactualdpi)) - MARGIN ); + return(hps_coor); } int vert_loc(int i) { - int return_value ; - return_value = (int) (i + (PAGESIZE / 4) + FUDGE) ; + int return_value; + return_value = (int) (i + (PAGESIZE / 4) + FUDGE); if ( return_value > PAGESIZE) { - return((int)PAGESIZE) ; + return((int)PAGESIZE); } else if (return_value < (PAGESIZE / 4.0)) { - return((PAGESIZE / 4)) ; - } else return(return_value) ; + return((PAGESIZE / 4)); + } else return(return_value); } Hps_link * @@ -364,45 +364,45 @@ dest_link(char *s) Should be true for all legitimate papers. Also, assume prepending of # for names. */ - struct nlist *np ; + struct nlist *np; - s++ ; /* get rid of hashmark */ - for(np = link_targets[hash_string(s)] ; np != NULL ; np = np -> next) { + s++; /* get rid of hashmark */ + for(np = link_targets[hash_string(s)]; np != NULL; np = np -> next) { if ( href_name_match(s, np->name)) { - return (np->defn) ; /* found */ + return (np->defn); /* found */ } } - error("Oh no, link not found in target hashtable") ; - error(s) ; - error("!") ; - return NULL ; /* not found */ + error("Oh no, link not found in target hashtable"); + error(s); + error("!"); + return NULL; /* not found */ } int count_targets(void) { - int count=0 ; - int i ; - struct nlist *np ; + int count=0; + int i; + struct nlist *np; - for (i = 0 ; i < HASHSIZE ; i++) - for(np = link_targets[i] ; np != NULL ; np = np -> next) - count++ ; - return count ; + for (i = 0; i < HASHSIZE; i++) + for(np = link_targets[i]; np != NULL; np = np -> next) + count++; + return count; } void do_targets(void) { - struct nlist *np ; - int i ; - Hps_link *dest ; + struct nlist *np; + int i; + Hps_link *dest; - for (i = 0 ; i < HASHSIZE ; i++) - for(np = link_sources[i] ; np != NULL ; np = np -> next) { + for (i = 0; i < HASHSIZE; i++) + for(np = link_sources[i]; np != NULL; np = np -> next) { if (np->name[0] == '#') { - dest = dest_link(np->name) ; - np->defn->page = dest->srcpg ; - np->defn->vert_dest = vert_loc((int) dest->rect.lly) ; + dest = dest_link(np->name); + np->defn->page = dest->srcpg; + np->defn->vert_dest = vert_loc((int) dest->rect.lly); } } } @@ -410,37 +410,37 @@ do_targets(void) { void do_target_dict(void) { - struct nlist *np ; - int i ; - (void) fprintf(bitfile, "HPSdict begin\n") ; - (void)fprintf(bitfile, "/TargetAnchors\n") ; - (void)fprintf(bitfile, "%i dict dup begin\n",count_targets()) ; + struct nlist *np; + int i; + (void) fprintf(bitfile, "HPSdict begin\n"); + (void)fprintf(bitfile, "/TargetAnchors\n"); + (void)fprintf(bitfile, "%i dict dup begin\n",count_targets()); - for (i = 0 ; i < HASHSIZE ; i++) - for(np = link_targets[i] ; np != NULL ; np = np -> next) + for (i = 0; i < HASHSIZE; i++) + for(np = link_targets[i]; np != NULL; np = np -> next) (void)fprintf(bitfile, "(%s) [%i [%.0f %.0f %.0f %.0f] %i] def\n", np->defn->title, np->defn->srcpg, np->defn->rect.llx, np->defn->rect.lly, np->defn->rect.urx, np->defn->rect.ury, - vert_loc((int) np->defn->rect.lly)) ; - (void)fprintf(bitfile,"end targetdump-hook def end\n") ; + vert_loc((int) np->defn->rect.lly)); + (void)fprintf(bitfile,"end targetdump-hook def end\n"); } int href_name_match(char *h, char *n) { - int count = 0 ; - int name_length = strlen(n) ; + int count = 0; + int name_length = strlen(n); while((*h == *n) & (*h != '\0') ) { - count++ ; - h++ ; - n++ ; + count++; + h++; + n++; } if (name_length == count) { - return 1 ; + return 1; } else { - /* printf(" count: %i \n", count) ; */ - return 0 ; + /* printf(" count: %i \n", count); */ + return 0; } } @@ -449,12 +449,12 @@ stamp_hps(Hps_link *pl) { char * tmpbuf; if (pl == NULL) { - error("stamp_hps: null pl pointer, oh no!") ; - return ; + error("stamp_hps: null pl pointer, oh no!"); + return; } if(pl->title == NULL) { - error("stamp_hps: null pl->title pointer, oh no!") ; - return ; + error("stamp_hps: null pl->title pointer, oh no!"); + return; } tmpbuf = (char *) xmalloc(strlen(pl->title)+200); @@ -465,8 +465,8 @@ stamp_hps(Hps_link *pl) " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ", pl->title, pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury, pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4], - pl->color[0], pl->color[1], pl->color[2]) ; - cmdout(tmpbuf) ; + pl->color[0], pl->color[1], pl->color[2]); + cmdout(tmpbuf); free(tmpbuf); @@ -480,13 +480,13 @@ stamp_external(char *s, Hps_link *pl) { char *tmpbuf; if (pl == NULL) { - error("stamp_external: null pl pointer, oh no!") ; - return ; + error("stamp_external: null pl pointer, oh no!"); + return; } if (s == NULL) { - error("stamp_external: null s pointer, oh no!") ; - return ; + error("stamp_external: null s pointer, oh no!"); + return; } tmpbuf = (char *) xmalloc(strlen(s) + 200); @@ -496,25 +496,25 @@ stamp_external(char *s, Hps_link *pl) (void)sprintf(tmpbuf," [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] (%s) pdfm ", pl->rect.llx, pl->rect.lly, pl->rect.urx, pl->rect.ury, pl->border[0], pl->border[1], pl->border[2], pl->border[3],pl->border[4], - pl->color[0], pl->color[1], pl->color[2], s) ; - cmdout(tmpbuf) ; + pl->color[0], pl->color[1], pl->color[2], s); + cmdout(tmpbuf); free(tmpbuf); } void finish_hps(void) { - fclose(bitfile) ; + fclose(bitfile); set_bitfile("head.tmp",1); - do_targets() ; + do_targets(); do_target_dict(); - (void)fprintf(bitfile, "TeXDict begin\n") ; - (void)fprintf(bitfile, "%%%%EndSetup\n") ; - fclose(bitfile) ; - open_output() ; - noprocset = 1 ; + (void)fprintf(bitfile, "TeXDict begin\n"); + (void)fprintf(bitfile, "%%%%EndSetup\n"); + fclose(bitfile); + open_output(); + noprocset = 1; removecomments = 0; - copyfile("head.tmp") ; - copyfile("body.tmp") ; + copyfile("head.tmp"); + copyfile("body.tmp"); if (dvips_debug_flag == 0 && debug_flag == 0) { unlink("head.tmp"); unlink("body.tmp"); @@ -525,80 +525,80 @@ void set_bitfile(const char *s, int mode) { if ((bitfile=fopen(s, mode ? FOPEN_ABIN_MODE : FOPEN_WBIN_MODE))==NULL) { - error(s) ; - error("!couldn't open file") ; + error(s); + error("!couldn't open file"); } - linepos = 0 ; + linepos = 0; } void vertical_in_hps(void) { - Rect_list *rl ; - /*printf("in vertical_in_hps") ; */ + Rect_list *rl; + /*printf("in vertical_in_hps"); */ if (current_type == NAME) return; /* Handle this case later */ if (!current_rect_list) { - current_rect_list = (Rect_list *)malloc(sizeof(Rect_list)) ; - current_rect_list->next = NULL ; + current_rect_list = (Rect_list *)malloc(sizeof(Rect_list)); + current_rect_list->next = NULL; } else { - rl = (Rect_list *)malloc(sizeof(Rect_list)) ; - rl->next = current_rect_list ; - current_rect_list = rl ; + rl = (Rect_list *)malloc(sizeof(Rect_list)); + rl->next = current_rect_list; + current_rect_list = rl; } - current_rect_list->rect.llx = dvi_to_hps_conv(hh, HORIZONTAL) ; - current_rect_list->rect.lly = dvi_to_hps_conv(vv, VERTICAL)-FUDGE ; - current_rect_list->rect.urx = dvi_to_hps_conv(hhmem, HORIZONTAL) ; - current_rect_list->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE ; + current_rect_list->rect.llx = dvi_to_hps_conv(hh, HORIZONTAL); + current_rect_list->rect.lly = dvi_to_hps_conv(vv, VERTICAL)-FUDGE; + current_rect_list->rect.urx = dvi_to_hps_conv(hhmem, HORIZONTAL); + current_rect_list->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE; - if (POPPED) start_new_box() ; + if (POPPED) start_new_box(); } void print_rect_list(void) { - Rect_list *rl, *rln ; + Rect_list *rl, *rln; - for(rl = current_rect_list ; rl != NULL ; rl = rln) { + for(rl = current_rect_list; rl != NULL; rl = rln) { /* printf("Rectangle is %.0f, %.0f, %.0f, %.0f\n", rl->rect.llx, rl->rect.lly, - rl->rect.urx, rl->rect.ury) ; */ - rln = rl -> next ; - free(rl) ; + rl->rect.urx, rl->rect.ury); */ + rln = rl -> next; + free(rl); } } void end_current_box(void) { - Hps_link *nl ; + Hps_link *nl; - POPPED = TRUE ; - HREF_COUNT-- ; + POPPED = TRUE; + HREF_COUNT--; if (current_type == HREF && current_name[0] != '#') { if ((nl = lookup_link(current_name, current_type)->defn)) { - nl->rect.urx = dvi_to_hps_conv(hhmem, HORIZONTAL) ; - nl->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE+12.0 ; + nl->rect.urx = dvi_to_hps_conv(hhmem, HORIZONTAL); + nl->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE+12.0; stamp_external(current_name,nl); /* Broken lines ? */ } else { error("!Null lookup"); } } else { if ((nl = lookup_link(current_name, current_type)->defn)) { - nl->rect.urx = dvi_to_hps_conv(hhmem, HORIZONTAL) ; - nl->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE+12.0 ; + nl->rect.urx = dvi_to_hps_conv(hhmem, HORIZONTAL); + nl->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE+12.0; if (current_type) { - stamp_hps(nl) ; /* Put link info right where special is */ + stamp_hps(nl); /* Put link info right where special is */ } } else { error("!Null lookup"); } /* printf("Ended box %.0f, %.0f, %.0f, %.0f\n", nl->rect.llx, \ - nl->rect.lly,nl->rect.urx, nl->rect.ury) ; */ + nl->rect.lly,nl->rect.urx, nl->rect.ury); */ } } void start_new_box(void) { - POPPED = FALSE ; - do_link(current_name, current_type) ; + POPPED = FALSE; + do_link(current_name, current_type); } #else -int no_hypertex ; /* prevent an empty file */ +int no_hypertex; /* prevent an empty file */ #endif diff --git a/Build/source/texk/dvipsk/loadfont.c b/Build/source/texk/dvipsk/loadfont.c index 31e8e60a150..6c324852f74 100644 --- a/Build/source/texk/dvipsk/loadfont.c +++ b/Build/source/texk/dvipsk/loadfont.c @@ -28,13 +28,13 @@ #include "protos_add.h" char errbuf[1000]; -int lastresortsizes[40] ; +int lastresortsizes[40]; /* * Now we have some routines to get stuff from the PK file. * Subroutine pkbyte returns the next byte. */ -FILE *pkfile ; -char name[MAXPATHLEN] ; +FILE *pkfile; +char name[MAXPATHLEN]; void badpk(const char *s) { @@ -45,36 +45,36 @@ badpk(const char *s) shalfword pkbyte(void) { - register shalfword i ; + register shalfword i; if ((i=getc(pkfile))==EOF) - badpk("unexpected eof") ; - return(i) ; + badpk("unexpected eof"); + return(i); } integer pkquad(void) { - register integer i ; + register integer i; - i = pkbyte() ; + i = pkbyte(); if (i > 127) - i -= 256 ; - i = i * 256 + pkbyte() ; - i = i * 256 + pkbyte() ; - i = i * 256 + pkbyte() ; - return(i) ; + i -= 256; + i = i * 256 + pkbyte(); + i = i * 256 + pkbyte(); + i = i * 256 + pkbyte(); + return(i); } integer pktrio(void) { - register integer i ; + register integer i; - i = pkbyte() ; - i = i * 256 + pkbyte() ; - i = i * 256 + pkbyte() ; - return(i) ; + i = pkbyte(); + i = i * 256 + pkbyte(); + i = i * 256 + pkbyte(); + return(i); } @@ -85,45 +85,45 @@ pktrio(void) #ifdef VMCMS /* IBM: VM/CMS - we let DVIPS EXEC handle this after the DVIPS MODULE has finished to avoid complications with system calls. */ -int dontmakefont = 0 ; +int dontmakefont = 0; #else #ifdef MVSXA /* IBM: MVS/XA - we let system administrator handle this on MVS/XA since some printers can't get to user fonts anyway */ -int dontmakefont = 1 ; +int dontmakefont = 1; #else -int dontmakefont = 0 ; /* if makefont fails once we won't try again */ +int dontmakefont = 0; /* if makefont fails once we won't try again */ #endif /* IBM: VM/CMS */ #endif void lectureuser(void) { - static int userwarned = 0 ; + static int userwarned = 0; if (! userwarned) { - error("Such scaling will generate extremely poor output.") ; - userwarned = 1 ; + error("Such scaling will generate extremely poor output."); + userwarned = 1; } } Boolean pkopen(register fontdesctype *fd) { - register char *d, *n ; - char *name_ret ; + register char *d, *n; + char *name_ret; #ifdef KPATHSEA - int dpi_ret ; + int dpi_ret; #else - int vdpi ; + int vdpi; #endif - d = fd->area ; - n = fd->name ; + d = fd->area; + n = fd->name; #ifndef KPATHSEA if (*d==0) - d = pkpath ; + d = pkpath; #endif #ifdef FONTLIB if (*(fd->area) == 0) { - int del ; + int del; for (del=0; del<=RES_TOLERANCE(fd->dpi); del=del>0?-del:-del+1) { if ((pkfile=flisearch(n, fd->dpi + del)) != (FILE *)NULL ) return(1); @@ -148,13 +148,13 @@ pkopen(register fontdesctype *fd) } else if (!kpse_bitmap_tolerance ((double) dpi_ret, (double) fd->dpi)) { - fd->loadeddpi = dpi_ret ; - fd->alreadyscaled = 0 ; + fd->loadeddpi = dpi_ret; + fd->alreadyscaled = 0; (void)sprintf(errbuf, "Font %s at %d not found; scaling %d instead.", - n, fd->dpi, dpi_ret) ; - error(errbuf) ; - lectureuser() ; + n, fd->dpi, dpi_ret); + error(errbuf); + lectureuser(); } if (this_name != name_ret) @@ -163,39 +163,39 @@ pkopen(register fontdesctype *fd) return pkfile != NULL; } #else - int del ; + int del; for (del=0; del<=RES_TOLERANCE(fd->dpi); del=del>0?-del:-del+1) { if (actualdpi == vactualdpi) { - vdpi = 0 ; + vdpi = 0; } else { vdpi = (2 * ((long)vactualdpi) * (fd->dpi + del) + actualdpi) - / (2 * actualdpi) ; + / (2 * actualdpi); } #ifdef MVSXA - (void)sprintf(name, "pk%d(%s)", fd->dpi + del, n) ; + (void)sprintf(name, "pk%d(%s)", fd->dpi + del, n); #else - (void)sprintf(name, "%s.%dpk", n, fd->dpi + del) ; + (void)sprintf(name, "%s.%dpk", n, fd->dpi + del); #endif if (0 != (pkfile=pksearch(d, name, READBIN, n, fd->dpi + del, vdpi))) - return(1) ; + return(1); } } if (d == pkpath) { if (actualdpi == vactualdpi) { - vdpi = 0 ; + vdpi = 0; } else { vdpi = (2 * ((long)vactualdpi) * fd->dpi + actualdpi) - / (2 * actualdpi) ; + / (2 * actualdpi); } #ifdef MVSXA - (void)sprintf(name, "pk%d(%s)", fd->dpi, n) ; + (void)sprintf(name, "pk%d(%s)", fd->dpi, n); #else - (void)sprintf(name, "%s.%dpk", n, fd->dpi) ; + (void)sprintf(name, "%s.%dpk", n, fd->dpi); #endif - makefont(n, (int)fd->dpi, DPI) ; + makefont(n, (int)fd->dpi, DPI); if (dontmakefont == 0 && (pkfile = pksearch(d, name, READBIN, n, fd->dpi, vdpi))) - return(1) ; + return(1); #ifndef MSDOS #ifdef OS2 if (_osmode == OS2_MODE) @@ -203,7 +203,7 @@ pkopen(register fontdesctype *fd) but do try for MSDOS */ #else #ifndef ATARIST - dontmakefont = 1 ; + dontmakefont = 1; #endif #endif #endif @@ -218,21 +218,21 @@ pkopen(register fontdesctype *fd) * and then work down. */ { - int i, j ; + int i, j; if (lastresortsizes[0] && fd->dpi < 30000) { - for (i=0; lastresortsizes[i] < fd->dpi; i++) ; + for (i=0; lastresortsizes[i] < fd->dpi; i++); for (j = i-1; j >= 0; j--) { if (actualdpi == vactualdpi) { - vdpi = 0 ; + vdpi = 0; } else { vdpi = (2 * ((long)vactualdpi) * lastresortsizes[j] + actualdpi) - / (2 * actualdpi) ; + / (2 * actualdpi); } #ifdef MVSXA - (void)sprintf(name, "pk%d(%s)", lastresortsizes[j], n) ; + (void)sprintf(name, "pk%d(%s)", lastresortsizes[j], n); #else - (void)sprintf(name, "%s.%dpk", n, lastresortsizes[j]) ; + (void)sprintf(name, "%s.%dpk", n, lastresortsizes[j]); #endif #ifdef FONTLIB if (0 != (pkfile=flisearch(n,(halfword)lastresortsizes[j])) @@ -242,24 +242,24 @@ pkopen(register fontdesctype *fd) if (0 != (pkfile=pksearch(d, name, READBIN, n, (halfword)lastresortsizes[j], vdpi))) { #endif - fd->loadeddpi = lastresortsizes[j] ; - fd->alreadyscaled = 0 ; + fd->loadeddpi = lastresortsizes[j]; + fd->alreadyscaled = 0; (void)sprintf(errbuf, "Font %s at %d dpi not found; scaling %d instead.", - n, fd->dpi, lastresortsizes[j]) ; - error(errbuf) ; - lectureuser() ; - return 1 ; + n, fd->dpi, lastresortsizes[j]); + error(errbuf); + lectureuser(); + return 1; } } for (j = i; lastresortsizes[j] < 30000; j++) { if (actualdpi == vactualdpi) { - vdpi = 0 ; + vdpi = 0; } else { vdpi = (2 * ((long)vactualdpi) * lastresortsizes[j] + actualdpi) - / (2 * actualdpi) ; + / (2 * actualdpi); } - (void)sprintf(name, "%s.%dpk", n, lastresortsizes[j]) ; + (void)sprintf(name, "%s.%dpk", n, lastresortsizes[j]); #ifdef FONTLIB if (0 != (pkfile=flisearch(n, (halfword)lastresortsizes[j])) || 0 != (pkfile=pksearch(d, name, READBIN, n, @@ -268,28 +268,28 @@ pkopen(register fontdesctype *fd) if (0 != (pkfile=pksearch(d, name, READBIN, n, (halfword)lastresortsizes[j], vdpi))) { #endif - fd->loadeddpi = lastresortsizes[j] ; - fd->alreadyscaled = 0 ; + fd->loadeddpi = lastresortsizes[j]; + fd->alreadyscaled = 0; (void)sprintf(errbuf, "Font %s at %d dpi not found; scaling %d instead.", - name, fd->dpi, lastresortsizes[j]) ; - error(errbuf) ; - lectureuser() ; - return 1 ; + name, fd->dpi, lastresortsizes[j]); + error(errbuf); + lectureuser(); + return 1; } } } } #ifdef MVSXA - (void)sprintf(name, "%s.pk%d", n, fd->dpi) ; + (void)sprintf(name, "%s.pk%d", n, fd->dpi); #else - (void)sprintf(name, "%s.%dpk", n, fd->dpi) ; + (void)sprintf(name, "%s.%dpk", n, fd->dpi); #endif (void)sprintf(errbuf, "Font %s%s not found, characters will be left blank.", - fd->area, name) ; - error(errbuf) ; - return(0) ; + fd->area, name); + error(errbuf); + return(0); #endif /* KPATHSEA */ } @@ -302,76 +302,76 @@ pkopen(register fontdesctype *fd) void loadfont(register fontdesctype *curfnt) { - register integer i ; - register shalfword cmd ; - register integer k ; - register integer length = 0 ; - register shalfword cc = 0 ; - register integer scaledsize = curfnt->scaledsize ; - register quarterword *tempr ; - register chardesctype *cd = 0 ; - int maxcc = 0 ; - int munged = 0 ; + register integer i; + register shalfword cmd; + register integer k; + register integer length = 0; + register shalfword cc = 0; + register integer scaledsize = curfnt->scaledsize; + register quarterword *tempr; + register chardesctype *cd = 0; + int maxcc = 0; + int munged = 0; /* * We clear out some pointers: */ if (curfnt->loaded == 3) { for (i=0; i<256; i++) { - curfnt->chardesc[i].TFMwidth = 0 ; - curfnt->chardesc[i].packptr = NULL ; - curfnt->chardesc[i].pixelwidth = 0 ; - curfnt->chardesc[i].flags &= EXISTS ; - curfnt->chardesc[i].flags2 = 0 ; + curfnt->chardesc[i].TFMwidth = 0; + curfnt->chardesc[i].packptr = NULL; + curfnt->chardesc[i].pixelwidth = 0; + curfnt->chardesc[i].flags &= EXISTS; + curfnt->chardesc[i].flags2 = 0; } } else { for (i=0; i<256; i++) { - curfnt->chardesc[i].TFMwidth = 0 ; - curfnt->chardesc[i].packptr = NULL ; - curfnt->chardesc[i].pixelwidth = 0 ; - curfnt->chardesc[i].flags = 0 ; - curfnt->chardesc[i].flags2 = 0 ; + curfnt->chardesc[i].TFMwidth = 0; + curfnt->chardesc[i].packptr = NULL; + curfnt->chardesc[i].pixelwidth = 0; + curfnt->chardesc[i].flags = 0; + curfnt->chardesc[i].flags2 = 0; } } - curfnt->maxchars = 256 ; /* just in case we return before the end */ + curfnt->maxchars = 256; /* just in case we return before the end */ if (!pkopen(curfnt)) { - tfmload(curfnt) ; - return ; + tfmload(curfnt); + return; } if (!quiet) { if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } (void)fprintf(stderr, "<%s>", realnameoffile); - prettycolumn += strlen(realnameoffile) + 2 ; + prettycolumn += strlen(realnameoffile) + 2; } #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr,"Loading pk font %s at %.1fpt\n", - curfnt->name, (real)scaledsize/(alpha*0x100000)) ; + curfnt->name, (real)scaledsize/(alpha*0x100000)); #endif /* DEBUG */ if (pkbyte()!=247) - badpk("expected pre") ; + badpk("expected pre"); if (pkbyte()!=89) - badpk("wrong id byte") ; + badpk("wrong id byte"); for(i=pkbyte(); i>0; i--) - (void)pkbyte() ; - k = (integer)(alpha * (real)pkquad()) ; + (void)pkbyte(); + k = (integer)(alpha * (real)pkquad()); if (k > curfnt->designsize + fsizetol || k < curfnt->designsize - fsizetol) { char *msg = concat ("Design size mismatch in font ", curfnt->name); error (msg); free (msg); } - k = pkquad() ; + k = pkquad(); if (k && curfnt->checksum) if (k!=curfnt->checksum) { char *msg = concat ("Checksum mismatch in font ", curfnt->name); error (msg); free (msg); } - k = pkquad() ; /* assume that hppp is correct in the PK file */ - k = pkquad() ; /* assume that vppp is correct in the PK file */ + k = pkquad(); /* assume that hppp is correct in the PK file */ + k = pkquad(); /* assume that vppp is correct in the PK file */ /* * Now we get down to the serious business of reading character definitions. */ @@ -379,135 +379,135 @@ loadfont(register fontdesctype *curfnt) if (cmd < 240) { switch (cmd & 7) { case 0: case 1: case 2: case 3: - length = (cmd & 7) * 256 + pkbyte() - 3 ; - cc = pkbyte() ; - cd = curfnt->chardesc+cc ; + length = (cmd & 7) * 256 + pkbyte() - 3; + cc = pkbyte(); + cd = curfnt->chardesc+cc; if (nosmallchars || curfnt->dpi != curfnt->loadeddpi) - cd->flags |= BIGCHAR ; - cd->TFMwidth = scalewidth(pktrio(), scaledsize) ; - cd->pixelwidth = pkbyte() ; - break ; + cd->flags |= BIGCHAR; + cd->TFMwidth = scalewidth(pktrio(), scaledsize); + cd->pixelwidth = pkbyte(); + break; case 4: case 5: case 6: - length = (cmd & 3) * 65536L + pkbyte() * 256L ; - length = length + pkbyte() - 4L ; - cc = pkbyte() ; - cd = curfnt->chardesc+cc ; - cd->TFMwidth = scalewidth(pktrio(), scaledsize) ; - cd->flags |= BIGCHAR ; - i = pkbyte() ; - cd->pixelwidth = i * 256 + pkbyte() ; - break ; + length = (cmd & 3) * 65536L + pkbyte() * 256L; + length = length + pkbyte() - 4L; + cc = pkbyte(); + cd = curfnt->chardesc+cc; + cd->TFMwidth = scalewidth(pktrio(), scaledsize); + cd->flags |= BIGCHAR; + i = pkbyte(); + cd->pixelwidth = i * 256 + pkbyte(); + break; case 7: - length = pkquad() - 11 ; - cc = pkquad() ; - if (cc<0 || cc>255) badpk("character code out of range") ; - cd = curfnt->chardesc + cc ; - cd->flags |= BIGCHAR ; - cd->TFMwidth = scalewidth(pkquad(), scaledsize) ; - cd->pixelwidth = (pkquad() + 32768) >> 16 ; - k = pkquad() ; + length = pkquad() - 11; + cc = pkquad(); + if (cc<0 || cc>255) badpk("character code out of range"); + cd = curfnt->chardesc + cc; + cd->flags |= BIGCHAR; + cd->TFMwidth = scalewidth(pkquad(), scaledsize); + cd->pixelwidth = (pkquad() + 32768) >> 16; + k = pkquad(); } if (cd->pixelwidth == 0 && cd->TFMwidth != 0) { if (cd->TFMwidth > 0) - k = (integer)(cd->TFMwidth * conv + 0.5) ; + k = (integer)(cd->TFMwidth * conv + 0.5); else - k = -(integer)(-cd->TFMwidth * conv + 0.5) ; + k = -(integer)(-cd->TFMwidth * conv + 0.5); if (k != 0) { - cd->pixelwidth = k ; - munged++ ; + cd->pixelwidth = k; + munged++; } } if (length <= 0) - badpk("packet length too small") ; + badpk("packet length too small"); if (dopprescan && ((cd->flags & EXISTS) == 0)) { for (length--; length>0; length--) - (void)pkbyte() ; + (void)pkbyte(); } else { if (cc > maxcc) - maxcc = cc ; + maxcc = cc; if (bytesleft < length || (length > MINCHUNK && compressed)) { #ifdef DEBUG if (dd(D_MEM)) (void)fprintf(stderr, #ifdef SHORTINT "Allocating new raster memory (%ld req, %ld left)\n", - length, bytesleft) ; + length, bytesleft); #else "Allocating new raster memory (%d req, %d left)\n", - (int)length, (int)bytesleft) ; + (int)length, (int)bytesleft); #endif #endif /* DEBUG */ if (length > MINCHUNK) { - tempr = (quarterword *)mymalloc((integer)length) ; + tempr = (quarterword *)mymalloc((integer)length); } else { - raster = (quarterword *)mymalloc((integer)RASTERCHUNK) ; - tempr = raster ; - bytesleft = RASTERCHUNK - length ; - raster += length ; + raster = (quarterword *)mymalloc((integer)RASTERCHUNK); + tempr = raster; + bytesleft = RASTERCHUNK - length; + raster += length; } } else { - tempr = raster ; - bytesleft -= length ; - raster += length ; + tempr = raster; + bytesleft -= length; + raster += length; } - cd->packptr = tempr ; - *tempr++ = cmd ; + cd->packptr = tempr; + *tempr++ = cmd; for (length--; length>0; length--) - *tempr++ = pkbyte() ; + *tempr++ = pkbyte(); } - cd->flags2 |= EXISTS ; + cd->flags2 |= EXISTS; } else { - k = 0 ; + k = 0; switch (cmd) { case 243: - k = pkbyte() ; + k = pkbyte(); if (k > 127) - k -= 256 ; + k -= 256; case 242: - k = k * 256 + pkbyte() ; + k = k * 256 + pkbyte(); case 241: - k = k * 256 + pkbyte() ; + k = k * 256 + pkbyte(); case 240: - k = k * 256 + pkbyte() ; + k = k * 256 + pkbyte(); while (k-- > 0) - i = pkbyte() ; - break ; + i = pkbyte(); + break; case 244: - k = pkquad() ; - break ; + k = pkquad(); + break; case 246: - break ; + break; default: - badpk("! unexpected command") ; + badpk("! unexpected command"); } } } #ifdef FONTLIB if (flib) - flib = 0 ; + flib = 0; else #endif - (void)fclose(pkfile) ; - curfnt->loaded = 1 ; - curfnt->maxchars = maxcc + 1 ; + (void)fclose(pkfile); + curfnt->loaded = 1; + curfnt->maxchars = maxcc + 1; if (munged > 0) { - static int seen = 0 ; + static int seen = 0; sprintf(errbuf, "Font %s at %d dpi has most likely been made improperly;", - curfnt->name, curfnt->dpi) ; - error(errbuf) ; + curfnt->name, curfnt->dpi); + error(errbuf); if (seen) - return ; - seen = 1 ; + return; + seen = 1; sprintf(errbuf, - "%d characters have 0 escapements but non-trivial TFM widths.", munged) ; - error(errbuf) ; + "%d characters have 0 escapements but non-trivial TFM widths.", munged); + error(errbuf); error( - "I'm stumbling along as best I can, but I recommend regenerating") ; + "I'm stumbling along as best I can, but I recommend regenerating"); error( - "these fonts; the problem is probably that they are non-CM fonts") ; + "these fonts; the problem is probably that they are non-CM fonts"); error( - "(such as circle10 or line10) created with a MF with the CM base") ; - error("preloaded .") ; + "(such as circle10 or line10) created with a MF with the CM base"); + error("preloaded ."); } } diff --git a/Build/source/texk/dvipsk/makefont.c b/Build/source/texk/dvipsk/makefont.c index 1603562ea3d..80c9b816baa 100644 --- a/Build/source/texk/dvipsk/makefont.c +++ b/Build/source/texk/dvipsk/makefont.c @@ -46,7 +46,7 @@ mfjobout(char *font, double mag) strcpy(pkout+i,"%"); break; default: - sprintf(pkout+i, "%%%c", *p) ; + sprintf(pkout+i, "%%%c", *p); fprintf(stderr,"Unknown option %%%c in pk path\n",*p); } i += strlen(pkout+i); @@ -55,7 +55,7 @@ mfjobout(char *font, double mag) pkout[i++] = *p; } /* *p='\0'; Could some DOS person explain to me what this does? */ - pkout[i] = 0 ; + pkout[i] = 0; mfjobfile = fopen(mfjobname,"w"); if (mfjobfile == (FILE *)NULL) return; @@ -68,7 +68,7 @@ mfjobout(char *font, double mag) } fprintf(mfjobfile,"{font=%s; mag=%f;}\n",font,mag); (void)fprintf(stderr, - "Appending {font=%s; mag=%f;} to %s\n",font,mag,mfjobname) ; + "Appending {font=%s; mag=%f;} to %s\n",font,mag,mfjobname); } #endif /* @@ -77,93 +77,93 @@ mfjobout(char *font, double mag) static int magstep(register int n, register int bdpi) { - register float t ; - int neg = 0 ; + register float t; + int neg = 0; if (n < 0) { - neg = 1 ; - n = -n ; + neg = 1; + n = -n; } if (n & 1) { - n &= ~1 ; - t = 1.095445115 ; + n &= ~1; + t = 1.095445115; } else - t = 1.0 ; + t = 1.0; while (n > 8) { - n -= 8 ; - t = t * 2.0736 ; + n -= 8; + t = t * 2.0736; } while (n > 0) { - n -= 2 ; - t = t * 1.2 ; + n -= 2; + t = t * 1.2; } if (neg) - return((int)floor(0.5 + bdpi / t)) ; + return((int)floor(0.5 + bdpi / t)); else - return((int)floor(0.5 + bdpi * t)) ; + return((int)floor(0.5 + bdpi * t)); } #ifdef MAKEPKCMD -static char *defcommand = MAKEPKCMD " %n %d %b %m" ; +static char *defcommand = MAKEPKCMD " %n %d %b %m"; #else #ifdef OS2 -static char *doscommand = "command /c MakeTeXP %n %d %b %m" ; -static char *os2command = "MakeTeXP %n %d %b %m" ; +static char *doscommand = "command /c MakeTeXP %n %d %b %m"; +static char *os2command = "MakeTeXP %n %d %b %m"; #define defcommand ( _osmode==OS2_MODE ? os2command : doscommand ) #else #ifdef MSDOS -static char *defcommand = "command /c MakeTeXP %n %d %b %m" ; +static char *defcommand = "command /c MakeTeXP %n %d %b %m"; #else #ifdef VMCMS -static char *defcommand = "EXEC MakeTeXPK %n %d %b %m" ; +static char *defcommand = "EXEC MakeTeXPK %n %d %b %m"; #else #ifdef ATARIST -static char *defcommand = "maketexp %n %d %b %m" ; +static char *defcommand = "maketexp %n %d %b %m"; #else -static char *defcommand = "MakeTeXPK %n %d %b %m" ; +static char *defcommand = "MakeTeXPK %n %d %b %m"; #endif #endif #endif #endif #endif -char *command = 0 ; +char *command = 0; /* * This routine tries to create a font by executing a command, and * then opening the font again if possible. */ -static char buf[125] ; +static char buf[125]; void makefont(char *name, int dpi, int bdpi) { - register char *p, *q ; - register int m, n ; - int modegiven = 0 ; + register char *p, *q; + register int m, n; + int modegiven = 0; #if defined MSDOS || defined OS2 || defined(ATARIST) double t; #endif if (command == 0) if (secure == 0 && (command=getenv("MAKETEXPK"))) - command = newstring(command) ; + command = newstring(command); else - command = defcommand ; + command = defcommand; for (p=command, q=buf; *p; p++) if (*p != '%') - *q++ = *p ; + *q++ = *p; else { switch (*++p) { case 'n' : case 'N' : - (void)strcpy(q, name) ; - break ; + (void)strcpy(q, name); + break; case 'd' : case 'D' : - (void)sprintf(q, "%d", dpi) ; - break ; + (void)sprintf(q, "%d", dpi); + break; case 'b' : case 'B' : - (void)sprintf(q, "%d", bdpi) ; - break ; + (void)sprintf(q, "%d", bdpi); + break; case 'o' : case 'O' : - (void)sprintf(q, "%s", mfmode ? mfmode : "default") ; - modegiven = 1 ; - break ; + (void)sprintf(q, "%s", mfmode ? mfmode : "default"); + modegiven = 1; + break; case 'm' : case 'M' : /* * Here we want to return a string. If we can find some integer @@ -174,27 +174,27 @@ case 'm' : case 'M' : * We do this for the very slight improvement in accuracy that * magstep() gives us over the rounded dpi/bdpi. */ - m = 0 ; + m = 0; if (dpi < bdpi) { while (1) { - m-- ; - n = magstep(m, bdpi) ; + m--; + n = magstep(m, bdpi); if (n == dpi) - break ; + break; if (n < dpi || m < -40) { - m = 9999 ; - break ; + m = 9999; + break; } } } else if (dpi > bdpi) { while (1) { - m++ ; - n = magstep(m, bdpi) ; + m++; + n = magstep(m, bdpi); if (n == dpi) - break ; + break; if (n > dpi || m > 40) { - m = 9999 ; - break ; + m = 9999; + break; } } } @@ -208,55 +208,55 @@ case 'm' : case 'M' : else n = m; if (n & 1) { - n &= ~1 ; - t = 1.095445115 ; + n &= ~1; + t = 1.095445115; } else - t = 1.0 ; + t = 1.0; while (n > 0) { - n -= 2 ; - t = t * 1.2 ; + n -= 2; + t = t * 1.2; } if (m < 0) - t = 1 / t ; + t = 1 / t; } - (void)sprintf(q, "%12.9f", t) ; + (void)sprintf(q, "%12.9f", t); #else #ifndef ATARIST if (m == 9999) { #else { #endif - (void)sprintf(q, "%d+%d/%d", dpi/bdpi, dpi%bdpi, bdpi) ; + (void)sprintf(q, "%d+%d/%d", dpi/bdpi, dpi%bdpi, bdpi); } else if (m >= 0) { - (void)sprintf(q, "magstep\\(%d.%d\\)", m/2, (m&1)*5) ; + (void)sprintf(q, "magstep\\(%d.%d\\)", m/2, (m&1)*5); } else { - (void)sprintf(q, "magstep\\(-%d.%d\\)", (-m)/2, (m&1)*5) ; + (void)sprintf(q, "magstep\\(-%d.%d\\)", (-m)/2, (m&1)*5); } #endif - break ; -case 0 : *q = 0 ; - break ; -default: *q++ = *p ; - *q = 0 ; - break ; + break; +case 0 : *q = 0; + break; +default: *q++ = *p; + *q = 0; + break; } - q += strlen(q) ; + q += strlen(q); } - *q = 0 ; + *q = 0; if (mfmode && !modegiven) { - strcpy(q, " ") ; - strcat(q, mfmode) ; + strcpy(q, " "); + strcat(q, mfmode); } #ifdef OS2 if ((_osmode == OS2_MODE) && filter) - (void)strcat(buf, quiet ? " >nul" : " 1>&2") ; + (void)strcat(buf, quiet ? " >nul" : " 1>&2"); #else #ifndef VMCMS /* no filters and no need to print to stderr */ #ifndef MVSXA #ifndef MSDOS #ifndef ATARIST if (filter) - (void)strcat(buf, quiet ? " >/dev/null" : " 1>&2") ; + (void)strcat(buf, quiet ? " >/dev/null" : " 1>&2"); #endif #endif #endif @@ -265,36 +265,36 @@ default: *q++ = *p ; #if defined MSDOS || defined OS2 if (! quiet && mfjobname == (char *)NULL) - (void)fprintf(stderr, "- %s\n", buf) ; + (void)fprintf(stderr, "- %s\n", buf); if (dontmakefont == 0) { if (mfjobname != (char *)NULL) mfjobout(name,t); else - (void)system(buf) ; + (void)system(buf); } #else if (! quiet) - (void)fprintf(stderr, "- %s\n", buf) ; + (void)fprintf(stderr, "- %s\n", buf); if (dontmakefont == 0) - (void)system(buf) ; + (void)system(buf); #endif else { - static FILE *fontlog = 0 ; + static FILE *fontlog = 0; if (fontlog == 0) { - fontlog = fopen("missfont.log", "a") ; + fontlog = fopen("missfont.log", "a"); if (fontlog != 0) { (void)fprintf(stderr, #ifndef VMCMS - "Appending font creation commands to missfont.log\n") ; + "Appending font creation commands to missfont.log\n"); #else "\nMissing font data will be passed to DVIPS EXEC via MISSFONT LOG\n"); #endif } } if (fontlog != 0) { - (void)fprintf(fontlog, "%s\n", buf) ; - (void)fflush(fontlog) ; + (void)fprintf(fontlog, "%s\n", buf); + (void)fflush(fontlog); } } } diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c index 687dc817039..69e23d10cc4 100644 --- a/Build/source/texk/dvipsk/output.c +++ b/Build/source/texk/dvipsk/output.c @@ -26,22 +26,22 @@ */ #include "protos.h" -char preamblecomment[256] ; /* usually "TeX output ..." */ +char preamblecomment[256]; /* usually "TeX output ..." */ /* * We need a few statics to take care of things. */ -static integer rhh, rvv ; -static int instring ; -static Boolean lastspecial = 1 ; -static shalfword d ; -static Boolean popened = 0 ; -int lastfont ; /* exported to dospecial to fix rotate.tex problem */ +static integer rhh, rvv; +static int instring; +static Boolean lastspecial = 1; +static shalfword d; +static Boolean popened = 0; +int lastfont; /* exported to dospecial to fix rotate.tex problem */ static void chrcmd(char c); /* just a forward declaration */ -static char strbuffer[LINELENGTH + 20], *strbp = strbuffer ; -static struct papsiz *finpapsiz ; +static char strbuffer[LINELENGTH + 20], *strbp = strbuffer; +static struct papsiz *finpapsiz; static struct papsiz defpapsiz = { 0, 40258437L, 52099154L, "letter", "" -} ; +}; #ifdef CREATIONDATE #if (!defined(VMS) && !defined(MSDOS) && !(defined(OS2) && defined(_MSC_VER)) && !defined(ATARIST)) /* VAXC/MSDOS don't like/need this !! */ @@ -60,35 +60,35 @@ static time_t jobtime; * Format: 80 {01,02} four byte length in littleendian order data * repeated possibly multiple times. */ -static const char *hxdata = "0123456789ABCDEF" ; -static int infigure ; +static const char *hxdata = "0123456789ABCDEF"; +static int infigure; static char possibleDSCLine[81], - *dscLinePointer = possibleDSCLine, *dscLineEnd = possibleDSCLine + 80 ; + *dscLinePointer = possibleDSCLine, *dscLineEnd = possibleDSCLine + 80; void copyfile_general(const char *s, struct header_list *cur_header) { - FILE *f = NULL ; - int c, prevc = '\n' ; - long len ; + FILE *f = NULL; + int c, prevc = '\n'; + long len; /* begin DOS EPS code */ int doseps = 0; unsigned long dosepsbegin, dosepsend = 0; - int removingBytes = 0 ; - const char *scanForEnd = 0 ; + int removingBytes = 0; + const char *scanForEnd = 0; int scanningFont = 0; /* end DOS EPS code */ #ifdef VMCMS - register char *lastdirsep ; - register char *trunc_s ; - trunc_s = s ; + register char *lastdirsep; + register char *trunc_s; + trunc_s = s; #endif #ifdef MVSXA - register char *lastdirsep ; - register char *trunc_s ; - trunc_s = s ; + register char *lastdirsep; + register char *trunc_s; + trunc_s = s; #endif - dscLinePointer = possibleDSCLine ; + dscLinePointer = possibleDSCLine; switch (infigure) { case 1: @@ -96,25 +96,25 @@ copyfile_general(const char *s, struct header_list *cur_header) * Look in headerpath too, just in case. This allows common header * or figure files to be installed in the .../ps directory. */ - f = search(figpath, s, READBIN) ; + f = search(figpath, s, READBIN); if (f == 0) - f = search(headerpath, s, READBIN) ; + f = search(headerpath, s, READBIN); #ifdef VMCMS - lastdirsep = strrchr(s, '/') ; - if ( NULL != lastdirsep ) trunc_s = lastdirsep + 1 ; + lastdirsep = strrchr(s, '/'); + if ( NULL != lastdirsep ) trunc_s = lastdirsep + 1; (void)sprintf(errbuf, - "Couldn't find figure file %s with CMS name %s; continuing.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s, trunc_s) ; + "Couldn't find figure file %s with CMS name %s; continuing.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s, trunc_s); #else #ifdef MVSXA - lastdirsep = strrchr(s, '/') ; - if ( NULL != lastdirsep ) trunc_s = lastdirsep + 1 ; + lastdirsep = strrchr(s, '/'); + if ( NULL != lastdirsep ) trunc_s = lastdirsep + 1; (void)sprintf(errbuf, - "Couldn't find figure file %s with MVS name %s; continuing.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s, trunc_s) ; + "Couldn't find figure file %s with MVS name %s; continuing.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s, trunc_s); #else - (void)sprintf(errbuf, "Could not find figure file %s; continuing.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s) ; + (void)sprintf(errbuf, "Could not find figure file %s; continuing.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s); #endif #endif - break ; + break; #ifndef VMCMS #ifndef MVSXA #ifndef VMS @@ -123,19 +123,19 @@ copyfile_general(const char *s, struct header_list *cur_header) #ifndef __THINK__ case 2: #ifdef SECURE - (void)sprintf(errbuf, "<%s>: Tick filename execution disabled", s) ; + (void)sprintf(errbuf, "<%s>: Tick filename execution disabled", s); #else #ifdef OS2 if (_osmode == OS2_MODE) { #endif if (secure == 0) { - (void)sprintf(errbuf, "Execution of <%s> failed ", s) ; - f = popen(s, "r") ; + (void)sprintf(errbuf, "Execution of <%s> failed ", s); + f = popen(s, "r"); if (f != 0) - (void)SET_BINARY(fileno(f)) ; + (void)SET_BINARY(fileno(f)); } else { - (void)sprintf(errbuf,"Secure mode is %d so execute <%s> will not run", secure,s) ; + (void)sprintf(errbuf,"Secure mode is %d so execute <%s> will not run", secure,s); } #ifdef OS2 } @@ -149,16 +149,16 @@ copyfile_general(const char *s, struct header_list *cur_header) #endif #endif default: - f = search(headerpath, s, READBIN) ; + f = search(headerpath, s, READBIN); if(cur_header && (cur_header->precode || cur_header->postcode)) { if(f==NULL) - f = search(figpath, s, READBIN) ; + f = search(figpath, s, READBIN); } - (void)sprintf(errbuf, "! Could not find header file %s.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s) ; - break ; + (void)sprintf(errbuf, "! Could not find header file %s.\nNote that an absolute path or a relative path with .. are denied in -R2 mode.", s); + break; } if (f==NULL) - error(errbuf) ; + error(errbuf); else { if (! quiet) { #if defined(VMCMS) || defined (MVSXA) @@ -166,131 +166,131 @@ copyfile_general(const char *s, struct header_list *cur_header) #else if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) { #endif - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } #ifdef VMCMS - (void)fprintf(stderr, "<%s>", trunc_s) ; + (void)fprintf(stderr, "<%s>", trunc_s); #else #ifdef MVSXA - (void)fprintf(stderr, "<%s>", trunc_s) ; + (void)fprintf(stderr, "<%s>", trunc_s); #else - (void)fprintf(stderr, "<%s>", realnameoffile) ; + (void)fprintf(stderr, "<%s>", realnameoffile); #endif #endif - (void)fflush(stderr) ; + (void)fflush(stderr); #if defined(VMCMS) || defined (MVSXA) - prettycolumn += 2 + strlen(s) ; + prettycolumn += 2 + strlen(s); #else - prettycolumn += 2 + strlen(realnameoffile) ; + prettycolumn += 2 + strlen(realnameoffile); #endif } if (linepos != 0) - (void)putc('\n', bitfile) ; + (void)putc('\n', bitfile); /* * Suggested by Andrew Trevorrow; don't ever BeginFont a file ending in .enc */ if (infont && strstr(s,".enc")) - infont = 0 ; + infont = 0; if (! disablecomments) { if (infigure) - (void)fprintf(bitfile, "%%%%BeginDocument: %s\n", s) ; + (void)fprintf(bitfile, "%%%%BeginDocument: %s\n", s); else if (infont) - (void)fprintf(bitfile, "%%%%BeginFont: %s\n", infont) ; + (void)fprintf(bitfile, "%%%%BeginFont: %s\n", infont); #ifdef HPS else if (noprocset) {} #endif else - (void)fprintf(bitfile, "%%%%BeginProcSet: %s 0 0\n", s) ; + (void)fprintf(bitfile, "%%%%BeginProcSet: %s 0 0\n", s); } if (cur_header && cur_header->precode) { - (void)fprintf(bitfile, "%s\n", cur_header->precode) ; - free(cur_header->precode) ; + (void)fprintf(bitfile, "%s\n", cur_header->precode); + free(cur_header->precode); } - c = getc(f) ; + c = getc(f); if (c == 0x80) { while (1) { - c = getc(f) ; + c = getc(f); switch(c) { case 1: case 2: - len = getc(f) ; - len += getc(f) * 256L ; - len += getc(f) * 65536L ; - len += getc(f) * 256L * 65536 ; + len = getc(f); + len += getc(f) * 256L; + len += getc(f) * 65536L; + len += getc(f) * 256L * 65536; if (c == 1) { while (len > 0) { - c = getc(f) ; + c = getc(f); if (c == EOF) { - error("premature EOF in MS-DOS font file") ; - len = 0 ; + error("premature EOF in MS-DOS font file"); + len = 0; } else { if (c == '\r') { /* Mac- or DOS-style text file */ - (void)putc('\n', bitfile) ; + (void)putc('\n', bitfile); if ((c = getc(f)) == '\n') /* DOS-style text */ len--; /* consume, but don't generate NL */ else ungetc(c, f); } else - (void)putc(c, bitfile) ; - len-- ; + (void)putc(c, bitfile); + len--; } } } else { - putc('\n', bitfile) ; - prevc = 0 ; + putc('\n', bitfile); + prevc = 0; while (len > 0) { - c = getc(f) ; + c = getc(f); if (c == EOF) { - error("premature EOF in MS-DOS font file") ; - len = 0 ; + error("premature EOF in MS-DOS font file"); + len = 0; } else { - (void)putc(hxdata[c >> 4], bitfile) ; - (void)putc(hxdata[c & 15], bitfile) ; - len-- ; - prevc += 2 ; + (void)putc(hxdata[c >> 4], bitfile); + (void)putc(hxdata[c & 15], bitfile); + len--; + prevc += 2; if (prevc >= 76) { - putc('\n', bitfile) ; - prevc = 0 ; + putc('\n', bitfile); + prevc = 0; } } } } - break ; + break; case 3: - goto msdosdone ; + goto msdosdone; default: - error("saw type other than 1, 2, or 3 in MS-DOS font file") ; - break ; + error("saw type other than 1, 2, or 3 in MS-DOS font file"); + break; } - c = getc(f) ; + c = getc(f); if (c == EOF) - break ; + break; if (c != 0x80) { - error("saw non-MSDOS header in MSDOS font file") ; - break ; + error("saw non-MSDOS header in MSDOS font file"); + break; } } msdosdone: - prevc = 0 ; + prevc = 0; } else { /* begin DOS EPS code */ if (c == 'E'+0x80) { if ((getc(f)=='P'+0x80) && (getc(f)=='S'+0x80) && (getc(f)=='F'+0x80)) { doseps = 1; - dosepsbegin = getc(f) ; - dosepsbegin += getc(f) * 256L ; - dosepsbegin += getc(f) * 65536L ; - dosepsbegin += getc(f) * 256L * 65536 ; - dosepsend = getc(f) ; - dosepsend += getc(f) * 256L ; - dosepsend += getc(f) * 65536L ; - dosepsend += getc(f) * 256L * 65536 ; + dosepsbegin = getc(f); + dosepsbegin += getc(f) * 256L; + dosepsbegin += getc(f) * 65536L; + dosepsbegin += getc(f) * 256L * 65536; + dosepsend = getc(f); + dosepsend += getc(f) * 256L; + dosepsend += getc(f) * 65536L; + dosepsend += getc(f) * 256L * 65536; fseek(f, dosepsbegin, 0); c = getc(f); - dosepsend-- ; + dosepsend--; } else { rewind(f); @@ -301,18 +301,18 @@ msdosdone: if (c != EOF) { while (1) { if (c == '\n') { /* end or beginning of line; check DSC */ - *dscLinePointer = 0 ; /* make sure we terminate! + *dscLinePointer = 0; /* make sure we terminate! * might be a new empty line! */ if (strncmp(possibleDSCLine, "%%BeginBinary:", 14) == 0 || strncmp(possibleDSCLine, "%%BeginData:", 12) == 0 || strncmp(possibleDSCLine, "%%BeginFont:", 12) == 0) { - integer size = 0 ; - char *p = possibleDSCLine ; - *dscLinePointer = 0 ; - *dscLineEnd = 0 ; + integer size = 0; + char *p = possibleDSCLine; + *dscLinePointer = 0; + *dscLineEnd = 0; if (scanForEnd == 0 && removecomments) { - (void)fputs(possibleDSCLine, bitfile) ; - (void)putc('\n', bitfile) ; + (void)fputs(possibleDSCLine, bitfile); + (void)putc('\n', bitfile); } if (strncmp(possibleDSCLine, "%%BeginFont:", 12) == 0) { @@ -332,26 +332,26 @@ msdosdone: } else { scanningFont = 0; - scanForEnd = 0 ; + scanForEnd = 0; while (*p != ':') - p++ ; - p++ ; + p++; + p++; while (*p && *p <= ' ') - p++ ; + p++; if ('0' > *p || *p > '9') { /* * No byte count! We need to scan for end binary * or end data, and hope we get it right. Really * the file is malformed. */ - scanForEnd = "Yes" ; + scanForEnd = "Yes"; } while ('0' <= *p && *p <= '9') { - size = size * 10 + *p - '0' ; - p++ ; + size = size * 10 + *p - '0'; + p++; } while (*p && *p <= ' ') - p++ ; + p++; if (*p == 'h' || *p == 'H') /* * Illustrator 8 and 9 have bogus byte counts @@ -359,55 +359,55 @@ msdosdone: * that it is safe to use ASCII scanning, so * we do so. */ - scanForEnd = "Yes" ; + scanForEnd = "Yes"; while (*p > ' ') /* ignore Hex/Binary/ASCII */ - p++ ; + p++; while (*p && *p <= ' ') - p++ ; - (void)putc(c, bitfile) ; + p++; + (void)putc(c, bitfile); if (c == '\r') { /* maybe we have a DOS-style text file */ c = getc(f); if (c == '\n') { (void)putc(c, bitfile); - dosepsend-- ; + dosepsend--; } else ungetc(c, f); } if (scanForEnd != 0) { if (strncmp(possibleDSCLine, "%%BeginBinary", 13) == 0) - scanForEnd = "%%EndBinary" ; + scanForEnd = "%%EndBinary"; else - scanForEnd = "%%EndData" ; + scanForEnd = "%%EndData"; } } if (scanForEnd == 0) { if (strncmp(p, "lines", 5) != 0 && strncmp(p, "Lines", 5) != 0) { for (; size>0; size--) { - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; if (c == EOF) error( - "! premature end of file in binary section") ; - (void)putc(c, bitfile) ; + "! premature end of file in binary section"); + (void)putc(c, bitfile); } } else { /* * Count both newlines and returns, and when either * goes over the count, we are done. */ - int newlines=0, returns=0 ; + int newlines=0, returns=0; while (newlines < size && returns < size) { - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; if (c == EOF) error( - "! premature end of file in binary section") ; - (void)putc(c, bitfile) ; + "! premature end of file in binary section"); + (void)putc(c, bitfile); if (c == '\n') - newlines++ ; + newlines++; else if (c == '\r') - returns++ ; + returns++; } /* * If we've seen precisely one too few newlines, @@ -415,28 +415,28 @@ msdosdone: */ if (returns == newlines + 1) { if ((c = getc(f)) == '\n') { - putc(c, bitfile) ; - dosepsend-- ; + putc(c, bitfile); + dosepsend--; } else { ungetc(c, f); } } } - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; if (c == '\n' || c == '\r') { - (void)putc(c, bitfile) ; + (void)putc(c, bitfile); if (c == '\r') { /* DOS-style text file? */ c = getc(f); - dosepsend-- ; + dosepsend--; if (c == '\n') { putc(c, bitfile); c = getc(f); - dosepsend-- ; + dosepsend--; } } else { - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; } } if (c != '%') { @@ -444,29 +444,29 @@ msdosdone: in the rest of the file, and pretend it worked; this works around various Illustrator bugs. -tgr, 14 June 2003 */ - const char *m1 = "%%EndData" ; - const char *m2 = "%%EndBinary" ; - const char *p1 = m1 ; - const char *p2 = m2 ; + const char *m1 = "%%EndData"; + const char *m2 = "%%EndBinary"; + const char *p1 = m1; + const char *p2 = m2; error( - " expected to see %%EndBinary at end of data; struggling on") ; + " expected to see %%EndBinary at end of data; struggling on"); while (1) { - (void)putc(c, bitfile) ; + (void)putc(c, bitfile); if (c == '\r' || c == '\n') { if (c == '\r') { /* DOS-style text file? */ c = getc(f); if (c != '\n') ungetc(c, f); else - dosepsend-- ; + dosepsend--; } - break ; + break; } - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; if (c == EOF) error( - "! premature end of file in binary section") ; + "! premature end of file in binary section"); /* * By the way, this code can be fooled by things like %%%EndBinary * or even %%EndBi%%EndBinary, but this isn't valid DSC anyway. @@ -474,62 +474,62 @@ msdosdone: * this code when doing stream-based substring matching. */ if (c == *p1) { - p1++ ; + p1++; if (*p1 == 0) - break ; + break; } else { - p1 = m1 ; + p1 = m1; } if (c == *p2) { - p2++ ; + p2++; if (*p2 == 0) - break ; + break; } else { - p2 = m2 ; + p2 = m2; } } } while (1) { - (void)putc(c, bitfile) ; + (void)putc(c, bitfile); if (c == '\r' || c == '\n') { if (c == '\r') { /* DOS-style text file? */ c = getc(f); if (c != '\n') ungetc(c, f); else { - (void)putc(c, bitfile) ; - dosepsend-- ; + (void)putc(c, bitfile); + dosepsend--; } } - break ; + break; } - c = getc(f) ; + c = getc(f); removingBytes = 0; - dosepsend-- ; + dosepsend--; if (c == EOF) error( - "! premature end of file in binary section") ; + "! premature end of file in binary section"); } - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; } } else if (scanForEnd && strncmp(possibleDSCLine, scanForEnd, strlen(scanForEnd))==0) { - scanForEnd = 0 ; + scanForEnd = 0; scanningFont = 0; } - dscLinePointer = possibleDSCLine ; + dscLinePointer = possibleDSCLine; } else if (dscLinePointer < dscLineEnd) { - *dscLinePointer++ = c ; + *dscLinePointer++ = c; if (removecomments && scanForEnd == 0 && c == '%' && dscLinePointer == possibleDSCLine + 1) { /* % is first char */ - c = getc(f) ; + c = getc(f); if (c == '%' || c == '!') - removingBytes = 1 ; + removingBytes = 1; if (c != EOF) - ungetc(c, f) ; - c = '%' ; + ungetc(c, f); + c = '%'; } } #ifdef VMCMS @@ -542,34 +542,34 @@ msdosdone: #endif #endif if (!removingBytes) - (void)putc(c, bitfile) ; + (void)putc(c, bitfile); } - prevc = c ; + prevc = c; /* begin DOS EPS code */ if (doseps && (dosepsend <= 0)) break; /* stop at end of DOS EPS PostScript section */ /* end DOS EPS code */ - c = getc(f) ; - dosepsend-- ; + c = getc(f); + dosepsend--; if (c == EOF) - break ; + break; else if (c == '\r' && ! scanningFont) { c = getc(f); if (c == '\n') { /* DOS-style text file? */ if (!removingBytes) (void)putc('\r', bitfile); - dosepsend-- ; + dosepsend--; } else ungetc(c, f); - c = '\n' ; + c = '\n'; } if (prevc == '\n') - removingBytes = 0 ; + removingBytes = 0; } } } if (prevc != '\n') - (void)putc('\n', bitfile) ; - linepos = 0 ; + (void)putc('\n', bitfile); + linepos = 0; #ifndef VMCMS #ifndef MVSXA #ifndef VMS @@ -580,10 +580,10 @@ msdosdone: #ifdef OS2 { if (_osmode == OS2_MODE) - (void)pclose(f) ; + (void)pclose(f); } #else - (void)pclose(f) ; + (void)pclose(f); #endif else #endif @@ -592,21 +592,21 @@ msdosdone: #endif #endif #endif - (void)fclose(f) ; + (void)fclose(f); if (cur_header && cur_header->postcode) { - (void)fprintf(bitfile, "\n%s", cur_header->postcode) ; - free(cur_header->postcode) ; + (void)fprintf(bitfile, "\n%s", cur_header->postcode); + free(cur_header->postcode); } if (!disablecomments) { if (infigure) - (void)fprintf(bitfile, "\n%%%%EndDocument\n") ; + (void)fprintf(bitfile, "\n%%%%EndDocument\n"); else if (infont) - (void)fprintf(bitfile, "\n%%%%EndFont\n") ; + (void)fprintf(bitfile, "\n%%%%EndFont\n"); #ifdef HPS else if (noprocset) {} #endif else - (void)fprintf(bitfile, "\n%%%%EndProcSet\n") ; + (void)fprintf(bitfile, "\n%%%%EndProcSet\n"); } } } @@ -614,7 +614,7 @@ msdosdone: void copyfile(const char *s) { - copyfile_general(s, NULL) ; + copyfile_general(s, NULL); } /* @@ -624,9 +624,9 @@ copyfile(const char *s) void figcopyfile(char *s, int systemtype) { - infigure = systemtype ? 2 : 1 ; - copyfile(s) ; - infigure = 0 ; + infigure = systemtype ? 2 : 1; + copyfile(s); + infigure = 0; } /* * This next routine writes out a `special' character. In this case, @@ -637,29 +637,29 @@ void specialout(char c) { if (linepos >= LINELENGTH) { - (void)putc('\n', bitfile) ; - linepos = 0 ; + (void)putc('\n', bitfile); + linepos = 0; } - (void)putc(c, bitfile) ; - linepos++ ; - lastspecial = 1 ; + (void)putc(c, bitfile); + linepos++; + lastspecial = 1; } void stringend(void) { if (linepos + instring >= LINELENGTH - 2) { - (void)putc('\n', bitfile) ; - linepos = 0 ; + (void)putc('\n', bitfile); + linepos = 0; } - (void)putc('(', bitfile) ; - *strbp = 0 ; - (void)fputs(strbuffer, bitfile) ; - (void)putc(')', bitfile) ; - linepos += instring + 2 ; - lastspecial = 1 ; - instring = 0 ; - strbp = strbuffer ; + (void)putc('(', bitfile); + *strbp = 0; + (void)fputs(strbuffer, bitfile); + (void)putc(')', bitfile); + linepos += instring + 2; + lastspecial = 1; + instring = 0; + strbp = strbuffer; } #ifdef SHIFTLOWCHARS @@ -685,7 +685,7 @@ T1Char(int c) } } if (curfnt->chardesc[tmpchr].flags2 & EXISTS) - tmpchr = c ; + tmpchr = c; return tmpchr; } #endif @@ -699,8 +699,8 @@ scout(unsigned char c) /* string character out */ * instance. If it is too long, we send out the string. */ if (instring > LINELENGTH-6) { - stringend() ; - chrcmd('p') ; + stringend(); + chrcmd('p'); } #ifdef SHIFTLOWCHARS c=T1Char(c); @@ -709,11 +709,11 @@ scout(unsigned char c) /* string character out */ if (c<' ' || c > 126 || c=='%' ) { */ if ( c<0x20 || c>= 0x7F || c==0x25 ) { - *strbp++ = '\\' ; - *strbp++ = '0' + ((c >> 6) & 3) ; - *strbp++ = '0' + ((c >> 3) & 7) ; - *strbp++ = '0' + (c & 7) ; - instring += 4 ; + *strbp++ = '\\'; + *strbp++ = '0' + ((c >> 6) & 3); + *strbp++ = '0' + ((c >> 3) & 7); + *strbp++ = '0' + (c & 7); + instring += 4; } else { #ifdef VMCMS c = ascii2ebcdic[c]; @@ -723,12 +723,12 @@ scout(unsigned char c) /* string character out */ #endif #endif if (c == '(' || c == ')' || c == '\\') { - *strbp++ = '\\' ; - *strbp++ = c ; - instring += 2 ; + *strbp++ = '\\'; + *strbp++ = c; + instring += 2; } else { - *strbp++ = c ; - instring++ ; + *strbp++ = c; + instring++; } } } @@ -736,35 +736,35 @@ scout(unsigned char c) /* string character out */ static void scout2(int c) { - char s[64] ; + char s[64]; - sprintf(s, "<%04x>p", c) ; - cmdout(s) ; + sprintf(s, "<%04x>p", c); + cmdout(s); } void cmdout(const char *s) { - int l ; + int l; /* hack added by dorab */ if (instring) { stringend(); chrcmd('p'); } - l = strlen(s) ; + l = strlen(s); if ((! lastspecial && linepos >= LINELENGTH - 20) || linepos + l >= LINELENGTH) { - (void)putc('\n', bitfile) ; - linepos = 0 ; - lastspecial = 1 ; + (void)putc('\n', bitfile); + linepos = 0; + lastspecial = 1; } else if (! lastspecial) { - (void)putc(' ', bitfile) ; - linepos++ ; + (void)putc(' ', bitfile); + linepos++; } - (void)fputs(s, bitfile) ; - linepos += l ; - lastspecial = 0 ; + (void)fputs(s, bitfile); + linepos += l; + lastspecial = 0; } @@ -773,70 +773,70 @@ chrcmd(char c) { if ((! lastspecial && linepos >= LINELENGTH - 20) || linepos + 2 > LINELENGTH) { - (void)putc('\n', bitfile) ; - linepos = 0 ; - lastspecial = 1 ; + (void)putc('\n', bitfile); + linepos = 0; + lastspecial = 1; } else if (! lastspecial) { - (void)putc(' ', bitfile) ; - linepos++ ; + (void)putc(' ', bitfile); + linepos++; } - (void)putc(c, bitfile) ; - linepos++ ; - lastspecial = 0 ; + (void)putc(c, bitfile); + linepos++; + lastspecial = 0; } void floatout(float n) { - char buf[20] ; + char buf[20]; - (void)sprintf(buf, "%.2f", n) ; - cmdout(buf) ; + (void)sprintf(buf, "%.2f", n); + cmdout(buf); } void doubleout(double n) { - char buf[40] ; + char buf[40]; - (void)sprintf(buf, "%g", n) ; - cmdout(buf) ; + (void)sprintf(buf, "%g", n); + cmdout(buf); } void numout(integer n) { - char buf[10] ; + char buf[10]; #ifdef SHORTINT - (void)sprintf(buf, "%ld", n) ; + (void)sprintf(buf, "%ld", n); #else - (void)sprintf(buf, "%d", n) ; + (void)sprintf(buf, "%d", n); #endif - cmdout(buf) ; + cmdout(buf); } void mhexout(register unsigned char *p, register long len) { - register const char *hexchar = hxdata ; - register int n, k ; + register const char *hexchar = hxdata; + register int n, k; while (len > 0) { if (linepos > LINELENGTH - 2) { - (void)putc('\n', bitfile) ; - linepos = 0 ; + (void)putc('\n', bitfile); + linepos = 0; } - k = (LINELENGTH - linepos) >> 1 ; + k = (LINELENGTH - linepos) >> 1; if (k > len) - k = len ; - len -= k ; - linepos += (k << 1) ; + k = len; + len -= k; + linepos += (k << 1); while (k--) { - n = *p++ ; - (void)putc(hexchar[n >> 4], bitfile) ; - (void)putc(hexchar[n & 15], bitfile) ; + n = *p++; + (void)putc(hexchar[n >> 4], bitfile); + (void)putc(hexchar[n & 15], bitfile); } } } @@ -844,14 +844,14 @@ mhexout(register unsigned char *p, void fontout(int n) { - char buf[6] ; + char buf[6]; if (instring) { - stringend() ; - chrcmd('p') ; + stringend(); + chrcmd('p'); } - makepsname(buf, n) ; - cmdout(buf) ; + makepsname(buf, n); + cmdout(buf); } void @@ -859,54 +859,54 @@ hvpos(void) { if (rvv != vv) { if (instring) { - stringend() ; - numout(hh) ; - numout(vv) ; - chrcmd('y') ; + stringend(); + numout(hh); + numout(vv); + chrcmd('y'); } else if (rhh != hh) { - numout(hh) ; - numout(vv) ; - chrcmd('a') ; + numout(hh); + numout(vv); + chrcmd('a'); } else { /* hard to get this case, but it's there when you need it! */ - numout(vv - rvv) ; - chrcmd('x') ; + numout(vv - rvv); + chrcmd('x'); } - rvv = vv ; + rvv = vv; } else if (rhh != hh) { if (instring) { - stringend() ; + stringend(); if (hh - rhh < 5 && rhh - hh < 5) { #ifdef VMCMS /* should replace 'p' in non-VMCMS line as well */ - chrcmd(ascii2ebcdic[(char)(112 + hh - rhh)]) ; + chrcmd(ascii2ebcdic[(char)(112 + hh - rhh)]); #else #ifdef MVSXA /* should replace 'p' in non-MVSXA line as well */ - chrcmd(ascii2ebcdic[(char)(112 + hh - rhh)]) ; + chrcmd(ascii2ebcdic[(char)(112 + hh - rhh)]); #else - chrcmd((char)('p' + hh - rhh)) ; + chrcmd((char)('p' + hh - rhh)); #endif #endif } else if (hh - rhh < d + 5 && rhh - hh < 5 - d) { #ifdef VMCMS /* should replace 'g' in non-VMCMS line as well */ - chrcmd(ascii2ebcdic[(char)(103 + hh - rhh - d)]) ; + chrcmd(ascii2ebcdic[(char)(103 + hh - rhh - d)]); #else #ifdef MVSXA /* should replace 'g' in non-MVSXA line as well */ - chrcmd(ascii2ebcdic[(char)(103 + hh - rhh - d)]) ; + chrcmd(ascii2ebcdic[(char)(103 + hh - rhh - d)]); #else - chrcmd((char)('g' + hh - rhh - d)) ; + chrcmd((char)('g' + hh - rhh - d)); #endif #endif - d = hh - rhh ; + d = hh - rhh; } else { - numout(hh - rhh) ; - chrcmd('b') ; - d = hh - rhh ; + numout(hh - rhh); + chrcmd('b'); + d = hh - rhh; } } else { - numout(hh - rhh) ; - chrcmd('w') ; + numout(hh - rhh); + chrcmd('w'); } } - rhh = hh ; + rhh = hh; } /* @@ -917,18 +917,18 @@ void newline(void) { if (linepos != 0) { - (void)fprintf(bitfile, "\n") ; - linepos = 0 ; + (void)fprintf(bitfile, "\n"); + linepos = 0; } - lastspecial = 1 ; + lastspecial = 1; } void nlcmdout(const char *s) { - newline() ; - cmdout(s) ; - newline() ; + newline(); + cmdout(s); + newline(); } /* * Is the dimension close enough for a match? We use 5bp @@ -938,8 +938,8 @@ static int indelta(integer i) { if (i < 0) - i = -i ; - return (i <= 328909) ; + i = -i; + return (i <= 328909); } /* * A case-irrelevant string compare. @@ -948,20 +948,20 @@ int mlower(int c) { if ('A' <= c && c <= 'Z') - return c - 'A' + 'a' ; + return c - 'A' + 'a'; else - return c ; + return c; } int ncstrcmp(const char *a, const char *b) { while (*a && (*a == *b || mlower(*a) == mlower(*b))) - a++, b++ ; + a++, b++; if (*a == 0 && *b == 0) - return 0 ; + return 0; else - return 1 ; + return 1; } /* * Find the paper size. @@ -969,16 +969,16 @@ ncstrcmp(const char *a, const char *b) void findpapersize(void) { if (finpapsiz == 0) { - struct papsiz *ps ; - struct papsiz *fps = 0 ; - int ih, iv, it ; - int mindiff = 0x7fffffff ; + struct papsiz *ps; + struct papsiz *fps = 0; + int ih, iv, it; + int mindiff = 0x7fffffff; if (tryepsf && !landscape) { - finpapsiz = &defpapsiz ; - hpapersize = defpapsiz.xsize ; - vpapersize = defpapsiz.ysize ; - return ; + finpapsiz = &defpapsiz; + hpapersize = defpapsiz.xsize; + vpapersize = defpapsiz.ysize; + return; } if (cropmarks) { /* @@ -987,92 +987,92 @@ findpapersize(void) { */ if (hpapersize == 0 || vpapersize == 0) { error( - "warning: -k crop marks wanted, but no paper size specified; using default") ; + "warning: -k crop marks wanted, but no paper size specified; using default"); if (landscape) { - hpapersize = defpapsiz.ysize ; - vpapersize = defpapsiz.xsize ; + hpapersize = defpapsiz.ysize; + vpapersize = defpapsiz.xsize; } else { - hpapersize = defpapsiz.xsize ; - vpapersize = defpapsiz.ysize ; + hpapersize = defpapsiz.xsize; + vpapersize = defpapsiz.ysize; } } - hpapersize += 2368143L ; - vpapersize += 2368143L ; - add_header(CROPHEADER) ; + hpapersize += 2368143L; + vpapersize += 2368143L; + add_header(CROPHEADER); } if (paperfmt && *paperfmt) { for (ps = papsizes; ps; ps = ps->next) if (ncstrcmp(paperfmt, ps->name)==0) - finpapsiz = ps ; + finpapsiz = ps; if (finpapsiz == 0) - error("no match for papersize") ; + error("no match for papersize"); } if (finpapsiz == 0 && hpapersize > 0 && vpapersize > 0) { for (ps=papsizes; ps; ps = ps->next) { - ih = ps->xsize-hpapersize ; - iv = ps->ysize-vpapersize ; - if (ih < 0) ih = -ih ; - if (iv < 0) iv = -iv ; - it = ih ; - if (it < iv) it = iv ; + ih = ps->xsize-hpapersize; + iv = ps->ysize-vpapersize; + if (ih < 0) ih = -ih; + if (iv < 0) iv = -iv; + it = ih; + if (it < iv) it = iv; if (it < mindiff) { - mindiff = it ; - fps = ps ; + mindiff = it; + fps = ps; } } if (indelta(mindiff)) - landscape = 0 ; + landscape = 0; else - fps = 0 ; - mindiff = 0x7fffffff ; + fps = 0; + mindiff = 0x7fffffff; if (fps == 0) { for (ps=papsizes; ps; ps = ps->next) { - iv = ps->ysize-hpapersize ; - ih = ps->xsize-vpapersize ; - if (ih < 0) ih = -ih ; - if (iv < 0) iv = -iv ; - it = ih ; - if (it < iv) it = iv ; + iv = ps->ysize-hpapersize; + ih = ps->xsize-vpapersize; + if (ih < 0) ih = -ih; + if (iv < 0) iv = -iv; + it = ih; + if (it < iv) it = iv; if (it < mindiff) { - mindiff = it ; - fps = ps ; + mindiff = it; + fps = ps; } } if (indelta(mindiff)) - landscape = 1 ; + landscape = 1; else - fps = 0 ; + fps = 0; if (fps == 0) { for (ps=papsizes; ps; ps = ps->next) { if (ps->ysize == 0 && ps->xsize == 0) { - fps = ps ; - break ; + fps = ps; + break; } } if (fps == 0) { - landscape = (hpapersize > vpapersize) ; + landscape = (hpapersize > vpapersize); error( - "no match for special paper size found; using default") ; + "no match for special paper size found; using default"); } } } - finpapsiz = fps ; + finpapsiz = fps; } if (finpapsiz == 0) { if (papsizes) - finpapsiz = papsizes ; + finpapsiz = papsizes; else - finpapsiz = &defpapsiz ; + finpapsiz = &defpapsiz; /* * But change xsize/ysize to match so bounding box works. */ if (hpapersize && vpapersize) { if (landscape) { - finpapsiz->ysize = hpapersize ; - finpapsiz->xsize = vpapersize ; + finpapsiz->ysize = hpapersize; + finpapsiz->xsize = vpapersize; } else { - finpapsiz->xsize = hpapersize ; - finpapsiz->ysize = vpapersize ; + finpapsiz->xsize = hpapersize; + finpapsiz->ysize = vpapersize; } } } @@ -1083,15 +1083,15 @@ findpapersize(void) { */ if (hpapersize == 0 || vpapersize == 0) { if (finpapsiz->xsize == 0 || finpapsiz->ysize == 0) { - finpapsiz->xsize = defpapsiz.xsize ; - finpapsiz->ysize = defpapsiz.ysize ; + finpapsiz->xsize = defpapsiz.xsize; + finpapsiz->ysize = defpapsiz.ysize; } if (landscape) { - vpapersize = finpapsiz->xsize ; - hpapersize = finpapsiz->ysize ; + vpapersize = finpapsiz->xsize; + hpapersize = finpapsiz->ysize; } else { - hpapersize = finpapsiz->xsize ; - vpapersize = finpapsiz->ysize ; + hpapersize = finpapsiz->xsize; + vpapersize = finpapsiz->ysize; } /* * Here, there was a papersize special, but the selected paper @@ -1099,8 +1099,8 @@ findpapersize(void) { * bounding box works. */ } else if (finpapsiz->xsize == 0 || finpapsiz->ysize == 0) { - finpapsiz->xsize = hpapersize ; - finpapsiz->ysize = vpapersize ; + finpapsiz->xsize = hpapersize; + finpapsiz->ysize = vpapersize; /* * Here, the user specified a size with -t, and there was a * papersize special, and its sizes were greater than zero. @@ -1113,18 +1113,18 @@ findpapersize(void) { !indelta(hpapersize - finpapsiz->ysize)) { if (vpapersize > finpapsiz->xsize || hpapersize > finpapsiz->ysize) - error("warning: -t selected paper may be too small") ; + error("warning: -t selected paper may be too small"); else - error("note: -t selected paper may be too large") ; + error("note: -t selected paper may be too large"); } } else { if (!indelta(hpapersize - finpapsiz->xsize) || !indelta(vpapersize - finpapsiz->ysize)) { if (hpapersize > finpapsiz->xsize || vpapersize > finpapsiz->ysize) - error("warning: -t selected paper may be too small") ; + error("warning: -t selected paper may be too small"); else - error("note: -t selected paper may be too large") ; + error("note: -t selected paper may be too large"); } } } @@ -1138,8 +1138,8 @@ findpapersize(void) { static int topoints(integer i) { - i += 65780L ; - return (i / 6578176L)*100 + (i % 6578176) * 100 / 6578176 ; + i += 65780L; + return (i / 6578176L)*100 + (i % 6578176) * 100 / 6578176; } /* * Send out the special paper stuff. If `hed' is non-zero, only @@ -1148,25 +1148,25 @@ topoints(integer i) void paperspec(const char *s, int hed) { - int sendit ; + int sendit; while (*s) { - s++ ; + s++; if (*s == '\0') - return ; + return; if (*s == '!') { - s++ ; - while (*s == ' ') s++ ; - sendit = hed ; + s++; + while (*s == ' ') s++; + sendit = hed; } else - sendit = ! hed ; + sendit = ! hed; if (sendit) { while (*s && *s != '\n') - (void)putc(*s++, bitfile) ; - putc('\n', bitfile) ; + (void)putc(*s++, bitfile); + putc('\n', bitfile); } else { while (*s && *s != '\n') - s++ ; + s++; } } } @@ -1174,13 +1174,13 @@ char * epsftest(integer bop) { if (tryepsf && paperfmt == 0 && *iname) { - findbb(bop+44) ; - return nextstring ; + findbb(bop+44); + return nextstring; } - return 0 ; + return 0; } -static char *isepsf = 0 ; -static int endprologsent ; +static char *isepsf = 0; +static int endprologsent; void open_output(void) { FILE * pf = NULL; @@ -1191,26 +1191,26 @@ open_output(void) { */ if (*oname == '!' || *oname == '|') { #if defined (MSDOS) && !defined (__DJGPP__) - error("! can't open output pipe") ; + error("! can't open output pipe"); #else #ifdef VMS - error("! can't open output pipe") ; + error("! can't open output pipe"); #else #ifdef VMCMS - error("! can't open output pipe") ; + error("! can't open output pipe"); #else #ifdef MVSXA - error("! can't open output pipe") ; + error("! can't open output pipe"); #else #ifdef __THINK__ - error("! can't open output pipe") ; + error("! can't open output pipe"); #else #ifdef ATARIST - error("! can't open output pipe") ; + error("! can't open output pipe"); #else #ifdef OS2 if (_osmode != OS2_MODE) { - error("! can't open output pipe") ; + error("! can't open output pipe"); } else { #endif #ifdef __DJGPP__ @@ -1227,22 +1227,22 @@ open_output(void) { know about DOS-specific executable extensions, while we want to be able to find "lpr.exe", "lpr.com", "lpr.bat" etc. */ extern char *__dosexec_find_on_path(const char *, - char **, char *) ; - extern char **environ ; - char *p = oname + 1 ; - char found[FILENAME_MAX] ; + char **, char *); + extern char **environ; + char *p = oname + 1; + char found[FILENAME_MAX]; while (ISSPACE(*p)) - p++ ; + p++; if (strncmp(p, "lpr", 3) == 0 && (ISSPACE(p[3]) || p[3] == '\0') && !__dosexec_find_on_path(oname+1, (char **)0, found) && !__dosexec_find_on_path(oname+1, environ, found)) - pf = fopen("PRN", "w") ; + pf = fopen("PRN", "w"); #endif if (pf == NULL && (pf = popen(oname+1, "w")) != NULL) popened = 1; if (pf == NULL) - error("! couldn't open output pipe") ; + error("! couldn't open output pipe"); bitfile = pf; #ifdef OS2 } @@ -1255,53 +1255,53 @@ open_output(void) { #endif } else { if ((bitfile=fopen(oname,"w"))==NULL) - error("! couldn't open PostScript file") ; + error("! couldn't open PostScript file"); } } else { - bitfile = stdout ; + bitfile = stdout; } /* Even PostScript output may include binary characters, so switch bitfile to binary mode. */ if (O_BINARY && !isatty(fileno(bitfile))) - SET_BINARY(fileno(bitfile)) ; + SET_BINARY(fileno(bitfile)); } void initprinter(sectiontype *sect) { - void tell_needed_fonts() ; - int n = sect->numpages * pagecopies * collatedcopies ; + void tell_needed_fonts(); + int n = sect->numpages * pagecopies * collatedcopies; #ifdef HPS if (!HPS_FLAG) #endif - open_output() ; + open_output(); - findpapersize() ; + findpapersize(); if (disablecomments) { (void)fprintf(bitfile, - "%%!PS (but not EPSF; comments have been disabled)\n") ; - (void)fprintf(stderr, "Warning: no %%%%Page comments generated.\n") ; + "%%!PS (but not EPSF; comments have been disabled)\n"); + (void)fprintf(stderr, "Warning: no %%%%Page comments generated.\n"); } else { if (multiplesects) { (void)fprintf(bitfile, - "%%!PS (but not EPSF because of memory limits)\n") ; - (void)fprintf(stderr, "Warning: no %%%%Page comments generated.\n") ; + "%%!PS (but not EPSF because of memory limits)\n"); + (void)fprintf(stderr, "Warning: no %%%%Page comments generated.\n"); } else { - isepsf = epsftest(sect->bos) ; + isepsf = epsftest(sect->bos); if (isepsf) - (void)fprintf(bitfile, "%%!PS-Adobe-2.0 EPSF-2.0\n") ; + (void)fprintf(bitfile, "%%!PS-Adobe-2.0 EPSF-2.0\n"); else - (void)fprintf(bitfile, "%%!PS-Adobe-2.0\n") ; + (void)fprintf(bitfile, "%%!PS-Adobe-2.0\n"); } if (tryepsf && isepsf == 0) - error("We tried, but couldn't make it EPSF.") ; - (void)fprintf(bitfile, "%%%%Creator: %s\n", banner + 8) ; + error("We tried, but couldn't make it EPSF."); + (void)fprintf(bitfile, "%%%%Creator: %s\n", banner + 8); if (*iname) - (void)fprintf(bitfile, "%%%%Title: %s\n", iname) ; + (void)fprintf(bitfile, "%%%%Title: %s\n", iname); #ifdef CREATIONDATE jobtime=time(0); (void)fprintf(bitfile, "%%%%CreationDate: %s", - asctime(localtime(&jobtime))) ; + asctime(localtime(&jobtime))); #endif if (! isepsf) { /* @@ -1311,133 +1311,133 @@ initprinter(sectiontype *sect) * spoolers. */ (void)fprintf(bitfile, "%%%%Pages: %d%s\n", (sepfiles ? n : totalpages), - (reverse?" -1":"")) ; + (reverse?" -1":"")); (void)fprintf(bitfile, "%%%%PageOrder: %sscend\n", reverse?"De":"A"); } if (landscape) { - fprintf(bitfile, "%%%%Orientation: Landscape\n") ; + fprintf(bitfile, "%%%%Orientation: Landscape\n"); fprintf(bitfile, "%%%%BoundingBox: 0 0 %d %d\n", - topoints(finpapsiz->xsize), topoints(finpapsiz->ysize)) ; + topoints(finpapsiz->xsize), topoints(finpapsiz->ysize)); } else if (isepsf) - fprintf(bitfile, "%%%%BoundingBox: %s\n", isepsf) ; + fprintf(bitfile, "%%%%BoundingBox: %s\n", isepsf); else fprintf(bitfile, "%%%%BoundingBox: 0 0 %d %d\n", - topoints(finpapsiz->xsize), topoints(finpapsiz->ysize)) ; - tell_needed_fonts() ; - paperspec(finpapsiz->specdat, 1) ; - (void)fprintf(bitfile, "%%%%EndComments\n") ; + topoints(finpapsiz->xsize), topoints(finpapsiz->ysize)); + tell_needed_fonts(); + paperspec(finpapsiz->specdat, 1); + (void)fprintf(bitfile, "%%%%EndComments\n"); } { - int i, len ; - char *p ; + int i, len; + char *p; /* * Here, too, we have to be careful not to exceed the line length * limitation, if possible. */ - (void)fprintf(bitfile, "%%DVIPSWebPage: %s\n", banner2) ; - (void)fprintf(bitfile, "%%DVIPSCommandLine:") ; - len = 18 ; + (void)fprintf(bitfile, "%%DVIPSWebPage: %s\n", banner2); + (void)fprintf(bitfile, "%%DVIPSCommandLine:"); + len = 18; for (i=0; i<gargc; i++) { - p = gargv[i] ; + p = gargv[i]; while (*p > ' ') - p++ ; + p++; if (*p) - len += 2 ; - len += strlen(gargv[i]) + 1 ; + len += 2; + len += strlen(gargv[i]) + 1; if (len > LINELENGTH) { - (void)fprintf(bitfile, "\n%%+") ; - len = strlen(gargv[i]) + 3 ; + (void)fprintf(bitfile, "\n%%+"); + len = strlen(gargv[i]) + 3; if (*p) - len += 2 ; + len += 2; } - (void)fprintf(bitfile, (*p ? " \"%s\"" : " %s"), gargv[i]) ; + (void)fprintf(bitfile, (*p ? " \"%s\"" : " %s"), gargv[i]); } - (void)fprintf(bitfile, "\n%%DVIPSParameters: dpi=%d", actualdpi) ; + (void)fprintf(bitfile, "\n%%DVIPSParameters: dpi=%d", actualdpi); if (actualdpi != vactualdpi) - (void)fprintf(bitfile, "x%d", vactualdpi) ; + (void)fprintf(bitfile, "x%d", vactualdpi); if (compressed) - (void)fprintf(bitfile, ", compressed") ; + (void)fprintf(bitfile, ", compressed"); if (removecomments) - (void)fprintf(bitfile, ", comments removed") ; - (void)fputc('\n', bitfile) ; + (void)fprintf(bitfile, ", comments removed"); + (void)fputc('\n', bitfile); } #ifdef VMCMS /* convert preamblecomment to ebcdic so we can read it */ { - int i ; - for ( i=0 ; preamblecomment[i] ; i++ ) - preamblecomment[i] = ascii2ebcdic[preamblecomment[i]] ; + int i; + for ( i=0; preamblecomment[i]; i++ ) + preamblecomment[i] = ascii2ebcdic[preamblecomment[i]]; } #else #ifdef MVSXA /* IBM: MVS/XA */ { - int i ; - for ( i=0 ; preamblecomment[i] ; i++ ) - preamblecomment[i] = ascii2ebcdic[preamblecomment[i]] ; + int i; + for ( i=0; preamblecomment[i]; i++ ) + preamblecomment[i] = ascii2ebcdic[preamblecomment[i]]; } #endif /* VMCMS */ #endif - (void)fprintf(bitfile, "%%DVIPSSource: %s\n", preamblecomment) ; - linepos = 0 ; - endprologsent = 0 ; + (void)fprintf(bitfile, "%%DVIPSSource: %s\n", preamblecomment); + linepos = 0; + endprologsent = 0; if (safetyenclose) - (void)fprintf(bitfile, "/SafetyEnclosure save def\n") ; + (void)fprintf(bitfile, "/SafetyEnclosure save def\n"); if (! headers_off) - send_headers() ; + send_headers(); } void setup(void) { - newline() ; + newline(); if (endprologsent == 0 && !disablecomments) { - (void)fprintf(bitfile, "%%%%EndProlog\n") ; - (void)fprintf(bitfile, "%%%%BeginSetup\n") ; + (void)fprintf(bitfile, "%%%%EndProlog\n"); + (void)fprintf(bitfile, "%%%%BeginSetup\n"); if (vactualdpi == actualdpi) (void)fprintf(bitfile, "%%%%Feature: *Resolution %ddpi\n", - actualdpi) ; + actualdpi); else (void)fprintf(bitfile, "%%%%Feature: *Resolution %dx%ddpi\n", - actualdpi, vactualdpi) ; + actualdpi, vactualdpi); if (multiplesects && *(finpapsiz->specdat)) { - (void)fprintf(bitfile, "TeXDict begin\n") ; - paperspec(finpapsiz->specdat, 0) ; - (void)fprintf(bitfile, "end\n") ; + (void)fprintf(bitfile, "TeXDict begin\n"); + paperspec(finpapsiz->specdat, 0); + (void)fprintf(bitfile, "end\n"); } if (manualfeed) - (void)fprintf(bitfile, "%%%%Feature: *ManualFeed True\n") ; + (void)fprintf(bitfile, "%%%%Feature: *ManualFeed True\n"); #ifdef HPS if (!HPS_FLAG) #endif if (multiplesects) - (void)fprintf(bitfile, "%%%%EndSetup\n") ; + (void)fprintf(bitfile, "%%%%EndSetup\n"); } if (multiplesects && ! disablecomments) - (void)fprintf(bitfile, "%%DVIPSBeginSection\n") ; - cmdout("TeXDict") ; - cmdout("begin") ; + (void)fprintf(bitfile, "%%DVIPSBeginSection\n"); + cmdout("TeXDict"); + cmdout("begin"); if (endprologsent || disablecomments || multiplesects == 0) { - (void)fprintf(bitfile, "\n") ; - paperspec(finpapsiz->specdat, 0) ; + (void)fprintf(bitfile, "\n"); + paperspec(finpapsiz->specdat, 0); } - if (manualfeed) cmdout("@manualfeed") ; - if (landscape) cmdout("@landscape") ; + if (manualfeed) cmdout("@manualfeed"); + if (landscape) cmdout("@landscape"); if (numcopies != 1) { - numout((integer)numcopies) ; - cmdout("@copies") ; + numout((integer)numcopies); + cmdout("@copies"); } - cmdout("end") ; + cmdout("end"); if (endprologsent == 0 && !disablecomments) { - newline() ; - endprologsent = 1 ; + newline(); + endprologsent = 1; #ifdef HPS if (!HPS_FLAG) #endif if (! multiplesects) - (void)fprintf(bitfile, "%%%%EndSetup\n") ; + (void)fprintf(bitfile, "%%%%EndSetup\n"); } #ifdef HPS if (HPS_FLAG) { - fclose(bitfile) ; - set_bitfile("body.tmp",0) ; + fclose(bitfile); + set_bitfile("body.tmp",0); } #endif } @@ -1447,16 +1447,16 @@ setup(void) { void cleanprinter(void) { - (void)fprintf(bitfile, "\n") ; - (void)fprintf(bitfile, "userdict /end-hook known{end-hook}if\n") ; + (void)fprintf(bitfile, "\n"); + (void)fprintf(bitfile, "userdict /end-hook known{end-hook}if\n"); if (safetyenclose) - (void)fprintf(bitfile, "SafetyEnclosure restore\n") ; + (void)fprintf(bitfile, "SafetyEnclosure restore\n"); if (!disablecomments) - (void)fprintf(bitfile, "%%%%EOF\n") ; + (void)fprintf(bitfile, "%%%%EOF\n"); if (sendcontrolD) - (void)putc(4, bitfile) ; + (void)putc(4, bitfile); if (ferror(bitfile)) - error("Problems with file writing; probably disk full.") ; + error("Problems with file writing; probably disk full."); #if !defined(MSDOS) || defined(__DJGPP__) #ifndef VMS #ifndef MVSXA @@ -1467,7 +1467,7 @@ cleanprinter(void) if (_osmode == OS2_MODE) #endif if (popened) - (void)pclose(bitfile) ; + (void)pclose(bitfile); #endif #endif #endif @@ -1475,17 +1475,17 @@ cleanprinter(void) #endif #endif if (popened == 0) - (void)fclose(bitfile) ; - bitfile = NULL ; + (void)fclose(bitfile); + bitfile = NULL; } /* this tells dvips that it has no clue where it is. */ -static int thispage = 0 ; -static integer rulex, ruley ; +static int thispage = 0; +static integer rulex, ruley; void psflush(void) { - rulex = ruley = rhh = rvv = -314159265 ; - lastfont = -1 ; + rulex = ruley = rhh = rvv = -314159265; + lastfont = -1; } /* * pageinit initializes the output variables. @@ -1493,35 +1493,35 @@ psflush(void) { void pageinit(void) { - psflush() ; - newline() ; - thispage++ ; + psflush(); + newline(); + thispage++; if (!disablecomments) { if (multiplesects) #ifdef SHORTINT - (void)fprintf(bitfile, "%%DVIPSSectionPage: %ld\n", pagenum) ; + (void)fprintf(bitfile, "%%DVIPSSectionPage: %ld\n", pagenum); else if (! isepsf) - (void)fprintf(bitfile, "%%%%Page: %ld %d\n", pagenum, thispage) ; + (void)fprintf(bitfile, "%%%%Page: %ld %d\n", pagenum, thispage); #else - (void)fprintf(bitfile, "%%DVIPSSectionPage: %d\n", pagenum) ; + (void)fprintf(bitfile, "%%DVIPSSectionPage: %d\n", pagenum); else if (! isepsf) - (void)fprintf(bitfile, "%%%%Page: %d %d\n", pagenum, thispage) ; + (void)fprintf(bitfile, "%%%%Page: %d %d\n", pagenum, thispage); #endif } - linepos = 0 ; - cmdout("TeXDict") ; - cmdout("begin") ; + linepos = 0; + cmdout("TeXDict"); + cmdout("begin"); #ifdef HPS if (HPS_FLAG) { - cmdout("HPSdict") ; - cmdout("begin") ; + cmdout("HPSdict"); + cmdout("begin"); } #endif - if (landscape) cmdout("@landscape") ; - numout((integer)pagenum) ; - numout((integer)thispage-1) ; - cmdout("bop") ; - d = 0 ; + if (landscape) cmdout("@landscape"); + numout((integer)pagenum); + numout((integer)thispage-1); + cmdout("bop"); + d = 0; } @@ -1533,14 +1533,14 @@ void pageend(void) { if (instring) { - stringend() ; - chrcmd('p') ; + stringend(); + chrcmd('p'); } - cmdout("eop") ; - cmdout("end") ; + cmdout("eop"); + cmdout("end"); #ifdef HPS if (HPS_FLAG) - cmdout("end") ; + cmdout("end"); #endif } @@ -1554,16 +1554,16 @@ pageend(void) void drawrule(integer rw, integer rh) { - numout((integer)hh) ; - numout((integer)vv) ; + numout((integer)hh); + numout((integer)vv); if (rw == rulex && rh == ruley) - chrcmd('V') ; + chrcmd('V'); else { - numout((integer)rw) ; - numout((integer)rh) ; - chrcmd('v') ; - rulex = rw ; - ruley = rh ; + numout((integer)rw); + numout((integer)rh); + chrcmd('v'); + rulex = rw; + ruley = rh; } } @@ -1573,38 +1573,38 @@ drawrule(integer rw, integer rh) void drawchar(chardesctype *c, int cc) { - hvpos() ; + hvpos(); if (lastfont != curfnt->psname) { - fontout((int)curfnt->psname) ; - lastfont = curfnt->psname ; + fontout((int)curfnt->psname); + lastfont = curfnt->psname; } - if (curfnt->codewidth==1) scout((unsigned char)cc) ; - else scout2(cc) ; - rhh = hh + c->pixelwidth ; /* rvv = rv */ + if (curfnt->codewidth==1) scout((unsigned char)cc); + else scout2(cc); + rhh = hh + c->pixelwidth; /* rvv = rv */ } /* * This routine sends out the document fonts comment. */ void tell_needed_fonts(void) { - struct header_list *hl = ps_fonts_used ; - char *q ; - int roomleft = -1 ; + struct header_list *hl = ps_fonts_used; + char *q; + int roomleft = -1; if (hl == 0) - return ; + return; while (0 != (q=get_name(&hl))) { if ((int)strlen(q) >= roomleft) { if (roomleft != -1) { - fprintf(bitfile, "\n%%%%+") ; - roomleft = LINELENGTH - 3 ; + fprintf(bitfile, "\n%%%%+"); + roomleft = LINELENGTH - 3; } else { - fprintf(bitfile, "%%%%DocumentFonts:") ; - roomleft = LINELENGTH - 16 ; + fprintf(bitfile, "%%%%DocumentFonts:"); + roomleft = LINELENGTH - 16; } } - fprintf(bitfile, " %s", q) ; - roomleft -= strlen(q) + 1 ; + fprintf(bitfile, " %s", q); + roomleft -= strlen(q) + 1; } - fprintf(bitfile, "\n") ; + fprintf(bitfile, "\n"); } diff --git a/Build/source/texk/dvipsk/papersiz.c b/Build/source/texk/dvipsk/papersiz.c index 19304d5ab55..31143579aaa 100644 --- a/Build/source/texk/dvipsk/papersiz.c +++ b/Build/source/texk/dvipsk/papersiz.c @@ -19,14 +19,14 @@ static long scale(long whole, long num, long den, long sf) { - long v ; + long v; - v = whole * sf + num * (sf / den) ; + v = whole * sf + num * (sf / den); if (v / sf != whole || v < 0 || v > 0x40000000L) - error("! arithmetic overflow in parameter") ; - sf = sf % den ; - v += (sf * num * 2 + den) / (2 * den) ; - return(v) ; + error("! arithmetic overflow in parameter"); + sf = sf % den; + v += (sf * num * 2 + den) / (2 * den); + return(v); } /* * Convert a sequence of digits into a long; return -1 if no digits. @@ -35,28 +35,28 @@ scale(long whole, long num, long den, long sf) static long myatol(char **s) { - register char *p ; - register long result ; + register char *p; + register long result; - result = 0 ; - p = *s ; + result = 0; + p = *s; while ('0' <= *p && *p <= '9') { if (result > 100000000) - error("! arithmetic overflow in parameter") ; - result = 10 * result + *p++ - '0' ; + error("! arithmetic overflow in parameter"); + result = 10 * result + *p++ - '0'; } if (p == *s && *p == '.') { return 0; } else if (p == *s) { #ifdef KPATHSEA - error(concat3 ("expected number in ", *s, ", returning 10")) ; + error(concat3 ("expected number in ", *s, ", returning 10")); #else - error("expected number! returning 10") ; + error("expected number! returning 10"); #endif - return 10 ; + return 10; } else { - *s = p ; - return(result) ; + *s = p; + return(result); } } /* @@ -64,60 +64,60 @@ myatol(char **s) * defaults. Returns a value in scaled points. */ static long scalevals[] = { 1864680L, 65536L, 786432L, 186468L, - 1L, 65782L, 70124L, 841489L, 4736286L } ; -static const char *scalenames = "cmptpcmmspbpddccin" ; + 1L, 65782L, 70124L, 841489L, 4736286L }; +static const char *scalenames = "cmptpcmmspbpddccin"; long myatodim(char **s) { - register long w, num, den, sc ; - register const char *q ; - char *p ; - int negative = 0, i ; + register long w, num, den, sc; + register const char *q; + char *p; + int negative = 0, i; - p = *s ; + p = *s; if (**s == '-') { - p++ ; - negative = 1 ; + p++; + negative = 1; } - w = myatol(&p) ; + w = myatol(&p); if (w < 0) { - error("number too large; 1000 used") ; - w = 1000 ; + error("number too large; 1000 used"); + w = 1000; } - num = 0 ; - den = 1 ; + num = 0; + den = 1; if (*p == '.') { - p++ ; + p++; while ('0' <= *p && *p <= '9') { if (den <= 1000) { - den *= 10 ; - num = num * 10 + *p - '0' ; + den *= 10; + num = num * 10 + *p - '0'; } else if (den == 10000) { - den *= 2 ; - num = num * 2 + (*p - '0') / 5 ; + den *= 2; + num = num * 2 + (*p - '0') / 5; } - p++ ; + p++; } } while (*p == ' ') - p++ ; - for (i=0, q=scalenames; ; i++, q += 2) + p++; + for (i=0, q=scalenames;; i++, q += 2) if (*q == 0) { #ifdef KPATHSEA - error(concat3 ("expected units in ", *s, ", assuming inches.")) ; + error(concat3 ("expected units in ", *s, ", assuming inches.")); #else - error("expected units! assuming inches.") ; + error("expected units! assuming inches."); #endif - sc = scalevals[8] ; - break ; + sc = scalevals[8]; + break; } else if (*p == *q && p[1] == q[1]) { - sc = scalevals[i] ; - p += 2 ; - break ; + sc = scalevals[i]; + p += 2; + break; } - w = scale(w, num, den, sc) ; - *s = p ; - return(negative?-w:w) ; + w = scale(w, num, den, sc); + *s = p; + return(negative?-w:w); } /* * The routine where we handle the paper size special. We need to pass in @@ -127,9 +127,9 @@ void handlepapersize(char *p, integer *x, integer *y) { while (*p == ' ') - p++ ; - *x = myatodim(&p) ; + p++; + *x = myatodim(&p); while (*p == ' ' || *p == ',') - p++ ; - *y = myatodim(&p) ; + p++; + *y = myatodim(&p); } diff --git a/Build/source/texk/dvipsk/pprescan.c b/Build/source/texk/dvipsk/pprescan.c index 46fc67d6143..b733365b3e9 100644 --- a/Build/source/texk/dvipsk/pprescan.c +++ b/Build/source/texk/dvipsk/pprescan.c @@ -11,7 +11,7 @@ /* * We declare this to tell everyone we are prescanning early. */ -Boolean pprescan ; +Boolean pprescan; /* * When a font is selected during the pre-prescan, this routine makes sure * that the tfm or vf (but not pk) file is loaded. @@ -19,15 +19,15 @@ Boolean pprescan ; static void ppreselectfont(fontdesctype *f) { - int i ; + int i; - curfnt = f ; + curfnt = f; if (curfnt->loaded == 0) { if (!residentfont(curfnt)) if (!virtualfont(curfnt)) { for (i=0; i<256; i++) - curfnt->chardesc[i].flags = 0 ; - curfnt->loaded = 3 ; /* we're scanning for sizes */ + curfnt->chardesc[i].flags = 0; + curfnt->loaded = 3; /* we're scanning for sizes */ } } } @@ -37,90 +37,90 @@ ppreselectfont(fontdesctype *f) static void pscanpage(void) { - register shalfword cmd ; - register chardesctype *cd ; - register fontmaptype *cfnt = 0 ; - integer fnt ; - integer mychar ; - register frametype *frp = frames ; + register shalfword cmd; + register chardesctype *cd; + register fontmaptype *cfnt = 0; + integer fnt; + integer mychar; + register frametype *frp = frames; #ifdef DEBUG if (dd(D_PAGE)) #ifdef SHORTINT - (void)fprintf(stderr,"PPrescanning page %ld\n", pagenum) ; + (void)fprintf(stderr,"PPrescanning page %ld\n", pagenum); #else /* ~SHORTINT */ - (void)fprintf(stderr,"PPrescanning page %d\n", pagenum) ; + (void)fprintf(stderr,"PPrescanning page %d\n", pagenum); #endif /* ~SHORTINT */ #endif /* DEBUG */ - curfnt = NULL ; - curpos = NULL ; - bopcolor(0) ; + curfnt = NULL; + curpos = NULL; + bopcolor(0); while (1) { switch (cmd=dvibyte()) { case 130: case 131: case 135: case 136: case 139: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: /* unimplemented or illegal commands */ (void)sprintf(errbuf, - "! DVI file contains unexpected command (%d)",cmd) ; - error(errbuf) ; + "! DVI file contains unexpected command (%d)",cmd); + error(errbuf); case 132: case 137: /* eight-byte commands setrule, putrule */ - (void)dvibyte() ; - (void)dvibyte() ; - (void)dvibyte() ; - (void)dvibyte() ; + (void)dvibyte(); + (void)dvibyte(); + (void)dvibyte(); + (void)dvibyte(); case 146: case 151: case 156: case 160: case 165: case 170: /* four-byte commands right4, w4, x4, down4, y4, z4 */ - (void)dvibyte() ; + (void)dvibyte(); case 145: case 150: case 155: case 159: case 164: case 169: /* three-byte commands right3, w3, x3, down3, y3, z3 */ - (void)dvibyte() ; + (void)dvibyte(); case 144: case 149: case 154: case 158: case 163: case 168: /* two-byte commands right2, w2, x2, down2, y2, z2 */ - (void)dvibyte() ; + (void)dvibyte(); case 143: case 148: case 153: case 157: case 162: case 167: /* one-byte commands right1, w1, x1, down1, y1, z1 */ - (void)dvibyte() ; + (void)dvibyte(); case 147: case 152: case 161: case 166: /* w0, x0, y0, z0 */ case 138: case 141: case 142: /* nop, push, pop */ - break ; + break; case 134: case 129: /* set2, put2 */ if (noomega) { (void)sprintf(errbuf, - "! DVI file contains unexpected Omega command (%d)",cmd) ; - error(errbuf) ; + "! DVI file contains unexpected Omega command (%d)",cmd); + error(errbuf); } - mychar = dvibyte() ; mychar = (mychar << 8) + dvibyte() ; - goto dochar ; -case 133: case 128: cmd = dvibyte() ; /* set1, put1 commands drops through */ + mychar = dvibyte(); mychar = (mychar << 8) + dvibyte(); + goto dochar; +case 133: case 128: cmd = dvibyte(); /* set1, put1 commands drops through */ default: /* these are commands 0 (setchar0) thru 127 (setchar 127) */ - mychar = cmd ; + mychar = cmd; dochar: if (curfnt==NULL) - error("! Bad DVI file: no font selected") ; + error("! Bad DVI file: no font selected"); if (mychar>=curfnt->maxchars) { - (void)sprintf(errbuf,"! invalid char %d from font %s", mychar, curfnt->name) ; - error(errbuf) ; + (void)sprintf(errbuf,"! invalid char %d from font %s", mychar, curfnt->name); + error(errbuf); } if (curfnt->loaded == 2) { /* scanning a virtual font character */ - frp->curp = curpos ; - frp->curl = curlim ; - frp->ff = ffont ; - frp->curf = curfnt ; + frp->curp = curpos; + frp->curl = curlim; + frp->ff = ffont; + frp->curf = curfnt; if (++frp == &frames[MAXFRAME] ) - error("! virtual recursion stack overflow") ; + error("! virtual recursion stack overflow"); cd = curfnt->chardesc + mychar; if (cd->packptr == 0) - error("! a non-existent virtual char is being used; check vf/tfm files") ; - curpos = cd->packptr + 2 ; - curlim = curpos + (256*(long)(*cd->packptr)+(*(cd->packptr+1))) ; - ffont = curfnt->localfonts ; + error("! a non-existent virtual char is being used; check vf/tfm files"); + curpos = cd->packptr + 2; + curlim = curpos + (256*(long)(*cd->packptr)+(*(cd->packptr+1))); + ffont = curfnt->localfonts; if (ffont==NULL) - curfnt = NULL ; + curfnt = NULL; else - ppreselectfont(ffont->desc) ; + ppreselectfont(ffont->desc); } else if (curfnt->loaded == 3) - curfnt->chardesc[mychar].flags = EXISTS ; - break ; + curfnt->chardesc[mychar].flags = EXISTS; + break; case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: @@ -131,51 +131,51 @@ case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: /* font selection commands */ - if (cmd < 235) fnt = cmd - 171 ; /* fntnum0 thru fntnum63 */ + if (cmd < 235) fnt = cmd - 171; /* fntnum0 thru fntnum63 */ else { - fnt = dvibyte() ; /* fnt1 */ + fnt = dvibyte(); /* fnt1 */ while (cmd-- > 235) - fnt = (fnt << 8) + dvibyte() ; + fnt = (fnt << 8) + dvibyte(); } for (cfnt=ffont; cfnt; cfnt = cfnt->next) - if (cfnt->fontnum == fnt) goto fontfound ; - error("! no font selected") ; -fontfound: curfnt = cfnt->desc ; - ppreselectfont(curfnt) ; - break ; -case 239: predospecial((integer)dvibyte(), 1) ; break ; /* xxx1 */ -case 240: predospecial((integer)twobytes(), 1) ; break ; /* xxx2 */ -case 241: predospecial(threebytes(), 1) ; break ; /* xxx3 */ -case 242: predospecial(signedquad(), 1) ; break ; /* xxx4 */ -case 243: case 244: case 245: case 246: fontdef(cmd-242) ; break ; /* fntdef1 */ + if (cfnt->fontnum == fnt) goto fontfound; + error("! no font selected"); +fontfound: curfnt = cfnt->desc; + ppreselectfont(curfnt); + break; +case 239: predospecial((integer)dvibyte(), 1); break; /* xxx1 */ +case 240: predospecial((integer)twobytes(), 1); break; /* xxx2 */ +case 241: predospecial(threebytes(), 1); break; /* xxx3 */ +case 242: predospecial(signedquad(), 1); break; /* xxx4 */ +case 243: case 244: case 245: case 246: fontdef(cmd-242); break; /* fntdef1 */ case 140: /* eop or end of virtual char */ if (curpos) { - --frp ; - curfnt = frp->curf ; - ffont = frp->ff ; - curlim = frp->curl ; - curpos = frp->curp ; - break ; + --frp; + curfnt = frp->curf; + ffont = frp->ff; + curlim = frp->curl; + curpos = frp->curp; + break; } - return ; + return; } } } /* * Finally, here's our main pprescan routine. */ -static integer firstmatch = -1, lastmatch = -1 ; +static integer firstmatch = -1, lastmatch = -1; void pprescanpages(void) { - register int cmd ; - integer lmaxpages = maxpages ; - integer mpagenum ; - integer pageseq = 0 ; - int ntfirst = notfirst ; + register int cmd; + integer lmaxpages = maxpages; + integer mpagenum; + integer pageseq = 0; + int ntfirst = notfirst; - pprescan = 1 ; - readpreamble() ; + pprescan = 1; + readpreamble(); /* * Now we look for the first page to process. If we get to the end of * the file before the page, we complain (fatally). @@ -184,29 +184,29 @@ pprescanpages(void) * header that might be in skipped pages. */ while (1) { - cmd = skipnop() ; + cmd = skipnop(); if (cmd==248) - error("! End of document before first specified page") ; + error("! End of document before first specified page"); if (cmd!=139) - error("! Bad DVI file: expected bop") ; - pagenum = signedquad() ; - pageseq++ ; - mpagenum = abspage ? pageseq : pagenum ; + error("! Bad DVI file: expected bop"); + pagenum = signedquad(); + pageseq++; + mpagenum = abspage ? pageseq : pagenum; if (mpagenum == firstpage && ntfirst) - firstmatch++ ; + firstmatch++; if (mpagenum == lastpage && notlast) - lastmatch++ ; + lastmatch++; if (ntfirst && mpagenum == firstpage && firstmatch == firstseq) - ntfirst = 0 ; + ntfirst = 0; if (ntfirst || ((evenpages && (pagenum & 1)) || (oddpages && (pagenum & 1)==0) || (pagelist && !InPageList(pagenum)))) { - skipover(40) ; - skippage() ; + skipover(40); + skippage(); } else { if (notlast && mpagenum == lastpage) - lastmatch-- ; - break ; + lastmatch--; + break; } } /* @@ -214,28 +214,28 @@ pprescanpages(void) * the variables we need. We don't have to be as smart as before in * skipping pages. */ - skipover(40) ; + skipover(40); while (lmaxpages > 0) { if (!(evenpages && (pagenum & 1)) && !(oddpages && (pagenum & 1)==0) && !(pagelist && !InPageList(pagenum))) { - pscanpage() ; - lmaxpages-- ; + pscanpage(); + lmaxpages--; } else - skippage() ; - mpagenum = abspage ? pageseq : pagenum ; + skippage(); + mpagenum = abspage ? pageseq : pagenum; if (mpagenum == lastpage && notlast) - lastmatch++ ; + lastmatch++; if (notlast && mpagenum == lastpage && lastmatch == lastseq) - lmaxpages = -1 ; /* we are done after this page. */ - cmd=skipnop() ; - if (cmd==248) break ; + lmaxpages = -1; /* we are done after this page. */ + cmd=skipnop(); + if (cmd==248) break; if (cmd!=139) - error("! Bad DVI file: expected bop") ; - pagenum = signedquad() ; - skipover(40) ; - pageseq++ ; + error("! Bad DVI file: expected bop"); + pagenum = signedquad(); + skipover(40); + pageseq++; } - fseek(dvifile, 0L, 0) ; - pprescan = 0 ; + fseek(dvifile, 0L, 0); + pprescan = 0; } diff --git a/Build/source/texk/dvipsk/prescan.c b/Build/source/texk/dvipsk/prescan.c index 14ee51829e1..facdf9d7d08 100644 --- a/Build/source/texk/dvipsk/prescan.c +++ b/Build/source/texk/dvipsk/prescan.c @@ -14,58 +14,58 @@ void readpreamble(void) { - register int i ; - char *p ; + register int i; + char *p; - if (dvibyte()!=247) error("! Bad DVI file: first byte not preamble") ; - if (dvibyte()!=2) error("! Bad DVI file: id byte not 2") ; - num = signedquad() ; - den = signedquad() ; - if (overridemag > 0) (void)signedquad() ; - else if (overridemag < 0) mag = (mag * signedquad()) / 1000.0 ; - else mag = signedquad() ; - conv = (real) num * DPI * mag / ( den * 254000000.0 ) ; - vconv = (real) num * VDPI * mag / ( den * 254000000.0 ) ; - alpha = (((real)den / 7227.0) / 0x100000) * (25400000.0 / (real) num) ; - fsizetol = 1 + (integer)(DPI/(72270.0 * conv)) ; + if (dvibyte()!=247) error("! Bad DVI file: first byte not preamble"); + if (dvibyte()!=2) error("! Bad DVI file: id byte not 2"); + num = signedquad(); + den = signedquad(); + if (overridemag > 0) (void)signedquad(); + else if (overridemag < 0) mag = (mag * signedquad()) / 1000.0; + else mag = signedquad(); + conv = (real) num * DPI * mag / ( den * 254000000.0 ); + vconv = (real) num * VDPI * mag / ( den * 254000000.0 ); + alpha = (((real)den / 7227.0) / 0x100000) * (25400000.0 / (real) num); + fsizetol = 1 + (integer)(DPI/(72270.0 * conv)); if (!pprescan) { - for (i=dvibyte(),p=preamblecomment;i>0;i--,p++) *p=dvibyte() ; - *p='\0' ; + for (i=dvibyte(),p=preamblecomment;i>0;i--,p++) *p=dvibyte(); + *p='\0'; if (!quiet) { - (void)fprintf(stderr, "'") ; + (void)fprintf(stderr, "'"); #ifdef VMCMS /* IBM: VM/CMS */ - for(p=preamblecomment;*p;p++) (void)putc(ascii2ebcdic[*p], stderr) ; + for(p=preamblecomment;*p;p++) (void)putc(ascii2ebcdic[*p], stderr); #else #ifdef MVSXA /* IBM: MVS/XA */ - for(p=preamblecomment;*p;p++) (void)putc(ascii2ebcdic[*p], stderr) ; + for(p=preamblecomment;*p;p++) (void)putc(ascii2ebcdic[*p], stderr); #else - for(p=preamblecomment;*p;p++) (void)putc(*p, stderr) ; + for(p=preamblecomment;*p;p++) (void)putc(*p, stderr); #endif /* IBM: VM/CMS */ #endif - (void)fprintf(stderr, "' -> %s\n", oname) ; + (void)fprintf(stderr, "' -> %s\n", oname); } } else - skipover(dvibyte()) ; + skipover(dvibyte()); } /* * Finally, here's our main prescan routine. */ -static integer firstmatch = -1, lastmatch = -1 ; +static integer firstmatch = -1, lastmatch = -1; void prescanpages(void) { - register int cmd ; - short ret = 0 ; - register integer thispageloc, thissecloc ; - register fontdesctype *f ; - register shalfword c ; - register long thissectionmem = 0 ; - integer mpagenum ; - integer pageseq = 0 ; - int ntfirst = notfirst ; + register int cmd; + short ret = 0; + register integer thispageloc, thissecloc; + register fontdesctype *f; + register shalfword c; + register long thissectionmem = 0; + integer mpagenum; + integer pageseq = 0; + int ntfirst = notfirst; - readpreamble() ; + readpreamble(); /* * Now we look for the first page to process. If we get to the end of * the file before the page, we complain (fatally). @@ -74,38 +74,38 @@ prescanpages(void) * header that might be in skipped pages. */ while (1) { - cmd = skipnop() ; + cmd = skipnop(); if (cmd==248) - error("! End of document before first specified page") ; + error("! End of document before first specified page"); if (cmd!=139) - error("! Bad DVI file: expected bop") ; - thispageloc = ftell(dvifile) ; /* the location FOLLOWING the bop */ + error("! Bad DVI file: expected bop"); + thispageloc = ftell(dvifile); /* the location FOLLOWING the bop */ #ifdef DEBUG if (dd(D_PAGE)) #ifdef SHORTINT - (void)fprintf(stderr,"bop at %ld\n", thispageloc) ; + (void)fprintf(stderr,"bop at %ld\n", thispageloc); #else /* ~SHORTINT */ - (void)fprintf(stderr,"bop at %d\n", (int)thispageloc) ; + (void)fprintf(stderr,"bop at %d\n", (int)thispageloc); #endif /* ~SHORTINT */ #endif /* DEBUG */ - pagenum = signedquad() ; - pageseq++ ; - mpagenum = abspage ? pageseq : pagenum ; + pagenum = signedquad(); + pageseq++; + mpagenum = abspage ? pageseq : pagenum; if (mpagenum == firstpage && ntfirst) - firstmatch++ ; + firstmatch++; if (mpagenum == lastpage && notlast) - lastmatch++ ; + lastmatch++; if (ntfirst && mpagenum == firstpage && firstmatch == firstseq) - ntfirst = 0 ; + ntfirst = 0; if (ntfirst || ((evenpages && (pagenum & 1)) || (oddpages && (pagenum & 1)==0) || (pagelist && !InPageList(pagenum)))) { - skipover(40) ; - skippage() ; + skipover(40); + skippage(); } else { if (notlast && mpagenum == lastpage) - lastmatch-- ; - break ; + lastmatch--; + break; } } /* @@ -114,23 +114,23 @@ prescanpages(void) */ while (maxpages > 0 && cmd != 248) { for (f=fonthead; f; f=f->next) { - f->psname = 0 ; + f->psname = 0; if (f->loaded==1) for (c=255; c>=0; c--) - f->chardesc[c].flags &= (STATUSFLAGS) ; + f->chardesc[c].flags &= (STATUSFLAGS); } - fontmem = swmem - OVERCOST ; + fontmem = swmem - OVERCOST; if (fontmem <= 1000) - error("! Too little VM in printer") ; + error("! Too little VM in printer"); /* The section begins at the bop command just before thispageloc (which may * be a page that was aborted because the previous section overflowed memory). */ - pagecount = 0 ; - (void)fseek(dvifile, (long)thispageloc, 0) ; - pagenum = signedquad() ; - skipover(40) ; - thissecloc = thispageloc ; + pagecount = 0; + (void)fseek(dvifile, (long)thispageloc, 0); + pagenum = signedquad(); + skipover(40); + thissecloc = thispageloc; /* * Now we have the loop that actually scans the pages. The scanpage routine * returns 1 if the page scans okay; it returns 2 if the memory ran out @@ -139,53 +139,53 @@ prescanpages(void) * of memory. After each page, we mark the characters seen on that page * as seen for this section so that they will be downloaded. */ - ret = 0 ; + ret = 0; while (maxpages>0) { if (!(evenpages && (pagenum & 1)) && !(oddpages && (pagenum & 1)==0) && !(pagelist && !InPageList(pagenum))) { - ret = scanpage() ; + ret = scanpage(); if (ret == 0) - break ; - pagecount++ ; - maxpages-- ; + break; + pagecount++; + maxpages--; } else - skippage() ; - thissectionmem = swmem - fontmem - OVERCOST ; - mpagenum = abspage ? pageseq : pagenum ; - pageseq++ ; + skippage(); + thissectionmem = swmem - fontmem - OVERCOST; + mpagenum = abspage ? pageseq : pagenum; + pageseq++; if (mpagenum == lastpage && notlast) - lastmatch++ ; + lastmatch++; if (notlast && mpagenum == lastpage && lastmatch == lastseq) - maxpages = -1 ; /* we are done after this page. */ + maxpages = -1; /* we are done after this page. */ if (reverse) - thissecloc = thispageloc ; + thissecloc = thispageloc; for (f=fonthead; f; f=f->next) if (f->loaded==1) { if (f->psflag & THISPAGE) - f->psflag = PREVPAGE ; + f->psflag = PREVPAGE; for (c=255; c>=0; c--) if (f->chardesc[c].flags & THISPAGE) f->chardesc[c].flags = PREVPAGE | - (f->chardesc[c].flags & (STATUSFLAGS)) ; + (f->chardesc[c].flags & (STATUSFLAGS)); } - cmd=skipnop() ; - if (cmd==248) break ; + cmd=skipnop(); + if (cmd==248) break; if (cmd!=139) - error("! Bad DVI file: expected bop") ; - thispageloc = ftell(dvifile) ; + error("! Bad DVI file: expected bop"); + thispageloc = ftell(dvifile); #ifdef DEBUG if (dd(D_PAGE)) #ifdef SHORTINT - (void)fprintf(stderr,"bop at %ld\n", thispageloc) ; + (void)fprintf(stderr,"bop at %ld\n", thispageloc); #else /* ~SHORTINT */ - (void)fprintf(stderr,"bop at %d\n", (int)thispageloc) ; + (void)fprintf(stderr,"bop at %d\n", (int)thispageloc); #endif /* ~SHORTINT */ #endif /* DEBUG */ - pagenum = signedquad() ; - skipover(40) ; + pagenum = signedquad(); + skipover(40); if (ret==2 || (maxsecsize && pagecount >= maxsecsize)) - break ; + break; } /* * Now we have reached the end of a section for some reason. @@ -193,32 +193,32 @@ prescanpages(void) * and continue. */ if (pagecount>0) { - register int fc = 0 ; - register sectiontype *sp ; - register charusetype *cp ; + register int fc = 0; + register sectiontype *sp; + register charusetype *cp; - totalpages += pagecount ; + totalpages += pagecount; for (f=fonthead; f; f=f->next) if (f->loaded==1 && f->psname) - fc++ ; + fc++; sp = (sectiontype *)mymalloc((integer)(sizeof(sectiontype) + - fc * sizeof(charusetype) + sizeof(fontdesctype *))) ; - sp->bos = thissecloc ; + fc * sizeof(charusetype) + sizeof(fontdesctype *))); + sp->bos = thissecloc; if (reverse) { - sp->next = sections ; - sections = sp ; + sp->next = sections; + sections = sp; } else { - register sectiontype *p ; + register sectiontype *p; - sp->next = NULL ; + sp->next = NULL; if (sections == NULL) - sections = sp ; + sections = sp; else { - for (p=sections; p->next != NULL; p = p->next) ; - p->next = sp ; + for (p=sections; p->next != NULL; p = p->next); + p->next = sp; } } - sp->numpages = pagecount ; + sp->numpages = pagecount; #ifdef DEBUG if (dd(D_PAGE)) #ifdef SHORTINT @@ -226,29 +226,29 @@ prescanpages(void) #else /* ~SHORTINT */ (void)fprintf(stderr,"Have a section: %d pages at %d fontmem %d\n", #endif /* ~SHORTINT */ - (integer)pagecount, (integer)thissecloc, (integer)thissectionmem) ; + (integer)pagecount, (integer)thissecloc, (integer)thissectionmem); #endif /* DEBUG */ - cp = (charusetype *) (sp + 1) ; - fc = 0 ; + cp = (charusetype *) (sp + 1); + fc = 0; for (f=fonthead; f; f=f->next) if (f->loaded==1 && f->psname) { - register halfword b, bit ; + register halfword b, bit; - cp->psfused = (f->psflag & PREVPAGE) ; - f->psflag = 0 ; - cp->fd = f ; - c = 0 ; + cp->psfused = (f->psflag & PREVPAGE); + f->psflag = 0; + cp->fd = f; + c = 0; for (b=0; b<16; b++) { - cp->bitmap[b] = 0 ; + cp->bitmap[b] = 0; for (bit=32768; bit!=0; bit>>=1) { if (f->chardesc[c].flags & PREVPAGE) - cp->bitmap[b] |= bit ; - c++ ; + cp->bitmap[b] |= bit; + c++; } } - cp++ ; + cp++; } - cp->fd = NULL ; + cp->fd = NULL; } } } diff --git a/Build/source/texk/dvipsk/protos.h b/Build/source/texk/dvipsk/protos.h index 531c305d8f1..5c7c4300554 100644 --- a/Build/source/texk/dvipsk/protos.h +++ b/Build/source/texk/dvipsk/protos.h @@ -374,178 +374,178 @@ extern boolean t1_subset_2(char *, unsigned char *, char *); /* global variables from dopage.c */ #ifdef HPS -extern integer hhmem, vvmem ; -extern integer pushcount ; -extern Boolean PAGEUS_INTERUPPTUS ; -extern Boolean NEED_NEW_BOX ; +extern integer hhmem, vvmem; +extern integer pushcount; +extern Boolean PAGEUS_INTERUPPTUS; +extern Boolean NEED_NEW_BOX; #endif /* global variables from dosection.c */ #ifdef HPS -extern int pagecounter ; +extern int pagecounter; #endif /* global variables from dvips.c */ -extern char *downloadedpsnames[] ; -extern int unused_top_of_psnames ; -extern fontdesctype *fonthead ; -extern fontdesctype *curfnt ; -extern sectiontype *sections ; -extern Boolean partialdownload ; -extern Boolean manualfeed ; -extern Boolean compressed ; -extern Boolean downloadpspk ; -extern Boolean safetyenclose ; -extern Boolean removecomments ; -extern Boolean nosmallchars ; -extern Boolean cropmarks ; -extern Boolean abspage ; -extern Boolean tryepsf ; -extern int secure ; -extern int secure_option ; -extern int collatedcopies ; -extern integer pagecopies ; -extern shalfword linepos ; -extern integer maxpages ; -extern Boolean notfirst, notlast ; -extern Boolean evenpages, oddpages, pagelist ; -extern Boolean sendcontrolD ; -extern Boolean shiftlowchars ; -extern integer firstpage, lastpage ; -extern integer firstseq, lastseq ; -extern integer hpapersize, vpapersize ; -extern integer hoff, voff ; -extern integer maxsecsize ; -extern integer firstboploc ; -extern Boolean sepfiles ; -extern int numcopies ; -extern const char *oname ; -extern char *iname ; -extern char *fulliname ; -extern char *nextstring, *maxstring ; -extern FILE *dvifile, *bitfile ; -extern quarterword *curpos, *curlim ; -extern fontmaptype *ffont ; -extern real conv ; -extern real vconv ; -extern real alpha ; -extern double mag ; -extern integer num, den ; -extern int overridemag ; -extern int actualdpi, vactualdpi ; -extern int maxdrift, vmaxdrift ; -extern char *paperfmt ; -extern int landscape ; -extern integer fontmem ; -extern integer pagecount ; -extern integer pagenum ; -extern long bytesleft ; -extern quarterword *raster ; -extern integer hh, vv ; -extern Boolean noomega ; -extern const char *infont ; +extern char *downloadedpsnames[]; +extern int unused_top_of_psnames; +extern fontdesctype *fonthead; +extern fontdesctype *curfnt; +extern sectiontype *sections; +extern Boolean partialdownload; +extern Boolean manualfeed; +extern Boolean compressed; +extern Boolean downloadpspk; +extern Boolean safetyenclose; +extern Boolean removecomments; +extern Boolean nosmallchars; +extern Boolean cropmarks; +extern Boolean abspage; +extern Boolean tryepsf; +extern int secure; +extern int secure_option; +extern int collatedcopies; +extern integer pagecopies; +extern shalfword linepos; +extern integer maxpages; +extern Boolean notfirst, notlast; +extern Boolean evenpages, oddpages, pagelist; +extern Boolean sendcontrolD; +extern Boolean shiftlowchars; +extern integer firstpage, lastpage; +extern integer firstseq, lastseq; +extern integer hpapersize, vpapersize; +extern integer hoff, voff; +extern integer maxsecsize; +extern integer firstboploc; +extern Boolean sepfiles; +extern int numcopies; +extern const char *oname; +extern char *iname; +extern char *fulliname; +extern char *nextstring, *maxstring; +extern FILE *dvifile, *bitfile; +extern quarterword *curpos, *curlim; +extern fontmaptype *ffont; +extern real conv; +extern real vconv; +extern real alpha; +extern double mag; +extern integer num, den; +extern int overridemag; +extern int actualdpi, vactualdpi; +extern int maxdrift, vmaxdrift; +extern char *paperfmt; +extern int landscape; +extern integer fontmem; +extern integer pagecount; +extern integer pagenum; +extern long bytesleft; +extern quarterword *raster; +extern integer hh, vv; +extern Boolean noomega; +extern const char *infont; #ifndef KPATHSEA -extern char *tfmpath ; -extern char *pkpath ; -extern char *vfpath ; -extern char *figpath ; -extern char *headerpath ; -extern char *configpath ; -extern char *pictpath ; +extern char *tfmpath; +extern char *pkpath; +extern char *vfpath; +extern char *figpath; +extern char *headerpath; +extern char *configpath; +extern char *pictpath; #ifdef SEARCH_SUBDIRECTORIES -extern char *fontsubdirpath ; +extern char *fontsubdirpath; #endif #endif /* ! KPATHSEA */ #ifdef FONTLIB -extern char *flipath ; -extern char *fliname ; +extern char *flipath; +extern char *fliname; #endif -extern integer swmem ; -extern int quiet ; -extern int filter ; -extern int dvips_debug_flag ; -extern int prettycolumn ; -extern int gargc ; -extern char **gargv ; -extern int totalpages ; -extern Boolean reverse ; -extern Boolean usesPSfonts ; -extern Boolean usesspecial ; -extern Boolean headers_off ; -extern Boolean usescolor ; -extern char *warningmsg ; -extern Boolean multiplesects ; -extern Boolean disablecomments ; -extern char *printer ; -extern char *mfmode ; -extern char *mflandmode ; +extern integer swmem; +extern int quiet; +extern int filter; +extern int dvips_debug_flag; +extern int prettycolumn; +extern int gargc; +extern char **gargv; +extern int totalpages; +extern Boolean reverse; +extern Boolean usesPSfonts; +extern Boolean usesspecial; +extern Boolean headers_off; +extern Boolean usescolor; +extern char *warningmsg; +extern Boolean multiplesects; +extern Boolean disablecomments; +extern char *printer; +extern char *mfmode; +extern char *mflandmode; extern int mfmode_option; extern int oname_option; -extern frametype frames[] ; -extern integer pagecost ; -extern integer fsizetol ; -extern Boolean includesfonts ; -extern fontdesctype *fonthd[MAXFONTHD] ; -extern int nextfonthd ; -extern char xdig[256] ; -extern char banner[], banner2[] ; -extern Boolean noenv ; -extern Boolean dopprescan ; -extern int dontmakefont ; -extern struct papsiz *papsizes ; -extern int headersready ; +extern frametype frames[]; +extern integer pagecost; +extern integer fsizetol; +extern Boolean includesfonts; +extern fontdesctype *fonthd[MAXFONTHD]; +extern int nextfonthd; +extern char xdig[256]; +extern char banner[], banner2[]; +extern Boolean noenv; +extern Boolean dopprescan; +extern int dontmakefont; +extern struct papsiz *papsizes; +extern int headersready; #if defined(MSDOS) || defined(OS2) || defined(ATARIST) -extern char *mfjobname ; -extern FILE *mfjobfile ; +extern char *mfjobname; +extern FILE *mfjobfile; #endif #ifdef DEBUG -extern integer debug_flag ; +extern integer debug_flag; #endif #ifdef HPS -extern Boolean HPS_FLAG ; +extern Boolean HPS_FLAG; #endif /* global variables from flib.c */ #ifdef FONTLIB -extern Boolean flib ; +extern Boolean flib; #endif /* global variables from hps.c */ #ifdef HPS -extern Boolean inHTMLregion ; -extern integer HREF_COUNT ; -extern int current_pushcount ; -extern Boolean noprocset ; +extern Boolean inHTMLregion; +extern integer HREF_COUNT; +extern int current_pushcount; +extern Boolean noprocset; #endif /* global variables from loadfont.c */ -extern char errbuf[1000] ; -extern int lastresortsizes[40] ; -extern FILE *pkfile ; +extern char errbuf[1000]; +extern int lastresortsizes[40]; +extern FILE *pkfile; /* global variables from output.c */ -extern char preamblecomment[256] ; +extern char preamblecomment[256]; /* global variables from pprescan.c */ -extern Boolean pprescan ; +extern Boolean pprescan; /* global variables from repack.c */ -extern long mbytesleft ; -extern quarterword *mraster ; +extern long mbytesleft; +extern quarterword *mraster; /* global variables from resident.c */ -extern struct header_list *ps_fonts_used ; -extern const char *psmapfile ; +extern struct header_list *ps_fonts_used; +extern const char *psmapfile; /* global variables from search.c */ -extern int to_close ; +extern int to_close; #ifdef KPATHSEA -extern char *realnameoffile ; +extern char *realnameoffile; #else -extern char realnameoffile[] ; +extern char realnameoffile[]; #endif /* global variables from tfmload.c */ -extern FILE *tfmfile ; +extern FILE *tfmfile; #endif diff --git a/Build/source/texk/dvipsk/protos_add.h b/Build/source/texk/dvipsk/protos_add.h index 21b165c1679..59d5c7e3b65 100644 --- a/Build/source/texk/dvipsk/protos_add.h +++ b/Build/source/texk/dvipsk/protos_add.h @@ -11,11 +11,11 @@ /* global variables from dopage.c */ extern struct dvistack { - integer hh, vv ; - integer h, v, w, x, y, z ; -} stack[] ; + integer hh, vv; + integer h, v, w, x, y, z; +} stack[]; /* global variables from loadfont.c */ -extern char name[] ; +extern char name[]; #endif diff --git a/Build/source/texk/dvipsk/repack.c b/Build/source/texk/dvipsk/repack.c index b5ed17b19a1..b8c4afa58e3 100644 --- a/Build/source/texk/dvipsk/repack.c +++ b/Build/source/texk/dvipsk/repack.c @@ -34,24 +34,24 @@ #define ADVXCHG2END CMD(13) #define END CMD(14) -static int rowlength = -1 ; -static unsigned char *specdata ; -static long tslen = 0 ; -static unsigned char *tempstore, *tsp, *tsend ; +static int rowlength = -1; +static unsigned char *specdata; +static long tslen = 0; +static unsigned char *tempstore, *tsp, *tsend; void putlong(register char *a, long i) { - a[0] = i >> 24 ; - a[1] = i >> 16 ; - a[2] = i >> 8 ; - a[3] = i ; + a[0] = i >> 24; + a[1] = i >> 16; + a[2] = i >> 8; + a[3] = i; } long getlong(register unsigned char *a) { - return ((((((a[0] << 8L) + a[1]) << 8L) + a[2]) << 8L) + a[3]) ; + return ((((((a[0] << 8L) + a[1]) << 8L) + a[2]) << 8L) + a[3]); } /* First, a routine that appends one byte to the compressed output. */ @@ -61,25 +61,25 @@ getlong(register unsigned char *a) static void addts(register unsigned char what) { - register unsigned char *p, *q ; + register unsigned char *p, *q; if (tsp >= tsend) { if (tempstore == NULL) { - tslen = 2020 ; - tempstore = (unsigned char *)mymalloc((integer)tslen) ; - tsp = tempstore ; + tslen = 2020; + tempstore = (unsigned char *)mymalloc((integer)tslen); + tsp = tempstore; } else { - tslen = 2 * tslen ; - tsp = (unsigned char *)mymalloc((integer)tslen) ; + tslen = 2 * tslen; + tsp = (unsigned char *)mymalloc((integer)tslen); for (p=tempstore, q=tsp; p<tsend; p++, q++) - *q = *p ; - free((char *)tempstore) ; - tempstore = tsp ; - tsp = q ; + *q = *p; + free((char *)tempstore); + tempstore = tsp; + tsp = q; } - tsend = tempstore + tslen ; + tsend = tempstore + tslen; } - *tsp++ = what ; + *tsp++ = what; } /* Next, a routine that discovers how to do the compression. */ @@ -104,249 +104,249 @@ addts(register unsigned char what) void dochar(unsigned char *from, short width, short height) { - register int i ; - register unsigned char *f, *t, *d ; - register unsigned char *e ; - register int accum ; - int j, k, kk ; - int diffrow ; - int repeatcount ; - int lit, pos, cmd = 0 ; - long lcm ; - int widthc ; + register int i; + register unsigned char *f, *t, *d; + register unsigned char *e; + register int accum; + int j, k, kk; + int diffrow; + int repeatcount; + int lit, pos, cmd = 0; + long lcm; + int widthc; - widthc = width + (width & 1) ; /* halfword correction */ - lcm = -1 ; + widthc = width + (width & 1); /* halfword correction */ + lcm = -1; if (widthc > rowlength) { if (rowlength > 0) - free((char *)specdata) ; - rowlength = widthc + 30 ; - specdata = (unsigned char *)mymalloc((integer)(rowlength + 15)) ; + free((char *)specdata); + rowlength = widthc + 30; + specdata = (unsigned char *)mymalloc((integer)(rowlength + 15)); } for (i= -15, t=specdata; i<=widthc; i++, t++) - *t = 0 ; - repeatcount = 0 ; - f = specdata + 2 ; + *t = 0; + repeatcount = 0; + f = specdata + 2; for (j=0; j<height; j++, f = from, from += widthc) { - diffrow = 0 ; + diffrow = 0; for (i=0, t=from, d=specdata; i<width; i++, f++, t++, d++) { if (*f == *t) { if (*t == 0) - *d = WHTPOSSIB ; + *d = WHTPOSSIB; else if (*t == 255) - *d = BLKPOSSIB ; + *d = BLKPOSSIB; else - *d = 0 ; + *d = 0; } else { - accum = DIFFERENT ; + accum = DIFFERENT; if (rsh(*f, *t)) - accum |= RSHPOSSIB ; + accum |= RSHPOSSIB; else if (lsh(*f, *t)) - accum |= LSHPOSSIB ; + accum |= LSHPOSSIB; if (*t == 0) - accum |= WHTPOSSIB ; + accum |= WHTPOSSIB; else if (*t == 255) - accum |= BLKPOSSIB ; - *d = accum ; - diffrow++ ; + accum |= BLKPOSSIB; + *d = accum; + diffrow++; } } /* end 'for i' */ - *d = ENDROW ; + *d = ENDROW; if (diffrow == 0) { - repeatcount++ ; + repeatcount++; } else { if (repeatcount) { while (repeatcount > MAXOUT) { - addts((unsigned char)(REPX+MAXOUT)) ; - repeatcount -= MAXOUT ; + addts((unsigned char)(REPX+MAXOUT)); + repeatcount -= MAXOUT; } - addts((unsigned char)(REPX+repeatcount)) ; - repeatcount = 0 ; + addts((unsigned char)(REPX+repeatcount)); + repeatcount = 0; } - pos = 0 ; + pos = 0; for (i=0, d=specdata, f=t-width; i<width;) { if ((*d & DIFFERENT) == 0) { - i++ ; - d++ ; - f++ ; + i++; + d++; + f++; } else { - accum = 0 ; + accum = 0; if (pos != i) - lit = NOSHIFT(*d) ; + lit = NOSHIFT(*d); else /* N.B.: 'lit' does not imply literate programming here */ - lit = NOPOSSIB(*d) ; - for (e=d; ;e++) { + lit = NOPOSSIB(*d); + for (e=d;;e++) { if (NOPOSSIB(*e)) - lit = 1 ; + lit = 1; if ((*e & DIFFERENT) == 0) - break ; + break; if ((*e & WHTPOSSIB) && (e[1] & WHTPOSSIB)) { while (*e & WHTPOSSIB) { - e++ ; - accum++ ; + e++; + accum++; } - cmd = CLRX ; - e -= accum ; - break ; + cmd = CLRX; + e -= accum; + break; } else if ((*e & BLKPOSSIB) && (e[1] & BLKPOSSIB)) { while (*e & BLKPOSSIB) { - e++ ; - accum++ ; + e++; + accum++; } - cmd = SETX ; - e -= accum ; - break ; + cmd = SETX; + e -= accum; + break; } } /* end 'for e'; d pts to first bad byte, e to next good one */ while (i - pos > MAXOUT) { - addts((unsigned char)(ADVX+MAXOUT)) ; - pos += MAXOUT ; + addts((unsigned char)(ADVX+MAXOUT)); + pos += MAXOUT; } if (0 != (k = (e - d))) { if (lit) { if (k > 2) { if (i > pos) { - addts((unsigned char)(ADVX + i - pos)) ; - pos = i ; + addts((unsigned char)(ADVX + i - pos)); + pos = i; } while (k > MAXOUT) { - addts((unsigned char)(CHGX + MAXOUT)) ; + addts((unsigned char)(CHGX + MAXOUT)); for (kk=0; kk<MAXOUT; kk++) - addts((unsigned char)(*f++)) ; - d += MAXOUT ; - pos += MAXOUT ; - i += MAXOUT ; - k -= MAXOUT ; + addts((unsigned char)(*f++)); + d += MAXOUT; + pos += MAXOUT; + i += MAXOUT; + k -= MAXOUT; } - addtse((unsigned char)(CHGX + k)) ; - pos += k ; + addtse((unsigned char)(CHGX + k)); + pos += k; for (; d<e; d++, i++, f++) - addts((unsigned char)(*f)) ; + addts((unsigned char)(*f)); } else { if (k == 1) { if (i == pos+MAXOUT) { - addts((unsigned char)(ADVX + MAXOUT)) ; - pos = i ; + addts((unsigned char)(ADVX + MAXOUT)); + pos = i; } - addtse((unsigned char)(ADVXCHG1 + i - pos)) ; - addts((unsigned char)(*f)) ; - i++ ; - pos = i ; - d++ ; - f++ ; + addtse((unsigned char)(ADVXCHG1 + i - pos)); + addts((unsigned char)(*f)); + i++; + pos = i; + d++; + f++; } else { if (i == pos+MAXOUT) { - addts((unsigned char)(ADVX + MAXOUT)) ; - pos = i ; + addts((unsigned char)(ADVX + MAXOUT)); + pos = i; } - addtse((unsigned char)(ADVXCHG2 + i - pos)) ; - addts((unsigned char)(*f)) ; - addts((unsigned char)(f[1])) ; - i += 2 ; - pos = i ; - d += 2 ; - f += 2 ; + addtse((unsigned char)(ADVXCHG2 + i - pos)); + addts((unsigned char)(*f)); + addts((unsigned char)(f[1])); + i += 2; + pos = i; + d += 2; + f += 2; } } } else { while (e > d) { if (*d & LSHPOSSIB) { if (i == pos+MAXOUT) { - addts((unsigned char)(ADVX + MAXOUT)) ; - pos = i ; + addts((unsigned char)(ADVX + MAXOUT)); + pos = i; } - addtse((unsigned char)(ADVXLSH + i - pos)) ; + addtse((unsigned char)(ADVXLSH + i - pos)); } else if (*d & RSHPOSSIB) { if (i == pos+MAXOUT) { - addts((unsigned char)(ADVX + MAXOUT)) ; - pos = i ; + addts((unsigned char)(ADVX + MAXOUT)); + pos = i; } - addtse((unsigned char)(ADVXRSH + i - pos)) ; + addtse((unsigned char)(ADVXRSH + i - pos)); } else if (*d & WHTPOSSIB) { /* i==pos */ - addts((unsigned char)(CLRX + 1)) ; lcm = -1 ; + addts((unsigned char)(CLRX + 1)); lcm = -1; } else if (*d & BLKPOSSIB) { /* i==pos */ - addts((unsigned char)(SETX + 1)) ; lcm = -1 ; + addts((unsigned char)(SETX + 1)); lcm = -1; } else - error("! bug") ; /* why wasn't lit true? */ - d++ ; - f++ ; - i++ ; - pos = i ; + error("! bug"); /* why wasn't lit true? */ + d++; + f++; + i++; + pos = i; } /* end 'while e>d' */ } } /* end 'if e>d' */ if (accum > 0) { if (i > pos) { - addts((unsigned char)(ADVX + i - pos)) ; - pos = i ; + addts((unsigned char)(ADVX + i - pos)); + pos = i; } - i += accum ; - d += accum ; - f += accum ; + i += accum; + d += accum; + f += accum; while (accum > MAXOUT) { - addts((unsigned char)(cmd + MAXOUT)) ; - accum -= MAXOUT ; - pos += MAXOUT ; + addts((unsigned char)(cmd + MAXOUT)); + accum -= MAXOUT; + pos += MAXOUT; } - lcm = -1 ; - addts((unsigned char)(cmd + accum)) ; - pos += accum ; + lcm = -1; + addts((unsigned char)(cmd + accum)); + pos += accum; } } /* end 'else DIFFERENT' */ } /* end 'for i' */ if (lcm != -1) { - tempstore[lcm] += MAXOUT ; /* append END */ - lcm = -1 ; + tempstore[lcm] += MAXOUT; /* append END */ + lcm = -1; } else { - addts((unsigned char)(END)) ; + addts((unsigned char)(END)); } } /* end 'else rows different' */ #ifdef DEBUG if (d != specdata + width) - error("! internal inconsistency in repack") ; + error("! internal inconsistency in repack"); #endif } /* end 'for j' */ if (repeatcount) { while (repeatcount > MAXOUT) { - addts((unsigned char)(REPX+MAXOUT)) ; - repeatcount -= MAXOUT ; + addts((unsigned char)(REPX+MAXOUT)); + repeatcount -= MAXOUT; } - addts((unsigned char)(REPX+repeatcount)) ; - repeatcount = 0 ; + addts((unsigned char)(REPX+repeatcount)); + repeatcount = 0; } } -long mbytesleft ; -quarterword *mraster ; +long mbytesleft; +quarterword *mraster; char * makecopy(register unsigned char *what, register long len, register unsigned char *p) { - register unsigned char *q ; + register unsigned char *q; if (p == NULL) { if (len > MINCHUNK) - p = (unsigned char *)mymalloc((integer)len) ; + p = (unsigned char *)mymalloc((integer)len); else { if (bytesleft < len) { - raster = (quarterword *)mymalloc((integer)RASTERCHUNK) ; - bytesleft = RASTERCHUNK ; + raster = (quarterword *)mymalloc((integer)RASTERCHUNK); + bytesleft = RASTERCHUNK; } - p = (unsigned char *)raster ; - bytesleft -= len ; - raster += len ; + p = (unsigned char *)raster; + bytesleft -= len; + raster += len; } } - q = p ; + q = p; while (len > 0) { - *p++ = *what++ ; - len -- ; + *p++ = *what++; + len --; } - return ((char *)q) ; + return ((char *)q); } /* Now the main routine, which is called when a character is used @@ -354,95 +354,95 @@ makecopy(register unsigned char *what, void repack(register chardesctype *cp) { - register long i, j ; - register unsigned char *p ; - register int width, height ; - register int wwidth ; - char startbytes ; - int smallchar ; + register long i, j; + register unsigned char *p; + register int width, height; + register int wwidth; + char startbytes; + int smallchar; - p = cp->packptr ; + p = cp->packptr; if (p == NULL) - error("! no raster?") ; - tsp = tempstore ; - tsend = tempstore + tslen ; - addts(*p) ; /* copy the PK flag byte */ + error("! no raster?"); + tsp = tempstore; + tsend = tempstore + tslen; + addts(*p); /* copy the PK flag byte */ if (*p & 4) { if ((*p & 7) == 7) { - startbytes = 17 ; - width = getlong(p + 1) ; - height = getlong(p + 5) ; + startbytes = 17; + width = getlong(p + 1); + height = getlong(p + 5); for (i=0; i<12; i++) - addts(*++p) ; + addts(*++p); } else { - startbytes = 9 ; - width = p[1] * 256 + p[2] ; - height = p[3] * 256 + p[4] ; - addts(*++p) ; - addts(*++p) ; - addts(*++p) ; - addts(*++p) ; + startbytes = 9; + width = p[1] * 256 + p[2]; + height = p[3] * 256 + p[4]; + addts(*++p); + addts(*++p); + addts(*++p); + addts(*++p); } } else { - startbytes = 5 ; - width = p[1] ; - height = p[2] ; + startbytes = 5; + width = p[1]; + height = p[2]; } - addts(*++p) ; - addts(*++p) ; - addts(*++p) ; - addts(*++p) ; - p++ ; /* OK, p now points to beginning of the nibbles */ - addts((unsigned char)0) ; - addts((unsigned char)0) ; - addts((unsigned char)0) ; - addts((unsigned char)0) ; /* leave room to stick in a new length field */ - wwidth = (width + 15) / 16 ; - i = 2 * height * (long)wwidth ; + addts(*++p); + addts(*++p); + addts(*++p); + addts(*++p); + p++; /* OK, p now points to beginning of the nibbles */ + addts((unsigned char)0); + addts((unsigned char)0); + addts((unsigned char)0); + addts((unsigned char)0); /* leave room to stick in a new length field */ + wwidth = (width + 15) / 16; + i = 2 * height * (long)wwidth; if (i <= 0) - i = 2 ; + i = 2; if ((cp->flags & BIGCHAR) == 0) - smallchar = 5 ; + smallchar = 5; else - smallchar = 0 ; - i += smallchar ; + smallchar = 0; + i += smallchar; if (mbytesleft < i) { if (mbytesleft >= RASTERCHUNK) - (void) free((char *) mraster) ; + (void) free((char *) mraster); if (RASTERCHUNK > i) { - mraster = (quarterword *)mymalloc((integer)RASTERCHUNK) ; - mbytesleft = RASTERCHUNK ; + mraster = (quarterword *)mymalloc((integer)RASTERCHUNK); + mbytesleft = RASTERCHUNK; } else { - i += i / 4 ; - mraster = (quarterword *)mymalloc((integer)(i + 3)) ; - mbytesleft = i ; + i += i / 4; + mraster = (quarterword *)mymalloc((integer)(i + 3)); + mbytesleft = i; } } while (i > 0) - mraster[--i] = 0 ; + mraster[--i] = 0; i = startbytes + unpack(p, (halfword *)mraster, (halfword)width, - (halfword)height, *(cp->packptr)) ; - dochar(mraster, (width + 7) >> 3, height) ; + (halfword)height, *(cp->packptr)); + dochar(mraster, (width + 7) >> 3, height); if (smallchar) { - addts((unsigned char)0) ; - addts((unsigned char)0) ; - addts((unsigned char)0) ; - addts((unsigned char)0) ; - addts((unsigned char)0) ; + addts((unsigned char)0); + addts((unsigned char)0); + addts((unsigned char)0); + addts((unsigned char)0); + addts((unsigned char)0); } - j = tsp - tempstore ; + j = tsp - tempstore; #ifdef DEBUG if (dd(D_COMPRESS)) (void)fprintf(stderr,"PK %ld bytes, unpacked %ld, compressed %ld\n", - i-(long)startbytes, (long)((width+7L)/8)*height, j-(long)startbytes-4) ; + i-(long)startbytes, (long)((width+7L)/8)*height, j-(long)startbytes-4); #endif /* DEBUG */ if ( i < j ) { if (i > MINCHUNK) - free(cp->packptr) ; + free(cp->packptr); cp->packptr = - (unsigned char *)makecopy(tempstore, j, (unsigned char *)0) ; + (unsigned char *)makecopy(tempstore, j, (unsigned char *)0); } else - makecopy(tempstore, j, (unsigned char *)cp->packptr) ; - putlong((char *)(cp->packptr+startbytes), j-startbytes-4-smallchar) ; - cp->flags |= REPACKED ; + makecopy(tempstore, j, (unsigned char *)cp->packptr); + putlong((char *)(cp->packptr+startbytes), j-startbytes-4-smallchar); + cp->flags |= REPACKED; } diff --git a/Build/source/texk/dvipsk/resident.c b/Build/source/texk/dvipsk/resident.c index b1d575e8b6f..3b2054ae2da 100644 --- a/Build/source/texk/dvipsk/resident.c +++ b/Build/source/texk/dvipsk/resident.c @@ -23,7 +23,7 @@ * a small and simple hash table to handle these. We don't need * a big hash table. */ -struct resfont *reshash[RESHASHPRIME] ; +struct resfont *reshash[RESHASHPRIME]; /* * The external declarations: */ @@ -33,27 +33,27 @@ struct resfont *reshash[RESHASHPRIME] ; * To maintain a list of document fonts, we use the following * pointer. */ -struct header_list *ps_fonts_used ; +struct header_list *ps_fonts_used; /* * Our hash routine. */ unsigned int hash(char *s) { - unsigned h = 12 ; + unsigned h = 12; while (*s != 0) - h = (h + h + *s++) % RESHASHPRIME ; - return(h) ; + h = (h + h + *s++) % RESHASHPRIME; + return(h); } /* * Reverse the hash chains. */ void revpslists(void) { - register int i ; + register int i; for (i=0; i<RESHASHPRIME; i++) - reshash[i] = (struct resfont *)revlist(reshash[i]) ; + reshash[i] = (struct resfont *)revlist(reshash[i]); } /* * cleanres() marks all resident fonts as not being yet sent, except @@ -62,12 +62,12 @@ revpslists(void) { */ void cleanres(void) { - register int i ; - register struct resfont *p ; + register int i; + register struct resfont *p; for (i=0; i<RESHASHPRIME; i++) for (p=reshash[i]; p; p=p->next) if (p->sent == 1) - p->sent = 0 ; + p->sent = 0; } /* * The routine that looks up a font name. @@ -75,19 +75,19 @@ cleanres(void) { struct resfont * lookup(char *name) { - struct resfont *p ; + struct resfont *p; for (p=reshash[hash(name)]; p!=NULL; p=p->next) if (strcmp(p->Keyname, name)==0) - return(p) ; - return(NULL) ; + return(p); + return(NULL); } struct resfont * findPSname(char *name) { - register int i ; - register struct resfont *p ; + register int i; + register struct resfont *p; for (i=0; i<RESHASHPRIME; i++) for (p=reshash[i]; p; p=p->next) { if (strcmp(p->PSname, name)==0) @@ -103,25 +103,25 @@ void add_entry(char *TeXname, char *PSname, char *Fontfile, char *Vectfile, char *specinfo, char *downloadinfo) { - struct resfont *p ; - int h ; + struct resfont *p; + int h; if (PSname == NULL) - PSname = TeXname ; - p = (struct resfont *)mymalloc((integer)sizeof(struct resfont)) ; - p->Keyname = TeXname ; - p->PSname = PSname ; + PSname = TeXname; + p = (struct resfont *)mymalloc((integer)sizeof(struct resfont)); + p->Keyname = TeXname; + p->PSname = PSname; p->Fontfile = Fontfile; p->Vectfile = Vectfile; - p->TeXname = TeXname ; - p->specialinstructions = specinfo ; + p->TeXname = TeXname; + p->specialinstructions = specinfo; if (downloadinfo && *downloadinfo) - p->downloadheader = downloadinfo ; + p->downloadheader = downloadinfo; else - p->downloadheader = 0 ; - h = hash(TeXname) ; - p->next = reshash[h] ; - p->sent = 0 ; - reshash[h] = p ; + p->downloadheader = 0; + h = hash(TeXname); + p->next = reshash[h]; + p->sent = 0; + reshash[h] = p; } /* * Now our residentfont routine. Returns the number of characters in @@ -130,16 +130,16 @@ add_entry(char *TeXname, char *PSname, char *Fontfile, int residentfont(register fontdesctype *curfnt) { - int i ; - struct resfont *p ; + int i; + struct resfont *p; /* * First we determine if we can find this font in the resident list. */ if (*curfnt->area) - return 0 ; /* resident fonts never have a nonstandard font area */ + return 0; /* resident fonts never have a nonstandard font area */ if ((p=lookup(curfnt->name))==NULL) - return 0 ; + return 0; /* * This is not yet the correct way to do things, but it is useful as it * is so we leave it in. The problem: if resident Times-Roman is @@ -152,9 +152,9 @@ residentfont(register fontdesctype *curfnt) #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr,"Using PK font %s for <%s>.\n", - curfnt->name, p->PSname) ; + curfnt->name, p->PSname); #endif /* DEBUG */ - return 0 ; + return 0; } /* * We clear out some pointers: @@ -162,64 +162,64 @@ residentfont(register fontdesctype *curfnt) #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr,"Font %s <%s> is resident.\n", - curfnt->name, p->PSname) ; + curfnt->name, p->PSname); #endif /* DEBUG */ - curfnt->resfont = p ; - curfnt->name = p->TeXname ; + curfnt->resfont = p; + curfnt->name = p->TeXname; for (i=0; i<256; i++) { - curfnt->chardesc[i].TFMwidth = 0 ; - curfnt->chardesc[i].packptr = NULL ; - curfnt->chardesc[i].pixelwidth = 0 ; - curfnt->chardesc[i].flags = 0 ; - curfnt->chardesc[i].flags2 = 0 ; + curfnt->chardesc[i].TFMwidth = 0; + curfnt->chardesc[i].packptr = NULL; + curfnt->chardesc[i].pixelwidth = 0; + curfnt->chardesc[i].flags = 0; + curfnt->chardesc[i].flags2 = 0; } - add_name(p->PSname, &ps_fonts_used) ; + add_name(p->PSname, &ps_fonts_used); /* * We include the font here. But we only should need to include the * font if we have a stupid spooler; smart spoolers should be able * to supply it automatically. */ if (p->downloadheader) { - char *cp = p->downloadheader ; - char *q ; + char *cp = p->downloadheader; + char *q; - infont = p->PSname ; + infont = p->PSname; while (1) { - q = cp ; + q = cp; while (*cp && *cp != ' ') - cp++ ; + cp++; if (*cp) { - *cp = 0 ; - add_header(q) ; - *cp++ = ' ' ; + *cp = 0; + add_header(q); + *cp++ = ' '; } else { /* if (strstr(q,".pfa")||strstr(q,".pfb")|| strstr(q,".PFA")||strstr(q,".PFB")) - break ; + break; else */ { - add_header(q) ; + add_header(q); break; } } - infont = 0 ; + infont = 0; } - infont = 0 ; + infont = 0; } - i = tfmload(curfnt) ; + i = tfmload(curfnt); if (i < 0) - i = 1 ; - usesPSfonts = 1 ; - return(i) ; + i = 1; + usesPSfonts = 1; + return(i); } #define INLINE_SIZE (2000) -static char was_inline[INLINE_SIZE] ; +static char was_inline[INLINE_SIZE]; static unsigned c_lineno; void bad_config(const char *err) { fprintf (stderr, "%s:%d:", realnameoffile, c_lineno); error (err); - fprintf(stderr, " (%s)\n", was_inline) ; + fprintf(stderr, " (%s)\n", was_inline); } #ifndef KPATHSEA @@ -232,30 +232,30 @@ static char * getpath(char *who, char *what) { if (who) { - register char *pp, *qq ; - int lastsep = 1 ; + register char *pp, *qq; + int lastsep = 1; for (pp=nextstring, qq=who; *qq;) { if (*qq == PATHSEP) { if (lastsep) { - strcpy(pp, what) ; - pp = pp + strlen(pp) ; + strcpy(pp, what); + pp = pp + strlen(pp); } - lastsep = 1 ; + lastsep = 1; } else - lastsep = 0 ; - *pp++ = *qq++ ; + lastsep = 0; + *pp++ = *qq++; } if (lastsep) { - strcpy(pp, what) ; - pp = pp + strlen(pp) ; + strcpy(pp, what); + pp = pp + strlen(pp); } - *pp = 0 ; - qq = nextstring ; - nextstring = pp + 1 ; - return qq ; + *pp = 0; + qq = nextstring; + nextstring = pp + 1; + return qq; } else - return what ; + return what; } #endif /* @@ -266,25 +266,25 @@ getpath(char *who, char *what) char * configstring(char *s, int nullok) { - char tstr[INLINE_SIZE] ; - char *p = tstr ; + char tstr[INLINE_SIZE]; + char *p = tstr; while (*s && *s <= ' ') - s++ ; + s++; if (*s == '"') { - s++ ; + s++; while (*s != 10 && *s != 0 && *s != '"' && p < tstr+290) - *p++ = *s++ ; + *p++ = *s++; } else { while (*s && p < tstr+290) - *p++ = *s++ ; + *p++ = *s++; while (*(p-1) <= ' ' && p > tstr) - p-- ; + p--; } - *p = 0 ; + *p = 0; if (p == tstr && ! nullok) - bad_config("bad string") ; - return newstring(tstr) ; + bad_config("bad string"); + return newstring(tstr); } #ifdef KPATHSEA /* We use this in `getdefaults' to modify the kpathsea structure for the @@ -295,23 +295,23 @@ configstring(char *s, int nullok) /* * Now we have the getdefaults routine. */ -const char *psmapfile = PSMAPFILE ; +const char *psmapfile = PSMAPFILE; Boolean getdefaults(const char *s) { - FILE *deffile ; - char PSname[INLINE_SIZE] ; - register char *p ; - integer hsiz, vsiz ; + FILE *deffile; + char PSname[INLINE_SIZE]; + register char *p; + integer hsiz, vsiz; #ifndef KPATHSEA - char *d = configpath ; - int i, j ; + char *d = configpath; + int i, j; #endif - int canaddtopaper = 0 ; + int canaddtopaper = 0; if (printer == NULL) { if (s) { - strcpy(PSname, s) ; + strcpy(PSname, s); } else { #ifdef KPATHSEA char *dvipsrc = kpse_var_value ("DVIPSRC"); @@ -337,7 +337,7 @@ getdefaults(const char *s) can show up: c:\/.dvipsrc and so on ... */ { char *p, *q; - for (p = q = PSname; *p && (p - PSname < INLINE_SIZE) ; + for (p = q = PSname; *p && (p - PSname < INLINE_SIZE); p++, q++) { if (IS_DIR_SEP(*p)) { *q = DIR_SEP; p++; q++; @@ -348,27 +348,27 @@ getdefaults(const char *s) *q = '\0'; } #else - if(!dvipsrc) dvipsrc = kpse_var_expand(DVIPSRC) ; - strcpy(PSname, dvipsrc ? dvipsrc : "~/.dvipsrc") ; - if(dvipsrc) free(dvipsrc) ; + if(!dvipsrc) dvipsrc = kpse_var_expand(DVIPSRC); + strcpy(PSname, dvipsrc ? dvipsrc : "~/.dvipsrc"); + if(dvipsrc) free(dvipsrc); #endif /* WIN32 */ #else /* ! KPATHSEA */ #ifndef VMCMS /* IBM: VM/CMS - don't have home directory on VMCMS */ #ifndef MVSXA - d = "~" ; + d = "~"; #endif #endif /* IBM: VM/CMS */ - strcpy(PSname, DVIPSRC) ; + strcpy(PSname, DVIPSRC); #endif /* KPATHSEA */ } } else { #if defined(MSDOS) || defined(OS2) - strcpy(PSname, printer) ; - strcat(PSname, ".cfg") ; + strcpy(PSname, printer); + strcat(PSname, ".cfg"); #else - strcpy(PSname, "config.") ; - strcat(PSname, printer) ; + strcpy(PSname, "config."); + strcat(PSname, printer); #endif } #ifdef KPATHSEA @@ -378,11 +378,11 @@ getdefaults(const char *s) #endif if (dvips_debug_flag && !quiet) { if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } (void)fprintf(stderr, "{%s}", realnameoffile); - prettycolumn += strlen(realnameoffile) + 2 ; + prettycolumn += strlen(realnameoffile) + 2; } #ifdef DEBUG if (dd (D_CONFIG)) { @@ -400,12 +400,12 @@ getdefaults(const char *s) /* * We need to get rid of the newline. */ - for (p=was_inline; *p; p++) ; + for (p=was_inline; *p; p++); while (p > was_inline && (*(p-1) == '\n' || *(p-1) == '\r')) { - *--p = '\0' ; + *--p = '\0'; } if (was_inline[0] != '@') - canaddtopaper = 0 ; + canaddtopaper = 0; switch (was_inline[0]) { /* * Handling paper size information: @@ -418,186 +418,186 @@ getdefaults(const char *s) * If it is `name hsize vsize', then we start a new definition. */ case '@' : - p = was_inline + 1 ; - while (*p && *p <= ' ') p++ ; + p = was_inline + 1; + while (*p && *p <= ' ') p++; if (*p == 0) { - papsizes = 0 ; /* throw away memory */ + papsizes = 0; /* throw away memory */ } else if (*p == '+') { if (canaddtopaper == 0) error( - " @+ in config files must immediately following a @ lines") ; + " @+ in config files must immediately following a @ lines"); else { - *(nextstring-1) = '\n' ;/* IBM: VM/CMS - changed 10 to "\n" */ - p++ ; - while (*p && *p == ' ') p++ ; - strcpy(nextstring, p) ; - nextstring += strlen(p) + 1 ; + *(nextstring-1) = '\n';/* IBM: VM/CMS - changed 10 to "\n" */ + p++; + while (*p && *p == ' ') p++; + strcpy(nextstring, p); + nextstring += strlen(p) + 1; } } else { - struct papsiz *ps ; - char *q ; + struct papsiz *ps; + char *q; - ps = (struct papsiz *)mymalloc((integer)sizeof(struct papsiz)) ; - ps->next = papsizes ; - papsizes = ps ; - q = p ; + ps = (struct papsiz *)mymalloc((integer)sizeof(struct papsiz)); + ps->next = papsizes; + papsizes = ps; + q = p; while (*p && *p > ' ') - p++ ; - *p++ = 0 ; - ps->name = newstring(q) ; - while (*p && *p <= ' ') p++ ; - handlepapersize(p, &hsiz, &vsiz) ; - ps->xsize = hsiz ; - ps->ysize = vsiz ; - ps->specdat = newstring("") ; - canaddtopaper = 1 ; + p++; + *p++ = 0; + ps->name = newstring(q); + while (*p && *p <= ' ') p++; + handlepapersize(p, &hsiz, &vsiz); + ps->xsize = hsiz; + ps->ysize = vsiz; + ps->specdat = newstring(""); + canaddtopaper = 1; } - break ; + break; case 'a' : - dopprescan = (was_inline[1] != '0') ; - break ; + dopprescan = (was_inline[1] != '0'); + break; case 'b': #ifdef SHORTINT if (sscanf(was_inline+1, "%ld", &pagecopies) != 1) - bad_config("missing pagecopies to b") ; + bad_config("missing pagecopies to b"); #else if (sscanf(was_inline+1, "%d", &pagecopies) != 1) - bad_config("missing pagecopies to b") ; + bad_config("missing pagecopies to b"); #endif if (pagecopies < 1 || pagecopies > 1000) - bad_config("pagecopies not between 1 and 1000") ; - break ; + bad_config("pagecopies not between 1 and 1000"); + break; case 'm' : #ifdef SHORTINT if (sscanf(was_inline+1, "%ld", &swmem) != 1) - bad_config("missing swmem to m") ; + bad_config("missing swmem to m"); #else /* ~SHORTINT */ if (sscanf(was_inline+1, "%d", &swmem) != 1) - bad_config("missing swmem to m") ; + bad_config("missing swmem to m"); #endif /* ~SHORTINT */ - swmem += fontmem ; /* grab headers we've seen already */ - break ; + swmem += fontmem; /* grab headers we've seen already */ + break; case 'M' : /* If the user specified a -mode, don't replace it. */ if (!mfmode_option) - mfmode = configstring(was_inline+1, 0) ; - mflandmode = 0 ; + mfmode = configstring(was_inline+1, 0); + mflandmode = 0; { - char *pp ; - for (pp=mfmode; pp && *pp>' '; pp++) ; + char *pp; + for (pp=mfmode; pp && *pp>' '; pp++); if (pp && *pp == ' ') { - *pp++ = 0 ; + *pp++ = 0; while (*pp && *pp <= ' ') - pp++ ; + pp++; if (*pp) - mflandmode = pp ; + mflandmode = pp; } } - break ; + break; case 'o' : if (!oname_option) { struct stat st_buf; - char *tmp_oname ; - tmp_oname = configstring(was_inline+1, 1) ; + char *tmp_oname; + tmp_oname = configstring(was_inline+1, 1); if ((*tmp_oname && tmp_oname[strlen(tmp_oname)-1] == ':') || (stat(tmp_oname, &st_buf) == 0 && S_ISCHR(st_buf.st_mode))) { - sendcontrolD = 1 ; /* if we send to a device, *we* are spooler */ + sendcontrolD = 1; /* if we send to a device, *we* are spooler */ #if defined(MSDOS) || defined(OS2) - tmp_oname[strlen(tmp_oname)-1] = 0 ; + tmp_oname[strlen(tmp_oname)-1] = 0; #endif } - oname = tmp_oname ; + oname = tmp_oname; } - break ; + break; case 'F' : - sendcontrolD = (was_inline[1] != '0') ; - break ; + sendcontrolD = (was_inline[1] != '0'); + break; case 'O' : - p = was_inline + 1 ; - handlepapersize(p, &hoff, &voff) ; - break ; + p = was_inline + 1; + handlepapersize(p, &hoff, &voff); + break; #ifdef FONTLIB case 'L' : { - char tempname[INLINE_SIZE] ; - if (sscanf(was_inline+1, "%s", PSname) != 1) bad_config("missing arg to L") ; + char tempname[INLINE_SIZE]; + if (sscanf(was_inline+1, "%s", PSname) != 1) bad_config("missing arg to L"); else { flipath = getpath(fliparse(PSname,tempname), flipath); - fliname = newstring(tempname) ; + fliname = newstring(tempname); } } - break ; + break; #endif case 'T' : if (sscanf(was_inline+1, "%s", PSname) != 1) - bad_config("missing arg to T") ; + bad_config("missing arg to T"); else #ifdef KPATHSEA SET_CLIENT_PATH (kpse_tfm_format, PSname); #else - tfmpath = getpath(PSname, tfmpath) ; + tfmpath = getpath(PSname, tfmpath); #endif - break ; + break; case 'P' : - if (sscanf(was_inline+1, "%s", PSname) != 1) bad_config("missing arg to P") ; + if (sscanf(was_inline+1, "%s", PSname) != 1) bad_config("missing arg to P"); else #ifdef KPATHSEA SET_CLIENT_PATH (kpse_pk_format, PSname); #else - pkpath = getpath(PSname, pkpath) ; + pkpath = getpath(PSname, pkpath); #endif - break ; + break; case 'p' : - p = was_inline + 1 ; + p = was_inline + 1; while (*p && *p <= ' ') - p++ ; + p++; if (*p == '+') { if (sscanf(p+1, "%s", PSname) != 1) - bad_config("missing arg to p") ; - getpsinfo(PSname) ; + bad_config("missing arg to p"); + getpsinfo(PSname); } else { - psmapfile = configstring(was_inline+1, 0) ; + psmapfile = configstring(was_inline+1, 0); } - break ; + break; case 'v' : case 'V' : if (sscanf(was_inline+1, "%s", PSname) != 1) - bad_config("missing arg to V") ; + bad_config("missing arg to V"); else #ifdef KPATHSEA SET_CLIENT_PATH (kpse_vf_format, PSname); #else - vfpath = getpath(PSname, vfpath) ; + vfpath = getpath(PSname, vfpath); #endif - break ; + break; case 'S' : if (sscanf(was_inline+1, "%s", PSname) != 1) - bad_config("missing arg to S") ; + bad_config("missing arg to S"); else #ifdef KPATHSEA SET_CLIENT_PATH (kpse_pict_format, PSname); #else - figpath = getpath(PSname, figpath) ; + figpath = getpath(PSname, figpath); #endif - break ; + break; case 's': - safetyenclose = 1 ; - break ; + safetyenclose = 1; + break; case 'H' : if (sscanf(was_inline+1, "%s", PSname) != 1) - bad_config("missing arg to H") ; + bad_config("missing arg to H"); else #ifdef KPATHSEA SET_CLIENT_PATH (headerpath, PSname); #else - headerpath = getpath(PSname, headerpath) ; + headerpath = getpath(PSname, headerpath); #endif - break ; + break; case '%': case ' ' : case '*' : case '#' : case ';' : case '=' : case 0 : case '\n' : - break ; + break; case 'r' : - reverse = (was_inline[1] != '0') ; - break ; + reverse = (was_inline[1] != '0'); + break; /* * This case is for last resort font scaling; I hate this, but enough * people have in no uncertain terms demanded it that I'll go ahead and @@ -612,27 +612,27 @@ case 'r' : */ case 'R': #ifndef KPATHSEA - i = 0 ; - p = was_inline + 1 ; + i = 0; + p = was_inline + 1; while (*p) { while (*p && *p <= ' ') - p++ ; + p++; if ('0' <= *p && *p <= '9') { - j = 0 ; + j = 0; while ('0' <= *p && *p <= '9') - j = 10 * j + (*p++ - '0') ; + j = 10 * j + (*p++ - '0'); if (i > 0) if (lastresortsizes[i-1] > j) { - bad_config("last resort sizes (R) must be sorted") ; + bad_config("last resort sizes (R) must be sorted"); } - lastresortsizes[i++] = j ; + lastresortsizes[i++] = j; } else { if (*p == 0) - break ; - bad_config("only numbers expected on `R' line") ; + break; + bad_config("only numbers expected on `R' line"); } } - lastresortsizes[i] = 32000 ; + lastresortsizes[i] = 32000; #else /* KPATHSEA */ for (p = was_inline + 1; *p; p++) { if (isblank (*p)) { @@ -641,64 +641,64 @@ case 'R': } kpse_fallback_resolutions_string = xstrdup (was_inline + 1); #endif - break ; + break; case 'D' : if (sscanf(was_inline+1, "%d", &actualdpi) != 1) - bad_config("missing arg to D") ; + bad_config("missing arg to D"); if (actualdpi < 10 || actualdpi > 10000) - bad_config("dpi must be between 10 and 10000") ; + bad_config("dpi must be between 10 and 10000"); vactualdpi = actualdpi; - break ; + break; /* * Execute a command. This can be dangerous, but can also be very useful. */ case 'E' : #ifdef SECURE - error("dvips was compiled with SECURE, which disables E in config") ; + error("dvips was compiled with SECURE, which disables E in config"); #else if (secure) { - error("E in config is disabled. To enable E, set z0 before E") ; - break ; + error("E in config is disabled. To enable E, set z0 before E"); + break; } - (void)system(was_inline+1) ; + (void)system(was_inline+1); #endif - break ; + break; case 'K': - removecomments = (was_inline[1] != '0') ; - break ; + removecomments = (was_inline[1] != '0'); + break; case 'U': - nosmallchars = (was_inline[1] != '0') ; - break ; + nosmallchars = (was_inline[1] != '0'); + break; case 'W': - for (p=was_inline+1; *p && *p <= ' '; p++) ; + for (p=was_inline+1; *p && *p <= ' '; p++); if (*p) - warningmsg = newstring(p) ; + warningmsg = newstring(p); else - warningmsg = 0 ; - break ; + warningmsg = 0; + break; case 'X' : if (sscanf(was_inline+1, "%d", &actualdpi) != 1) - bad_config("missing numeric arg to X") ; + bad_config("missing numeric arg to X"); if (actualdpi < 10 || actualdpi > 10000) - bad_config("X arg must be between 10 and 10000") ; - break ; + bad_config("X arg must be between 10 and 10000"); + break; case 'Y' : if (sscanf(was_inline+1, "%d", &vactualdpi) != 1) - bad_config("missing numeric arg to Y") ; + bad_config("missing numeric arg to Y"); if (vactualdpi < 10 || vactualdpi > 10000) - bad_config("Y arg must be between 10 and 10000") ; - break ; + bad_config("Y arg must be between 10 and 10000"); + break; case 'x': case 'y': if (sscanf(was_inline+1, "%lg", &mag) != 1) - bad_config("missing arg to x or y") ; - overridemag = (was_inline[0] == 'x') ? 1 : -1 ; - break ; + bad_config("missing arg to x or y"); + overridemag = (was_inline[0] == 'x') ? 1 : -1; + break; case 'e' : if (sscanf(was_inline+1, "%d", &maxdrift) != 1) - bad_config("missing arg to e") ; - if (maxdrift < 0) bad_config("bad argument to e") ; + bad_config("missing arg to e"); + if (maxdrift < 0) bad_config("bad argument to e"); vmaxdrift = maxdrift; - break ; + break; case 'z' : if (secure_option && secure && was_inline[1] == '0') { fprintf (stderr, @@ -706,70 +706,70 @@ case 'z' : realnameoffile); /* Never happen */ } else { if (was_inline[1] == '0') { - secure = 0 ; + secure = 0; } else if (was_inline[1] == '2') { - secure = 2 ; + secure = 2; } else { - secure = 1 ; + secure = 1; } } - break ; + break; case 'q' : case 'Q' : - quiet = (was_inline[1] != '0') ; - break ; + quiet = (was_inline[1] != '0'); + break; case 'f' : - filter = (was_inline[1] != '0') ; + filter = (was_inline[1] != '0'); if (filter) oname = ""; /* noenv has already been tested, so no point in setting. */ sendcontrolD = 0; - break ; + break; #ifdef SHIFTLOWCHARS case 'G': - shiftlowchars = (was_inline[1] != '0') ; - break ; + shiftlowchars = (was_inline[1] != '0'); + break; #endif case 'h' : if (sscanf(was_inline+1, "%s", PSname) != 1) - bad_config("missing arg to h") ; - else (void)add_header(PSname) ; - break ; + bad_config("missing arg to h"); + else (void)add_header(PSname); + break; case 'i' : if (sscanf(was_inline+1, "%d", &maxsecsize) != 1) - maxsecsize = 0 ; - sepfiles = 1 ; - break ; + maxsecsize = 0; + sepfiles = 1; + break; case 'I': - noenv = (was_inline[1] != '0') ; - break ; + noenv = (was_inline[1] != '0'); + break; case 'N' : - disablecomments = (was_inline[1] != '0') ; - break ; + disablecomments = (was_inline[1] != '0'); + break; case 'Z' : - compressed = (was_inline[1] != '0') ; - break ; + compressed = (was_inline[1] != '0'); + break; case 'j': - partialdownload = (was_inline[1] != '0') ; - break ; + partialdownload = (was_inline[1] != '0'); + break; case 't' : if (sscanf(was_inline+1, "%s", PSname) != 1) - bad_config("missing arg to t") ; + bad_config("missing arg to t"); else { if (strcmp(PSname, "landscape") == 0) { if (hpapersize || vpapersize) error( - "both landscape and papersize specified; ignoring landscape") ; + "both landscape and papersize specified; ignoring landscape"); else - landscape = 1 ; + landscape = 1; } else - paperfmt = newstring(PSname) ; + paperfmt = newstring(PSname); } - break ; + break; default: - bad_config("strange line") ; + bad_config("strange line"); } } - (void)fclose(deffile) ; + (void)fclose(deffile); } else { if (printer) { @@ -790,55 +790,55 @@ default: void getpsinfo(const char *name) { - FILE *deffile ; - register char *p ; - char *specinfo, *downloadinfo ; - char downbuf[500] ; - char specbuf[500] ; - int slen ; + FILE *deffile; + register char *p; + char *specinfo, *downloadinfo; + char downbuf[500]; + char specbuf[500]; + int slen; if (name == 0) - name = psmapfile ; + name = psmapfile; if ((deffile=search(mappath, name, READ))!=NULL) { if (dvips_debug_flag && !quiet) { if (strlen(realnameoffile) + prettycolumn > STDOUTSIZE) { - fprintf(stderr, "\n") ; - prettycolumn = 0 ; + fprintf(stderr, "\n"); + prettycolumn = 0; } (void)fprintf(stderr, "{%s}", realnameoffile); - prettycolumn += strlen(realnameoffile) + 2 ; + prettycolumn += strlen(realnameoffile) + 2; } while (fgets(was_inline, INLINE_SIZE, deffile)!=NULL) { - p = was_inline ; + p = was_inline; if (*p > ' ' && *p != '*' && *p != '#' && *p != ';' && *p != '%') { - char *TeXname = NULL ; - char *PSname = NULL ; + char *TeXname = NULL; + char *PSname = NULL; char *Fontfile = NULL; char *Vectfile = NULL; char *hdr_name = NULL; boolean nopartial_p = false; boolean encoding_p = false; - specinfo = NULL ; - downloadinfo = NULL ; - downbuf[0] = 0 ; - specbuf[0] = 0 ; + specinfo = NULL; + downloadinfo = NULL; + downbuf[0] = 0; + specbuf[0] = 0; while (*p) { - encoding_p = false ; + encoding_p = false; while (*p && *p <= ' ') - p++ ; + p++; if (*p) { if (*p == '"') { /* PostScript instructions? */ if (specinfo) { - strcat(specbuf, specinfo) ; - strcat(specbuf, " ") ; + strcat(specbuf, specinfo); + strcat(specbuf, " "); } - specinfo = p + 1 ; + specinfo = p + 1; } else if (*p == '<') { /* Header to download? */ /* If had previous downloadinfo, save it. */ if (downloadinfo) { - strcat(downbuf, downloadinfo) ; - strcat(downbuf, " ") ; + strcat(downbuf, downloadinfo); + strcat(downbuf, " "); downloadinfo = NULL; } if (p[1] == '<') { /* << means always full download */ @@ -848,29 +848,29 @@ getpsinfo(const char *name) p++; encoding_p = true; } - p++ ; + p++; /* skip whitespace after < */ while (*p && *p <= ' ') p++; /* save start of header name */ - hdr_name = p ; + hdr_name = p; } else if (TeXname) /* second regular word on line? */ - PSname = p ; + PSname = p; else /* first regular word? */ - TeXname = p ; + TeXname = p; if (*p == '"') { - p++ ; /* find end of "..." word */ + p++; /* find end of "..." word */ while (*p != '"' && *p) - p++ ; + p++; } else while (*p > ' ') /* find end of anything else */ - p++ ; + p++; if (*p) - *p++ = 0 ; + *p++ = 0; /* If we had a header we were downloading, figure out what to do; couldn't do this above since we @@ -882,7 +882,7 @@ getpsinfo(const char *name) FontPart, and download as usual */ Vectfile = downloadinfo = hdr_name; } else if (nopartial_p) { - downloadinfo = hdr_name ; + downloadinfo = hdr_name; } else if (FILESTRCASEEQ (suffix, "pfa") || FILESTRCASEEQ (suffix, "pfb") || STREQ (suffix, "PFA") @@ -895,28 +895,28 @@ getpsinfo(const char *name) } } if (specinfo) - strcat(specbuf, specinfo) ; + strcat(specbuf, specinfo); if (downloadinfo) - strcat(downbuf, downloadinfo) ; + strcat(downbuf, downloadinfo); slen = strlen(downbuf) - 1; if (slen > 0 && downbuf[slen] == ' ') { downbuf[slen] = 0; } if (TeXname) { - TeXname = newstring(TeXname) ; - PSname = newstring(PSname) ; + TeXname = newstring(TeXname); + PSname = newstring(PSname); Fontfile = newstring(Fontfile); Vectfile = newstring(Vectfile); - specinfo = newstring(specbuf) ; - downloadinfo = newstring(downbuf) ; + specinfo = newstring(specbuf); + downloadinfo = newstring(downbuf); add_entry(TeXname, PSname, Fontfile, Vectfile, - specinfo, downloadinfo) ; + specinfo, downloadinfo); } } } - (void)fclose(deffile) ; + (void)fclose(deffile); } - checkstrings() ; + checkstrings(); } #ifndef KPATHSEA /* @@ -927,7 +927,7 @@ getpsinfo(const char *name) static char * getenvup(char *who, char *what) { - return getpath(getenv(who), what) ; + return getpath(getenv(who), what); } #endif #if !defined(KPATHSEA) && defined(SEARCH_SUBDIRECTORIES) @@ -938,36 +938,36 @@ checkenv(int which) { #ifndef KPATHSEA if (which) { - tfmpath = getenvup(FONTPATH, tfmpath) ; - vfpath = getenvup("VFFONTS", vfpath) ; - pictpath = getenvup("TEXPICTS", pictpath) ; - figpath = getenvup("TEXINPUTS", figpath) ; - headerpath = getenvup("DVIPSHEADERS", headerpath) ; + tfmpath = getenvup(FONTPATH, tfmpath); + vfpath = getenvup("VFFONTS", vfpath); + pictpath = getenvup("TEXPICTS", pictpath); + figpath = getenvup("TEXINPUTS", figpath); + headerpath = getenvup("DVIPSHEADERS", headerpath); if (getenv("TEXPKS")) - pkpath = getenvup("TEXPKS", pkpath) ; + pkpath = getenvup("TEXPKS", pkpath); else if (getenv("TEXPACKED")) - pkpath = getenvup("TEXPACKED", pkpath) ; + pkpath = getenvup("TEXPACKED", pkpath); else if (getenv("PKFONTS")) - pkpath = getenvup("PKFONTS", pkpath) ; + pkpath = getenvup("PKFONTS", pkpath); #ifdef SEARCH_SUBDIRECTORIES else if (getenv(FONTPATH)) - pkpath = getenvup(FONTPATH, pkpath) ; + pkpath = getenvup(FONTPATH, pkpath); if (getenv ("TEXFONTS_SUBDIR")) fontsubdirpath = getenvup ("TEXFONTS_SUBDIR", fontsubdirpath); { - char pathsep[2] ; + char pathsep[2]; char *do_subdir_path(); char *dirs = do_subdir_path (fontsubdirpath); /* If the paths were in dynamic storage before, that memory is wasted now. */ - pathsep[0] = PATHSEP ; - pathsep[1] = '\0' ; + pathsep[0] = PATHSEP; + pathsep[1] = '\0'; tfmpath = concat3 (tfmpath, pathsep, dirs); pkpath = concat3 (pkpath, pathsep, dirs); } #endif } else - configpath = getenvup("TEXCONFIG", configpath) ; + configpath = getenvup("TEXCONFIG", configpath); #endif } @@ -1004,8 +1004,8 @@ extern char *getcwd (); #include <sys/param.h> /* for MAXPATHLEN */ #endif -extern void exit() ; -extern int chdir() ; +extern void exit(); +extern int chdir(); /* Memory operations: variants of malloc(3) and realloc(3) that just give up the ghost when they fail. */ @@ -1102,10 +1102,10 @@ do_subdir_path(char *dir_list) unsigned len; char *result = xmalloc ((unsigned)1); char *temp = dir_list; - char dirsep[2] ; + char dirsep[2]; - dirsep[0] = DIRSEP ; - dirsep[1] = '\0' ; + dirsep[0] = DIRSEP; + dirsep[1] = '\0'; /* Make a copy in writable memory. */ dir_list = xmalloc (strlen (temp) + 1); diff --git a/Build/source/texk/dvipsk/scalewidth.c b/Build/source/texk/dvipsk/scalewidth.c index 349baea8f33..dab197a9290 100644 --- a/Build/source/texk/dvipsk/scalewidth.c +++ b/Build/source/texk/dvipsk/scalewidth.c @@ -22,15 +22,15 @@ integer scalewidth(register integer a, register integer b) { - register integer al, bl ; + register integer al, bl; if (a < 0) - return -scalewidth(-a, b) ; + return -scalewidth(-a, b); if (b < 0) - return -scalewidth(a, -b) ; - al = a & 32767 ; - bl = b & 32767 ; - a >>= 15 ; - b >>= 15 ; - return ( ((al*bl/32768) + a*bl+al*b)/32 + a*b*1024) ; + return -scalewidth(a, -b); + al = a & 32767; + bl = b & 32767; + a >>= 15; + b >>= 15; + return ( ((al*bl/32768) + a*bl+al*b)/32 + a*b*1024); } diff --git a/Build/source/texk/dvipsk/scanpage.c b/Build/source/texk/dvipsk/scanpage.c index e70db2dc3f0..8cdf38d3b6b 100644 --- a/Build/source/texk/dvipsk/scanpage.c +++ b/Build/source/texk/dvipsk/scanpage.c @@ -22,52 +22,52 @@ Boolean prescanchar(chardesctype *cd) { - register quarterword *cras ; - register integer thischar ; + register quarterword *cras; + register integer thischar; if ((cd->flags & (PREVPAGE | THISPAGE)) == 0) { /* the character hasn't been used before in the current section */ - cras = cd->packptr ; + cras = cd->packptr; if (curfnt->resfont) { - thischar = PSCHARCOST ; - cd->flags |= THISPAGE ; + thischar = PSCHARCOST; + cd->flags |= THISPAGE; } else if (cras != NULL) { - thischar = CHARCOST ; + thischar = CHARCOST; if (cd->flags & BIGCHAR) - thischar += 43 ; + thischar += 43; if (compressed) { if ((cd->flags & REPACKED) == 0) { - repack(cd) ; - cras = cd->packptr ; + repack(cd); + cras = cd->packptr; } if ((*cras & 4)) if ((*cras & 7) == 7) - thischar += getlong(cras + 17) ; + thischar += getlong(cras + 17); else - thischar += getlong(cras + 9) ; + thischar += getlong(cras + 9); else - thischar += getlong(cras + 5) ; + thischar += getlong(cras + 5); } else { if ((*cras & 4)) if ((*cras & 7) == 7) thischar += getlong(cras + 1) - * ((getlong(cras + 5) + 7) >> 3) ; + * ((getlong(cras + 5) + 7) >> 3); else thischar += (cras[3] * 256L + cras[4]) * - ((cras[1] * 256L + cras[2] + 7) >> 3) ; + ((cras[1] * 256L + cras[2] + 7) >> 3); else - thischar += ((long)(cras[2] * ((cras[1] + 7) >> 3))) ; + thischar += ((long)(cras[2] * ((cras[1] + 7) >> 3))); } - cd->flags |= THISPAGE ; + cd->flags |= THISPAGE; } else - thischar = 0 ; - fontmem -= thischar ; + thischar = 0; + fontmem -= thischar; if (fontmem <= pagecost) { if (pagecount > 0) - return(0) ; + return(0); } } - return(1) ; + return(1); } /* * When a font is selected during the prescan, this routine makes sure that @@ -78,29 +78,29 @@ prescanchar(chardesctype *cd) Boolean preselectfont(fontdesctype *f) { - curfnt = f ; + curfnt = f; if (curfnt->loaded == 0 || curfnt->loaded == 3) { if (!residentfont(curfnt)) if (!virtualfont(curfnt)) - loadfont(curfnt) ; + loadfont(curfnt); } if (curfnt->psname == 0) { if (curfnt->loaded < 2) { /* virtual font costs nothing (yet) */ if (curfnt->resfont) - fontmem -= PSFONTCOST ; + fontmem -= PSFONTCOST; else { - fontmem -= FONTCOST + curfnt->maxchars ; + fontmem -= FONTCOST + curfnt->maxchars; if (curfnt->loadeddpi != curfnt->dpi) - fontmem -= 48 ; /* for the new font matrix */ + fontmem -= 48; /* for the new font matrix */ } } - curfnt->psname = 1 ; + curfnt->psname = 1; if (fontmem <= pagecost) { if (pagecount > 0) - return(0) ; + return(0); } } - return(1) ; + return(1); } /* * Now our scanpage routine. @@ -108,28 +108,28 @@ preselectfont(fontdesctype *f) short scanpage(void) { - register shalfword cmd ; - register chardesctype *cd ; - register fontmaptype *cfnt = 0 ; - integer fnt ; - integer mychar ; - register frametype *frp = frames ; + register shalfword cmd; + register chardesctype *cd; + register fontmaptype *cfnt = 0; + integer fnt; + integer mychar; + register frametype *frp = frames; if (firstboploc == 0) - firstboploc = ftell(dvifile) ; - pagecost = 0 ; + firstboploc = ftell(dvifile); + pagecost = 0; #ifdef DEBUG if (dd(D_PAGE)) #ifdef SHORTINT - (void)fprintf(stderr,"Scanning page %ld\n", pagenum) ; + (void)fprintf(stderr,"Scanning page %ld\n", pagenum); #else /* ~SHORTINT */ - (void)fprintf(stderr,"Scanning page %d\n", pagenum) ; + (void)fprintf(stderr,"Scanning page %d\n", pagenum); #endif /* ~SHORTINT */ #endif /* DEBUG */ - curfnt = NULL ; - curpos = NULL ; + curfnt = NULL; + curpos = NULL; - bopcolor(0) ; /* IBM: color - put current colorstack to bopstackdepth */ + bopcolor(0); /* IBM: color - put current colorstack to bopstackdepth */ while (1) { switch (cmd=dvibyte()) { @@ -137,73 +137,73 @@ case 130: case 131: case 135: case 136: case 139: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: /* unimplemented or illegal commands */ (void)sprintf(errbuf, - "! DVI file contains unexpected command (%d)",cmd) ; - error(errbuf) ; + "! DVI file contains unexpected command (%d)",cmd); + error(errbuf); case 132: case 137: /* eight-byte commands setrule, putrule */ - (void)dvibyte() ; - (void)dvibyte() ; - (void)dvibyte() ; - (void)dvibyte() ; + (void)dvibyte(); + (void)dvibyte(); + (void)dvibyte(); + (void)dvibyte(); case 146: case 151: case 156: case 160: case 165: case 170: /* four-byte commands right4, w4, x4, down4, y4, z4 */ - (void)dvibyte() ; + (void)dvibyte(); case 145: case 150: case 155: case 159: case 164: case 169: /* three-byte commands right3, w3, x3, down3, y3, z3 */ - (void)dvibyte() ; + (void)dvibyte(); case 144: case 149: case 154: case 158: case 163: case 168: /* two-byte commands right2, w2, x2, down2, y2, z2 */ - (void)dvibyte() ; + (void)dvibyte(); case 143: case 148: case 153: case 157: case 162: case 167: /* one-byte commands right1, w1, x1, down1, y1, z1 */ - (void)dvibyte() ; + (void)dvibyte(); case 147: case 152: case 161: case 166: /* w0, x0, y0, z0 */ case 138: case 141: case 142: /* nop, push, pop */ - break ; + break; case 134: case 129: /* set2, put2 */ if (noomega) { (void)sprintf(errbuf, - "! DVI file contains unexpected Omega command (%d)",cmd) ; - error(errbuf) ; + "! DVI file contains unexpected Omega command (%d)",cmd); + error(errbuf); } - mychar = dvibyte() ; mychar = (mychar << 8) + dvibyte() ; - goto dochar ; -case 133: case 128: cmd = dvibyte() ; /* set1 commands drops through */ + mychar = dvibyte(); mychar = (mychar << 8) + dvibyte(); + goto dochar; +case 133: case 128: cmd = dvibyte(); /* set1 commands drops through */ default: /* these are commands 0 (setchar0) thru 127 (setchar 127) */ - mychar = cmd ; + mychar = cmd; dochar: /* * We are going to approximate that each string of consecutive characters * requires (length of string) bytes of PostScript VM. */ if (curfnt==NULL) - error("! Bad DVI file: no font selected") ; + error("! Bad DVI file: no font selected"); if (mychar>=curfnt->maxchars) { - (void)sprintf(errbuf,"! invalid char %d from font %s", mychar, curfnt->name) ; - error(errbuf) ; + (void)sprintf(errbuf,"! invalid char %d from font %s", mychar, curfnt->name); + error(errbuf); } if (curfnt->loaded == 2) { /* scanning a virtual font character */ - frp->curp = curpos ; - frp->curl = curlim ; - frp->ff = ffont ; - frp->curf = curfnt ; + frp->curp = curpos; + frp->curl = curlim; + frp->ff = ffont; + frp->curf = curfnt; if (++frp == &frames[MAXFRAME] ) - error("! virtual recursion stack overflow") ; - cd = curfnt->chardesc + mychar ; + error("! virtual recursion stack overflow"); + cd = curfnt->chardesc + mychar; if (cd->packptr == 0) - error("! a non-existent virtual character is being used; check vf/tfm files") ; - curpos = cd->packptr + 2 ; - curlim = curpos + (256*(long)(*cd->packptr)+(*(cd->packptr+1))) ; - ffont = curfnt->localfonts ; + error("! a non-existent virtual character is being used; check vf/tfm files"); + curpos = cd->packptr + 2; + curlim = curpos + (256*(long)(*cd->packptr)+(*(cd->packptr+1))); + ffont = curfnt->localfonts; if (ffont==NULL) - curfnt = NULL ; + curfnt = NULL; else if (!preselectfont(ffont->desc)) - goto outofmem ; + goto outofmem; } else { - pagecost++ ; + pagecost++; if (!prescanchar(curfnt->chardesc + mychar)) - goto outofmem ; + goto outofmem; } - break ; + break; case 171: case 172: case 173: case 174: case 175: case 176: case 177: case 178: case 179: case 180: case 181: case 182: case 183: case 184: case 185: case 186: case 187: case 188: case 189: case 190: case 191: @@ -214,59 +214,59 @@ case 213: case 214: case 215: case 216: case 217: case 218: case 219: case 220: case 221: case 222: case 223: case 224: case 225: case 226: case 227: case 228: case 229: case 230: case 231: case 232: case 233: case 234: case 235: case 236: case 237: case 238: /* font selection commands */ - if (cmd < 235) fnt = cmd - 171 ; /* fntnum0 thru fntnum63 */ + if (cmd < 235) fnt = cmd - 171; /* fntnum0 thru fntnum63 */ else { - fnt = dvibyte() ; /* fnt1 */ + fnt = dvibyte(); /* fnt1 */ while (cmd-- > 235) - fnt = (fnt << 8) + dvibyte() ; + fnt = (fnt << 8) + dvibyte(); } for (cfnt=ffont; cfnt; cfnt = cfnt->next) - if (cfnt->fontnum == fnt) goto fontfound ; - printf("Font number %d not found\n", fnt) ; - error("! no font selected") ; -fontfound: curfnt = cfnt->desc ; + if (cfnt->fontnum == fnt) goto fontfound; + printf("Font number %d not found\n", fnt); + error("! no font selected"); +fontfound: curfnt = cfnt->desc; if (!preselectfont(curfnt)) - goto outofmem ; - break ; -case 239: predospecial((integer)dvibyte(), 1) ; break ; /* xxx1 */ -case 240: predospecial((integer)twobytes(), 1) ; break ; /* xxx2 */ -case 241: predospecial(threebytes(), 1) ; break ; /* xxx3 */ -case 242: predospecial(signedquad(), 1) ; break ; /* xxx4 */ -case 243: case 244: case 245: case 246: fontdef(cmd-242) ; break ; /* fntdef1 */ + goto outofmem; + break; +case 239: predospecial((integer)dvibyte(), 1); break; /* xxx1 */ +case 240: predospecial((integer)twobytes(), 1); break; /* xxx2 */ +case 241: predospecial(threebytes(), 1); break; /* xxx3 */ +case 242: predospecial(signedquad(), 1); break; /* xxx4 */ +case 243: case 244: case 245: case 246: fontdef(cmd-242); break; /* fntdef1 */ case 140: /* eop or end of virtual char */ if (curpos) { - --frp ; - curfnt = frp->curf ; - ffont = frp->ff ; - curlim = frp->curl ; - curpos = frp->curp ; - break ; + --frp; + curfnt = frp->curf; + ffont = frp->ff; + curlim = frp->curl; + curpos = frp->curp; + break; } - goto endofpage ; /* eop */ + goto endofpage; /* eop */ } } endofpage: if (fontmem > pagecost) - return(1) ; + return(1); if (pagecount > 0) { - return(0) ; + return(0); } /* IBM: color */ #ifdef SHORTINT - (void)fprintf(stderr, "Page %ld may be too complex to print\n", pagenum) ; + (void)fprintf(stderr, "Page %ld may be too complex to print\n", pagenum); #else /* ~SHORTINT */ - (void)fprintf(stderr, "Page %d may be too complex to print\n", pagenum) ; + (void)fprintf(stderr, "Page %d may be too complex to print\n", pagenum); #endif /* ~SHORTINT */ /* * This case should be rare indeed. Even with only 200K of virtual memory, * at 11 bytes per char, you can have 18K characters on a page. */ - return(2) ; + return(2); outofmem: if (frp != frames) { - curpos = frames->curp ; - curlim = frames->curl ; - ffont = frames->ff ; - curfnt = frames->curf ; + curpos = frames->curp; + curlim = frames->curl; + ffont = frames->ff; + curfnt = frames->curf; } - return 0 ; + return 0; } diff --git a/Build/source/texk/dvipsk/search.c b/Build/source/texk/dvipsk/search.c index 16a930293cf..df08033240b 100644 --- a/Build/source/texk/dvipsk/search.c +++ b/Build/source/texk/dvipsk/search.c @@ -24,8 +24,8 @@ #define GUNZIP "gzip -d" #endif -int to_close ; /* use fclose or pclose? */ -char *realnameoffile ; +int to_close; /* use fclose or pclose? */ +char *realnameoffile; /* Return safely quoted version of NAME. That means using "..." on Windows and '...' on Unix, with any occurrences of the quote char @@ -213,21 +213,21 @@ pksearch(const char *file, const char *mode, halfword dpi, FILE * my_real_fopen(register const char *n, register const char *t) { - FILE *tf ; + FILE *tf; if (dd(D_FILES)) { - fprintf(stderr, "<%s(%s)> ", n, t) ; - tf = fopen(n, t) ; + fprintf(stderr, "<%s(%s)> ", n, t); + tf = fopen(n, t); if (tf == 0) - fprintf(stderr, "failed\n") ; + fprintf(stderr, "failed\n"); else - fprintf(stderr, "succeeded\n") ; + fprintf(stderr, "succeeded\n"); } else - tf = fopen(n, t) ; + tf = fopen(n, t); #ifdef OS2 if (tf == (FILE *)NULL) tf = fat_fopen(n, t); /* try again with filename truncated to 8.3 */ #endif - return tf ; + return tf; } #endif @@ -289,15 +289,15 @@ fat_fopen(char *fname, char *t) strcpy(np,nbuf); /* now code copied from my_real_fopen() */ if (dd(D_FILES)) { - fprintf(stderr, "<%s(%s)> ", n, t) ; - tf = fopen(n, t) ; + fprintf(stderr, "<%s(%s)> ", n, t); + tf = fopen(n, t); if (tf == 0) - fprintf(stderr, "failed\n") ; + fprintf(stderr, "failed\n"); else - fprintf(stderr, "succeeded\n") ; + fprintf(stderr, "succeeded\n"); } else - tf = fopen(n, t) ; + tf = fopen(n, t); return tf; } return (FILE *)NULL; @@ -308,8 +308,8 @@ int close_file(FILE *f) { switch(to_close) { -case USE_PCLOSE: return pclose(f) ; -case USE_FCLOSE: return fclose(f) ; -default: return -1 ; +case USE_PCLOSE: return pclose(f); +case USE_FCLOSE: return fclose(f); +default: return -1; } } diff --git a/Build/source/texk/dvipsk/skippage.c b/Build/source/texk/dvipsk/skippage.c index 13da8d5f423..6f9f6622b15 100644 --- a/Build/source/texk/dvipsk/skippage.c +++ b/Build/source/texk/dvipsk/skippage.c @@ -16,19 +16,19 @@ void skippage(void) { - register shalfword cmd ; - register integer i ; + register shalfword cmd; + register integer i; #ifdef DEBUG if (dd(D_PAGE)) #ifdef SHORTINT - (void)fprintf(stderr,"Skipping page %ld\n", pagenum) ; + (void)fprintf(stderr,"Skipping page %ld\n", pagenum); #else /* ~SHORTINT */ - (void)fprintf(stderr,"Skipping page %d\n", pagenum) ; + (void)fprintf(stderr,"Skipping page %d\n", pagenum); #endif /* ~SHORTINT */ #endif /* DEBUG */ -/* skipover(40) ; skip rest of bop command? how did this get in here? */ - bopcolor(0) ; +/* skipover(40); skip rest of bop command? how did this get in here? */ + bopcolor(0); while ((cmd=dvibyte())!=140) { switch (cmd) { /* illegal options */ @@ -36,39 +36,39 @@ case 130: case 131: case 135: case 136: case 139: case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: (void)sprintf(errbuf, - "! DVI file contains unexpected command (%d)",cmd) ; - error(errbuf) ; + "! DVI file contains unexpected command (%d)",cmd); + error(errbuf); /* eight byte commands */ case 132: case 137: - cmd = dvibyte() ; - cmd = dvibyte() ; - cmd = dvibyte() ; - cmd = dvibyte() ; + cmd = dvibyte(); + cmd = dvibyte(); + cmd = dvibyte(); + cmd = dvibyte(); /* four byte commands */ case 146: case 151: case 156: case 160: case 165: case 170: case 238: - cmd = dvibyte() ; + cmd = dvibyte(); /* three byte commands */ case 145: case 150: case 155: case 159: case 164: case 169: case 237: - cmd = dvibyte() ; + cmd = dvibyte(); /* two byte commands */ case 129: case 134: case 144: case 149: case 154: case 158: case 163: case 168: case 236: - cmd = dvibyte() ; + cmd = dvibyte(); /* one byte commands */ case 128: case 133: case 143: case 148: case 153: case 157: case 162: case 167: case 235: - cmd = dvibyte() ; - break ; + cmd = dvibyte(); + break; /* specials */ -case 239: i = dvibyte() ; predospecial(i, 0) ; break ; -case 240: i = twobytes() ; predospecial(i, 0) ; break ; -case 241: i = threebytes() ; predospecial(i, 0) ; break ; -case 242: i = signedquad() ; predospecial(i, 0) ; break ; +case 239: i = dvibyte(); predospecial(i, 0); break; +case 240: i = twobytes(); predospecial(i, 0); break; +case 241: i = threebytes(); predospecial(i, 0); break; +case 242: i = signedquad(); predospecial(i, 0); break; /* font definition */ case 243: case 244: case 245: case 246: - fontdef(cmd - 242) ; - break ; -default: ; + fontdef(cmd - 242); + break; +default:; } } } diff --git a/Build/source/texk/dvipsk/t1part.c b/Build/source/texk/dvipsk/t1part.c index 8f7efaf3f99..9074705bf62 100644 --- a/Build/source/texk/dvipsk/t1part.c +++ b/Build/source/texk/dvipsk/t1part.c @@ -16,7 +16,7 @@ #ifdef BORLANDC void huge *UniGetMem(size) -ub4 size ; +ub4 size; { void huge *tmp; if ((tmp =(void huge*) farcalloc(1L, size)) == NULL) @@ -65,8 +65,8 @@ int CharCount; int GridCount; int ind_ref; -int LoadVector(int, CHAR *) ; -int Afm(void) ; +int LoadVector(int, CHAR *); +int Afm(void); typedef struct { @@ -359,7 +359,7 @@ GetWord(unsigned char *mem) } if(isalpha(*line)) { - *tmp++ = *line++ ; + *tmp++ = *line++; while(!isspace(*line) && *line != '/') *tmp++= *line++; *tmp = '\0'; @@ -695,14 +695,14 @@ ChooseChar(unsigned char *name, CHAR *TmpChar) * O'Neill; bugs in application of fix due to me. */ if (NextChar == 0) { - NextChar = (CHAR *) getmem(sizeof(CHAR)) ; - NextChar->name = (unsigned char *) getmem(length + 1) ; - strcpy((char *) NextChar->name, (char *) name) ; - NextChar->length = length ; - NextChar->num = -1 ; - NextChar->NextChar = 0 ; - NextChar->choose = 1 ; - ThisChar->NextChar = NextChar ; + NextChar = (CHAR *) getmem(sizeof(CHAR)); + NextChar->name = (unsigned char *) getmem(length + 1); + strcpy((char *) NextChar->name, (char *) name); + NextChar->length = length; + NextChar->num = -1; + NextChar->NextChar = 0; + NextChar->choose = 1; + ThisChar->NextChar = NextChar; } ThisChar = NextChar; } @@ -911,7 +911,7 @@ ScanSubrs(int i) len_dup = strlen(Dup); - for( ; number < keyword[i].oldnum + keyword[i].offset;) + for(; number < keyword[i].oldnum + keyword[i].offset;) { if((word_type=GetToken())>0) { @@ -925,7 +925,7 @@ ScanSubrs(int i) err_num=GetNum(); if(err_num<0) - ; + ; else { if(err_num<4) @@ -1038,7 +1038,7 @@ DeCodeStr(int num, int numseac) { unsigned int loccr; unsigned char byte; - static int j ; + static int j; int i; unsigned char jj,k; int tmpnum; @@ -1546,7 +1546,7 @@ ScanBinary(void) label[number].select = FLG_BINARY; offset= ++number; - for (current=0, FirstKey=current ; ; current++) + for (current=0, FirstKey=current;; current++) { i=FindKeyWord(firstnum,lastnum); switch(i) @@ -1769,7 +1769,7 @@ CharEncoding(void) { int err_token=0; int num=0; - int seen = 0 ; + int seen = 0; while (1) { err_token=GetWord(token); @@ -1794,8 +1794,8 @@ CharEncoding(void) FirstChar=AddChar(FirstChar,token, num); keep_num=num; keep_flg=1; - seen++ ; - err_token = GetWord(token) ; + seen++; + err_token = GetWord(token); } } else { @@ -1810,7 +1810,7 @@ CharEncoding(void) } } } else - return seen ; + return seen; } } @@ -1959,12 +1959,12 @@ CheckChoosing(void) static char * KillUnique(char *s) { - char *r = strstr(s, "/UniqueID") ; + char *r = strstr(s, "/UniqueID"); if (r) { - r[7] = 'X' ; - r[8] = 'X' ; + r[7] = 'X'; + r[8] = 'X'; } - return s ; + return s; } void @@ -2311,7 +2311,7 @@ OutHEX(FILE *fout) { int i=0; int num; - static const char *hexstr = "0123456789abcdef" ; + static const char *hexstr = "0123456789abcdef"; int bin; line=tmpline; @@ -2380,7 +2380,7 @@ Afm(void) "" }; - for(i=0; psfontfile[i] ; i++) + for(i=0; psfontfile[i]; i++) { if(psfontfile[i] == '.') break; diff --git a/Build/source/texk/dvipsk/t1part.h b/Build/source/texk/dvipsk/t1part.h index b33bf4dfb63..955ddd22d89 100644 --- a/Build/source/texk/dvipsk/t1part.h +++ b/Build/source/texk/dvipsk/t1part.h @@ -37,7 +37,7 @@ extern int debug_flag; #ifdef DVIPS extern FILE *search(); #ifndef KPATHSEA -extern char *headerpath ; +extern char *headerpath; #endif /* not KPATHSEA */ #define psfopen(A,B) search(headerpath,A,B) #else @@ -142,6 +142,6 @@ int WorkVect(); #define FLG_LOAD_BASE (1) extern unsigned char grid[]; -extern unsigned char *line, *tmpline ; -extern int loadbase ; +extern unsigned char *line, *tmpline; +extern int loadbase; extern struct Char *FirstCharB; diff --git a/Build/source/texk/dvipsk/tfmload.c b/Build/source/texk/dvipsk/tfmload.c index 6bd2febb089..e951092c161 100644 --- a/Build/source/texk/dvipsk/tfmload.c +++ b/Build/source/texk/dvipsk/tfmload.c @@ -11,12 +11,12 @@ */ #include "protos.h" -FILE *tfmfile ; +FILE *tfmfile; /* * Our static variables: */ -static char name[50] ; +static char name[50]; void badtfm(const char *s) @@ -34,189 +34,189 @@ tfmopen(register fontdesctype *fd) { register char *n; #ifdef KPATHSEA - kpse_file_format_type d ; + kpse_file_format_type d; #else register char *d; #endif - n = fd->name ; + n = fd->name; if (!noomega) { #ifdef KPATHSEA d = ofmpath; #else - d = fd->area ; + d = fd->area; if (*d==0) - d = ofmpath ; + d = ofmpath; #endif #ifdef MVSXA /* IBM: MVS/XA */ - (void)sprintf(name, "ofm(%s)", n) ; + (void)sprintf(name, "ofm(%s)", n); #else - (void)sprintf(name, "%s.ofm", n) ; + (void)sprintf(name, "%s.ofm", n); #endif if ((tfmfile=search(d, name, READBIN))!=NULL) - return ; + return; } #ifdef KPATHSEA d = tfmpath; #else - d = fd->area ; + d = fd->area; if (*d==0) - d = tfmpath ; + d = tfmpath; #endif #ifdef MVSXA /* IBM: MVS/XA */ - (void)sprintf(name, "tfm(%s)", n) ; + (void)sprintf(name, "tfm(%s)", n); #else - (void)sprintf(name, "%s.tfm", n) ; + (void)sprintf(name, "%s.tfm", n); #endif if ((tfmfile=search(d, name, READBIN))!=NULL) - return ; + return; (void)sprintf(errbuf, "Can't open font metric file %s%s", - fd->area, name) ; - error(errbuf) ; - error("I will use cmr10.tfm instead, so expect bad output.") ; + fd->area, name); + error(errbuf); + error("I will use cmr10.tfm instead, so expect bad output."); #ifdef MVSXA /* IBM: MVS/XA */ if ((tfmfile=search(d, "tfm(cmr10)", READBIN))!=NULL) #else if ((tfmfile=search(d, "cmr10.tfm", READBIN))!=NULL) #endif - return ; - error("! I can't find cmr10.tfm; please reinstall me with proper paths") ; + return; + error("! I can't find cmr10.tfm; please reinstall me with proper paths"); } shalfword tfmbyte(void) { - return(getc(tfmfile)) ; + return(getc(tfmfile)); } halfword tfm16(void) { - register halfword a ; - a = tfmbyte () ; - return ( a * 256 + tfmbyte () ) ; + register halfword a; + a = tfmbyte (); + return ( a * 256 + tfmbyte () ); } integer tfm32(void) { - register integer a ; - a = tfm16 () ; - if (a > 32767) a -= 65536 ; - return ( a * 65536 + tfm16 () ) ; + register integer a; + a = tfm16 (); + if (a > 32767) a -= 65536; + return ( a * 65536 + tfm16 () ); } int tfmload(register fontdesctype *curfnt) { - register integer i, j ; - register integer li, cd=0 ; - integer scaledsize ; - integer nw, hd ; - integer bc, ec ; - integer nco=0, ncw=0, npc=0, no_repeats = 0 ; - integer *scaled ; - integer *chardat ; - int font_level ; - integer pretend_no_chars ; - int charcount = 0 ; + register integer i, j; + register integer li, cd=0; + integer scaledsize; + integer nw, hd; + integer bc, ec; + integer nco=0, ncw=0, npc=0, no_repeats = 0; + integer *scaled; + integer *chardat; + int font_level; + integer pretend_no_chars; + int charcount = 0; - tfmopen(curfnt) ; + tfmopen(curfnt); /* * Next, we read the font data from the tfm file, and store it in * our own arrays. */ - li = tfm16() ; + li = tfm16(); if (li!=0) { - font_level = -1 ; - hd = tfm16() ; - bc = tfm16() ; ec = tfm16() ; - nw = tfm16() ; - li = tfm32() ; li = tfm32() ; li = tfm32() ; li = tfm16() ; + font_level = -1; + hd = tfm16(); + bc = tfm16(); ec = tfm16(); + nw = tfm16(); + li = tfm32(); li = tfm32(); li = tfm32(); li = tfm16(); if (hd<2 || bc>ec+1 || ec>255 || nw>256) - badtfm("header") ; + badtfm("header"); } else { /* In an .ofm file */ - if (noomega) badtfm("length") ; + if (noomega) badtfm("length"); font_level = tfm16(); - li = tfm32() ; hd = tfm32() ; - bc = tfm32() ; ec = tfm32() ; - nw = tfm32() ; + li = tfm32(); hd = tfm32(); + bc = tfm32(); ec = tfm32(); + nw = tfm32(); for (i=0; i<8; i++) li=tfm32(); if (font_level>1 || hd<2 || bc<0 || ec<0 || nw<0 || bc>ec+1 || ec>65535 || nw>65536) - badtfm("header") ; + badtfm("header"); if (font_level==1) { - nco = tfm32() ; - ncw = tfm32() ; - npc = tfm32() ; + nco = tfm32(); + ncw = tfm32(); + npc = tfm32(); for (i=0; i<12; i++) li=tfm32(); } } - li = tfm32() ; + li = tfm32(); check_checksum (li, curfnt->checksum, curfnt->name); - li = (integer)(alpha * (real)tfm32()) ; + li = (integer)(alpha * (real)tfm32()); if (li > curfnt->designsize + fsizetol || li < curfnt->designsize - fsizetol) { char *msg = concat ("Design size mismatch in font ", curfnt->name); error(msg); } - pretend_no_chars=ec+1 ; - if (pretend_no_chars<256) pretend_no_chars=256 ; + pretend_no_chars=ec+1; + if (pretend_no_chars<256) pretend_no_chars=256; else { curfnt->chardesc = (chardesctype *) - xrealloc(curfnt->chardesc, sizeof(chardesctype)*pretend_no_chars) ; - curfnt->maxchars = pretend_no_chars ; + xrealloc(curfnt->chardesc, sizeof(chardesctype)*pretend_no_chars); + curfnt->maxchars = pretend_no_chars; } for (i=2; i<((font_level==1)?nco-29:hd); i++) - li = tfm32() ; - chardat = (integer *) xmalloc(pretend_no_chars*sizeof(integer)) ; + li = tfm32(); + chardat = (integer *) xmalloc(pretend_no_chars*sizeof(integer)); for (i=0; i<pretend_no_chars; i++) - chardat[i] = -1 ; + chardat[i] = -1; for (i=bc; i<=ec; i++) { if (no_repeats>0) { - no_repeats-- ; + no_repeats--; } else if (font_level>=0) { - cd = tfm16() ; - li = tfm32() ; - li = tfm16() ; + cd = tfm16(); + li = tfm32(); + li = tfm16(); if (font_level==1) { - no_repeats = tfm16() ; - for (j=0; j<(npc|1); j++) tfm16() ; - ncw -= 3 + npc/2 ; + no_repeats = tfm16(); + for (j=0; j<(npc|1); j++) tfm16(); + ncw -= 3 + npc/2; } } else { - cd = tfmbyte() ; - li = tfm16() ; - li = tfmbyte() ; + cd = tfmbyte(); + li = tfm16(); + li = tfmbyte(); } - if (cd>=nw) badtfm("char info") ; + if (cd>=nw) badtfm("char info"); if (cd) { - chardat[i] = cd ; - charcount++ ; + chardat[i] = cd; + charcount++; } } if (font_level==1&&ncw!=0) { char *msg = ("Table size mismatch in ", curfnt->name); error(errbuf); } - scaledsize = curfnt->scaledsize ; - scaled = (integer *) xmalloc(nw*sizeof(integer)) ; + scaledsize = curfnt->scaledsize; + scaled = (integer *) xmalloc(nw*sizeof(integer)); for (i=0; i<nw; i++) - scaled[i] = scalewidth(tfm32(), scaledsize) ; - (void)fclose(tfmfile) ; + scaled[i] = scalewidth(tfm32(), scaledsize); + (void)fclose(tfmfile); for (i=0; i<pretend_no_chars; i++) if (chardat[i]!= -1) { - li = scaled[chardat[i]] ; - curfnt->chardesc[i].TFMwidth = li ; + li = scaled[chardat[i]]; + curfnt->chardesc[i].TFMwidth = li; if (li >= 0) - curfnt->chardesc[i].pixelwidth = ((integer)(conv*li+0.5)) ; + curfnt->chardesc[i].pixelwidth = ((integer)(conv*li+0.5)); else - curfnt->chardesc[i].pixelwidth = -((integer)(conv*-li+0.5)) ; - curfnt->chardesc[i].flags = (curfnt->resfont ? EXISTS : 0) ; - curfnt->chardesc[i].flags2 = EXISTS ; - } else curfnt->chardesc[i].flags = curfnt->chardesc[i].flags2 = 0 ; - free(chardat) ; - free(scaled) ; - if (ec>=256) curfnt->codewidth = 2 ; /* XXX: 2byte-code can have ec<256 */ - curfnt->loaded = 1 ; - return charcount ; + curfnt->chardesc[i].pixelwidth = -((integer)(conv*-li+0.5)); + curfnt->chardesc[i].flags = (curfnt->resfont ? EXISTS : 0); + curfnt->chardesc[i].flags2 = EXISTS; + } else curfnt->chardesc[i].flags = curfnt->chardesc[i].flags2 = 0; + free(chardat); + free(scaled); + if (ec>=256) curfnt->codewidth = 2; /* XXX: 2byte-code can have ec<256 */ + curfnt->loaded = 1; + return charcount; } diff --git a/Build/source/texk/dvipsk/unpack.c b/Build/source/texk/dvipsk/unpack.c index de69f508d0f..865e9a13a61 100644 --- a/Build/source/texk/dvipsk/unpack.c +++ b/Build/source/texk/dvipsk/unpack.c @@ -14,12 +14,12 @@ /* * Some statics for use here. */ -static halfword bitweight ; -static halfword dynf ; +static halfword bitweight; +static halfword dynf; static halfword gpower[17] = { 0 , 1 , 3 , 7 , 15 , 31 , 63 , 127 , - 255 , 511 , 1023 , 2047 , 4095 , 8191 , 16383 , 32767 , 65535 } ; -static long repeatcount ; -static quarterword *p ; + 255 , 511 , 1023 , 2047 , 4095 , 8191 , 16383 , 32767 , 65535 }; +static long repeatcount; +static quarterword *p; /* * We need procedures to get a nybble, bit, and packed word from the @@ -30,152 +30,152 @@ shalfword getnyb(void) { if ( bitweight == 0 ) - { bitweight = 16 ; - return(*p++ & 15) ; + { bitweight = 16; + return(*p++ & 15); } else { - bitweight = 0 ; - return(*p >> 4) ; + bitweight = 0; + return(*p >> 4); } } Boolean getbit(void) { - bitweight >>= 1 ; + bitweight >>= 1; if ( bitweight == 0 ) - { p++ ; - bitweight = 128 ; + { p++; + bitweight = 128; } - return(*p & bitweight) ; + return(*p & bitweight); } long pkpackednum(void) { register halfword i; - register long j ; - i = getnyb () ; + register long j; + i = getnyb (); if ( i == 0 ) { - do { j = getnyb () ; - i++ ; - } while ( j == 0 ) ; + do { j = getnyb (); + i++; + } while ( j == 0 ); while ( i != 0 ) { - j = j * 16 + ((long) getnyb ()) ; - i-- ; + j = j * 16 + ((long) getnyb ()); + i--; } - return ( j - 15 + ( 13 - dynf ) * 16 + dynf ) ; + return ( j - 15 + ( 13 - dynf ) * 16 + dynf ); } - else if ( i <= dynf ) return ( i ) ; - else if ( i < 14 ) return ( ( i - dynf - 1 )*16 + getnyb() + dynf + 1 ) ; + else if ( i <= dynf ) return ( i ); + else if ( i < 14 ) return ( ( i - dynf - 1 )*16 + getnyb() + dynf + 1 ); else { if (repeatcount != 0) - error("! recursive repeat count in pk file") ; - repeatcount = 1 ; - if ( i == 14 ) repeatcount = pkpackednum () ; - return ( pkpackednum() ) ; + error("! recursive repeat count in pk file"); + repeatcount = 1; + if ( i == 14 ) repeatcount = pkpackednum (); + return ( pkpackednum() ); } } void flip(register char *s, register long howmany) { - register char t ; + register char t; while (howmany > 0) { - t = *s ; - *s = s[1] ; - s[1] = t ; - howmany-- ; - s += 2 ; + t = *s; + *s = s[1]; + s[1] = t; + howmany--; + s += 2; } } /* * And now we have our main routine. */ -static halfword bftest = 1 ; +static halfword bftest = 1; long unpack(quarterword *pack, halfword *raster, halfword cwidth, halfword cheight, halfword cmd) { - register integer i, j ; - shalfword wordwidth ; - register halfword word, wordweight ; - shalfword rowsleft ; - Boolean turnon ; - shalfword hbit, ww ; - long count ; - halfword *oraster ; + register integer i, j; + shalfword wordwidth; + register halfword word, wordweight; + shalfword rowsleft; + Boolean turnon; + shalfword hbit, ww; + long count; + halfword *oraster; - oraster = raster ; - p = pack ; - dynf = cmd / 16 ; - turnon = cmd & 8 ; - wordwidth = (cwidth + 15)/16 ; + oraster = raster; + p = pack; + dynf = cmd / 16; + turnon = cmd & 8; + wordwidth = (cwidth + 15)/16; if ( dynf == 14 ) - { bitweight = 256 ; - for ( i = 1 ; i <= cheight ; i ++ ) - { word = 0 ; - wordweight = 32768 ; - for ( j = 1 ; j <= cwidth ; j ++ ) - { if ( getbit () ) word += wordweight ; - wordweight >>= 1 ; + { bitweight = 256; + for ( i = 1; i <= cheight; i ++ ) + { word = 0; + wordweight = 32768; + for ( j = 1; j <= cwidth; j ++ ) + { if ( getbit () ) word += wordweight; + wordweight >>= 1; if ( wordweight == 0 ) - { *raster++ = word ; - word = 0 ; - wordweight = 32768 ; + { *raster++ = word; + word = 0; + wordweight = 32768; } } if ( wordweight != 32768 ) - *raster++ = word ; + *raster++ = word; } } else { - rowsleft = cheight ; - hbit = cwidth ; - repeatcount = 0 ; - ww = 16 ; - word = 0 ; - bitweight = 16 ; + rowsleft = cheight; + hbit = cwidth; + repeatcount = 0; + ww = 16; + word = 0; + bitweight = 16; while ( rowsleft > 0 ) - { count = pkpackednum() ; + { count = pkpackednum(); while ( count != 0 ) { if ( ( count <= ww ) && ( count < hbit ) ) { if ( turnon ) word += gpower [ ww ] - gpower - [ ww - count ] ; - hbit -= count ; - ww -= count ; - count = 0 ; + [ ww - count ]; + hbit -= count; + ww -= count; + count = 0; } else if ( ( count >= hbit ) && ( hbit <= ww ) ) { if ( turnon ) - word += gpower[ww] - gpower[ww-hbit] ; - *raster++ = word ; - for ( i = 1 ; i <= repeatcount ; i ++ ) { - for ( j = 1 ; j <= wordwidth ; j ++ ) { - *raster = *(raster - wordwidth) ; - raster++ ; + word += gpower[ww] - gpower[ww-hbit]; + *raster++ = word; + for ( i = 1; i <= repeatcount; i ++ ) { + for ( j = 1; j <= wordwidth; j ++ ) { + *raster = *(raster - wordwidth); + raster++; } } - rowsleft -= repeatcount + 1 ; - repeatcount = 0 ; - word = 0 ; - ww = 16 ; - count -= hbit ; - hbit = cwidth ; + rowsleft -= repeatcount + 1; + repeatcount = 0; + word = 0; + ww = 16; + count -= hbit; + hbit = cwidth; } else - { if ( turnon ) word += gpower [ ww ] ; - *raster++ = word ; - word = 0 ; - count -= ww ; - hbit -= ww ; - ww = 16 ; + { if ( turnon ) word += gpower [ ww ]; + *raster++ = word; + word = 0; + count -= ww; + hbit -= ww; + ww = 16; } } - turnon = ! turnon ; + turnon = ! turnon; } if ( ( rowsleft != 0 ) || ( (unsigned)hbit != cwidth ) ) - error ( "! error while unpacking; more bits than required" ) ; + error ( "! error while unpacking; more bits than required" ); } if (*(char *)&bftest) /* is the hardware LittleEndian? */ - flip((char *)oraster, ((cwidth + 15) >> 4) * (long)cheight) ; - return(p-pack) ; + flip((char *)oraster, ((cwidth + 15) >> 4) * (long)cheight); + return(p-pack); } diff --git a/Build/source/texk/dvipsk/virtualfont.c b/Build/source/texk/dvipsk/virtualfont.c index 08dedb450c5..a0444623811 100644 --- a/Build/source/texk/dvipsk/virtualfont.c +++ b/Build/source/texk/dvipsk/virtualfont.c @@ -15,8 +15,8 @@ * Now we have some routines to get stuff from the VF file. * Subroutine vfbyte returns the next byte. */ -static FILE *vffile ; -static char name[500] ; +static FILE *vffile; +static char name[500]; void badvf(const char *s) { @@ -27,75 +27,75 @@ badvf(const char *s) shalfword vfbyte(void) { - register shalfword i ; + register shalfword i; if ((i=getc(vffile))==EOF) - badvf("unexpected eof") ; - return(i) ; + badvf("unexpected eof"); + return(i); } integer vfquad(void) { - register integer i ; + register integer i; - i = vfbyte() ; + i = vfbyte(); if (i > 127) - i -= 256 ; - i = i * 256 + vfbyte() ; - i = i * 256 + vfbyte() ; - i = i * 256 + vfbyte() ; - return(i) ; + i -= 256; + i = i * 256 + vfbyte(); + i = i * 256 + vfbyte(); + i = i * 256 + vfbyte(); + return(i); } integer vftrio(void) { - register integer i ; + register integer i; - i = vfbyte() ; - i = i * 256 + vfbyte() ; - i = i * 256 + vfbyte() ; - return(i) ; + i = vfbyte(); + i = i * 256 + vfbyte(); + i = i * 256 + vfbyte(); + return(i); } int vfopen(register fontdesctype *fd) { - register char *n ; + register char *n; #ifndef KPATHSEA - register char *d ; + register char *d; #endif - n = fd->name ; + n = fd->name; #ifndef KPATHSEA - d = fd->area ; + d = fd->area; if (*d==0) - d = vfpath ; + d = vfpath; #endif if (strlen(n) + 5 >= sizeof (name)) { /* 5 for vf() + null */ - error("! VF file name too long in vfopen") ; + error("! VF file name too long in vfopen"); } #ifdef MVSXA /* IBM: MVS/XA */ - (void)sprintf(name, "vf(%s)", n) ; + (void)sprintf(name, "vf(%s)", n); #else - (void)sprintf(name, "%s.vf", n) ; + (void)sprintf(name, "%s.vf", n); #endif #ifdef KPATHSEA if (0 != (vffile=search(vfpath, name, READBIN))) #else if (0 != (vffile=search(d, name, READBIN))) #endif - return(1) ; + return(1); if (!noomega) #ifdef KPATHSEA if (0 != (vffile=search(ovfpath, n, READBIN))) #else if (0 != (vffile=search(d, n, READBIN))) #endif - return(2) ; - return(0) ; + return(2); + return(0); } /* @@ -104,42 +104,42 @@ vfopen(register fontdesctype *fd) fontmaptype * vfontdef(integer s, int siz) { - register integer i, j, fn ; - register fontdesctype *fp ; - register fontmaptype *cfnt ; - char *nam, *area ; - integer cksum, scsize, dssize ; + register integer i, j, fn; + register fontdesctype *fp; + register fontmaptype *cfnt; + char *nam, *area; + integer cksum, scsize, dssize; - fn = vfbyte() ; + fn = vfbyte(); while (siz-- > 1) - fn = (fn << 8) + vfbyte() ; - cfnt = (fontmaptype *)mymalloc((integer)sizeof(fontmaptype)) ; - cfnt->fontnum = fn ; - cksum = vfquad() ; - scsize = scalewidth(s, vfquad()) ; - dssize = (integer)(alpha * (real)vfquad()) ; - i = vfbyte() ; j = vfbyte() ; + fn = (fn << 8) + vfbyte(); + cfnt = (fontmaptype *)mymalloc((integer)sizeof(fontmaptype)); + cfnt->fontnum = fn; + cksum = vfquad(); + scsize = scalewidth(s, vfquad()); + dssize = (integer)(alpha * (real)vfquad()); + i = vfbyte(); j = vfbyte(); if (nextstring + i + j > maxstring) - error("! out of string space") ; - area = nextstring ; + error("! out of string space"); + area = nextstring; for (; i>0; i--) - *nextstring++ = vfbyte() ; - *nextstring++ = 0 ; - nam = nextstring ; + *nextstring++ = vfbyte(); + *nextstring++ = 0; + nam = nextstring; for (; j>0; j--) - *nextstring++ = vfbyte() ; - *nextstring++ = 0 ; - fp = matchfont(nam, area, scsize, (char *)0) ; + *nextstring++ = vfbyte(); + *nextstring++ = 0; + fp = matchfont(nam, area, scsize, (char *)0); if (fp) { - nextstring = nam ; - fp->checksum = cksum ; + nextstring = nam; + fp->checksum = cksum; } else { - fp = newfontdesc(cksum, scsize, dssize, nam, area) ; - fp->next = fonthead ; - fonthead = fp ; + fp = newfontdesc(cksum, scsize, dssize, nam, area); + fp->next = fonthead; + fonthead = fp; } - cfnt->desc = fp ; - return (cfnt) ; + cfnt->desc = fp; + return (cfnt); } /* @@ -148,25 +148,25 @@ vfontdef(integer s, int siz) Boolean virtualfont(register fontdesctype *curfnt) { - register integer i ; - register shalfword cmd ; - register integer k ; - register integer length ; - register integer cc ; - register chardesctype *cd ; - integer scaledsize = curfnt->scaledsize ; - integer no_of_chars=256 ; - integer maxcc=255 ; - register quarterword *tempr ; - fontmaptype *fm, *newf ; - int kindfont ; - kindfont = vfopen(curfnt) ; /* 1 for TeX, 2 for Omega */ + register integer i; + register shalfword cmd; + register integer k; + register integer length; + register integer cc; + register chardesctype *cd; + integer scaledsize = curfnt->scaledsize; + integer no_of_chars=256; + integer maxcc=255; + register quarterword *tempr; + fontmaptype *fm, *newf; + int kindfont; + kindfont = vfopen(curfnt); /* 1 for TeX, 2 for Omega */ if (!kindfont) - return (0) ; + return (0); #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr,"Loading virtual font %s at %.1fpt\n", - name, (real)scaledsize/(alpha*0x100000)) ; + name, (real)scaledsize/(alpha*0x100000)); #endif /* DEBUG */ /* @@ -180,21 +180,21 @@ virtualfont(register fontdesctype *curfnt) mymalloc(65536 * (integer)sizeof(chardesctype)); } for (i=0; i<no_of_chars; i++) { - curfnt->chardesc[i].TFMwidth = 0 ; - curfnt->chardesc[i].packptr = NULL ; - curfnt->chardesc[i].pixelwidth = 0 ; - curfnt->chardesc[i].flags = 0 ; - curfnt->chardesc[i].flags2 = 0 ; + curfnt->chardesc[i].TFMwidth = 0; + curfnt->chardesc[i].packptr = NULL; + curfnt->chardesc[i].pixelwidth = 0; + curfnt->chardesc[i].flags = 0; + curfnt->chardesc[i].flags2 = 0; } if (vfbyte()!=247) - badvf("expected pre") ; + badvf("expected pre"); if (vfbyte()!=202) - badvf("wrong id byte") ; + badvf("wrong id byte"); for(i=vfbyte(); i>0; i--) - (void)vfbyte() ; - k = vfquad() ; + (void)vfbyte(); + k = vfquad(); check_checksum (k, curfnt->checksum, curfnt->name); - k = (integer)(alpha * (real)vfquad()) ; + k = (integer)(alpha * (real)vfquad()); if (k > curfnt->designsize + 2 || k < curfnt->designsize - 2) { char *msg = concat("Design size mismatch in font ", name); error(msg); @@ -203,42 +203,42 @@ virtualfont(register fontdesctype *curfnt) /* * Now we look for font definitions. */ - fm = NULL ; + fm = NULL; while ((cmd=vfbyte())>=243) { if (cmd>246) - badvf("unexpected command in preamble") ; - newf = vfontdef(scaledsize, cmd-242) ; + badvf("unexpected command in preamble"); + newf = vfontdef(scaledsize, cmd-242); if (fm) - fm->next = newf ; - else curfnt->localfonts = newf ; - fm = newf ; - fm->next = NULL ; /* FIFO */ + fm->next = newf; + else curfnt->localfonts = newf; + fm = newf; + fm->next = NULL; /* FIFO */ } /* * Now we get down to the serious business of reading character definitions. */ do { if (cmd==242) { - length = vfquad() + 2 ; - if (length<2) badvf("negative length packet") ; - if (length>65535) badvf("packet too long") ; - cc = vfquad() ; - if (cc<0 || cc>=no_of_chars) badvf("character code out of range") ; - cd = curfnt->chardesc + cc ; - cd->TFMwidth = scalewidth(vfquad(), scaledsize) ; + length = vfquad() + 2; + if (length<2) badvf("negative length packet"); + if (length>65535) badvf("packet too long"); + cc = vfquad(); + if (cc<0 || cc>=no_of_chars) badvf("character code out of range"); + cd = curfnt->chardesc + cc; + cd->TFMwidth = scalewidth(vfquad(), scaledsize); } else { length = cmd + 2; - cc = vfbyte() ; - cd = curfnt->chardesc + cc ; - cd->TFMwidth = scalewidth(vftrio(), scaledsize) ; + cc = vfbyte(); + cd = curfnt->chardesc + cc; + cd->TFMwidth = scalewidth(vftrio(), scaledsize); } maxcc = (maxcc<cc) ? cc : maxcc; if (cd->TFMwidth >= 0) - cd->pixelwidth = ((integer)(conv*cd->TFMwidth+0.5)) ; + cd->pixelwidth = ((integer)(conv*cd->TFMwidth+0.5)); else - cd->pixelwidth = -((integer)(conv*-cd->TFMwidth+0.5)) ; - cd->flags = EXISTS ; - cd->flags2 = EXISTS ; + cd->pixelwidth = -((integer)(conv*-cd->TFMwidth+0.5)); + cd->flags = EXISTS; + cd->flags2 = EXISTS; if (bytesleft < length) { #ifdef DEBUG if (dd(D_MEM)) @@ -248,39 +248,39 @@ virtualfont(register fontdesctype *curfnt) #else "Allocating new raster memory (%d req, %ld left)\n", #endif - length, bytesleft) ; + length, bytesleft); #endif /* DEBUG */ if (length > MINCHUNK) { - tempr = (quarterword *)mymalloc((integer)length) ; - bytesleft = 0 ; + tempr = (quarterword *)mymalloc((integer)length); + bytesleft = 0; } else { - raster = (quarterword *)mymalloc((integer)RASTERCHUNK) ; - tempr = raster ; - bytesleft = RASTERCHUNK - length ; - raster += length ; + raster = (quarterword *)mymalloc((integer)RASTERCHUNK); + tempr = raster; + bytesleft = RASTERCHUNK - length; + raster += length; } } else { - tempr = raster ; - bytesleft -= length ; - raster += length ; + tempr = raster; + bytesleft -= length; + raster += length; } - cd->packptr = tempr ; - length -= 2 ; - *tempr++ = length / 256 ; - *tempr++ = length % 256 ; + cd->packptr = tempr; + length -= 2; + *tempr++ = length / 256; + *tempr++ = length % 256; for (; length>0; length--) - *tempr++ = vfbyte() ; - cmd = vfbyte() ; - } while (cmd < 243) ; + *tempr++ = vfbyte(); + cmd = vfbyte(); + } while (cmd < 243); if (cmd != 248) - badvf("missing postamble") ; - (void)fclose(vffile) ; - curfnt->loaded = 2 ; + badvf("missing postamble"); + (void)fclose(vffile); + curfnt->loaded = 2; if (maxcc+1<no_of_chars) { curfnt->chardesc = (chardesctype *) xrealloc(curfnt->chardesc, (maxcc+1) * (integer)sizeof(chardesctype)); curfnt->maxchars=maxcc+1; } - return (1) ; + return (1); } diff --git a/Build/source/texk/dvipsk/writet1.c b/Build/source/texk/dvipsk/writet1.c index a54d975c96c..35cc3a03e09 100644 --- a/Build/source/texk/dvipsk/writet1.c +++ b/Build/source/texk/dvipsk/writet1.c @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define make_subset_tag(a, b) #define update_subset_tag() -static char *dvips_extra_charset ; +static char *dvips_extra_charset; static char *cur_file_name; static char *cur_enc_name; static unsigned char *grid; @@ -1524,7 +1524,7 @@ boolean t1_subset(char *fontfile, char *encfile, unsigned char *g) for (i = 0; i <= MAX_CHAR_CODE; i++) if (ext_glyph_names[i] != notdef) free(ext_glyph_names[i]); - return 1 ; /* note: there *is* no unsuccessful return */ + return 1; /* note: there *is* no unsuccessful return */ } boolean t1_subset_2(char *fontfile, unsigned char *g, char *extraGlyphs) @@ -1535,10 +1535,10 @@ boolean t1_subset_2(char *fontfile, unsigned char *g, char *extraGlyphs) grid = g; cur_file_name = fontfile; hexline_length = 0; - dvips_extra_charset = extraGlyphs ; + dvips_extra_charset = extraGlyphs; writet1(); for (i = 0; i <= MAX_CHAR_CODE; i++) if (ext_glyph_names[i] != notdef) free(ext_glyph_names[i]); - return 1 ; /* note: there *is* no unsuccessful return */ + return 1; /* note: there *is* no unsuccessful return */ } |