1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
$NetBSD: patch-au,v 1.2 2008/08/24 20:35:37 tonnerre Exp $
--- texk/dviljk/dvi2xx.h.orig 1999-03-16 08:03:33.000000000 +0100
+++ texk/dviljk/dvi2xx.h
@@ -8,10 +8,14 @@
/* #define LJ */
/* #define DRAWGLYPH */
+#ifndef HAVE_MKDTEMP
+extern char *mkdtemp(char *path);
+#endif
+
#ifdef KPATHSEA
#include <kpathsea/config.h>
+#include <kpathsea/c-std.h>
#include <kpathsea/c-limits.h>
-#include <kpathsea/c-memstr.h>
#include <kpathsea/magstep.h>
#include <kpathsea/proginit.h>
#include <kpathsea/progname.h>
@@ -24,6 +28,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#ifdef unix
#include <limits.h>
#endif
@@ -41,9 +46,6 @@
#ifdef MSC5
#include <dos.h> /* only for binaryopen on device */
#endif
-#if defined (unix) && !defined (KPATHSEA)
-#include <limits.h>
-#endif
#include "config.h"
@@ -116,6 +118,7 @@
#define HUGE_SIZE (unsigned char) 2
#define HUGE_CHAR_PATTERN 32767l
#define BYTES_PER_PIXEL_LINE 500 /* max number of bytes per pixel line */
+#define MAX_SPECIAL_DEFPOINTS 80 /* max number of defpoint specials */
#define PK_POST 245
@@ -281,7 +284,14 @@ char *MFMODE = MFMODE600;
#define VisChar(c) (unsigned char)(c)
#endif
-#define GetBytes(fp,buf,n) read_multi(buf,1,n,fp) /* used to be a function */
+/* Used to be a function. buf is always an array, never a pointer.
+ Without that invariant, we would have to introduce full dynamic
+ memory management in this driver -- probably it would be easier to
+ write a new one. [27 Jun 07 -js] */
+#define GetBytes(fp,buf,n) \
+ ( sizeof(buf) != sizeof(void *) && sizeof(buf) > n ? \
+ read_multi(buf, 1, n, fp) \
+ : Fatal("Try to read %d bytes in an array of size %d", n, sizeof(buf)) )
/**********************************************************************/
@@ -307,6 +317,7 @@ int printf();
int sscanf();
int strcmp();
char *strcpy();
+char *strncpy();
# ifdef MSC5
unsigned int strlen();
# endif
@@ -393,7 +404,7 @@ struct font_entry { /* font entry */
char n[STRSIZE]; /* FNT_DEF command parameters */
long4 font_mag; /* computed from FNT_DEF s and d parameters */
/*char psname[STRSIZE];*/ /* PostScript name of the font */
- char name[STRSIZE]; /* full name of PXL file */
+ char *name; /* full name of PXL file */
FILEPTR font_file_id; /* file identifier (NO_FILE if none) */
#ifdef USEPXL
long4 magnification; /* magnification read from PXL file */
@@ -487,8 +498,8 @@ void LoadAChar DVIPROTO((long4, regis
long4 NoSignExtend DVIPROTO((FILEPTR, int));
void OpenFontFile DVIPROTO((void));
long4 PixRound DVIPROTO((long4, long4));
-void PkRaster DVIPROTO((struct char_entry *, int));
-void RasterLine DVIPROTO((struct char_entry *, unsigned int,
+void PkRaster DVIPROTO((struct char_entry *, int));
+void RasterLine DVIPROTO((struct char_entry *, unsigned int,
unsigned int, unsigned char *));
void RasterChar DVIPROTO((struct char_entry *));
void ReadFontDef DVIPROTO((long4));
@@ -534,11 +545,12 @@ bool LastPageSpecified = _FALSE;
#ifndef KPATHSEA
char *PXLpath = FONTAREA;
#endif
-char G_progname[STRSIZE]; /* program name */
-char filename[STRSIZE]; /* DVI file name */
-char rootname[STRSIZE]; /* DVI filename without extension */
+char *G_progname; /* program name */
+char *filename; /* DVI file name */
+char *rootname; /* DVI filename without extension */
char *HeaderFileName = ""; /* file name & path of Headerfile */
char *EmitFileName = ""; /* file name & path for output */
+char tmp_dir[STRSIZE] = ""; /* temporary directory for auxilliary files */
#ifdef IBM3812
bool FirstAlternate = _FALSE; /* first page from alternate casette ? */
#endif
|