summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/resident.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipsk/resident.c')
-rw-r--r--Build/source/texk/dvipsk/resident.c652
1 files changed, 326 insertions, 326 deletions
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);