summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-07 08:54:56 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-07 08:54:56 +0000
commit875e77707294c9e48e549cfeed457f13ef2f88c8 (patch)
treede88fd6d9fc6e04393e5572c8df8aa48c0956e08 /Build/source/texk
parentecc7e87ccffc19c4550f5b2452688a8fb3006aa8 (diff)
dvipsk cleanup: static funcs and trailing whitespace
git-svn-id: svn://tug.org/texlive/trunk@18142 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog33
-rw-r--r--Build/source/texk/dvipsk/bbox.c4
-rw-r--r--Build/source/texk/dvipsk/color.c6
-rw-r--r--Build/source/texk/dvipsk/dosection.c2
-rw-r--r--Build/source/texk/dvipsk/dospecial.c6
-rw-r--r--Build/source/texk/dvipsk/dpicheck.c4
-rw-r--r--Build/source/texk/dvipsk/drawPS.c2
-rw-r--r--Build/source/texk/dvipsk/dviinput.c2
-rw-r--r--Build/source/texk/dvipsk/dvips.c47
-rw-r--r--Build/source/texk/dvipsk/emspecial.c110
-rw-r--r--Build/source/texk/dvipsk/finclude.c28
-rw-r--r--Build/source/texk/dvipsk/header.c7
-rw-r--r--Build/source/texk/dvipsk/hps.c203
-rw-r--r--Build/source/texk/dvipsk/loadfont.c8
-rw-r--r--Build/source/texk/dvipsk/output.c24
-rw-r--r--Build/source/texk/dvipsk/papersiz.c4
-rw-r--r--Build/source/texk/dvipsk/protos.h148
-rw-r--r--Build/source/texk/dvipsk/repack.c8
-rw-r--r--Build/source/texk/dvipsk/resident.c10
-rw-r--r--Build/source/texk/dvipsk/t1part.c114
-rw-r--r--Build/source/texk/dvipsk/t1part.h49
-rw-r--r--Build/source/texk/dvipsk/tfmload.c2
-rw-r--r--Build/source/texk/dvipsk/unpack.c180
-rw-r--r--Build/source/texk/dvipsk/virtualfont.c14
-rw-r--r--Build/source/texk/dvipsk/writet1.c124
25 files changed, 502 insertions, 637 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index 81e455ee5ae..29c3cd4cbcc 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,9 +1,30 @@
-2010-05-06 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
-
- * output.c: correct wrong boundary values of characters.
- from Takuji Tanaka <KXD02663@nifty.ne.jp>.
- * protos.h, dvips.c, output.c, resident.c: remove unnecessary SJIS option.
- from Takuji Tanaka <KXD02663@nifty.ne.jp>.
+2010-05-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * bbox.c: Declare function used only in this file as static,
+ remove trailing whitespace.
+ * color.c: The same.
+ * dosection.c: The same.
+ * dospecial.c: The same.
+ * dpicheck.c: The same.
+ * drawPS.c: The same.
+ * dviinput.c: The same.
+ * dvips.c: The same.
+ * emspecial.c: The same.
+ * finclude.c: The same.
+ * header.c: The same.
+ * hps.c: The same.
+ * loadfont.c: The same.
+ * output.c: The same.
+ * papersiz.c: The same.
+ * repack.c: The same.
+ * resident.c: The same.
+ * t1part.c: The same.
+ * tfmload.c: The same.
+ * unpack.c: The same.
+ * virtualfont.c: The same.
+ * writet1.c: The same. Skip compilation of unused functions.
+ * protos.h: Remove all these extern declarations.
+ * t1part.h: Remove unused K&R function declarations.
2010-05-06 Karl Berry <karl@tug.org>
diff --git a/Build/source/texk/dvipsk/bbox.c b/Build/source/texk/dvipsk/bbox.c
index 8073df25fb6..d7ee108d310 100644
--- a/Build/source/texk/dvipsk/bbox.c
+++ b/Build/source/texk/dvipsk/bbox.c
@@ -27,7 +27,7 @@ typedef struct bbtft {
static bbfontmaptype *bbffont;
-void
+static void
bbtfmload(register fontdesctype *curfnt)
{
register integer i, j;
@@ -278,7 +278,7 @@ bbspecial(integer h, integer v, integer dir, int nbytes)
}
}
}
-void
+static void
bbdopage(void)
{
register shalfword cmd;
diff --git a/Build/source/texk/dvipsk/color.c b/Build/source/texk/dvipsk/color.c
index 34a264f901c..5a0977f590d 100644
--- a/Build/source/texk/dvipsk/color.c
+++ b/Build/source/texk/dvipsk/color.c
@@ -1,5 +1,5 @@
-/*
- * This is a set of routines for dvips that are used to process color
+/*
+ * This is a set of routines for dvips that are used to process color
* commands in the TeX file (passed by \special commands). This was
* orignally written by J. Hafner, E. Blanz and M. Flickner of IBM
* Research, Almaden Research Center. Contact hafner@almaden.ibm.com.
@@ -47,7 +47,7 @@ static char *cstack, *csp, *cend, *bg;
* is a word followed by arguments, we send out the arguments and
* then the word prefixed by "TeXcolor".
*/
-void
+static void
colorcmdout(char *s)
{
char *p;
diff --git a/Build/source/texk/dvipsk/dosection.c b/Build/source/texk/dvipsk/dosection.c
index 426ca5d70e8..18a281b8da4 100644
--- a/Build/source/texk/dvipsk/dosection.c
+++ b/Build/source/texk/dvipsk/dosection.c
@@ -198,7 +198,7 @@ InPageList(integer i)
return 0;
}
-void
+static void
InstallPL(integer pslow, integer pshigh)
{
register struct p_list_str *pl;
diff --git a/Build/source/texk/dvipsk/dospecial.c b/Build/source/texk/dvipsk/dospecial.c
index 6dde4f95fc6..a99e6bd6662 100644
--- a/Build/source/texk/dvipsk/dospecial.c
+++ b/Build/source/texk/dvipsk/dospecial.c
@@ -264,7 +264,7 @@ Tolower(register char c)
#endif /* IBM: VM/CMS */
#endif
#endif /* !KPATHSEA */
-int
+static int
IsSame(const char *a, const char *b)
{
for(; *a != '\0'; ) {
@@ -281,7 +281,7 @@ const char *ValStr; /* ... String values found */
long ValInt; /* Integer value found */
float ValNum; /* Number or Dimension value found */
-char *
+static 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 */
@@ -574,7 +574,7 @@ default:
scanfontcomments(ValStr);
}
-int
+static int
maccess(char *s)
{
FILE *f = search(figpath, s, "r");
diff --git a/Build/source/texk/dvipsk/dpicheck.c b/Build/source/texk/dvipsk/dpicheck.c
index 69a6d445a42..19d8b6c92d8 100644
--- a/Build/source/texk/dvipsk/dpicheck.c
+++ b/Build/source/texk/dvipsk/dpicheck.c
@@ -14,7 +14,7 @@ static int checkdpi;
/*
* This routine adds some sizes to `existsizes'.
*/
-void
+static void
addsiz(int rhsize)
{
register integer *p;
@@ -30,7 +30,7 @@ addsiz(int rhsize)
hsize = t;
} while (hsize);
}
-void
+static void
adddpi(int hsize)
{
long a, b, c;
diff --git a/Build/source/texk/dvipsk/drawPS.c b/Build/source/texk/dvipsk/drawPS.c
index c010697020b..b60ea6f78bb 100644
--- a/Build/source/texk/dvipsk/drawPS.c
+++ b/Build/source/texk/dvipsk/drawPS.c
@@ -268,7 +268,7 @@ arc(char *cp, int invis)
* of a dashed box is solid.
* The number of inches/dash must be adjusted accordingly.
*/
-void
+static void
flushDashedPath(int dotted, double inchesPerDash)
{
register int i;
diff --git a/Build/source/texk/dvipsk/dviinput.c b/Build/source/texk/dvipsk/dviinput.c
index 1371bdaab4b..c617409b225 100644
--- a/Build/source/texk/dvipsk/dviinput.c
+++ b/Build/source/texk/dvipsk/dviinput.c
@@ -11,7 +11,7 @@
*/
#include "protos.h"
-void
+static void
abortpage(void)
{
error("! unexpected eof on DVI file");
diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c
index f53e6977de6..292647b35c9 100644
--- a/Build/source/texk/dvipsk/dvips.c
+++ b/Build/source/texk/dvipsk/dvips.c
@@ -63,8 +63,10 @@ extern char *strtok(); /* some systems don't have this in strings.h */
static char ofnme[252],infnme[252],pap[40],thh[20];
#endif
-/* PS fonts fully downloaded as headers */
-char *downloadedpsnames[DOWNLOADEDPSSIZE];
+Boolean SJIS; /* KANJI code encoding */
+
+/* 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 */
@@ -301,6 +303,7 @@ static const char *helparr[] = {
#else
" -Z* Compress bitmap fonts",
#endif
+"-SJIS* Shift-JIS encoding",
/*"- 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)",
@@ -349,7 +352,7 @@ error_with_perror(const char *s, const char *fname)
} else {
putc ('\n', stderr);
}
-
+
if (*s=='!') {
freememforpsnames();
if (bitfile != NULL) {
@@ -372,7 +375,7 @@ error(const char *s)
#ifndef KPATHSEA
char *
concat(char *s1, char *s2)
-{
+{
char *s = malloc(strlen(s1)+strlen(s2)+1);
if (s == NULL) {
fprintf(stderr, "Malloc failed to give %d bytes.\nAborting\n",
@@ -390,7 +393,7 @@ concat(char *s1, char *s2)
void
check_checksum(unsigned c1, unsigned c2, const char *name)
{
- if (c1 && c2 && c1 != c2
+ if (c1 && c2 && c1 != c2
#ifdef KPATHSEA
&& !kpse_tex_hush ("checksum")
#endif
@@ -437,7 +440,7 @@ mymalloc(integer n)
error("! no memory");
return p;
}
-void
+static void
morestrings(void) {
strings = mymalloc((integer)STRINGSIZE);
nextstring = strings;
@@ -452,7 +455,7 @@ checkstrings(void) {
/*
* Initialize sets up all the globals and data structures.
*/
-void
+static void
initialize(void)
{
int i;
@@ -471,6 +474,7 @@ initialize(void)
downloadedpsnames[i] = NULL;
unused_top_of_psnames = 0;
morestrings();
+ SJIS = 0;
maxpages = 100000;
numcopies = 1;
iname = fulliname = strings;
@@ -507,7 +511,7 @@ newstring(const char *s)
nextstring += l + 1;
return(q);
}
-void
+static void
newoutname(void) {
static int seq = 0;
static char *seqptr = 0;
@@ -551,7 +555,7 @@ revlist(VOID *p)
return (VOID *)qq;
}
/* this asks for a new set of arguments from the command line */
-void
+static void
queryargs(void)
{
fputs("Options: ",stdout);
@@ -597,7 +601,7 @@ main(int argc, char **argv)
kpse_set_program_name (argv[0], "dvips");
kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
#endif
-
+
#ifdef __THINK__
argc = dcommand(&argv); /* do I/O stream redirection */
#endif
@@ -763,15 +767,15 @@ case 'f' :
break;
case 'u' :
{
- char PSname[300];
+ char PSname[300];
if (*p == 0 && argv[i+1])
p = argv[++i];
strcpy(PSname, p);
- if (!strchr(PSname, '.'))
+ if (!strchr(PSname, '.'))
strcat(PSname, ".map"); /* default extension */
if (PSname[0] == '+')
getpsinfo(PSname+1);
- else
+ else
psmapfile = strdup(PSname); /* a cute small memory leak (just as in 'p' option handling in resident.c) */
}
break;
@@ -807,10 +811,13 @@ case 'R':
secure_option = 1; /* Never used */
break;
case 'S':
- if (*p == 0 && argv[i+1])
- p = argv[++i];
- if (sscanf(p, "%d", &maxsecsize)==0)
- error("! Bad section size arg (-S).");
+ if (strncmp (p, "JIS", 3) == 0) SJIS = (*(p + 3) != '0');
+ else {
+ if (*p == 0 && argv[i+1])
+ p = argv[++i];
+ if (sscanf(p, "%d", &maxsecsize)==0)
+ error("! Bad section size arg (-S).");
+ }
break;
case 'm' :
if (STREQ (p, "ode") && argv[i+1]) {
@@ -836,7 +843,7 @@ case 'n' :
}
break;
case 'o' :
- if (*p == 0 && argv[i+1] &&
+ if (*p == 0 && argv[i+1] &&
(STREQ (argv[i+1], "-") || argv[i+1][0] != '-'))
p = argv[++i];
oname_option = 1;
@@ -1076,7 +1083,7 @@ default:
} else {
if (*iname == 0) {
register char *p;
-
+
lastext = 0;
iname = nextstring;
p = argv[i];
@@ -1157,7 +1164,7 @@ default:
#ifdef KPATHSEA
kpse_init_prog ("DVIPS", actualdpi, mfmode, "cmr10");
kpse_make_tex_discard_errors = quiet;
-#endif
+#endif
/*
* The logic here is a bit convoluted. Since all `additional'
* PostScript font information files are loaded *before* the master
diff --git a/Build/source/texk/dvipsk/emspecial.c b/Build/source/texk/dvipsk/emspecial.c
index 59fe6154f47..542cd32147e 100644
--- a/Build/source/texk/dvipsk/emspecial.c
+++ b/Build/source/texk/dvipsk/emspecial.c
@@ -59,6 +59,7 @@ struct emunit emtable[] = {
{0,0.0}
};
+static void emgraph(char *filename, float emwidth, float emheight);
/* clear the empoints array if necessary */
void
@@ -72,7 +73,7 @@ emclear(void)
}
/* put an empoint into the empoints array */
-struct empt *
+static struct empt *
emptput(shalfword point, integer x, integer y)
{
struct empt *p;
@@ -98,7 +99,7 @@ emptput(shalfword point, integer x, integer y)
}
/* get an empoint from the empoints array */
-struct empt *
+static struct empt *
emptget(shalfword point)
{
struct empt *p;
@@ -120,7 +121,7 @@ emptget(shalfword point)
/* convert width into dpi units */
-float
+static float
emunits(float width, char *unit)
{
struct emunit *p;
@@ -143,9 +144,6 @@ struct empt *empoint;
char emunit[30];
char emstr[250];
char *emp;
-#ifndef KPATHSEA
-void emgraph();
-#endif
hvpos();
for (emp = p+3; *emp && isspace(*emp); emp++); /* skip blanks */
@@ -159,7 +157,7 @@ void emgraph();
cmdout(emstr);
#ifdef DEBUG
if (dd(D_SPECIAL))
- (void)fprintf(stderr, "em special: Linewidth set to %.1f dots\n",
+ (void)fprintf(stderr, "em special: Linewidth set to %.1f dots\n",
emwidth);
#endif
} else {
@@ -201,7 +199,7 @@ void emgraph();
}
else if (strncmp(emp, "point", 5) == 0) {
if (empoints == NULL) {
- empoints =
+ empoints =
(struct empt **)mymalloc((integer)emmax * sizeof(struct empt *));
emused = TRUE;
emclear();
@@ -249,7 +247,7 @@ void emgraph();
if (emwidth!=-1.0) {
#ifdef DEBUG
if (dd(D_SPECIAL))
- (void)fprintf(stderr,"em special: Linewidth temporarily set to %.1f dots\n",
+ (void)fprintf(stderr,"em special: Linewidth temporarily set to %.1f dots\n",
emwidth);
#endif
strcpy(emstr,"currentlinewidth");
@@ -309,7 +307,7 @@ void emgraph();
}
}
else {
- sprintf(errbuf,
+ sprintf(errbuf,
"Unknown em: command (%s) in \\special will be ignored", p);
specerror(errbuf);
}
@@ -349,7 +347,7 @@ void emgraph();
/* 8 Oct 92 */
/* Routines to read binary numbers from IBM PC file types */
-integer
+static integer
readinteger(FILE *f)
{
integer i;
@@ -363,12 +361,12 @@ readinteger(FILE *f)
return(i);
}
-halfword
+static halfword
readhalfword(FILE *f)
{
halfword i;
int r;
-
+
i = 0;
for (r = 0; r < 2; r++)
{
@@ -380,7 +378,7 @@ readhalfword(FILE *f)
#define readquarterword(f) ((unsigned char)fgetc(f))
#define tobyte(x) ((x/8) + (x%8 ? 1 : 0))
-/* These routines will decode PCX files produced by Microsoft
+/* These routines will decode PCX files produced by Microsoft
* Windows Paint. Other programs may not produce files which
* will be successfully decoded, most notably version 1.xx of
* PC Paint. */
@@ -390,7 +388,7 @@ readhalfword(FILE *f)
* be a sixteen-bit signed; halfword must be a sixteen-bit unsigned;
* quarterword must be an eight-bit unsigned.
*/
-typedef struct
+typedef struct
{
quarterword man;
quarterword ver;
@@ -408,7 +406,7 @@ typedef struct
halfword byteperline;
halfword paltype;
quarterword fill[58];
-} PCXHEAD;
+} PCXHEAD;
static int
PCXreadhead(FILE *pcxf, PCXHEAD *pcxh)
@@ -439,8 +437,8 @@ PCXreadhead(FILE *pcxf, PCXHEAD *pcxh)
return(1); /* success */
}
-int
-PCXreadline(FILE *pcxf,
+static int
+PCXreadline(FILE *pcxf,
unsigned char *pcxbuf,
unsigned int byteperline)
{
@@ -466,7 +464,7 @@ PCXreadline(FILE *pcxf,
}
static void
-PCXgetpalette(FILE *pcxf, PCXHEAD *pcxh,
+PCXgetpalette(FILE *pcxf, PCXHEAD *pcxh,
unsigned char *r,
unsigned char *g,
unsigned char *b)
@@ -557,9 +555,9 @@ PCXgetpalette(FILE *pcxf, PCXHEAD *pcxh,
}
}
-void
+static void
PCXshowpicture(FILE *pcxf, int wide, int high, int bytes,
- int cp, int bp, unsigned char *r,
+ int cp, int bp, unsigned char *r,
unsigned char *g, unsigned char *b)
{
int x;
@@ -623,7 +621,7 @@ PCXshowpicture(FILE *pcxf, int wide, int high, int bytes,
xmod = 7 - (x&7);
xbit = 1 << xmod;
switch(bp) {
- case 1:
+ case 1:
for (c = 0; c < cp; c++) {
row = rowa[c];
p |= ( (unsigned)(row[xdiv] & xbit) >> xmod ) << c;
@@ -637,7 +635,7 @@ PCXshowpicture(FILE *pcxf, int wide, int high, int bytes,
row = rowa[0]; /* assume single plane */
p = (unsigned) (row[x]);
break;
- default:
+ default:
fprintf(stderr, "em:graph: Unable to Decode this PCX file\n");
return;
}
@@ -653,8 +651,8 @@ PCXshowpicture(FILE *pcxf, int wide, int high, int bytes,
free(rowa[0]);
}
-void
-imagehead(char *filename, int wide, int high,
+static void
+imagehead(char *filename, int wide, int high,
float emwidth, float emheight)
{
char *fullname = NULL, *name;
@@ -691,17 +689,17 @@ imagehead(char *filename, int wide, int high,
cmdout("scale");
#ifdef DEBUG
if (dd(D_SPECIAL)) {
- (void)fprintf(stderr,
+ (void)fprintf(stderr,
"\nem:graph: %s width %d pixels scaled to %.1f pixels\n",
filename, wide, emwidth);
- (void)fprintf(stderr,
+ (void)fprintf(stderr,
"em:graph: %s height %d pixels scaled to %.1f pixels\n",
filename, high, emheight);
}
#endif
}
-void
+static void
imagetail(void)
{
if (!disablecomments) {
@@ -715,7 +713,7 @@ imagetail(void)
}
}
-void
+static void
pcxgraph(FILE *pcxf, char *filename,
float emwidth, float emheight /* dimension in pixels */ )
{
@@ -765,7 +763,7 @@ struct wpnt_1 {
#define WPAINT_1 1
#define WPAINT_2 2
-void
+static void
MSP_2_ps(FILE *f, int wide, int high)
{
char *line;
@@ -809,7 +807,7 @@ MSP_2_ps(FILE *f, int wide, int high)
fseek(f, 32, SEEK_SET);
- /* read in the table of line lengths */
+ /* read in the table of line lengths */
linelen = (halfword *) mymalloc((integer)sizeof(halfword) * high);
for (i = 0; i < high; i++) {
linelen[i] = readhalfword(f);
@@ -847,7 +845,7 @@ MSP_2_ps(FILE *f, int wide, int high)
free(line);
}
-void
+static void
MSP_1_ps(FILE *f, int wide, int high)
{
char *line;
@@ -890,7 +888,7 @@ MSP_1_ps(FILE *f, int wide, int high)
}
-void
+static void
mspgraph(FILE *f, char *filename, float emwidth, float emheight)
{
struct wpnt_1 head;
@@ -898,22 +896,22 @@ mspgraph(FILE *f, char *filename, float emwidth, float emheight)
/* read the header of the file and figure out what it is */
fread(head.id, 1, 4, f);
- head.width = readhalfword(f);
- head.high = readhalfword(f);
- head.x_asp = readhalfword(f);
- head.y_asp = readhalfword(f);
- head.x_asp_prn = readhalfword(f);
- head.y_asp_prn = readhalfword(f);
- head.width_prn = readhalfword(f);
- head.high_prn = readhalfword(f);
- head.chk_sum = readinteger(f);
- head.chk_head = readhalfword(f);
+ head.width = readhalfword(f);
+ head.high = readhalfword(f);
+ head.x_asp = readhalfword(f);
+ head.y_asp = readhalfword(f);
+ head.x_asp_prn = readhalfword(f);
+ head.y_asp_prn = readhalfword(f);
+ head.width_prn = readhalfword(f);
+ head.high_prn = readhalfword(f);
+ head.chk_sum = readinteger(f);
+ head.chk_head = readhalfword(f);
if (feof(f)) {
fprintf(stderr, "em:graph: Unable to Read Valid MSP Header\n");
return;
}
-
+
/* check the id bytes */
if (!memcmp(head.id, "DanM", 4))
paint_type = WPAINT_1;
@@ -976,13 +974,13 @@ struct bitmapfileheader {
integer offbits;
};
-void
+static void
rgbread(FILE *f, int w, int b, char *s)
{
int i;
/* set the line to white */
- memset(s, 0xff, ((w*b)/8)+1);
+ memset(s, 0xff, ((w*b)/8)+1);
/* read in all the full bytes */
for (i = 0; i < (w * b) / 8; i++)
@@ -1005,7 +1003,7 @@ unsigned rle_dx = 0; /* delta command horizontal offset */
unsigned rle_dy = 0; /* delta command vertical offset */
/* checked against output from Borland Resource Workshop */
-void
+static void
rle4read(FILE *f, int w, int b, char *s)
{
int i;
@@ -1018,7 +1016,7 @@ rle4read(FILE *f, int w, int b, char *s)
i = 0;
hi = TRUE;
/* set the line to white */
- memset(s, 0xff, limit+1);
+ memset(s, 0xff, limit+1);
if (rle_dy) {
rle_dy--;
@@ -1080,9 +1078,9 @@ rle4read(FILE *f, int w, int b, char *s)
}
}
}
-
+
/* untested */
-void
+static void
rle8read(FILE *f, int w, int b, char *s)
{
int i;
@@ -1093,7 +1091,7 @@ rle8read(FILE *f, int w, int b, char *s)
limit = (w*b)/8;
i = 0;
/* set the line to white */
- memset(s, 0xff, limit+1);
+ memset(s, 0xff, limit+1);
if (rle_dy) {
rle_dy--;
@@ -1138,7 +1136,7 @@ rle8read(FILE *f, int w, int b, char *s)
}
}
-void
+static void
bmpgraph(FILE *f, char *filename, float emwidth, float emheight)
{
struct bitmapfileheader bmfh;
@@ -1178,7 +1176,7 @@ bmpgraph(FILE *f, char *filename, float emwidth, float emheight)
bmih.size = readinteger(f);
if (bmih.size == 12) { /* OS2 bitmap */
- isOS2 = TRUE;
+ isOS2 = TRUE;
bmih.width = readhalfword(f);
bmih.height = readhalfword(f);
bmih.planes = readhalfword(f);
@@ -1192,7 +1190,7 @@ bmpgraph(FILE *f, char *filename, float emwidth, float emheight)
bmih.clrimportant = 0;
}
else { /* Windows bitmap */
- isOS2 = FALSE;
+ isOS2 = FALSE;
bmih.width = readinteger(f);
bmih.height = readinteger(f);
bmih.planes = readhalfword(f);
@@ -1344,7 +1342,7 @@ bmpgraph(FILE *f, char *filename, float emwidth, float emheight)
c = (rr < 0xff) || (gg < 0xff) || (bb < 0xff);
break;
}
- if (c)
+ if (c)
pshexa[j/8] &= ~omask;
else
pshexa[j/8] |= omask;
@@ -1371,7 +1369,7 @@ bmpgraph(FILE *f, char *filename, float emwidth, float emheight)
const char *extarr[]=
{ ".pcx", ".msp", ".bmp", NULL };
-void
+static void
emgraph(char *filename, float emwidth, float emheight)
{
char fname[80];
diff --git a/Build/source/texk/dvipsk/finclude.c b/Build/source/texk/dvipsk/finclude.c
index 5e21670d007..30b3e12c211 100644
--- a/Build/source/texk/dvipsk/finclude.c
+++ b/Build/source/texk/dvipsk/finclude.c
@@ -37,8 +37,8 @@ double atof();
* no fontmaptype node for the resulting font descriptor until this font is
* encountered by fontdef() (if that ever happens).
*/
-fontdesctype *
-ifontdef(char *name, char *area,
+static fontdesctype *
+ifontdef(char *name, char *area,
int scsize, int dssize, char *scname)
{
fontdesctype *fp;
@@ -53,7 +53,7 @@ ifontdef(char *name, char *area,
* When a font appears in an included psfile for the first time, this routine
* links it into the fonthd[] array.
*/
-void
+static void
setfamily(fontdesctype *f)
{
int i;
@@ -77,7 +77,7 @@ setfamily(fontdesctype *f)
* The first string is the original value of nextstring; the second
* string is the return value.
*/
-char*
+static char*
getname(char *s)
{
char *a, *p, sav;
@@ -103,7 +103,7 @@ getname(char *s)
* we just estimate two usages per character and one string per pair of
* usages.
*/
-void
+static void
includechars(fontdesctype *f, char *s)
{
int b, c, d;
@@ -146,7 +146,7 @@ includechars(fontdesctype *f, char *s)
* options like `hscale=' because then the definition of `fshow' would have
* to change.
*/
-void
+static void
scan1fontcomment(char *p)
{
char *q, *name, *area;
@@ -198,7 +198,7 @@ scan1fontcomment(char *p)
* book specifies two arguments. This routine will accept one or two arguments;
* if there are two arguments we take the maximum.
*/
-integer
+static integer
scanvm(char *p)
{
char* q;
@@ -221,7 +221,7 @@ scanvm(char *p)
* an associated header file (from psfonts.map), the header file
* is added with add_header.
*/
-void
+static void
scan_fontnames(char *str, const char *psfile)
{
char *p,*pe;
@@ -267,7 +267,7 @@ scan_fontnames(char *str, const char *psfile)
/* this code borrowed from residentfont() in resident.c */
char *cp = re->downloadheader;
char *q;
-
+
infont = re->PSname;
while (1) {
q = cp;
@@ -316,11 +316,11 @@ scan_fontnames(char *str, const char *psfile)
*/
static int fc_state = 0;
/*
- * Do we need to check for information at the end of the postscript file?
+ * Do we need to check for information at the end of the postscript file?
*/
static int check_atend = 0;
-void
+static void
scanfontusage(char *p, const char *psfile)
{
if (strncmp(p, "%%DocumentFonts: ",17) == 0) {
@@ -423,7 +423,7 @@ scanfontcomments(const char *filename)
#endif /* DEBUG */
fc_state = 0;
-
+
fseek(f,-4096,2); /* seek to 4096 bytes before EOF. */
fgets(p,500,f); /* throw away a partial line. */
@@ -453,7 +453,7 @@ scanfontcomments(const char *filename)
* Is string s less than 30 characters long with no special characters
* that are not allowed in PostScript commands.
*/
-Boolean
+static Boolean
okascmd(char *ss)
{
register int c = 0;
@@ -467,7 +467,7 @@ okascmd(char *ss)
/*
* Output font area and font name strings as a literal string
*/
-void
+static void
nameout(char *area, char *name)
{
char buf[30];
diff --git a/Build/source/texk/dvipsk/header.c b/Build/source/texk/dvipsk/header.c
index ee5214861b8..0f54fd101dc 100644
--- a/Build/source/texk/dvipsk/header.c
+++ b/Build/source/texk/dvipsk/header.c
@@ -18,6 +18,9 @@ struct header_list *header_head;
*/
#include "protos.h"
+static int add_name_general(const char *s, struct header_list **what,
+ char *pre, char *post);
+
int
add_name(const char *s, struct header_list **what)
{
@@ -28,7 +31,7 @@ add_name(const char *s, struct header_list **what)
* This more general routine adds a name to a list of unique
* names.
*/
-int
+static int
add_name_general(const char *s, struct header_list **what, char *pre, char *post)
{
struct header_list *p, *q;
@@ -68,7 +71,7 @@ checkhmem(const char *s, char *pre, char *post)
}
if (f==0) {
char *msg = concat ("! Couldn't find header file: ", s);
-
+
if (secure == 2) {
msg = concat (msg,
"\nAbsolute and ../relative paths are denied in -R2 mode.");
diff --git a/Build/source/texk/dvipsk/hps.c b/Build/source/texk/dvipsk/hps.c
index 0303b1e720e..daf1e23300d 100644
--- a/Build/source/texk/dvipsk/hps.c
+++ b/Build/source/texk/dvipsk/hps.c
@@ -1,7 +1,7 @@
/* This is the main file for hacking dvips to do HyperPostScript
* Written by Mark D. Doyle 11/94. It is (C) Copyright 1994 by Mark D. Doyle
* and the University of California. You may modify and use this program to
- * your heart's content.
+ * your heart's content.
*/
#include "dvips.h"
@@ -33,7 +33,7 @@
Boolean inHTMLregion = 0;
Boolean NO_ERROR = 1;
Boolean HPS_ERROR = 0;
-integer HREF_COUNT;
+integer HREF_COUNT;
Boolean ISHREF = 0;
Boolean POPPED = 0;
Boolean PUSHED = 0;
@@ -52,7 +52,7 @@ typedef struct rectangle {
double lly; /* lower left y coor */
double urx; /* upper right x coor */
double ury; /* upper right y coor */
- } dvipsRectangle;
+ } dvipsRectangle;
typedef struct hps_link {
int action; /* GoTo, GoToR, or Launch */
@@ -79,7 +79,7 @@ typedef struct rect_list { /* linked list of rectangles */
Rect_list *current_rect_list;
-#define HASHSIZE 1223
+#define HASHSIZE 1223
static struct nlist *link_targets[HASHSIZE]; /* names .... */
static struct nlist *link_sources[HASHSIZE]; /* hrefs .... */
@@ -99,14 +99,27 @@ Boolean noprocset; /* Leave out BeginProc and EndProc comments */
#define HORIZONTAL 1
#define FUDGE 2.0
-/* For later use
+/* 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 */
+static int href_or_name(void);
+static int parseref(void);
+static int get_string(void);
+static int do_link(char *s, int type);
+static struct nlist *lookup_link(char *s, int type);
+static struct nlist *install_link(char *name, struct hps_link *defn, int type);
+static Hps_link *link_dup(struct hps_link *s);
+static double dvi_to_hps_conv(int i, int dir);
+static int href_name_match(char *h, char *n);
+static void stamp_hps(struct hps_link *pl);
+static void stamp_external(char *s, struct hps_link *pl);
+static void print_rect_list(void);
+
/* parse anchor into link */
void
do_html(char *s)
@@ -114,7 +127,7 @@ do_html(char *s)
Hps_link *nl;
url_name = (char *)malloc(strlen(s)+1);
hs = s;
- HREF_COUNT = 0;
+ HREF_COUNT = 0;
skip_space(hs); /* skip spaces */
if ( TOLOWER(*hs) == 'a') { /* valid start */
POPPED = FALSE;
@@ -129,7 +142,7 @@ do_html(char *s)
skip_space(hs);
while(*hs != '\0') {
/* parse for names and href */
- if (!href_or_name()) {
+ if (!href_or_name()) {
error("Bad HMTL:");
error(s);
error("!");
@@ -145,17 +158,17 @@ do_html(char *s)
inHTMLregion = FALSE;
}
if (current_type == HREF && current_name[0] != '#') {
- if ((nl = lookup_link(current_name, current_type)->defn)) {
+ 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.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)) {
+ 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.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 */
@@ -163,24 +176,24 @@ do_html(char *s)
} else {
error("!Null lookup");
}
- }
+ }
}
else {
error( "No A in html special");
error(s);
/*error("!");*/
}
-
+
return;
}
-int
+static int
href_or_name(void) {
if ((strncmp(hs, "href", 4) == 0) || (strncmp(hs, "HREF", 4) == 0)) {
ISHREF = TRUE;
- } else if ((strncmp(hs, "name", 4) == 0)
+ } 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);
@@ -197,7 +210,7 @@ href_or_name(void) {
return(NO_ERROR);
}
-int
+static int
parseref(void) {
int i = 0;
for(i=0; i++ < 4; hs++); /* skip href or name in html string */
@@ -211,11 +224,11 @@ parseref(void) {
if(!get_string()) return(HPS_ERROR);
return(NO_ERROR); /* extract stuff between double quotes */
}
-
-int
+
+static int
get_string(void) {
- char *v = url_name;
-
+ char *v = url_name;
+
skip_space(hs);
/* hash_name(); */
if (*hs == '"') {
@@ -234,12 +247,12 @@ get_string(void) {
}
}
-int
+static int
do_link(char *s, int type)
{
Hps_link *p;
-
+
if (HREF_COUNT++ > 0) {
error("!HTML string contains more than one href");
return(HPS_ERROR);
@@ -249,11 +262,11 @@ do_link(char *s, int type)
p->title = (char *)malloc(strlen(s)+1);
p->title = s;
p->srcpg = pagecounter;
- p->rect.llx = dvi_to_hps_conv(hh, HORIZONTAL);
+ 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->vert_dest = -1;
p->page = -1;
p->color[0] = 0;
p->color[1] = 0; /* Blue links */
@@ -264,16 +277,16 @@ do_link(char *s, int type)
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_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)
+
+static unsigned int
+hash_string(char *s)
{
unsigned hashval;
for (hashval = 0; *s != '\0'; s++)
@@ -281,13 +294,13 @@ hash_string(char *s)
return hashval % HASHSIZE;
}
-/* lookup a hashed name */
+/* lookup a hashed name */
-struct nlist *
+static struct nlist *
lookup_link(char *s, int type)
{
struct nlist *np;
-
+
for(np = type ? link_sources[hash_string(s)] : link_targets[hash_string(s)];
np != NULL; np = np -> next)
if (strcmp(s, np->name) == 0)
@@ -295,7 +308,7 @@ lookup_link(char *s, int type)
return NULL; /* not found */
}
-struct nlist *
+static struct nlist *
install_link(char *name, Hps_link *defn, int type)
{
struct nlist *np;
@@ -307,7 +320,7 @@ install_link(char *name, Hps_link *defn, int type)
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 NULL;
return np;
}
@@ -323,33 +336,33 @@ dup_str(char *w) /* make a duplicate of s */
}
#endif
-Hps_link *
+static Hps_link *
link_dup(Hps_link *s) /* make a duplicate link */
{
Hps_link *p;
-
+
p = (Hps_link *) malloc(sizeof(*p));
if (p != NULL)
p = s;
return p;
}
-double
+static double
dvi_to_hps_conv(int i, int dir)
{
double hps_coor;
/* Convert dvi integers into proper hps coordinates
Take into account magnification and resolution that dvi file was
- produced at */
+ produced at */
hps_coor = dir ? (((i * 72.0) / vactualdpi) +MARGIN) : (PAGESIZE - ((i * 72.0) / (vactualdpi)) - MARGIN );
return(hps_coor);
}
-int
+static int
vert_loc(int i)
{
int return_value;
- return_value = (int) (i + (PAGESIZE / 4) + FUDGE);
+ return_value = (int) (i + (PAGESIZE / 4) + FUDGE);
if ( return_value > PAGESIZE) {
return((int)PAGESIZE);
} else if (return_value < (PAGESIZE / 4.0)) {
@@ -357,15 +370,15 @@ vert_loc(int i)
} else return(return_value);
}
-Hps_link *
+static Hps_link *
dest_link(char *s)
{
/* Assume for now that only one entry with same NAME, i.e.
Should be true for all legitimate papers.
Also, assume prepending of # for names. */
-
+
struct nlist *np;
-
+
s++; /* get rid of hashmark */
for(np = link_targets[hash_string(s)]; np != NULL; np = np -> next) {
if ( href_name_match(s, np->name)) {
@@ -378,36 +391,36 @@ dest_link(char *s)
return NULL; /* not found */
}
-int
+static int
count_targets(void) {
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
+static void
do_targets(void) {
struct nlist *np;
int i;
Hps_link *dest;
-
- for (i = 0; i < HASHSIZE; i++)
+
+ for (i = 0; i < HASHSIZE; i++)
for(np = link_sources[i]; np != NULL; np = np -> next) {
- if (np->name[0] == '#') {
+ if (np->name[0] == '#') {
dest = dest_link(np->name);
np->defn->page = dest->srcpg;
np->defn->vert_dest = vert_loc((int) dest->rect.lly);
- }
+ }
}
}
-void
+static void
do_target_dict(void)
{
struct nlist *np;
@@ -415,18 +428,18 @@ do_target_dict(void)
(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->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));
+ vert_loc((int) np->defn->rect.lly));
(void)fprintf(bitfile,"end targetdump-hook def end\n");
}
-int
+static int
href_name_match(char *h, char *n)
{
int count = 0;
@@ -444,54 +457,54 @@ href_name_match(char *h, char *n)
}
}
-void
+static void
stamp_hps(Hps_link *pl)
{
char * tmpbuf;
if (pl == NULL) {
error("stamp_hps: null pl pointer, oh no!");
return;
- }
+ }
if(pl->title == NULL) {
error("stamp_hps: null pl->title pointer, oh no!");
return;
- }
+ }
tmpbuf = (char *) xmalloc(strlen(pl->title)+200);
- /* print out the proper pdfm with local page info only
+ /* print out the proper pdfm with local page info only
* target info will be in the target dictionary */
- (void)sprintf(tmpbuf,
- " (%s) [[%.0f %.0f %.0f %.0f] [%i %i %i [%i %i]] [%.0f %.0f %.0f]] pdfm ",
+ (void)sprintf(tmpbuf,
+ " (%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);
+ cmdout(tmpbuf);
free(tmpbuf);
-
-
+
+
}
/* For external URL's, we just pass them through as a string. The hyperps
* interpreter can then do what is wants with them.
*/
-void
-stamp_external(char *s, Hps_link *pl)
+static void
+stamp_external(char *s, Hps_link *pl)
{
char *tmpbuf;
if (pl == NULL) {
error("stamp_external: null pl pointer, oh no!");
return;
- }
+ }
if (s == NULL) {
error("stamp_external: null s pointer, oh no!");
return;
- }
+ }
tmpbuf = (char *) xmalloc(strlen(s) + 200);
- /* print out the proper pdfm with local page info only
+ /* print out the proper pdfm with local page info only
* target info will be in the target dictionary */
(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,
@@ -523,7 +536,7 @@ finish_hps(void) {
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");
@@ -532,7 +545,7 @@ if ((bitfile=fopen(s, mode ? FOPEN_ABIN_MODE : FOPEN_WBIN_MODE))==NULL) {
}
void
-vertical_in_hps(void) {
+vertical_in_hps(void) {
Rect_list *rl;
/*printf("in vertical_in_hps"); */
if (current_type == NAME) return; /* Handle this case later */
@@ -545,44 +558,44 @@ vertical_in_hps(void) {
rl->next = current_rect_list;
current_rect_list = rl;
}
- current_rect_list->rect.llx = dvi_to_hps_conv(hh, HORIZONTAL);
+ 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();
+ current_rect_list->rect.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE;
+
+ if (POPPED) start_new_box();
}
-void
+static void
print_rect_list(void) {
Rect_list *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,
+ /* 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);
- }
-}
+ }
+}
void
-end_current_box(void) {
+end_current_box(void) {
Hps_link *nl;
-
+
POPPED = TRUE;
HREF_COUNT--;
if (current_type == HREF && current_name[0] != '#') {
- if ((nl = lookup_link(current_name, current_type)->defn)) {
+ 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.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)) {
+ 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.ury = dvi_to_hps_conv(vvmem, VERTICAL)-FUDGE+12.0;
if (current_type) {
stamp_hps(nl); /* Put link info right where special is */
}
@@ -596,7 +609,7 @@ end_current_box(void) {
void
start_new_box(void) {
- POPPED = FALSE;
+ POPPED = FALSE;
do_link(current_name, current_type);
}
#else
diff --git a/Build/source/texk/dvipsk/loadfont.c b/Build/source/texk/dvipsk/loadfont.c
index b64a68aeaa8..a769bd73c6e 100644
--- a/Build/source/texk/dvipsk/loadfont.c
+++ b/Build/source/texk/dvipsk/loadfont.c
@@ -96,7 +96,7 @@ int dontmakefont = 0; /* if makefont fails once we won't try again */
#endif /* IBM: VM/CMS */
#endif
-void
+static void
lectureuser(void) {
static int userwarned = 0;
@@ -105,7 +105,7 @@ lectureuser(void) {
userwarned = 1;
}
}
-Boolean
+static Boolean
pkopen(register fontdesctype *fd)
{
register char *d, *n;
@@ -159,7 +159,7 @@ pkopen(register fontdesctype *fd)
if (this_name != name_ret)
free (this_name);
-
+
return pkfile != NULL;
}
#else
@@ -199,7 +199,7 @@ pkopen(register fontdesctype *fd)
#ifndef MSDOS
#ifdef OS2
if (_osmode == OS2_MODE)
- dontmakefont = 1; /* failed so don't try again under OS/2,
+ dontmakefont = 1; /* failed so don't try again under OS/2,
but do try for MSDOS */
#else
#ifndef ATARIST
diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c
index a5e5cc532e6..3b2a3f24ed4 100644
--- a/Build/source/texk/dvipsk/output.c
+++ b/Build/source/texk/dvipsk/output.c
@@ -49,6 +49,7 @@ integer rdir = 0, fdir = 0;
* We need a few statics to take care of things.
*/
static void chrcmd(char c);
+static void tell_needed_fonts(void);
static void print_composefont(void);
static void setdir(int d);
static int JIStoSJIS(int c);
@@ -340,7 +341,7 @@ msdosdone:
beyond our present needs. If we were going
to do that much work, this entire chunk of
code should probably be
- rewritten. [dmj@ams.org, 2007/08/20] */
+ rewritten. [dmj@ams.org, 2007/08/20] */
scanForEnd = "%%EndFont";
scanningFont = 1;
@@ -674,7 +675,7 @@ stringend(void)
}
#ifdef SHIFTLOWCHARS
-/*
+/*
* moving chars 0-32 and 127 to higher positions
* is desirable when using some fonts
*/
@@ -769,9 +770,9 @@ jscout(int c, char *fs) /* string character out */
sprintf(s, "a<%02x>p", c);
} else if (c<0x800) {
sprintf(s, "a<%02x%02x>p", UCStoUTF8B1(c), UCStoUTF8B2(c));
- } else if (c<0x10000) {
+ } else if (c<0xffff) {
sprintf(s, "a<%02x%02x%02x>p", UCStoUTF8C1(c), UCStoUTF8C2(c), UCStoUTF8C3(c));
- } else if (c<0x110000) {
+ } else if (c<0x10ffff) {
sprintf(s, "a<%02x%02x%02x%02x>p", UCStoUTF8D1(c), UCStoUTF8D2(c), UCStoUTF8D3(c), UCStoUTF8D4(c));
} else {
error("warning: Illegal code value.");
@@ -779,7 +780,7 @@ jscout(int c, char *fs) /* string character out */
} else if (c>0xffff && strstr(fs,"-UTF16-")!=NULL) {
sprintf(s, "a<%04x%04x>p", UTF32toUTF16HS(c), UTF32toUTF16LS(c));
} else {
- if ((strstr(fs,"-RKSJ-")!=NULL)) c = JIStoSJIS(c);
+ if ((strstr(fs,"-RKSJ-")!=NULL) || (SJIS && c > 0x2120)) c = JIStoSJIS(c);
sprintf(s, "a<%04x>p", c);
}
cmdout(s);
@@ -1027,7 +1028,7 @@ indelta(integer i)
/*
* A case-irrelevant string compare.
*/
-int
+static int
mlower(int c)
{
if ('A' <= c && c <= 'Z')
@@ -1035,7 +1036,7 @@ mlower(int c)
else
return c;
}
-int
+static int
ncstrcmp(const char *a, const char *b)
{
while (*a && (*a == *b ||
@@ -1049,7 +1050,7 @@ ncstrcmp(const char *a, const char *b)
/*
* Find the paper size.
*/
-void
+static void
findpapersize(void) {
if (finpapsiz == 0) {
struct papsiz *ps;
@@ -1228,7 +1229,7 @@ topoints(integer i)
* Send out the special paper stuff. If `hed' is non-zero, only
* send out lines starting with `!' else send all other lines out.
*/
-void
+static void
paperspec(const char *s, int hed)
{
int sendit;
@@ -1253,7 +1254,7 @@ paperspec(const char *s, int hed)
}
}
}
-char *
+static char *
epsftest(integer bop)
{
if (tryepsf && paperfmt == 0 && *iname) {
@@ -1335,7 +1336,6 @@ open_output(void) {
void
initprinter(sectiontype *sect)
{
- void tell_needed_fonts();
int n = sect->numpages * pagecopies * collatedcopies;
#ifdef HPS
if (!HPS_FLAG)
@@ -1688,7 +1688,7 @@ drawchar(chardesctype *c, int cc)
/*
* This routine sends out the document fonts comment.
*/
-void
+static void
tell_needed_fonts(void) {
struct header_list *hl = ps_fonts_used;
char *q;
diff --git a/Build/source/texk/dvipsk/papersiz.c b/Build/source/texk/dvipsk/papersiz.c
index 31143579aaa..ea1d5fddde8 100644
--- a/Build/source/texk/dvipsk/papersiz.c
+++ b/Build/source/texk/dvipsk/papersiz.c
@@ -66,7 +66,7 @@ myatol(char **s)
static long scalevals[] = { 1864680L, 65536L, 786432L, 186468L,
1L, 65782L, 70124L, 841489L, 4736286L };
static const char *scalenames = "cmptpcmmspbpddccin";
-long
+static long
myatodim(char **s)
{
register long w, num, den, sc;
@@ -125,7 +125,7 @@ myatodim(char **s)
*/
void
handlepapersize(char *p, integer *x, integer *y)
-{
+{
while (*p == ' ')
p++;
*x = myatodim(&p);
diff --git a/Build/source/texk/dvipsk/protos.h b/Build/source/texk/dvipsk/protos.h
index 0f857c800fa..d66ec8760e1 100644
--- a/Build/source/texk/dvipsk/protos.h
+++ b/Build/source/texk/dvipsk/protos.h
@@ -12,12 +12,9 @@ struct tcd;
/******* prototypes for functions *******/
/* prototypes for functions from bbox.c */
-extern void bbtfmload(fontdesctype *curfnt);
-extern void bbdopage(void);
extern void findbb(int bop);
/* prototypes for functions from color.c */
-extern void colorcmdout(char *s);
extern void initcolor(void);
extern void background(char *bkgrnd);
extern void resetcolorstack(char *p, int outtops);
@@ -31,16 +28,12 @@ extern void dopage(void);
/* prototypes for functions from dosection.c */
extern void dosection(sectiontype *s, int c);
extern int InPageList(int i);
-extern void InstallPL(int pslow, int pshigh);
extern int ParsePages(char *s);
/* prototypes for functions from dospecial.c */
extern void specerror(const char *s);
extern void outbangspecials(void);
-extern int IsSame(const char *a, const char *b);
-extern char *GetKeyVal(char *str, int *tno);
extern void predospecial(int numbytes, Boolean scanning);
-extern int maccess(char *s);
extern void dospecial(int numbytes);
extern float *bbdospecial(int nbytes);
@@ -51,8 +44,6 @@ extern void lfontout(int n);
extern void dopsfont(sectiontype *fs);
/* prototypes for functions from dpicheck.c */
-extern void addsiz(int rhsize);
-extern void adddpi(int hsize);
extern unsigned short dpicheck(unsigned short dpi);
/* prototypes for functions from drawPS.c */
@@ -60,7 +51,6 @@ extern unsigned short dpicheck(unsigned short dpi);
extern void setPenSize(char *cp);
extern void addPath(char *cp);
extern void arc(char *cp, int invis);
-extern void flushDashedPath(int dotted, double inchesPerDash);
extern void flushPath(int invis);
extern void flushDashed(char *cp, int dotted);
extern void flushSpline(char *cp);
@@ -71,7 +61,6 @@ extern void blackenLast(void);
#endif /* TPIC */
/* prototypes for functions from dviinput.c */
-extern void abortpage(void);
extern short dvibyte(void);
extern unsigned short twobytes(void);
extern int threebytes(void);
@@ -87,48 +76,16 @@ extern void error_with_perror(const char *s, const char *fname);
extern void error(const char *s);
extern void check_checksum(unsigned int c1, unsigned int c2, const char *name);
extern char *mymalloc(int n);
-extern void morestrings(void);
extern void checkstrings(void);
-extern void initialize(void);
extern char *newstring(const char *s);
-extern void newoutname(void);
extern void *revlist(void *p);
-extern void queryargs(void);
/* prototypes for functions from emspecial.c */
extern void emclear(void);
-extern struct empt *emptput(short point, int x, int y);
-extern struct empt *emptget(short point);
-extern float emunits(float width, char *unit);
extern void emspecial(char *p);
-extern int readinteger(FILE *f);
-extern unsigned short readhalfword(FILE *f);
-extern int PCXreadline(FILE *pcxf, unsigned char *pcxbuf, unsigned int byteperline);
-extern void PCXshowpicture(FILE *pcxf,int wide,int high,int bytes,int cp,int bp,unsigned char *r,unsigned char *g,unsigned char *b);
-extern void imagehead(char *filename, int wide, int high, float emwidth, float emheight);
-extern void imagetail(void);
-extern void pcxgraph(FILE *pcxf, char *filename, float emwidth, float emheight);
-extern void MSP_2_ps(FILE *f, int wide, int high);
-extern void MSP_1_ps(FILE *f, int wide, int high);
-extern void mspgraph(FILE *f, char *filename, float emwidth, float emheight);
-extern void rgbread(FILE *f, int w, int b, char *s);
-extern void rle4read(FILE *f, int w, int b, char *s);
-extern void rle8read(FILE *f, int w, int b, char *s);
-extern void bmpgraph(FILE *f, char *filename, float emwidth, float emheight);
-extern void emgraph(char *filename, float emwidth, float emheight);
/* prototypes for functions from finclude.c */
-extern fontdesctype *ifontdef(char *name, char *area, int scsize, int dssize, char *scname);
-extern void setfamily(fontdesctype *f);
-extern char *getname(char *s);
-extern void includechars(fontdesctype *f, char *s);
-extern void scan1fontcomment(char *p);
-extern int scanvm(char *p);
-extern void scan_fontnames(char *str, const char *psfile);
-extern void scanfontusage(char *p, const char *psfile);
extern void scanfontcomments(const char *filename);
-extern Boolean okascmd(char *ss);
-extern void nameout(char *area, char *name);
extern void fonttableout(void);
/* prototypes for functions from flib.c */
@@ -145,8 +102,6 @@ extern int skipnop(void);
/* prototypes for functions from header.c */
extern int add_name(const char *s, struct header_list **what );
-extern int add_name_general(const char *s, struct header_list **what,
- char *pre, char *post);
extern void checkhmem(const char *s, char *p, char *q);
extern int add_header(const char *s);
extern int add_header_general(const char *s, char *pre, char* post);
@@ -156,27 +111,9 @@ extern void send_headers(void);
/* prototypes for functions from hps.c */
#ifdef HPS
extern void do_html(char *s);
-extern int href_or_name(void);
-extern int parseref(void);
-extern int get_string(void);
-extern int do_link(char *s, int type);
-extern unsigned int hash_string(char *s);
-extern struct nlist *lookup_link(char *s, int type);
-extern struct nlist *install_link(char *name, struct hps_link *defn, int type);
-extern struct hps_link *link_dup(struct hps_link *s);
-extern double dvi_to_hps_conv(int i, int dir);
-extern int vert_loc(int i);
-extern struct hps_link *dest_link(char *s);
-extern int count_targets(void);
-extern void do_targets(void);
-extern void do_target_dict(void);
-extern int href_name_match(char *h, char *n);
-extern void stamp_hps(struct hps_link *pl);
-extern void stamp_external(char *s, struct hps_link *pl);
extern void finish_hps(void);
extern void set_bitfile(const char *s, int mode);
extern void vertical_in_hps(void);
-extern void print_rect_list(void);
extern void end_current_box(void);
extern void start_new_box(void);
#endif /* HPS */
@@ -186,8 +123,6 @@ extern void badpk(const char *s);
extern short pkbyte(void);
extern int pkquad(void);
extern int pktrio(void);
-extern void lectureuser(void);
-extern Boolean pkopen(fontdesctype *fd);
extern void loadfont(fontdesctype *curfnt);
/* prototypes for functions from makefont.c */
@@ -210,13 +145,8 @@ extern void numout(int n);
extern void mhexout(unsigned char *p, long len);
extern void hvpos(void);
extern void newline(void);
-extern void nlcmdout(const char *s);
-extern int mlower(int c);
-extern int ncstrcmp(const char *a, const char *b);
-extern void findpapersize(void);
-extern void paperspec(const char *s, int hed);
-extern char *epsftest(int bop);
extern void open_output(void);
+extern void nlcmdout(const char *s);
extern void initprinter(sectiontype *sect);
extern void setup(void);
extern void cleanprinter(void);
@@ -225,12 +155,9 @@ extern void pageinit(void);
extern void pageend(void);
extern void drawrule(int rw, int rh);
extern void cmddir(void);
-
extern void drawchar(chardesctype * c, int cc);
-extern void tell_needed_fonts(void);
/* prototypes for functions from papersiz.c */
-extern long myatodim(char **s );
extern void handlepapersize(char *p, int *x, int *y);
/* prototypes for functions from pprescan.c */
@@ -241,10 +168,8 @@ extern void readpreamble(void);
extern void prescanpages(void);
/* prototypes for functions from repack.c */
-extern void was_putlong(char *a, long i);
extern long getlong(unsigned char *a);
extern void dochar(unsigned char *from, short width, short height);
-extern char *makecopy(unsigned char *what, long len, unsigned char *p);
extern void repack(struct tcd *cp);
/* prototypes for functions from resident.c */
@@ -253,10 +178,7 @@ extern void revpslists(void);
extern void cleanres(void);
extern struct resfont *lookup(char *name);
extern struct resfont *findPSname(char *name);
-extern void add_entry(char *TeXname, char *PSname, char *Fontfile, char *Vectfile, char *specinfo, char *downloadinfo);
extern int residentfont(fontdesctype *curfnt);
-extern void bad_config(const char *err);
-extern char *configstring(char *s, int nullok);
extern Boolean getdefaults(const char *s);
extern void getpsinfo(const char *name);
extern void checkenv(int which);
@@ -284,89 +206,26 @@ extern int close_file(FILE *f);
extern void skippage(void);
/* prototypes for functions from t1part.c */
-extern int DefTypeFont(unsigned char *name);
-extern int GetZeroLine(unsigned char *str);
-extern int GetWord(unsigned char *mem);
-extern int GetToken(void);
-extern int GetNum(void);
-extern int PassToken(void);
-extern int PassString(unsigned char flg);
extern void *getmem(unsigned int size);
-extern struct Char *AddChar(struct Char *TmpChar, unsigned char *CharName, int num);
-extern void AddStr(unsigned char *name, int num);
-extern void RevChar(struct Char *TmpChar);
-extern void OutChar(struct Char *TmpChar, FILE *fout);
-extern void Reverse(struct String *TmpStr);
-extern void OutStr(struct String *TmpStr, FILE *fout);
-extern void PrintChar(struct Char *TmpChar);
-extern int ClearB(void);
-extern int ChooseChar(unsigned char *name, struct Char *TmpChar);
-extern int FindSeac(int num);
-extern int FindCharW(unsigned char *name, int length);
-extern void ClearCW(struct Char *ThisChar);
-extern int WorkVect(struct Char *TmpChar);
-extern void UnDefineCharsW(void);
extern struct Char *UnDefineChars(struct Char *TmpChar);
-extern void UnDefineStr(void);
-extern void ScanSubrs(int i);
-extern void ViewReturnCall(int num_err, int top, int *pstack, int j, int depth);
-extern int DeCodeStr(int num, int numseac);
-extern void ScanChars(int i);
-extern void LastLook(void);
-extern int FindKeyWord(int First_Key, int lastkey);
-extern int ScanBinary(void);
-extern unsigned char *itoasp(int n, unsigned char *s, int len);
-extern void SubstNum(void);
-extern unsigned long little4(unsigned char *buff);
-extern unsigned char CDeCrypt(unsigned char cipher, unsigned int *lcdr);
-extern int EndOfEncoding(int err_num);
-extern void CorrectGrid(void);
-extern int CharEncoding(void);
-extern void FindEncoding(void);
-extern void CheckChoosing(void);
-extern void OutASCII(FILE *fout, unsigned char *buff, unsigned long len);
-extern void BinEDeCrypt(unsigned char *buff, unsigned long len);
-extern void HexEDeCrypt(unsigned char *mem);
-extern int PartialPFA(FILE *fin, FILE *fout);
-extern int PartialPFB(FILE *fin, FILE *fout);
-extern void OutHEX(FILE *fout);
-extern int Afm(void);
extern int FontPart(FILE *fout, unsigned char *fontfile, unsigned char *vectfile);
-extern int LoadVector(int num, struct Char *TmpChar);
-extern int ChooseVect(struct Char *tmpChar);
-extern void ErrorOfScan(int err);
-extern void NameOfProgram(void);
/* prototypes for functions from tfmload.c */
extern void badtfm(const char *s);
extern void tfmopen(fontdesctype *fd);
-extern short tfmbyte(void);
extern unsigned short tfm16(void);
extern int tfm32(void);
extern int tfmload(fontdesctype *curfnt);
/* prototypes for functions from unpack.c */
-extern short getnyb(void);
-extern Boolean getbit(void);
-extern long pkpackednum(void);
-extern void flip(char *s, long howmany);
extern long unpack(unsigned char *pack, unsigned short *raster,
unsigned short cwidth, unsigned short cheight, unsigned short cmd);
/* prototypes for functions from virtualfont.c */
-extern void badvf(const char *s);
-extern short vfbyte(void);
-extern int vfquad(void);
-extern int vftrio(void);
-extern int vfopen(fontdesctype *fd);
-extern struct tft *vfontdef(int s, int siz);
extern Boolean virtualfont(fontdesctype *curfnt);
/* prototypes for functions from writet1.c */
extern void load_enc(char *, const char **);
-extern void writet1(void);
-extern void t1_free(void);
-extern boolean t1_subset(char *, char *, unsigned char *);
extern boolean t1_subset_2(char *, unsigned char *, char *);
/*********** global variables ***********/
@@ -386,6 +245,7 @@ extern int pagecounter;
#endif
/* global variables from dvips.c */
+extern Boolean SJIS;
extern char *downloadedpsnames[];
extern int unused_top_of_psnames;
extern fontdesctype *fonthead;
@@ -418,7 +278,7 @@ extern integer hoff, voff;
extern integer maxsecsize;
extern integer firstboploc;
extern Boolean sepfiles;
-extern int numcopies;
+extern int numcopies;
extern const char *oname;
extern char *iname;
extern char *fulliname;
@@ -469,7 +329,7 @@ extern int prettycolumn;
extern int gargc;
extern char **gargv;
extern int totalpages;
-extern Boolean reverse;
+extern Boolean reverse;
extern Boolean usesPSfonts;
extern Boolean usesspecial;
extern Boolean headers_off;
diff --git a/Build/source/texk/dvipsk/repack.c b/Build/source/texk/dvipsk/repack.c
index 77382bcc89f..7772c1feb61 100644
--- a/Build/source/texk/dvipsk/repack.c
+++ b/Build/source/texk/dvipsk/repack.c
@@ -39,7 +39,7 @@ static unsigned char *specdata;
static long tslen = 0;
static unsigned char *tempstore, *tsp, *tsend;
-void
+static void
putlong(register char *a, long i)
{
a[0] = i >> 24;
@@ -321,9 +321,9 @@ dochar(unsigned char *from, short width, short height)
long mbytesleft;
quarterword *mraster;
-char *
-makecopy(register unsigned char *what,
- register long len,
+static char *
+makecopy(register unsigned char *what,
+ register long len,
register unsigned char *p)
{
register unsigned char *q;
diff --git a/Build/source/texk/dvipsk/resident.c b/Build/source/texk/dvipsk/resident.c
index 6bb21c2d91f..073e21bfff9 100644
--- a/Build/source/texk/dvipsk/resident.c
+++ b/Build/source/texk/dvipsk/resident.c
@@ -99,7 +99,7 @@ findPSname(char *name)
/*
* This routine adds an entry.
*/
-void
+static void
add_entry(char *TeXname, char *PSname, char *Fontfile,
char *Vectfile, char *specinfo, char *downloadinfo)
{
@@ -214,7 +214,7 @@ residentfont(register fontdesctype *curfnt)
#define INLINE_SIZE (2000)
static char was_inline[INLINE_SIZE];
static unsigned c_lineno;
-void
+static void
bad_config(const char *err)
{
fprintf (stderr, "%s:%d:", realnameoffile, c_lineno);
@@ -263,7 +263,7 @@ getpath(char *who, char *what)
* double quotes with spaces in them. We also accept strings
* with spaces in them, but kill off any spaces at the end.
*/
-char *
+static char *
configstring(char *s, int nullok)
{
char tstr[INLINE_SIZE];
@@ -570,7 +570,9 @@ case 'v' : case 'V' :
#endif
break;
case 'S' :
- if (sscanf(was_inline+1, "%s", PSname) != 1)
+ if (!strncmp(was_inline, "SJIS", 4))
+ SJIS = (was_inline[4] != '0');
+ else if (sscanf(was_inline+1, "%s", PSname) != 1)
bad_config("missing arg to S");
else
#ifdef KPATHSEA
diff --git a/Build/source/texk/dvipsk/t1part.c b/Build/source/texk/dvipsk/t1part.c
index 9074705bf62..86a7035c8dd 100644
--- a/Build/source/texk/dvipsk/t1part.c
+++ b/Build/source/texk/dvipsk/t1part.c
@@ -65,8 +65,14 @@ int CharCount;
int GridCount;
int ind_ref;
-int LoadVector(int, CHAR *);
-int Afm(void);
+static unsigned char CDeCrypt(unsigned char, unsigned int *);
+static void CorrectGrid(void);
+static void OutHEX(FILE *);
+static int Afm(void);
+static int LoadVector(int, CHAR *);
+static int ChooseVect(CHAR *);
+static void ErrorOfScan(int err);
+static void NameOfProgram(void);
typedef struct
{
@@ -281,7 +287,7 @@ struct def_label label[NUM_LABEL];
-int
+static int
DefTypeFont(unsigned char *name)
{
int i;
@@ -294,7 +300,7 @@ DefTypeFont(unsigned char *name)
return -1;
}
-int
+static int
GetZeroLine(unsigned char *str)
{
int token_type=0;
@@ -316,7 +322,7 @@ GetZeroLine(unsigned char *str)
/* We get token type and its content for ASCII code */
-int
+static int
GetWord(unsigned char *mem)
{
int token_type=0;
@@ -375,7 +381,7 @@ GetWord(unsigned char *mem)
/* We get token type and its content for BINARY code */
-int
+static int
GetToken(void)
{
register unsigned char *tmp;
@@ -413,7 +419,7 @@ GetToken(void)
return(token_type= -1);
}
-int
+static int
GetNum(void)
{
unsigned char *tmp;
@@ -437,7 +443,7 @@ GetNum(void)
/* We pass token without definition its type, it's for speed */
-int
+static int
PassToken(void)
{
while(temp < end_of_scan)
@@ -457,7 +463,7 @@ PassToken(void)
/* Simple pass off without charstring decrypting */
/* */
-int
+static int
PassString(unsigned char flg)
{
int len_str;
@@ -497,7 +503,7 @@ getmem(unsigned size)
return tmp;
}
-CHAR *
+static CHAR *
AddChar(CHAR *TmpChar, unsigned char *CharName, int num)
{
int length;
@@ -514,7 +520,7 @@ AddChar(CHAR *TmpChar, unsigned char *CharName, int num)
}
-void
+static void
AddStr(unsigned char *name, int num)
{
int length;
@@ -532,7 +538,7 @@ AddStr(unsigned char *name, int num)
/* We prepare own encoding vector for output */
-void
+static void
RevChar(CHAR *TmpChar)
{
int i;
@@ -562,7 +568,7 @@ RevChar(CHAR *TmpChar)
/* And here we produce own resulting encoding vector for partial font */
-void
+static void
OutChar(CHAR *TmpChar, FILE *fout)
{
@@ -619,7 +625,7 @@ Reeverse(STRING *TmpStr)
/* And here we post strings to out */
-void
+static void
OutStr(STRING *TmpStr, FILE *fout)
{
STRING *ThisStr = TmpStr;
@@ -640,7 +646,7 @@ OutStr(STRING *TmpStr, FILE *fout)
-void
+static void
PrintChar(CHAR *TmpChar)
{
CHAR *ThisChar = TmpChar;
@@ -657,7 +663,7 @@ PrintChar(CHAR *TmpChar)
}
-int
+static int
ClearB(void)
{
CHAR *ThisChar = FirstCharB;
@@ -672,7 +678,7 @@ ClearB(void)
/* We mark chars in encoding vector thanks same names from
reencoding vector */
-int
+static int
ChooseChar(unsigned char *name, CHAR *TmpChar)
{
int length;
@@ -715,7 +721,7 @@ ChooseChar(unsigned char *name, CHAR *TmpChar)
/* We find index in label array for char, wich is required
for compose char, if it uses SEAC command */
-int
+static int
FindSeac(int num)
{
int i;
@@ -731,9 +737,9 @@ FindSeac(int num)
}
-void ClearCW(CHAR *);
+static void ClearCW(CHAR *);
-int
+static int
FindCharW(unsigned char *name, int length)
{
CHAR *ThisChar = FirstCharW;
@@ -802,7 +808,7 @@ FindCharW(unsigned char *name, int length)
}
-void
+static void
ClearCW(CHAR *ThisChar)
{
@@ -828,7 +834,7 @@ ClearCW(CHAR *ThisChar)
/* We build temporary 'work' encoding vector only for searching
needed chars */
-int
+static int
WorkVect(CHAR *TmpChar)
{
while (TmpChar != NULL) {
@@ -848,7 +854,7 @@ WorkVect(CHAR *TmpChar)
}
-void
+static void
UnDefineCharsW(void)
{
CHAR *ThisChar = FirstCharW;
@@ -880,7 +886,7 @@ UnDefineChars(CHAR *TmpChar)
-void
+static void
UnDefineStr(void)
{
STRING *ThisStr = FirstStr;
@@ -900,7 +906,7 @@ UnDefineStr(void)
/* We mark subroutines without charstring decrypting */
/* */
-void
+static void
ScanSubrs(int i)
{
int err_num;
@@ -968,7 +974,7 @@ ScanSubrs(int i)
}
}
-void
+static void
ViewReturnCall(int num_err, int top, int *pstack,
int j, int depth)
{
@@ -1033,7 +1039,7 @@ ViewReturnCall(int num_err, int top, int *pstack,
/* We decrypt charstring with recursive descent */
/* */
-int
+static int
DeCodeStr(int num, int numseac)
{
unsigned int loccr;
@@ -1307,7 +1313,7 @@ DeCodeStr(int num, int numseac)
/* */
-void
+static void
ScanChars(int i)
{
@@ -1336,7 +1342,7 @@ ScanChars(int i)
if(CharCount!=0)
{
-
+
num_err=FindCharW(token, str_len);
if(num_err==FLG_BINARY)
@@ -1477,7 +1483,7 @@ ScanChars(int i)
}
}
-void
+static void
LastLook(void)
{
label[number].begin = temp;
@@ -1485,7 +1491,7 @@ LastLook(void)
number++;
}
-int
+static int
FindKeyWord(int First_Key, int lastkey)
{
int word_type=0;
@@ -1532,7 +1538,7 @@ FindKeyWord(int First_Key, int lastkey)
/* To increase scan speed we use dynamic range of keywords */
-int
+static int
ScanBinary(void)
{
int i;
@@ -1591,7 +1597,7 @@ ScanBinary(void)
}
}
-unsigned char *
+static unsigned char *
itoasp(int n, unsigned char *s, int len)
{
static int i, j;
@@ -1613,7 +1619,7 @@ itoasp(int n, unsigned char *s, int len)
return NULL;
}
-void
+static void
SubstNum(void)
{
int i, j;
@@ -1630,7 +1636,7 @@ SubstNum(void)
}
}
-ub4
+static ub4
little4(ub1 *buff)
{
return (ub4) buff[0] +
@@ -1643,7 +1649,7 @@ unsigned short int c1 = C1, c2 = C2;
unsigned short int edr;
-unsigned char
+static unsigned char
CDeCrypt(unsigned char cipher, unsigned int *lcdr)
{
register unsigned char plain;
@@ -1661,7 +1667,7 @@ unsigned short int eer;
*/
-int
+static int
EndOfEncoding(int err_num)
{
@@ -1743,7 +1749,7 @@ EndOfEncoding(int err_num)
in non StandardEncoding */
-void
+static void
CorrectGrid(void)
{
int i, j, k, imax;
@@ -1764,7 +1770,7 @@ CorrectGrid(void)
}
/* We build vector for non StandardEncoding */
-int
+static int
CharEncoding(void)
{
int err_token=0;
@@ -1802,7 +1808,7 @@ CharEncoding(void)
if(keep_flg==1)
{
keep_num=FLG_OUT_STR;
-
+
if(EndOfEncoding(err_token)<0)
{
return -1;
@@ -1816,7 +1822,7 @@ CharEncoding(void)
-void
+static void
FindEncoding(void)
{
int num_err=0;
@@ -1869,7 +1875,7 @@ FindEncoding(void)
reencode them if there is reencoding vector for this case and
build work vector */
-void
+static void
CheckChoosing(void)
{
@@ -1967,7 +1973,7 @@ KillUnique(char *s)
return s;
}
-void
+static void
OutASCII(FILE *fout, ub1 *buff, ub4 len)
{
ub4 i;
@@ -2009,7 +2015,7 @@ OutASCII(FILE *fout, ub1 *buff, ub4 len)
/* It's eexec decription for PFB format */
-void
+static void
BinEDeCrypt(ub1 *buff, ub4 len)
{
ub4 i;
@@ -2024,7 +2030,7 @@ BinEDeCrypt(ub1 *buff, ub4 len)
/* And it's eexec decription for PFA format */
-void
+static void
HexEDeCrypt(unsigned char *mem)
{
int ch1, ch2, cipher;
@@ -2058,7 +2064,7 @@ HexEDeCrypt(unsigned char *mem)
}
}
-int
+static int
PartialPFA(FILE *fin, FILE *fout)
{
ub1 type;
@@ -2166,7 +2172,7 @@ PartialPFA(FILE *fin, FILE *fout)
#define NEXT_BINARY 3
#define NEXT_ASCII 4
-int
+static int
PartialPFB(FILE *fin, FILE *fout)
{
ub1 type;
@@ -2269,7 +2275,7 @@ PartialPFB(FILE *fin, FILE *fout)
OutChar(FirstCharW, fout);
}
-
+
Reeverse(FirstStr);
OutStr(RevStr, fout);
}
@@ -2306,7 +2312,7 @@ PartialPFB(FILE *fin, FILE *fout)
}
}
-void
+static void
OutHEX(FILE *fout)
{
int i=0;
@@ -2357,7 +2363,7 @@ OutHEX(FILE *fout)
/* We parse AFM file only if we've received errors after
parsing of own vector */
-int
+static int
Afm(void)
{
unsigned char afmfile[100];
@@ -2570,7 +2576,7 @@ FontPart(FILE *fout, unsigned char *fontfile,
-int
+static int
LoadVector(int num, CHAR *TmpChar)
{
@@ -2677,7 +2683,7 @@ LoadVector(int num, CHAR *TmpChar)
}
}
-int
+static int
ChooseVect(CHAR *tmpChar)
{
CHAR *ThisChar = tmpChar;
@@ -2700,7 +2706,7 @@ ChooseVect(CHAR *tmpChar)
}
-void
+static void
ErrorOfScan(int err)
{
switch(err)
@@ -2737,7 +2743,7 @@ ErrorOfScan(int err)
}
}
-void
+static void
NameOfProgram(void)
{
#ifdef DVIPS
diff --git a/Build/source/texk/dvipsk/t1part.h b/Build/source/texk/dvipsk/t1part.h
index 955ddd22d89..ef4ebe728a7 100644
--- a/Build/source/texk/dvipsk/t1part.h
+++ b/Build/source/texk/dvipsk/t1part.h
@@ -85,55 +85,6 @@ typedef unsigned char typetemp;
#endif
#include "protos.h"
-#if 0
-struct Char * AddChar ();
-void AddStr();
-void BinEDeCrypt ();
-int DeCodeStr();
-int DefTypeFont();
-unsigned
-char CDeCrypt();
-void CorrectGrid();
-int CharEncoding ();
-void CheckChoosing();
-int ChooseChar();
-int ChooseVect();
-int EndOfEncoding();
-void ErrorOfScan ();
-int FindCharW();
-void FindEncoding ();
-int FindKeyWord ();
-int FontPart ();
-void HexEDeCrypt ();
-void *getmem ();
-int GetNum ();
-int GetToken ();
-int GetWord ();
-int GetZeroLine ();
-unsigned
-char *itoasp ();
-void LastLook ();
-ub4 little4 ();
-void OutASCII ();
-void OutHEX ();
-void OutStr();
-void NameOfProgram ();
-int PartialPFA ();
-int PartialPFB ();
-void PrintChar ();
-int PassString ();
-int PassToken ();
-void Reverse();
-int ScanBinary ();
-void ScanChars ();
-void ScanSubrs ();
-void SubstNum ();
-void ViewReturnCall();
-struct Char * UnDefineChars ();
-void UnDefineCharsW();
-void UnDefineStr();
-int WorkVect();
-#endif
#define NUM_LABEL 1024
#define BASE_MEM 16384
diff --git a/Build/source/texk/dvipsk/tfmload.c b/Build/source/texk/dvipsk/tfmload.c
index d3d9b7ce958..f9a4601a5ab 100644
--- a/Build/source/texk/dvipsk/tfmload.c
+++ b/Build/source/texk/dvipsk/tfmload.c
@@ -82,7 +82,7 @@ tfmopen(register fontdesctype *fd)
error("! I can't find cmr10.tfm; please reinstall me with proper paths");
}
-shalfword
+static shalfword
tfmbyte(void)
{
return(getc(tfmfile));
diff --git a/Build/source/texk/dvipsk/unpack.c b/Build/source/texk/dvipsk/unpack.c
index 865e9a13a61..493d6d7cb99 100644
--- a/Build/source/texk/dvipsk/unpack.c
+++ b/Build/source/texk/dvipsk/unpack.c
@@ -1,5 +1,5 @@
/*
- * Unpacks the raster data from the packed buffer. This code was
+ * Unpacks the raster data from the packed buffer. This code was
* translated from pktopx.web using an automatic translator, then
* converted for this purpose. This little routine can be very useful
* in other drivers as well.
@@ -14,10 +14,10 @@
/*
* Some statics for use here.
*/
-static halfword bitweight;
+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 };
+ 255 , 511 , 1023 , 2047 , 4095 , 8191 , 16383 , 32767 , 65535 };
static long repeatcount;
static quarterword *p;
@@ -26,56 +26,56 @@ static quarterword *p;
* packed data structure.
*/
-shalfword
+static shalfword
getnyb(void)
{
- if ( bitweight == 0 )
- { bitweight = 16;
+ if ( bitweight == 0 )
+ { bitweight = 16;
return(*p++ & 15);
} else {
bitweight = 0;
return(*p >> 4);
}
-}
+}
-Boolean
+static Boolean
getbit(void)
{
- bitweight >>= 1;
- if ( bitweight == 0 )
+ bitweight >>= 1;
+ if ( bitweight == 0 )
{ p++;
bitweight = 128;
- }
+ }
return(*p & bitweight);
-}
+}
-long
+static 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--;
- }
- return ( j - 15 + ( 13 - dynf ) * 16 + dynf );
+ j = j * 16 + ((long) getnyb ());
+ i--;
+ }
+ 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 ();
+ if ( i == 14 ) repeatcount = pkpackednum ();
return ( pkpackednum() );
- }
-}
+ }
+}
-void
+static void
flip(register char *s, register long howmany)
{
register char t;
@@ -95,86 +95,86 @@ static halfword bftest = 1;
long
unpack(quarterword *pack, halfword *raster,
halfword cwidth, halfword cheight, halfword cmd)
-{
- register integer i, j;
- shalfword wordwidth;
+{
+ register integer i, j;
+ shalfword wordwidth;
register halfword word, wordweight;
- shalfword rowsleft;
- Boolean turnon;
- shalfword hbit, ww;
- long count;
+ shalfword rowsleft;
+ Boolean turnon;
+ shalfword hbit, ww;
+ long count;
halfword *oraster;
oraster = raster;
p = pack;
- dynf = cmd / 16;
- turnon = cmd & 8;
+ 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;
+ 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;
- if ( wordweight == 0 )
- { *raster++ = word;
+ if ( wordweight == 0 )
+ { *raster++ = word;
word = 0;
- wordweight = 32768;
- }
- }
- if ( wordweight != 32768 )
- *raster++ = word;
- }
+ wordweight = 32768;
+ }
+ }
+ if ( wordweight != 32768 )
+ *raster++ = word;
+ }
} else {
- rowsleft = cheight;
- hbit = cwidth;
- repeatcount = 0;
- ww = 16;
- word = 0;
+ rowsleft = cheight;
+ hbit = cwidth;
+ repeatcount = 0;
+ ww = 16;
+ word = 0;
bitweight = 16;
- while ( rowsleft > 0 )
- { count = pkpackednum();
- while ( count != 0 )
- { if ( ( count <= ww ) && ( count < hbit ) )
- { if ( turnon ) word += gpower [ ww ] - gpower
- [ ww - count ];
- hbit -= count;
- ww -= count;
- count = 0;
- }
- else if ( ( count >= hbit ) && ( hbit <= ww ) )
+ while ( rowsleft > 0 )
+ { count = pkpackednum();
+ while ( count != 0 )
+ { if ( ( count <= ww ) && ( count < hbit ) )
+ { if ( turnon ) word += gpower [ ww ] - gpower
+ [ ww - count ];
+ hbit -= count;
+ ww -= count;
+ count = 0;
+ }
+ else if ( ( count >= hbit ) && ( hbit <= ww ) )
{ if ( turnon )
- word += gpower[ww] - gpower[ww-hbit];
- *raster++ = word;
+ 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;
- }
- else
- { if ( turnon ) word += gpower [ ww ];
+ 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;
- }
- }
- turnon = ! turnon;
- }
- if ( ( rowsleft != 0 ) || ( (unsigned)hbit != cwidth ) )
- error ( "! error while unpacking; more bits than required" );
- }
+ word = 0;
+ count -= ww;
+ hbit -= ww;
+ ww = 16;
+ }
+ }
+ turnon = ! turnon;
+ }
+ if ( ( rowsleft != 0 ) || ( (unsigned)hbit != cwidth ) )
+ 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);
diff --git a/Build/source/texk/dvipsk/virtualfont.c b/Build/source/texk/dvipsk/virtualfont.c
index 4319c047946..8160339d649 100644
--- a/Build/source/texk/dvipsk/virtualfont.c
+++ b/Build/source/texk/dvipsk/virtualfont.c
@@ -17,14 +17,14 @@
*/
static FILE *vffile;
static char name[500];
-void
+static void
badvf(const char *s)
{
char *msg = concatn("! Bad VF file ", name, ": ", s, NULL);
error(msg);
}
-shalfword
+static shalfword
vfbyte(void)
{
register shalfword i;
@@ -34,7 +34,7 @@ vfbyte(void)
return(i);
}
-integer
+static integer
vfquad(void)
{
register integer i;
@@ -48,7 +48,7 @@ vfquad(void)
return(i);
}
-integer
+static integer
vftrio(void)
{
register integer i;
@@ -59,7 +59,7 @@ vftrio(void)
return(i);
}
-int
+static int
vfopen(register fontdesctype *fd)
{
register char *n;
@@ -75,7 +75,7 @@ vfopen(register fontdesctype *fd)
#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);
@@ -101,7 +101,7 @@ vfopen(register fontdesctype *fd)
/*
* The following routine is like fontdef, but for local fontdefs in VF files.
*/
-fontmaptype *
+static fontmaptype *
vfontdef(integer s, int siz)
{
register integer i, j, fn;
diff --git a/Build/source/texk/dvipsk/writet1.c b/Build/source/texk/dvipsk/writet1.c
index e8dfeb8b0c7..bc00fc7d68a 100644
--- a/Build/source/texk/dvipsk/writet1.c
+++ b/Build/source/texk/dvipsk/writet1.c
@@ -71,7 +71,7 @@ static char *dvips_extra_charset;
static char *cur_file_name;
static char *cur_enc_name;
static unsigned char *grid;
-static char *ext_glyph_names[MAX_CHAR_CODE + 1];
+static char *ext_glyph_names[MAX_CHAR_CODE + 1];
static char print_buf[PRINTF_BUF_SIZE];
static int hexline_length;
static char notdef[] = ".notdef";
@@ -127,7 +127,7 @@ notdef, notdef, notdef, notdef
static char charstringname[] = "/CharStrings";
char **t1_glyph_names;
-char *t1_builtin_glyph_names[MAX_CHAR_CODE + 1];
+char *t1_builtin_glyph_names[MAX_CHAR_CODE + 1];
static boolean read_encoding_only;
static int t1_encoding;
@@ -194,11 +194,11 @@ static char enc_line[ENC_BUF_SIZE];
/* define t1_line_ptr, t1_line_array & t1_line_limit */
typedef char t1_line_entry;
-define_array(t1_line);
+define_array(t1_line);
/* define t1_buf_ptr, t1_buf_array & t1_buf_limit */
typedef char t1_buf_entry;
-define_array(t1_buf);
+define_array(t1_buf);
static int cs_start;
@@ -337,7 +337,7 @@ void load_enc(char *enc_name, const char **glyph_names)
names_count++;
}
if (*r != 10 && *r != '%') {
- if (strncmp(r, "] def", strlen("] def")) == 0)
+ if (strncmp(r, "] def", strlen("] def")) == 0)
goto done;
else {
remove_eol(r, enc_line);
@@ -358,7 +358,7 @@ static void t1_check_pfa(void)
int c = t1_getchar();
if (c != 128)
t1_pfa = true;
- else
+ else
t1_pfa = false;
t1_ungetchar(c);
}
@@ -452,17 +452,17 @@ static float t1_scan_num(char *p, char **r)
pdftex_fail("a number expected: `%s'", t1_line_array);
}
if (r != NULL) {
- for (; isdigit(*p) || *p == '.' ||
+ for (; isdigit(*p) || *p == '.' ||
*p == 'e' || *p == 'E' || *p == '+' || *p == '-'; p++);
*r = p;
}
return f;
}
-static boolean str_suffix(const char *begin_buf, const char *end_buf,
- const char *s)
+static boolean str_suffix(const char *begin_buf, const char *end_buf,
+ const char *s)
{
- const char *s1 = end_buf - 1,
+ const char *s1 = end_buf - 1,
*s2 = strend(s) - 1;
if (*s1 == 10)
s1--;
@@ -473,7 +473,7 @@ static boolean str_suffix(const char *begin_buf, const char *end_buf,
return s2 < s;
}
-static void t1_getline(void)
+static void t1_getline(void)
{
int c, l, eexec_scan;
char *p;
@@ -490,7 +490,7 @@ restart:
if (c == EOF)
goto exit;
while (!t1_eof()) {
- if (t1_in_eexec == 1)
+ if (t1_in_eexec == 1)
c = edecrypt((byte)c);
alloc_array(t1_line, 1, T1_BUF_SIZE);
append_char_to_buf(c, t1_line_ptr, t1_line_array, t1_line_limit);
@@ -502,7 +502,7 @@ restart:
}
if (c == 10 || (t1_pfa && eexec_scan == eexec_len && c == 32))
break;
- if (t1_cs && t1_cslen == 0 && (t1_line_ptr - t1_line_array > 4) &&
+ if (t1_cs && t1_cslen == 0 && (t1_line_ptr - t1_line_array > 4) &&
(t1_suffix(" RD ") || t1_suffix(" -| "))) {
p = t1_line_ptr - 5;
while (*p != ' ')
@@ -527,7 +527,7 @@ exit:
alloc_array(t1_buf, t1_line_limit, t1_line_limit);
}
-static void t1_putline(void)
+static void t1_putline(void)
{
char *p = t1_line_array;
if (t1_line_ptr - t1_line_array <= 1)
@@ -536,7 +536,7 @@ static void t1_putline(void)
while (p < t1_line_ptr)
out_eexec_char(eencrypt(*p++));
}
- else
+ else
while (p < t1_line_ptr)
t1_putchar(*p++);
}
@@ -554,11 +554,11 @@ static void t1_printf(const char *fmt,...)
va_list args;
va_start(args, fmt);
vsprintf(t1_line_array, fmt, args);
- t1_puts(t1_line_array);
+ t1_puts(t1_line_array);
va_end(args);
}
-static void t1_init_params(const char *open_name_prefix)
+static void t1_init_params(const char *open_name_prefix)
{
t1_log(open_name_prefix);
t1_log(cur_file_name);
@@ -587,7 +587,7 @@ static void t1_check_block_len(boolean decrypt)
if (t1_block_length == 0)
return;
c = t1_getbyte();
- if (decrypt)
+ if (decrypt)
c = edecrypt((byte)c);
l = t1_block_length;
if (!(l == 0 && (c == 10 || c == 13))) {
@@ -638,7 +638,7 @@ static void t1_stop_eexec(void)
t1_in_eexec = 2;
}
-static void t1_scan_param(void)
+static void t1_scan_param(void)
{
static const char *lenIV = "/lenIV";
if (!t1_scan || *t1_line_array != '/')
@@ -680,8 +680,8 @@ static void t1_builtin_enc(void)
t1_builtin_glyph_names[i] = xstrdup(standard_glyph_names[i]);
t1_encoding = ENC_STANDARD;
}
- else
- pdftex_fail("cannot subset font (unknown predefined encoding `%s')",
+ else
+ pdftex_fail("cannot subset font (unknown predefined encoding `%s')",
t1_buf_array);
return;
} else
@@ -689,13 +689,13 @@ static void t1_builtin_enc(void)
/*
* At this moment "/Encoding" is the prefix of t1_line_array, and the encoding is
* not a predefined encoding
- *
+ *
* We have two possible forms of Encoding vector. The first case is
- *
+ *
* /Encoding [/a /b /c...] readonly def
- *
+ *
* and the second case can look like
- *
+ *
* /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for
* dup 0 /x put
* dup 1 /y put
@@ -735,7 +735,7 @@ static void t1_builtin_enc(void)
}
}
else { /* the second case */
- p = strchr(t1_line_array, 10);
+ p = strchr(t1_line_array, 10);
for (;;) {
if (*p == 10) {
t1_getline();
@@ -744,7 +744,7 @@ static void t1_builtin_enc(void)
/*
check for `dup <index> <glyph> put'
*/
- if (sscanf(p, "dup %i%256s put", &i, t1_buf_array) == 2 &&
+ if (sscanf(p, "dup %i%256s put", &i, t1_buf_array) == 2 &&
*t1_buf_array == '/' && valid_code(i)) {
if (strcmp(t1_buf_array + 1, notdef) != 0)
t1_builtin_glyph_names[i] = xstrdup(t1_buf_array + 1);
@@ -763,8 +763,8 @@ static void t1_builtin_enc(void)
/*
check for `dup dup <from> <size> getinterval <to> exch putinterval'
*/
- else if (sscanf(p, "dup dup %i %i getinterval %i exch putinterval",
- &a, &c, &b) == 3 &&
+ else if (sscanf(p, "dup dup %i %i getinterval %i exch putinterval",
+ &a, &c, &b) == 3 &&
valid_code(a) && valid_code(b) && valid_code(c)) {
for (i = 0; i < c; i++)
copy_glyph_names(t1_builtin_glyph_names, a + i, b + i);
@@ -777,12 +777,12 @@ static void t1_builtin_enc(void)
else if ((p == t1_line_array || (p > t1_line_array && p[-1] == ' ')) &&
strcmp(p, "def\n") == 0)
return;
- /*
- skip an unrecognizable word
+ /*
+ skip an unrecognizable word
*/
else {
while (*p != ' ' && *p != 10)
- p++;
+ p++;
skip(p, ' ');
}
}
@@ -818,7 +818,7 @@ static const char **
check_cs_token_pair(void)
{
const char **p = (const char**) cs_token_pairs_list;
- for (; p[0] != NULL; ++p)
+ for (; p[0] != NULL; ++p)
if (t1_buf_prefix(p[0]) && t1_buf_suffix(p[1]))
return p;
return NULL;
@@ -843,12 +843,12 @@ static void cs_store(boolean is_subr)
if (strcmp(t1_buf_array + 1, notdef) == 0) /* skip the slash */
ptr->name = (char*) notdef;
else
- ptr->name = xstrdup(t1_buf_array + 1);
+ ptr->name = xstrdup(t1_buf_array + 1);
}
/* copy " RD " + cs data to t1_buf_array */
memcpy(t1_buf_array, t1_line_array + cs_start - 4, (unsigned)(t1_cslen + 4));
/* copy the end of cs data to t1_buf_array */
- for (p = t1_line_array + cs_start + t1_cslen, t1_buf_ptr = t1_buf_array + t1_cslen + 4;
+ for (p = t1_line_array + cs_start + t1_cslen, t1_buf_ptr = t1_buf_array + t1_cslen + 4;
*p != 10; *t1_buf_ptr++ = *p++);
*t1_buf_ptr++ = 10;
if (is_subr && cs_token_pair == NULL)
@@ -882,7 +882,7 @@ static boolean is_cc_init = false;
}
/*
-static integer cc_get(integer index)
+static integer cc_get(integer index)
{
if (index < 0) {
if (stack_ptr + index < cc_stack )
@@ -901,13 +901,13 @@ static integer cc_get(integer index)
#define cc_push(V) *stack_ptr++ = V
#define cc_clear() stack_ptr = cc_stack
-
+
#define set_cc(N, B, A, C) \
cc_tab[N].nargs = A; \
cc_tab[N].bottom = B; \
cc_tab[N].clear = C; \
cc_tab[N].valid = true
-
+
static void cc_init(void)
{
int i;
@@ -1004,7 +1004,7 @@ static void cs_mark(const char *cs_name, int subr)
int last_cmd = 0;
integer a, a1, a2;
unsigned short cr;
- static integer lastargOtherSubr3 = 3; /* the argument of last call to
+ static integer lastargOtherSubr3 = 3; /* the argument of last call to
OtherSubrs[3] */
cs_entry *ptr;
cc_entry *cc;
@@ -1015,7 +1015,7 @@ static void cs_mark(const char *cs_name, int subr)
return;
}
else {
- if (cs_notdef != NULL &&
+ if (cs_notdef != NULL &&
(cs_name == notdef || strcmp(cs_name, notdef) == 0))
ptr = cs_notdef;
else {
@@ -1033,9 +1033,9 @@ static void cs_mark(const char *cs_name, int subr)
/* only marked CharString entries and invalid entries can be skipped;
valid marked subrs must be parsed to keep the stack in sync */
if (!ptr->valid || (ptr->used && cs_name != NULL))
- return;
+ return;
ptr->used = true;
- cr = 4330;
+ cr = 4330;
cs_len = ptr->cslen;
data = ptr->data + 4;
for (i = 0; i < t1_lenIV; i++, cs_len--)
@@ -1049,11 +1049,11 @@ static void cs_mark(const char *cs_name, int subr)
else if (b <= 250) {
--cs_len;
a = ((b - 247) << 8) + 108 + cs_getchar();
- }
+ }
else if (b <= 254) {
--cs_len;
a = -((b - 251) << 8) - 108 - cs_getchar();
- }
+ }
else {
cs_len -= 4;
a = (cs_getchar() & 0xff) << 24;
@@ -1081,11 +1081,11 @@ static void cs_mark(const char *cs_name, int subr)
}
if (cc->bottom) {
if (stack_ptr - cc_stack < cc->nargs)
- cs_warn(cs_name, subr,
+ cs_warn(cs_name, subr,
"less arguments on stack (%i) than required (%i)",
(int)(stack_ptr - cc_stack), (int)cc->nargs);
else if (stack_ptr - cc_stack > cc->nargs)
- cs_warn(cs_name, subr,
+ cs_warn(cs_name, subr,
"more arguments on stack (%i) than required (%i)",
(int)(stack_ptr - cc_stack), (int)cc->nargs);
}
@@ -1096,7 +1096,7 @@ static void cs_mark(const char *cs_name, int subr)
cc_pop(1);
mark_subr(a1);
if (!subr_tab[a1].valid) {
- cs_warn(cs_name, subr,
+ cs_warn(cs_name, subr,
"cannot call subr (%i)", (int)a1);
goto cs_error;
}
@@ -1115,7 +1115,7 @@ static void cs_mark(const char *cs_name, int subr)
cc_push(lastargOtherSubr3);
/* the only case when we care about the value being pushed onto
stack is when POP follows CALLOTHERSUBR (changing hints by
- OtherSubrs[3])
+ OtherSubrs[3])
*/
break;
case CS_SEAC:
@@ -1132,8 +1132,8 @@ static void cs_mark(const char *cs_name, int subr)
}
}
if (cs_name == NULL && last_cmd != CS_RETURN) {
- pdftex_warn("last command in subr `%i' is not a RETURN; "
- "I will add it now but please consider fixing the font",
+ pdftex_warn("last command in subr `%i' is not a RETURN; "
+ "I will add it now but please consider fixing the font",
(int) subr);
append_cs_return(ptr);
}
@@ -1153,7 +1153,7 @@ static void t1_subset_ascii_part(void)
t1_putline();
t1_getline();
}
- t1_builtin_enc();
+ t1_builtin_enc();
if (is_reencoded(fm_cur))
t1_glyph_names = external_enc();
else
@@ -1221,7 +1221,7 @@ static void t1_read_subrs(void)
cs_entry *ptr;
t1_getline();
while (!(t1_charstrings() || t1_subrs())) {
- t1_scan_param();
+ t1_scan_param();
t1_putline();
t1_getline();
}
@@ -1230,7 +1230,7 @@ found:
t1_scan = false;
if (!t1_subrs())
return;
- subr_size_pos = strlen("/Subrs") + 1;
+ subr_size_pos = strlen("/Subrs") + 1;
/* subr_size_pos points to the number indicating dict size after "/Subrs" */
subr_size = t1_scan_num(t1_line_array + subr_size_pos, 0);
if (subr_size == 0) {
@@ -1269,7 +1269,7 @@ found:
t1_getline();
}
subr_array_end = xstrdup(t1_buf_array);
- if (i == POST_SUBRS_SCAN) { /* CharStrings not found;
+ if (i == POST_SUBRS_SCAN) { /* CharStrings not found;
suppose synthetic font */
for (ptr = subr_tab; ptr - subr_tab < subr_size; ptr++)
if (ptr->valid)
@@ -1324,7 +1324,7 @@ static void t1_flush_cs(boolean is_subr)
cs_len = 0;
if (is_subr) {
cr = 4330;
- /* at this point we have t1_lenIV >= 0;
+ /* at this point we have t1_lenIV >= 0;
* a negative value would be caught in t1_scan_param() */
return_cs = xtalloc(t1_lenIV + 1, byte);
for (cs_len = 0, r = return_cs; cs_len < t1_lenIV; cs_len++, r++)
@@ -1421,7 +1421,7 @@ static void t1_subset_charstrings(void)
{
cs_entry *ptr;
cs_size_pos = strstr(t1_line_array, charstringname) + strlen(charstringname)
- - t1_line_array + 1;
+ - t1_line_array + 1;
/* cs_size_pos points to the number indicating
dict size after "/CharStrings" */
cs_size = t1_scan_num(t1_line_array + cs_size_pos, 0);
@@ -1473,7 +1473,7 @@ static void t1_subset_end(void)
get_length3();
}
-void writet1(void)
+static void writet1(void)
{
read_encoding_only = false;
if (!is_included(fm_cur)) { /* scan parameters from font file */
@@ -1489,7 +1489,7 @@ void writet1(void)
t1_include();
t1_close_font_file(">>");
return;
- }
+ }
/* partial downloading */
if (!t1_open_fontfile("<"))
return;
@@ -1503,13 +1503,16 @@ void writet1(void)
t1_close_font_file(">");
}
-void t1_free(void)
+#if 0 /* unused */
+static void t1_free(void)
{
xfree(t1_line_array);
xfree(t1_buf_array);
}
+#endif /* 0 */
-boolean t1_subset(char *fontfile, char *encfile, unsigned char *g)
+#if 0 /* unused */
+static boolean t1_subset(char *fontfile, char *encfile, unsigned char *g)
{
int i;
cur_enc_name = encfile;
@@ -1526,6 +1529,7 @@ boolean t1_subset(char *fontfile, char *encfile, unsigned char *g)
free(ext_glyph_names[i]);
return 1; /* note: there *is* no unsuccessful return */
}
+#endif /* 0 */
boolean t1_subset_2(char *fontfile, unsigned char *g, char *extraGlyphs)
{