1 --- dvipsk-p1.7a.patch.orig 2005-10-17 17:03:56.000000000 +0900
2 +++ dvipsk-p1.7a.patch 2007-08-16 14:51:19.000000000 +0900
3 @@ -1236,37 +1236,30 @@
6 diff -Nur dvipsk.orig/dvips.c dvipsk/dvips.c
7 ---- dvipsk.orig/dvips.c Sun Jan 30 22:17:21 2005
8 -+++ dvipsk/dvips.c Thu Mar 3 11:11:55 2005
12 +--- dvipsk.orig/dvips.c 2007-08-16 14:39:44.000000000 +0900
13 ++++ dvipsk/dvips.c 2007-08-16 14:44:03.000000000 +0900
15 + #define DEFRES (600)
18 +#ifdef __APPLE__ /* for Mac OS X, T. Uchiyama */
19 +#include <sys/types.h>
20 +#include <sys/time.h>
21 +#include <sys/resource.h>
25 * First we define some globals.
28 - static char ofnme[252],infnme[252],pap[40],thh[20];
31 + /* PS fonts fully downloaded as headers */
32 + char *downloadedpsnames[DOWNLOADEDPSSIZE];
34 +Boolean SJIS ; /* KANJI code */
35 + int unused_top_of_psnames ; /* unused top number of downloadedpsnames[#] */
36 fontdesctype *fonthead ; /* list of all fonts mentioned so far */
37 fontdesctype *curfnt ; /* the currently selected font */
38 - sectiontype *sections ; /* sections to process document in */
40 - Boolean cropmarks ; /* add cropmarks? */
41 - Boolean abspage = 0 ; /* are page numbers absolute? */
42 - Boolean tryepsf = 0 ; /* should we try to make it espf? */
43 --Boolean secure = 0 ; /* make safe for suid */
44 -+Boolean secure = 1 ; /* make safe for suid */
45 - int collatedcopies = 1 ; /* how many collated copies? */
46 - int sectioncopies = 1 ; /* how many times to repeat each section? */
47 - integer pagecopies = 1 ; /* how many times to repeat each page? */
50 char xdig[256]; /* table for reading hexadecimal digits */
51 char banner[] = BANNER ; /* our startup message */
52 char banner2[] = BANNER2 ; /* our second startup message */
54 Boolean noenv = 0 ; /* ignore PRINTER envir variable? */
55 Boolean dopprescan = 0 ; /* do we do a scan before the prescan? */
56 extern int dontmakefont ;
60 " Z* Compress bitmap fonts ",
63 /* "- Interactive query of options", */
64 " # = number f = file s = string * = suffix, `0' to turn off ",
65 " c = comma-separated dimension pair (e.g., 3.2in,-32.1cm) ",
66 -@@ -294,16 +302,21 @@
67 +@@ -302,16 +311,21 @@
70 FILE *f = status == 0 ? stdout : stderr;
71 @@ -1302,30 +1295,31 @@
73 + fputs ("Email bug reports to www-ptex@ascii.co.jp.\n", f);
76 - * This error routine prints an error message; if the first
78 - for (s="abcdef"; *s!=0; s++)
79 - xdig[(int)*s] = i++;
83 + for(i=0 ; i < DOWNLOADEDPSSIZE; i++)
84 + downloadedpsnames[i] = NULL;
89 iname = fulliname = strings ;
94 - register sectiontype *sects ;
95 + sectiontype *sects ;
97 +#ifdef __APPLE__ /* for Mac OS X, T. Uchiyama */
99 + getrlimit(RLIMIT_STACK, &rl);
100 + rl.rlim_cur = 2048 * 1024;
101 + setrlimit(RLIMIT_STACK, &rl);
106 kpse_set_program_name (argv[0], "dvips");
107 -@@ -618,12 +638,12 @@
108 + kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
109 +@@ -639,12 +661,12 @@
112 if (argc == 2 && strncmp(argv[1], "-?", 2) == 0) {
113 @@ -1340,8 +1334,8 @@
117 -@@ -747,10 +767,13 @@
118 - secure = (*p != '0') ;
119 +@@ -790,10 +812,13 @@
120 + secure_option = 1 ; /* Never used */
123 - if (*p == 0 && argv[i+1])
124 @@ -1358,7 +1352,7 @@
127 if (STREQ (p, "ode") && argv[i+1]) {
133 @@ -1367,7 +1361,7 @@
136 case 'x' : case 'y' :
137 -@@ -1070,7 +1093,7 @@
138 +@@ -1113,7 +1138,7 @@
140 papsizes = (struct papsiz *)revlist((void *)papsizes) ;
141 if (queryoptions != 0) { /* get new options */
142 @@ -1376,38 +1370,40 @@
146 -@@ -1108,7 +1131,7 @@
147 - getpsinfo((char *)NULL) ;
148 +@@ -1152,11 +1177,11 @@
151 -- (void)fprintf(stderr, "%s %s\n", banner, banner2) ;
152 -+ (void)fprintf(stderr, "%s\n%s\n", banner, banner2) ;
153 + if (dvips_debug_flag) {
155 +- (void)fprintf(stderr, "\n%s %s\n", banner, banner2) ;
156 ++ (void)fprintf(stderr, "\n%s\n%s\n", banner, banner2) ;
160 +- (void)fprintf(stderr, "%s %s\n", banner, banner2) ;
161 ++ (void)fprintf(stderr, "%s\n%s\n", banner, banner2) ;
164 dvifile = fopen(iname, READBIN) ;
166 diff -Nur dvipsk.orig/dvips.h dvipsk/dvips.h
167 ---- dvipsk.orig/dvips.h Sun Jan 30 22:17:15 2005
168 -+++ dvipsk/dvips.h Mon Oct 17 16:57:18 2005
172 +--- dvipsk.orig/dvips.h 2007-08-16 14:39:44.000000000 +0900
173 ++++ dvipsk/dvips.h 2007-08-16 14:49:19.000000000 +0900
175 /* This file is the header for dvips's global data structures. */
176 -+#define CREATIONDATE
178 -+#define MAX_CODE 65536
180 + #define CREATIONDATE
181 ++#define MAX_CODE 65536
183 --"This is dvips(k) 5.95a Copyright 2005 Radical Eye Software"
184 +-"This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software"
185 -#define BANNER2 "(www.radicaleye.com)"
186 +"This is dvips(k) p1.7a Copyright 2005 ASCII Corp.(www-ptex@ascii.co.jp)"
188 -+"based on dvips(k) 5.95a Copyright 2005 Radical Eye Software (www.radicaleye.com)"
189 ++"This is dvips(k) 5.96.1 Copyright 2007 Radical Eye Software (www.radicaleye.com)"
190 +#define WEBURL "(www.radicaleye.com)"
195 - #define STRINGSIZE (200000) /* maximum total chars in strings in program */
197 + #define STRINGSIZE (200000) /* maximum total chars in strings in program */
198 #define RASTERCHUNK (8192) /* size of chunk of raster */
199 #define MINCHUNK (240) /* minimum size char to get own raster */
200 -#define STACKSIZE (350) /* maximum stack size for dvi files */
201 @@ -1417,9 +1413,9 @@
202 +#define MAXFRAME (50) /* maximum depth of virtual font recursion */
203 +#define MAXFONTHD (1024) /* number of unique names of included fonts */
204 #define STDOUTSIZE (75) /* width of a standard output line */
205 + #define DOWNLOADEDPSSIZE (1000) /* max number of downloaded fonts to check */
207 - * Other constants, which define printer-dependent stuff.
210 * psfile. It can be 0, PREVPAGE, THISPAGE, or EXISTS.
213 @@ -1428,7 +1424,7 @@
214 halfword dpi, loadeddpi ;
215 halfword alreadyscaled ;
219 struct tfd *nextsize;
221 chardesctype *chardesc ;