diff options
author | 2020-09-10 18:10:49 +0200 | |
---|---|---|
committer | 2020-09-11 20:06:36 +0200 | |
commit | acfc02c1747065fe450c7cfeb6f1844b62335f08 (patch) | |
tree | 5887806a2e6b99bbb0255e013a9028810e230a7f /contrib | |
parent | Import Ghostscript 9.52 (diff) | |
download | ghostscript-gpl-patches-acfc02c1747065fe450c7cfeb6f1844b62335f08.tar.gz ghostscript-gpl-patches-acfc02c1747065fe450c7cfeb6f1844b62335f08.tar.bz2 ghostscript-gpl-patches-acfc02c1747065fe450c7cfeb6f1844b62335f08.zip |
Import Ghostscript 9.53ghostscript-9.53
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/contrib.mak | 314 | ||||
-rw-r--r-- | contrib/gdevadmp.c | 2 | ||||
-rw-r--r-- | contrib/gdevbjc_.h | 6 | ||||
-rw-r--r-- | contrib/japanese/dmp_init.ps | 206 | ||||
-rw-r--r-- | contrib/japanese/dmp_site.ps | 14 | ||||
-rw-r--r-- | contrib/japanese/doc/gdevdmpr.txt | 545 | ||||
-rw-r--r-- | contrib/japanese/dviprlib.c | 2823 | ||||
-rw-r--r-- | contrib/japanese/escp_24.src | 12 | ||||
-rw-r--r-- | contrib/japanese/gdevdmpr.c | 888 | ||||
-rw-r--r-- | contrib/lips4/gdevlips.h | 5 | ||||
-rw-r--r-- | contrib/lips4/gdevlprn.h | 5 |
11 files changed, 161 insertions, 4659 deletions
diff --git a/contrib/contrib.mak b/contrib/contrib.mak index bb266407..2edee7af 100644 --- a/contrib/contrib.mak +++ b/contrib/contrib.mak @@ -22,6 +22,10 @@ CONTRIB_MAK=$(CONTRIBDIR)$(D)contrib.mak $(TOP_MAKEFILES) CONTRIBSRC=$(CONTRIBDIR)$(D) +# Almost all device drivers depend on the following: +CONTDEVH=$(gserrors_h) $(gx_h) $(gxdevice_h) +CONTDEV=$(AK) $(ECHOGS_XE) $(GDEVH) + ###### --------------------------- Catalog -------------------------- ###### # The following drivers are user-contributed, and maintained (if at all) by @@ -53,8 +57,6 @@ CONTRIBSRC=$(CONTRIBDIR)$(D) # cdnj500 HP DesignJet 500 # chp2200 HP Business Inkjet 2200 # dl2100 DEC DL2100 -# dmprt dot matrix printer driver for Ghostscript (it can use -# dviprt printer config files, japanese) # escpage Epson ESC/Page driver for Ghostscript (japanese) # fmpr Fujitsu FMPR (japanese) # fmlbp Fujitsu FMLBP2xx Page Printer (japanese) @@ -152,16 +154,16 @@ appledmp_=$(DEVOBJ)gdevadmp.$(OBJ) $(DEVOBJ)gdevadmp.$(OBJ) : $(CONTRIBSRC)gdevadmp.c $(PDEVH) $(CONTRIB_MAK) $(MAKEDIRS) $(DEVCC) $(DEVO_)gdevadmp.$(OBJ) $(C_) $(CONTRIBSRC)gdevadmp.c -$(DD)appledmp.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)appledmp.dev : $(appledmp_) $(DD)page.dev $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)appledmp $(appledmp_) -$(DD)iwhi.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)iwhi.dev : $(appledmp_) $(DD)page.dev $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)iwhi $(appledmp_) -$(DD)iwlo.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)iwlo.dev : $(appledmp_) $(DD)page.dev $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)iwlo $(appledmp_) -$(DD)iwlq.dev : $(appledmp_) $(DD)page.dev $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)iwlq.dev : $(appledmp_) $(DD)page.dev $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)iwlq $(appledmp_) @@ -185,19 +187,19 @@ $(DEVOBJ)gdevbjca.$(OBJ) : $(CONTRIBSRC)gdevbjca.c $(PDEVH) $(bjc_h) \ $(DEVCC) $(DEVO_)gdevbjca.$(OBJ) $(C_) $(CONTRIBSRC)gdevbjca.c $(DD)bjcmono.dev : $(bjc_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bjcmono $(bjc_) $(DD)bjcgray.dev : $(bjc_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bjcgray $(bjc_) $(DD)bjccmyk.dev : $(bjc_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bjccmyk $(bjc_) $(DD)bjccolor.dev : $(bjc_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bjccolor $(bjc_) @@ -208,25 +210,25 @@ cdeskjet8_=$(DEVOBJ)gdevcd8.$(OBJ) $(HPPCL) # Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) # Printer: HP 670 $(DD)cdj670.dev : $(cdeskjet8_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdj670 $(cdeskjet8_) # Author: Uli Wortmann (uliw@erdw.ethz.ch) # Printer: HP 850 $(DD)cdj850.dev : $(cdeskjet8_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdj850 $(cdeskjet8_) # Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) # Printer: HP 890 $(DD)cdj890.dev : $(cdeskjet8_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdj890 $(cdeskjet8_) # Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) # Printer: HP 1600 $(DD)cdj1600.dev : $(cdeskjet8_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdj1600 $(cdeskjet8_) $(DEVOBJ)gdevcd8.$(OBJ) : $(CONTRIBSRC)gdevcd8.c $(PDEVH) $(math__h)\ @@ -244,7 +246,8 @@ $(DEVOBJ)gdevcd8.$(OBJ) : $(CONTRIBSRC)gdevcd8.c $(PDEVH) $(math__h)\ # Author: Matthew Gelhaus (mgelhaus@proaxis.com) # Printer: HP 880c -$(DD)cdj880.dev : $(cdeskjet8_) $(DD)page.dev +$(DD)cdj880.dev : $(cdeskjet8_) $(DD)page.dev $(CONTDEV) \ + $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdj880 $(cdeskjet8_) @@ -255,7 +258,7 @@ cdeskjet9_=$(DEVOBJ)gdevdj9.$(OBJ) $(HPPCL) # Author: Rene Harsch (rene@harsch.net) # Printer: HP 970Cxi $(DD)cdj970.dev : $(cdeskjet9_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdj970 $(cdeskjet9_) $(DEVOBJ)gdevdj9.$(OBJ) : $(CONTRIBSRC)gdevdj9.c $(PDEVH) $(math__h) $(string__h)\ @@ -268,7 +271,7 @@ $(DEVOBJ)gdevdj9.$(OBJ) : $(CONTRIBSRC)gdevdj9.c $(PDEVH) $(math__h) $(string__h ### NOTE: Same as chp2200 (some PJL and CRD changes). $(DD)cdnj500.dev : $(cdeskjet8_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)cdnj500 $(cdeskjet8_) @@ -277,7 +280,7 @@ $(DD)cdnj500.dev : $(cdeskjet8_) $(DD)page.dev \ ### NOTE: Depends on the presence of the cdj850 section. $(DD)chp2200.dev : $(cdeskjet8_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV2) $(DD)chp2200 $(cdeskjet8_) @@ -288,11 +291,11 @@ $(DD)chp2200.dev : $(cdeskjet8_) $(DD)page.dev \ GDIMONO=$(DEVOBJ)gdevgdi.$(OBJ) $(HPPCL) $(DD)gdi.dev : $(GDIMONO) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)gdi $(GDIMONO) $(DD)samsunggdi.dev : $(GDIMONO) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)samsunggdi $(GDIMONO) $(DEVOBJ)gdevgdi.$(OBJ) : $(CONTRIBSRC)gdevgdi.c $(PDEVH) $(gdevpcl_h) \ @@ -306,17 +309,17 @@ $(DEVOBJ)gdevgdi.$(OBJ) : $(CONTRIBSRC)gdevgdi.c $(PDEVH) $(gdevpcl_h) \ hl1250_=$(DEVOBJ)gdevhl12.$(OBJ) $(HPDLJM) $(DD)hl1250.dev : $(hl1250_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hl1250 $(hl1250_) $(DD)hl1240.dev : $(hl1250_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hl1240 $(hl1250_) # Author: Marek Michalkiewicz <marekm@linux.org.pl> # Printer: Brother HL-1250 (may work with some other models too) $(DEVOBJ)gdevhl12.$(OBJ) : $(CONTRIBSRC)gdevhl12.c $(PDEVH) $(gdevdljm_h) \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(DEVCC) $(DEVO_)gdevhl12.$(OBJ) $(C_) $(CONTRIBSRC)gdevhl12.c @@ -327,37 +330,37 @@ ln03_=$(DEVOBJ)gdevln03.$(OBJ) # Author: Ulrich Mueller (ulm@vsnhd1.cern.ch) # Printer: DEC LN03 $(DD)ln03.dev : $(ln03_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)ln03 $(ln03_) # Author: Nick Brown (nick.brown@coe.int) # Printer: DEClaser 2100 $(DD)dl2100.dev : $(ln03_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)dl2100 $(ln03_) # Author: Ian MacPhedran (macphed@dvinci.USask.CA) # Printer: DEC LA50 $(DD)la50.dev : $(ln03_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)la50 $(ln03_) # Author: Bruce Lowekamp (lowekamp@csugrad.cs.vt.edu) # Printer: DEC LA70 $(DD)la70.dev : $(ln03_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)la70 $(ln03_) # Author: Ian MacPhedran (macphed@dvinci.USask.CA) # Printer: DEC LA75 $(DD)la75.dev : $(ln03_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)la75 $(ln03_) # Author: Andre' Beck (Andre_Beck@IRS.Inf.TU-Dresden.de) # Printer: DEC LA75plus $(DD)la75plus.dev : $(ln03_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)la75plus $(ln03_) $(DEVOBJ)gdevln03.$(OBJ) : $(CONTRIBSRC)gdevln03.c $(PDEVH) \ @@ -380,27 +383,27 @@ $(DEVOBJ)gdevescv.$(OBJ) : $(ESCV_SRC)gdevescv.c $(ESCV_SRC)gdevescv.h $(PDEVH) $(DEVCC) -DA4 $(DEVO_)gdevescv.$(OBJ) $(C_) $(escv_opts) $(ESCV_SRC)gdevescv.c $(DD)alc1900.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)alc1900 $(escv_) $(DD)alc2000.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)alc2000 $(escv_) $(DD)alc4000.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)alc4000 $(escv_) $(DD)alc4100.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)alc4100 $(escv_) $(DD)alc8500.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)alc8500 $(escv_) $(DD)alc8600.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)alc8600 $(escv_) $(DD)alc9100.dev : $(escv_) $(DD)page.dev \ @@ -408,11 +411,11 @@ $(DD)alc9100.dev : $(escv_) $(DD)page.dev \ $(SETPDEV) $(DD)alc9100 $(escv_) $(DD)lp3000c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp3000c $(escv_) $(DD)lp8000c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8000c $(escv_) $(DD)lp8200c.dev : $(escv_) $(DD)page.dev \ @@ -420,15 +423,15 @@ $(DD)lp8200c.dev : $(escv_) $(DD)page.dev \ $(SETPDEV) $(DD)lp8200c $(escv_) $(DD)lp8300c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8300c $(escv_) $(DD)lp8500c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8500c $(escv_) $(DD)lp8800c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8800c $(escv_) $(DD)lp9000c.dev : $(escv_) $(DD)page.dev \ @@ -436,177 +439,177 @@ $(DD)lp9000c.dev : $(escv_) $(DD)page.dev \ $(SETPDEV) $(DD)lp9000c $(escv_) $(DD)lp9200c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9200c $(escv_) $(DD)lp9500c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9500c $(escv_) $(DD)lp9800c.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9800c $(escv_) $(DD)lps6500.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lps6500 $(escv_) $(DD)epl2050.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl2050 $(escv_) $(DD)epl2050p.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl2050p $(escv_) $(DD)epl2120.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl2120 $(escv_) $(DD)epl2500.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl2500 $(escv_) $(DD)epl2750.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl2750 $(escv_) $(DD)epl5800.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl5800 $(escv_) $(DD)epl5900.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl5900 $(escv_) $(DD)epl6100.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl6100 $(escv_) $(DD)epl6200.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)epl6200 $(escv_) $(DD)lp1800.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp1800 $(escv_) $(DD)lp1900.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp1900 $(escv_) $(DD)lp2200.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp2200 $(escv_) $(DD)lp2400.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp2400 $(escv_) $(DD)lp2500.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp2500 $(escv_) $(DD)lp7500.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp7500 $(escv_) $(DD)lp7700.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp7700 $(escv_) $(DD)lp7900.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp7900 $(escv_) $(DD)lp8100.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8100 $(escv_) $(DD)lp8300f.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8300f $(escv_) $(DD)lp8400f.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8400f $(escv_) $(DD)lp8600.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8600 $(escv_) $(DD)lp8600f.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8600f $(escv_) $(DD)lp8700.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8700 $(escv_) $(DD)lp8900.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp8900 $(escv_) $(DD)lp9000b.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9000b $(escv_) $(DD)lp9100.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9100 $(escv_) $(DD)lp9200b.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9200b $(escv_) $(DD)lp9300.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9300 $(escv_) $(DD)lp9400.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9400 $(escv_) $(DD)lp9600.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9600 $(escv_) $(DD)lp9600s.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp9600s $(escv_) $(DD)lps4500.dev : $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lps4500 $(escv_) $(DD)eplcolor.dev: $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)eplcolor $(escv_) $(DD)eplmono.dev: $(escv_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)eplmono $(escv_) # ------ The Lexmark 5700 and 7000 devices ------ # lex7000_=$(DEVOBJ)gdevlx7.$(OBJ) $(DD)lex7000.dev : $(lex7000_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lex7000 $(lex7000_) lex5700_=$(DEVOBJ)gdevlx7.$(OBJ) $(DD)lex5700.dev : $(lex5700_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lex5700 $(lex5700_) lex3200_=$(DEVOBJ)gdevlx7.$(OBJ) $(DD)lex3200.dev : $(lex3200_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lex3200 $(lex3200_) lex2050_=$(DEVOBJ)gdevlx7.$(OBJ) $(DD)lex2050.dev : $(lex2050_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lex2050 $(lex2050_) $(DEVOBJ)gdevlx7.$(OBJ) : $(CONTRIBSRC)gdevlx7.c $(PDEVH) \ @@ -623,7 +626,7 @@ $(DEVOBJ)gdevlx32.$(OBJ) : $(CONTRIBSRC)gdevlx32.c $(PDEVH) $(gsparam_h) \ $(DEVCC) $(DEVO_)gdevlx32.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx32.c $(DD)lxm3200.dev : $(lxm3200_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lxm3200 $(lxm3200_) @@ -649,13 +652,13 @@ $(DEVOBJ)gdevlips.$(OBJ) : $(GX) $(LIPS_SRC)gdevlips.c $(std_h) \ $(DEVCC) $(DEVO_)gdevlips.$(OBJ) $(LIPS_OPT) $(C_) $(LIPS_SRC)gdevlips.c $(DD)lips4.dev : $(lipsr_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lips4 $(lipsr_) lipsv_=$(DEVOBJ)gdevl4v.$(OBJ) $(DEVOBJ)gdevlips.$(OBJ) $(DD)lips4v.dev : $(ECHOGS_XE) $(lipsv_) $(DD)vector.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETDEV) $(DD)lips4v $(lipsv_) $(ADDMOD) $(DD)lips4v -include $(GLD)vector @@ -668,11 +671,11 @@ $(DEVOBJ)gdevl4v.$(OBJ) : $(LIPS_SRC)gdevl4v.c $(LIPS_SRC)gdevlips.h $(GDEV)\ ### --------------- Some extra devices: lips2p, bjc880j ---------------- ### $(DD)lips2p.dev : $(lipsr_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lips2p $(lipsr_) $(DD)bjc880j.dev : $(lipsr_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bjc880j $(lipsr_) @@ -681,15 +684,15 @@ $(DD)bjc880j.dev : $(lipsr_) $(DD)page.dev \ md2k_=$(DEVOBJ)gdevmd2k.$(OBJ) $(DD)md2k.dev : $(md2k_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)md2k $(md2k_) $(DD)md5k.dev : $(md2k_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)md5k $(md2k_) $(DEVOBJ)gdevmd2k.$(OBJ) : $(CONTRIBSRC)gdevmd2k.c $(PDEVH) $(gsparam_h) \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(DEVCC) $(DEVO_)gdevmd2k.$(OBJ) $(C_) $(CONTRIBSRC)gdevmd2k.c @@ -697,7 +700,7 @@ $(DEVOBJ)gdevmd2k.$(OBJ) : $(CONTRIBSRC)gdevmd2k.c $(PDEVH) $(gsparam_h) \ oki4w_=$(DEVOBJ)gdevop4w.$(OBJ) $(DD)oki4w.dev : $(oki4w_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)oki4w $(oki4w_) # Author: Ivan Schreter (ivan@shadow.sk) @@ -720,11 +723,11 @@ $(DEVOBJ)gdevopvp.$(OBJ) : $(OPVP_SRC)gdevopvp.c $(OPVP_SRC)opvp_common.h\ $(DEVCC) $(DEVO_)gdevopvp.$(OBJ) $(OPVP_OPT) $(C_) $(OPVP_SRC)gdevopvp.c $(DD)opvp.dev : $(opvp_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)opvp $(opvp_) $(DD)oprp.dev : $(opvp_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)oprp $(opvp_) @@ -901,78 +904,78 @@ $(DEVOBJ)pclcomp.$(OBJ) : $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h \ # The generic pcl3 device with selectable subdevices $(DD)pcl3.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)pcl3 $(pcl3_) # Fixed devices for specific printers $(DD)hpdjplus.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdjplus $(pcl3_) $(DD)hpdjportable.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdjportable $(pcl3_) $(DD)hpdj310.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj310 $(pcl3_) $(DD)hpdj320.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj320 $(pcl3_) $(DD)hpdj340.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj340 $(pcl3_) $(DD)hpdj400.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj400 $(pcl3_) $(DD)hpdj500.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj500 $(pcl3_) $(DD)hpdj500c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj500c $(pcl3_) $(DD)hpdj510.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj510 $(pcl3_) $(DD)hpdj520.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj520 $(pcl3_) $(DD)hpdj540.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj540 $(pcl3_) $(DD)hpdj550c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj550c $(pcl3_) $(DD)hpdj560c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj560c $(pcl3_) $(DD)hpdj600.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj600 $(pcl3_) $(DD)hpdj660c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj660c $(pcl3_) $(DD)hpdj670c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj670c $(pcl3_) $(DD)hpdj680c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj680c $(pcl3_) $(DD)hpdj690c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj690c $(pcl3_) $(DD)hpdj850c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj850c $(pcl3_) $(DD)hpdj855c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj855c $(pcl3_) $(DD)hpdj870c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj870c $(pcl3_) $(DD)hpdj890c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj890c $(pcl3_) $(DD)hpdj1120c.dev : $(pcl3_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)hpdj1120c $(pcl3_) #------------------------------------------------------------------------------ @@ -1009,7 +1012,7 @@ pcl3-install: xes_=$(DEVOBJ)gdevxes.$(OBJ) $(DD)xes.dev : $(xes_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)xes $(xes_) # Author: Peter Flass (flass@lbdrscs.bitnet) @@ -1029,16 +1032,16 @@ JAPSRC=$(JAPDIR)$(D) pr201_=$(DEVOBJ)gdevp201.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) -$(DD)pr201.dev : $(pr201_) $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)pr201.dev : $(pr201_) $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)pr201 $(pr201_) -$(DD)pr150.dev : $(pr201_) $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)pr150.dev : $(pr201_) $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)pr150 $(pr201_) -$(DD)pr1000.dev : $(pr201_) $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)pr1000.dev : $(pr201_) $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)pr1000 $(pr201_) -$(DD)pr1000_4.dev : $(pr201_) $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)pr1000_4.dev : $(pr201_) $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)pr1000_4 $(pr201_) $(DEVOBJ)gdevp201.$(OBJ) : $(JAPSRC)gdevp201.c $(PDEVH) \ @@ -1049,7 +1052,7 @@ $(DEVOBJ)gdevp201.$(OBJ) : $(JAPSRC)gdevp201.c $(PDEVH) \ jj100_=$(DEVOBJ)gdevj100.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) -$(DD)jj100.dev : $(jj100_) $(CONTRIB_MAK) $(MAKEDIRS) +$(DD)jj100.dev : $(jj100_) $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)jj100 $(jj100_) $(DEVOBJ)gdevj100.$(OBJ) : $(JAPSRC)gdevj100.c $(PDEVH) \ @@ -1061,11 +1064,11 @@ $(DEVOBJ)gdevj100.$(OBJ) : $(JAPSRC)gdevj100.c $(PDEVH) \ bj10v_=$(DEVOBJ)gdev10v.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) $(DD)bj10v.dev : $(bj10v_) \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bj10v $(bj10v_) $(DD)bj10vh.dev : $(bj10v_) \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)bj10vh $(bj10v_) # Uncomment the following line if you are using MS-DOS on PC9801 series. @@ -1076,29 +1079,6 @@ $(DEVOBJ)gdev10v.$(OBJ) : $(JAPSRC)gdev10v.c $(PDEVH) \ # $(DEVCC) -DPC9801 $(O_)$@ $(C_) $(JAPSRC)gdev10v.c -### ---------------- Dot matrix printer device ---------------- ### -dmprt_=$(DEVOBJ)gdevdmpr.$(OBJ) $(DEVOBJ)dviprlib.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) - -$(DD)dmprt.dev : $(dmprt_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) - $(SETDEV) $(DD)dmprt $(dmprt_) - $(ADDMOD) $(DD)dmprt -ps dmp_init - -$(DEVOBJ)gdevdmpr.$(OBJ) : $(JAPSRC)gdevdmpr.c $(JAPSRC)dviprlib.h $(PDEVH) \ - $(CONTRIB_MAK) $(MAKEDIRS) - $(DEVCC) $(O_)$@ $(C_) $(JAPSRC)gdevdmpr.c - -$(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h \ - $(CONTRIB_MAK) $(MAKEDIRS) - $(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c - -extra-dmprt-install: install-libdata - $(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1 - $(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1 - $(INSTALL_DATA) $(JAPSRC)escp_24.src $(DESTDIR)$(gsdatadir)$(D)lib || exit 1 - - - ## ## EPSON MachJet driver ## @@ -1110,19 +1090,19 @@ $(DEVOBJ)gdevmjc.$(OBJ) : $(JAPSRC)gdevmjc.c $(JAPSRC)gdevmjc.h $(PDEVH) $(gdevp $(DEVCC) -DA4 $(DEVO_)gdevmjc.$(OBJ) $(C_) $(JAPSRC)gdevmjc.c $(DD)mj700v2c.dev : $(mj700v2c_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)mj700v2c $(mj700v2c_) $(DD)mj500c.dev : $(mj700v2c_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)mj500c $(mj700v2c_) $(DD)mj6000c.dev : $(mj700v2c_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)mj6000c $(mj700v2c_) $(DD)mj8000c.dev : $(mj700v2c_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)mj8000c $(mj700v2c_) ### ----------------- The Fujitsu FMPR printer device ----------------- ### @@ -1130,7 +1110,7 @@ $(DD)mj8000c.dev : $(mj700v2c_) $(DD)page.dev \ fmpr_=$(DEVOBJ)gdevfmpr.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) $(DD)fmpr.dev : $(fmpr_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)fmpr $(fmpr_) $(DEVOBJ)gdevfmpr.$(OBJ) : $(JAPSRC)gdevfmpr.c $(PDEVH) \ @@ -1142,7 +1122,7 @@ $(DEVOBJ)gdevfmpr.$(OBJ) : $(JAPSRC)gdevfmpr.c $(PDEVH) \ fmlbp_=$(DEVOBJ)gdevfmlbp.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) $(DD)fmlbp.dev : $(fmlbp_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)fmlbp $(fmlbp_) $(DEVOBJ)gdevfmlbp.$(OBJ) : $(JAPSRC)gdevfmlbp.c $(PDEVH) \ @@ -1159,7 +1139,7 @@ $(DEVOBJ)gdevfmlbp.$(OBJ) : $(JAPSRC)gdevfmlbp.c $(PDEVH) \ ml6_=$(DEVOBJ)gdevml6.$(OBJ) $(DEVOBJ)gdevprn.$(OBJ) $(DD)ml600.dev : $(ml6_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)ml600 $(ml6_) $(DEVOBJ)gdevml6.$(OBJ) : $(JAPSRC)gdevml6.c $(PDEVH) \ @@ -1172,11 +1152,11 @@ $(DEVOBJ)gdevml6.$(OBJ) : $(JAPSRC)gdevml6.c $(PDEVH) \ lbp3x0_=$(DEVOBJ)gdevlbp3.$(OBJ) $(DD)lbp310.dev :$(lbp3x0_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lbp310 $(lbp3x0_) $(DD)lbp320.dev :$(lbp3x0_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lbp320 $(lbp3x0_) $(DEVOBJ)gdevlbp3.$(OBJ) : $(JAPSRC)gdevlbp3.c $(PDEVH) @@ -1191,7 +1171,7 @@ $(DEVOBJ)gdevnpdl.$(OBJ) : $(JAPSRC)gdevnpdl.c $(LIPS_SRC)gdevlprn.h $(PDEVH) \ $(DEVCC) -DA4 $(DEVO_)gdevnpdl.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevnpdl.c $(DD)npdl.dev : $(npdl_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)npdl $(npdl_) ### ------- EPSON ESC/Page printer device ----------------- ### @@ -1203,11 +1183,11 @@ $(DEVOBJ)gdevespg.$(OBJ) : $(JAPSRC)gdevespg.c $(LIPS_SRC)gdevlprn.h $(PDEVH) \ $(DEVCC) -DA4 $(DEVO_)gdevespg.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevespg.c $(DD)escpage.dev : $(escpage_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)escpage $(escpage_) $(DD)lp2000.dev : $(escpage_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)lp2000 $(escpage_) ### --- The RICOH RPDL language printer device ------ ### @@ -1218,7 +1198,7 @@ $(DEVOBJ)gdevrpdl.$(OBJ) : $(JAPSRC)gdevrpdl.c $(LIPS_SRC)gdevlprn.h $(PDEVH) \ $(DEVCC) $(DEVO_)gdevrpdl.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevrpdl.c $(DD)rpdl.dev : $(rpdl_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)rpdl $(rpdl_) ### ---------- RICOH RPDL IV(600dpi) printer devices ---------- ### @@ -1228,11 +1208,11 @@ $(DD)rpdl.dev : $(rpdl_) $(DD)page.dev \ # $(DEVCC) $(DEVO_)gdevrpdl.$(OBJ) $(C_) $(JAPSRC)gdevrpdl.c # #$(DD)nx100f.dev : $(rpdl_) $(DD)page.dev \ -# $(CONTRIB_MAK) $(MAKEDIRS) +# $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) # $(SETPDEV2) $(DD)nx100f $(rpdl_) # #$(DD)nx100v.dev : $(rpdl_) $(DD)page.dev \ -# $(CONTRIB_MAK) $(MAKEDIRS) +# $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) # $(SETPDEV2) $(DD)nx100v $(rpdl_) ### ------------ The ALPS Micro Dry printer devices ------------ ### @@ -1240,15 +1220,15 @@ $(DD)rpdl.dev : $(rpdl_) $(DD)page.dev \ alps_=$(DEVOBJ)gdevalps.$(OBJ) $(DD)md50Mono.dev : $(alps_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)md50Mono $(alps_) $(DD)md50Eco.dev : $(alps_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)md50Eco $(alps_) $(DD)md1xMono.dev : $(alps_) $(DD)page.dev \ - $(CONTRIB_MAK) $(MAKEDIRS) + $(CONTDEV) $(CONTRIB_MAK) $(MAKEDIRS) $(SETPDEV) $(DD)md1xMono $(alps_) $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH) \ @@ -1267,4 +1247,4 @@ extra-upp-install: install-libdata ### ------------ Build/Install special features ------------ ### -install-contrib-extras: extra-dmprt-install extra-upp-install +install-contrib-extras: extra-upp-install diff --git a/contrib/gdevadmp.c b/contrib/gdevadmp.c index d48c0dab..72fdcab6 100644 --- a/contrib/gdevadmp.c +++ b/contrib/gdevadmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2019 Artifex Software, Inc. +/* Copyright (C) 2001-2020 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or diff --git a/contrib/gdevbjc_.h b/contrib/gdevbjc_.h index 92f5448c..b40c6fc4 100644 --- a/contrib/gdevbjc_.h +++ b/contrib/gdevbjc_.h @@ -46,8 +46,8 @@ /* BJC printer drivers definitions and utility interfaces */ -#ifndef gdevbjc_INCLUDED -# define gdevbjc_INCLUDED +#ifndef gdevbjcUNDERSCORE_INCLUDED +# define gdevbjcUNDERSCORE_INCLUDED /* Define the default X and Y resolution. */ #define X_DPI 360 @@ -248,4 +248,4 @@ void bjc_rgb_to_cmy (byte r, byte g, byte b, int *c, int *m, int *y); void bjc_rgb_to_gray(byte r, byte g, byte b, int *k); uint bjc_rand(gx_device_bjc_printer *dev); void bjc_init_tresh(gx_device_bjc_printer *dev, int rnd); -#endif /* gdevbjc_INCLUDED */ +#endif /* gdevbjcUNDERSCORE_INCLUDED */ diff --git a/contrib/japanese/dmp_init.ps b/contrib/japanese/dmp_init.ps deleted file mode 100644 index b7bebd6d..00000000 --- a/contrib/japanese/dmp_init.ps +++ /dev/null @@ -1,206 +0,0 @@ -%! -% Copyright (C) 1989, 1992, 1993 Aladdin Enterprises. All rights reserved. -% -% This file is part of Ghostscript. -% -% Ghostscript is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY. No author or distributor accepts responsibility -% to anyone for the consequences of using it or for whether it serves any -% particular purpose or works at all, unless he says so in writing. Refer -% to the Ghostscript General Public License for full details. -% -% Everyone is granted permission to copy, modify and redistribute -% Ghostscript, but only under the conditions described in the Ghostscript -% General Public License. A copy of this license is supposed to have been -% given to you along with Ghostscript so you can know your rights and -% responsibilities. It should be in a file named COPYING. Among other -% things, the copyright notice and this notice must be preserved on all -% copies. - -% dmp_init.ps -% Initialization file for `dmprt' device driver. -% -% Written initial version by... ASAYAMA Kazunori 1993 Nov. -% Modified for Ghostscript 4.03 by ... ASAYAMA Kazunori 1997 May. - -%%%%% check version %%%%% - -201 % version of this initialization file. - -/dmprt finddevice { /DmprtParams gsgetdeviceprop /Version get } - stopped { pop pop 0 } if -2 copy ne { - (\ndmprt: driver version\() print - dup 0 eq {pop (unknown) print }{==only}ifelse - (\) does not match dmp_init.ps version\() print - ==only (\).\n) print - flush 1 .quit -} { pop pop } ifelse - -%%%%% BODY %%%%% - -40 dict begin % .WorkDict .UserParams - % .DmprtDevice - % .GetDmprtParam .SetDmprtParam - % .DmprtParams .Xdpi .Ydpi .Xdot .Ydot - % - % in cm mm pt bp dot - % BeginMode EndMode - % .ModeDataBase .CurrentMode - % BeginConfig EndConfig - % BeginPrinterProps EndPrinterProps - -/.WorkDict currentdict def -/.ModeDataBase 10 dict def -/.dicttomark { - counttomark 2 idiv dup dict begin { def } repeat pop currentdict end -} bind def - -%%%%% utilities for user customization. %%%%% - -/in { } bind def -/cm { 2.54 div } bind def -/mm { 25.4 div } bind def -/pt { 72.27 div } bind def -/bp { 72.0 div } bind def -/dot { [ exch truncate cvi ] } bind def - -% the database of user customizations. (not implemented yet.) -/BeginMode { % <name> -> <name> mark - mark -} bind def -/EndMode { % <name> mark <item1> <value1> ... <itemN> <valueN> -> -- - .dicttomark .ModeDataBase - dup dup maxlength exch length eq { - % Expand capacity of database dictionaly. - dup maxlength 10 add dict copy dup /.ModeDataBase exch def - } if - 3 1 roll put -} bind def - -% these procedures are undocumented in the user's manual. -% these are used in order to specify the propaties directly. -/BeginPrinterProps { [ } bind def -/EndPrinterProps { ] /printer exch } bind def - -%%%%% run the user customization file. %%%%% - -/BeginConfig mark def -/EndConfig { .dicttomark /.UserParams exch def } bind def -systemdict /DMPCONFIG 2 copy known -{ get run } % -sDMPCONFIG=<filename> -{ pop pop (dmp_site.ps) findlibfile { closefile run } if } ifelse - -%%%%% refer database %%%%% - -/.UsedMode .ModeDataBase length dict def -/.ExpandUserParams { % <dict> -> <param1> <value1> ... <paramN> <valueN> - /.InheritMode null def - { 1 index /inherit eq { - exch pop dup .UsedMode exch known { % check recursive reference. - /.ExpandUserParams /rangecheck signalerror - } if - /.InheritMode exch def - } if } forall - .InheritMode type /nametype eq { - .UsedMode .InheritMode true put - .ModeDataBase .InheritMode get .ExpandUserParams - } if -} bind def - -systemdict /DMPMODE 2 copy known - {get .ModeDataBase exch get} {pop pop .UserParams} ifelse -mark exch .ExpandUserParams .dicttomark /.UserParams exch def - -%%%%% Local variables and procedures. %%%%% -/.DmprtDevice /dmprt finddevice def -/.SetDmprtParam { % <key> <value> -> -- - .DmprtParams 3 1 roll put -} bind def -/.SetLocalParam { .LocalParams 3 1 roll put } bind def -/.GetDmprtParam { % <key> -> <value> - .DmprtParams exch get -} bind def -/.GetUserParam { % <key> <default-value> -> <value> - .UserParams 3 -1 roll 2 copy known {get exch pop}{pop pop} ifelse -} bind def -/.SetUserParam { % <prop-name> <key> <default-value> -> -- - .GetUserParam .SetDmprtParam -} bind def - -%%%%% dviprt proparties %%%%% - -mark -.UserParams /printer 2 copy known { - get dup type /dicttype ne { mark /FileName 3 -1 roll .dicttomark } if -} -{ pop pop % Default printer is `ESC/P 24 pins'. - mark - /Name (ESC/P 24 pins) - /Transpose true - /Reverse false - /NonMoving false - /Encoding (Null) - /HDpi 180 - /VDpi 180 - /Pins 24 - /MinimalUnit 1 - /MaximalUnit 180 - /Constant 1 - /BitImageMode (\007\0333\030\033?Z\047) - /NormalMode (\004\015\014\0332) - /SendBitImage (\002\033Z\002\001\200) - /SkipSpaces (\002\033\\\002\001\200) - /LineFeed (\002\015\012) - /FormFeed (\002\015\014) - /AfterBitImage () - /BitRowHeader () - .dicttomark -} ifelse -/DviprtParams exch .DmprtDevice putdeviceprops - -getdeviceprops .dicttomark /.DmprtParams exch def -.DmprtParams /DviprtParams get /.DviprtParams exch def -.DmprtParams /DmprtParams get /.LocalParams exch def - -% calcurate resolutions and define operators converting -% from user-coordination to device-coordination(count by dots). -/resolution [ .DviprtParams dup /HDpi get exch /VDpi get ] - .GetUserParam {} forall /.Ydpi exch def /.Xdpi exch def -/.Xdot { dup type /arraytype eq { 0 get } { .Xdpi mul truncate cvi } ifelse -} bind def -/.Ydot { dup type /arraytype eq { 0 get } { .Ydpi mul truncate cvi } ifelse -} bind def - -%%%%% Standard Ghostscript device propaties. %%%%% - -/HWSize % default is A4. - /defaultsize [8.3 11.7] .GetUserParam - [ exch dup 0 get .Xdot exch 1 get .Ydot ] .SetDmprtParam - -%%%%% dmprt device propaties. %%%%% - -/MaxSize - /maxsize [0.0 0.0] .GetUserParam [ exch dup 0 get .Xdot exch 1 get .Ydot ] - .SetLocalParam -/Margins /margin [0.0 0.0 0.0 0.0] .GetUserParam - [ exch dup 0 get .Xdot exch dup 1 get .Ydot - exch dup 2 get .Xdot exch 3 get .Ydot ] .SetLocalParam -/Verbose QUIET {false} - {/verbose false .GetUserParam} ifelse .SetLocalParam -/Debug /debug false .GetUserParam .SetLocalParam - -%%%%% Page device propaties. %%%%% -%%%%% See PostScript Reference Manual 2nd edition. %%%%% - -/HWResolution [ .Xdpi .Ydpi ] .SetDmprtParam -/Offsets - /offset [0.0 0.0] .GetUserParam [ exch dup 0 get .Xdot exch 1 get .Ydot ] - .SetLocalParam - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -mark .DmprtParams {} forall .DmprtDevice putdeviceprops pop - -end -%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of file %%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/contrib/japanese/dmp_site.ps b/contrib/japanese/dmp_site.ps deleted file mode 100644 index 05bdb4d6..00000000 --- a/contrib/japanese/dmp_site.ps +++ /dev/null @@ -1,14 +0,0 @@ -%! -BeginConfig -%%%%%%%%%%%%%%%%%%%%%% Standard user cusomizations %%%%%%%%%%%%%%%%%%%%% -/printer (escp_24.src) -% horizontal / vertical -% /resolution [ 180.0 180.0 ] -% horizontal / vertical -% /offset [ 0.0 0.0 ] -% width / height -% /defaultsize [ 8.0 in 11.0 in ] -% width / height -% /maxsize [ 8.0 -1 ] -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -EndConfig diff --git a/contrib/japanese/doc/gdevdmpr.txt b/contrib/japanese/doc/gdevdmpr.txt deleted file mode 100644 index 5c64d5d4..00000000 --- a/contrib/japanese/doc/gdevdmpr.txt +++ /dev/null @@ -1,545 +0,0 @@ -¢£ ¢£ -¢£ ¥É¥Ã¥È¥Þ¥È¥ê¥¯¥¹¥×¥ê¥ó¥¿ÈÆÍѥɥ饤¥Ð ¢£ -¢£ dmprt version 2.01 ¢£ -¢£ for Ghostscript version 4.03 ¢£ -¢£ ¢£ -¢£ ÞÉ»³ÏÂŵ ¢£ -¢£ TPM03937@pcvan.or.jp ¢£ -¢£ GHF01532@niftyserve.or.jp ¢£ -¢£ asayama@vsp.cpg.sony.co.jp ¢£ -¢£ ¢£ - -======================================================================== -¡ü £±¡¥ ¥Õ¥¡¥¤¥ë¹½À® -======================================================================== - - ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï¼¡¤Î¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£Ëܥɥ¥å¥á¥ó¥ÈÃæ¤Ç¡ÖËÜ -¥Ñ¥Ã¥±¡¼¥¸¡×¤È¤¤¤¦¾ì¹ç¤Ë¤Ï¤³¤ì¤éÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò»Ø¤·¤Æ¤¤¤ë¤â¤Î¤È¤·¤Þ¤¹¡£ - - COPYING GNU General Public License - gdevdmpr.sj ¤³¤Î¥Õ¥¡¥¤¥ë(Shift JIS) - gdevdmpr.c ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë - dviprlib.c ¡· - dviprlib.h ¡· - gdevdmpr.mak Makefile - escp_24.src dviprt¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î¥µ¥ó¥×¥ë - dmp_init.ps ½é´ü²½¥Õ¥¡¥¤¥ë - dmp_site.ps ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥µ¥ó¥×¥ë - testpage.ps °ÌÃÖ¹ç¤ï¤»¥Æ¥¹¥ÈÍѤÎPS¥Õ¥¡¥¤¥ë - -======================================================================== -¡ü £²¡¥ ³µÍ× -======================================================================== - - ¤³¤Î¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ï¡¢¥Ó¥Ã¥È¥Þ¥Ã¥×¥¤¥á¡¼¥¸¤Î°õ»ú¤Î¤¿¤á¤Î¥×¥ê¥ó¥¿Ì¿Îá -¤ò¥æ¡¼¥¶¤¬ÄêµÁ¤Ç¤¤ë¤è¤¦¤Ë¤·¡¢½ÐÍè¤ë¸Â¤ê¿¤¯¤Î¼ïÎà¤Î¥×¥ê¥ó¥¿¤ËÂбþ¤Ç¤¤ë -¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¹¡£ - - ¥×¥ê¥ó¥¿¥³¡¼¥É¤ÎÄêµÁ¤Ï¡¢MS-DOS ¾å¤Ç¹¤¯ÍѤ¤¤é¤ì¤Æ¤¤¤ë TeX ÍÑ¥×¥ê¥ó¥¿¥É -¥é¥¤¥Ð dviprt.exe ¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë (³ÈÄ¥»Ò.cfg)¡¢¤Þ¤¿¤Ï¤½¤Î¥½¡¼¥¹ -¥Õ¥¡¥¤¥ë (³ÈÄ¥»Ò.src) ¤òÍѤ¤¤ë¡¢¤È¤¤¤¦ÊýË¡¤Ç¹Ô¤¤¤Þ¤¹¡£ - - ¢¨ ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î½ñ¼°¤Ë¤Ä¤¤¤Æ¤Ï dviprt ¤Î¥Æ¥¯¥Ë¥«¥ë¥Þ¥Ë¥å¥¢ - ¥ë texjman.tex (ver. 2.42 °Ê¹ß) ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£tex???ma.lzh(??? - ¤Ï¥Ð¡¼¥¸¥ç¥óÈÖ¹æ) ¤È¤¤¤¦¥Õ¥¡¥¤¥ë̾¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ - - ¢¨ dviprt ¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î»ÅÍͤ¬¥Ð¡¼¥¸¥ç¥ó 2.41.8 °Ê¹ß¤Ç³È - Ä¥¤µ¤ì¤Þ¤·¤¿¡£dmprt ¤ÎËܥС¼¥¸¥ç¥ó¤Ç¤Ï¤³¤Î¿·¤·¤¤»ÅÍͤˤâÂбþ¤·¤Æ¤¤ - ¤Þ¤¹¡£ - - ¢¨ dviprt.exe ¤Ï TSG(ÅìµþÂç³ØÍýÏÀ²Ê³Ø¥°¥ë¡¼¥×) µÚ¤Ó PC-VAN SSCIENCE - ¤Î SHIMA ¤µ¤ó¤Ë¤è¤ë TeX ÍÑ¥×¥ê¥ó¥¿¥É¥é¥¤¥Ð¤Ç¤¹¡£PC-VAN ¤Ç¤Ï - SSCIENCE ¤Î OSL¡¢Nifty Serve ¤Ç¤Ï FLABO ¤Î¥é¥¤¥Ö¥é¥ê¤Î 11 ÈÖ (TeX - ÀìÍÑ)¡¢ASCII NET ¤Ç¤Ï pool msdos ¤ÇÆþ¼ê²Äǽ¤Ç¤¹¡£¤Þ¤¿ annonymous - FTP ¤Ç¤âÆþ¼ê¤Ç¤¤Þ¤¹¡£ - - ¢¨ ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï dviprt.exe ¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Ñ¥Ã¥±¡¼¥¸ - tex???ut.lzh (??? ¤Ï¥Ð¡¼¥¸¥ç¥óÈÖ¹æ) ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ - - ¢¨ dviprt v2.42 ¤Î»þÅÀ¤ÇÇÛÉۥѥ屡¼¥¸¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥×¥ê¥ó¥¿ÄêµÁ¥Õ - ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¤È¤ª¤ê¤Ç¤¹¡£ - - ¤³¤ì¤éÁ´¤Æ¤Î¥×¥ê¥ó¥¿¤Ç¤ÎÆ°ºî³Îǧ¤¬½ÐÍè¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³ - ¤ì¤é¤Î¥×¥ê¥ó¥¿¤ÎÃæ¤ÇÀµ¾ï¤Ë°õ»ú½ÐÍè¤Ê¤¤¾ì¹ç¤Ë¤Ï¤´Ï¢Íí¤¯¤À¤µ¤¤¡£½ÐÍè - ¤ë¸Â¤êÂн褷¤Þ¤¹¡£ - - ap850.src EPSON AP-850/MJ-500ÍÑ (48¥É¥Ã¥È) - ap900.src EPSON AP-900ÍÑ (360dpi) - art.src Xerox ART mode (240dpi) - art2.src Xerox ART2 mode (240dpi, Hex mode) - bj_10v48.src Canon BJ-10/BJ-15ÍÑ (48¥É¥Ã¥È) - bj_130j.src Canon BJ-130J/BJ-330JÍÑ (48¥É¥Ã¥È) - dj500.src HP DeskJet 500ÍÑ (300dpi) - dj505j.src HP DeskJet 500J/300J/505J/505J plusÍÑ (300dpi) - dj505j1.src HP DeskJet 505J plusÍÑ (300dpi PCL mode1 °µ½Ì) - dj505j2.src HP DeskJet 505J plusÍÑ (300dpi PCl mode2 °µ½Ì) - dvi2pbm.src raw PBM ½ÐÎÏÍÑ (118dpi) - epsimage.src Encapsulated PostScript(TM) Image ½ÐÎÏÍÑ(118dpi) - escp_24.src EPSON ESC/P (24¥É¥Ã¥È)¥×¥ê¥ó¥¿ÍÑ - escp_48.src EPSON HG-4800ÍÑ (48¥É¥Ã¥È) - escp_48a.src EPSON HG-5130ÍÑ (48¥É¥Ã¥È, ÎÙÀܥɥåȲÄ) - escp_8.src EPSON ESC/P (8¥Ô¥ó)ÍÑ - fmpr-351.src Fujitsu FMPR-351ÍÑ (48¥É¥Ã¥È) - g3fax.src G3 FAXÍÑ(200dpi, Header ¤Ê¤·) - hl_8e.src Brother HL-8eÍÑ (300dpi) - hp_djp.src HP DeskJet PlusÍÑ (300dpi) - hp_ljp.src HP LaserJet PlusÍÑ (300dpi) - jt48escp.src Star JT-48 ESC/P (48 ¥É¥Ã¥È) - jt48nm.src Star JT-48CL/NM (48 ¥É¥Ã¥È) - lbp-b406.src Canon LBP-B406ÍÑ(240dpi) - lbp8_240.src Canon LBP-8/LIPS IIÍÑ (240dpi) - lbp8_300.src Canon LBP-8/LIPS IIÍÑ (300dpi) - lcs240.src Casio LCS-240ÍÑ (240dpi) - lips3.src Canon LIPS IIIÍÑ - lp3000.src EPSON LP-3000(2000)ÍÑ - lp7000.src EPSON LP-7000ÍÑ - lp_rpdl.src RICOH LP3320-SP4 mark2 - / LP2310-SP5 (RPDL)ÍÑ (240dpi) - l_880.src Kyocera L-880ÍÑ (300dpi) - nec_page.src NEC PC-PR2000ÍÑ - nec_pgr.src NEC PC-PR1000,2000,4000ÍÑ (240dpi) - nec_pgr4.src NEC PC-PR2000,4000ÍÑ (400dpi) - nm_24.src NEC NM(24¥É¥Ã¥È)ÍÑ - pc-pr101.src NEC PC-PR101ÍÑ(24¥É¥Ã¥È) - pc-pr_24.src NEC PC-PR(24¥É¥Ã¥È)ÍÑ - pc150v48.src NEC PC-PR150V(48¥É¥Ã¥È)ÍÑ - pc8821.src NEC PC-8821(16¥É¥Ã¥È)ÍÑ - pc_pr406.src NEC PR406LM(48¥É¥Ã¥È)ÍÑ - pc_pr602.src NEC PC-PR602RÍÑ (240dpi) - pr_130ax.src SANYO PR_130AX, TOSHIBA PR-48(J31DPR02)ÍÑ (180dpi) - pr-48.src Toshiba PR-48 (360dpi) - r98_dma.src RICOH LP3320-SP4 R98 emulation mode - Direct Memory Access - rpdl_dma.src RICOH LP3320-SP4 Direct Memory Access (240dpi) - smdfax.src SONY SMD50/70 ¥·¥ê¡¼¥ºFAX (200dpi) - starfax.src StarfaxÍÑ (200dpi) - - -======================================================================== -¡ü £³¡¥ Æ°ºî´Ä¶ -======================================================================== - - ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ï´ðËÜŪ¤ËÈ󵡼ï°Í¸¤Î¤Ä¤â¤ê¤Ç½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹ (¤¿¤À¤· -FreeBSD ¾å¤Ç¤·¤«Æ°ºî³Îǧ¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤Þ¤»¤ó)¡£ - - ¤³¤Î¥É¥é¥¤¥Ð¤òÁȤ߹þ¤à¤³¤È¤¬½ÐÍè¤ë Ghostscript ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¤¬¡¢ -Ghostscript ¤ÎËÜÂΤȥǥХ¤¥¹¥É¥é¥¤¥Ð¤È¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬ Ghostscript -version 4.03 ¤ÈƱÍͤΤâ¤Î¤Ê¤é¤Ð²Äǽ¤Ç¤¹ (2.6.x ¤Ë¤ÏÁȤ߹þ¤á¤Þ¤»¤ó¡£ -2.6.x ¤Ç¤Ï½¾Íè¤Î¤â¤Î¤òÍѤ¤¤Æ²¼¤µ¤¤)¡£ - - -======================================================================== -¡ü £´¡¥ ƳÆþ¤Î¼ê½ç -======================================================================== - ¤³¤³¤Ç¤Ï dmprt ¤¬ÁȤߤ³¤ó¤Ç¤¢¤ë¼Â¹Ô²Äǽ·Á¼°¤Î gs ¤¬´û¤Ë¼ê¸µ¤Ë¤¢¤ë¤â¤Î -¤È¤·¤ÆÀâÌÀ¤·¤Þ¤¹¡£¥³¥ó¥Ñ¥¤¥ë¤¬É¬Íפʾì¹ç¤Ï¤³¤Î¥É¥¥å¥á¥ó¥ÈËöÈø¤Î¡Ö¥³¥ó¥Ñ -¥¤¥ë¡×¤Î¹àÌܤò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ - - dmprt ¤Ï¤ª¤ª¤è¤½ÈÆÍѤΥץê¥ó¥¿¥É¥é¥¤¥Ð¤Ç¤¹¤«¤é¡¢µÕ¤Ë¸À¤¦¤È¥æ¡¼¥¶¤¬ÀßÄê -¤ò¤ª¤³¤Ê¤Ã¤Æ¤ä¤é¤Ê¤¤¤ÈÀµ¤·¤¯Æ°ºî¤·¤Æ¤¯¤ì¤Þ¤»¤ó¡£ - - °Ê²¼¤Îºî¶È¤ò¹Ô¤¤¤Þ¤¹¡£ - -(1) ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÊÔ½¸ -(2) ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Î»ØÄê - ------------------------ -¡ú 4.1 ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë ------------------------ - - ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢¥×¥ê¥ó¥¿¤Îµ¡¼ïÊ̾ðÊó¤Ê¤É¤ò»ØÄꤷ¤Þ¤¹¡£¤Þ¤¿¡¢°õ»ú -°ÌÃÖ¤ÎÊäÀµ¤Ê¤É¤¬É¬Íפʤé¤Ð¤µ¤é¤Ë¤½¤ì¤ò»ØÄꤷ¤Þ¤¹¡£ - - ------------------------------ -¡ú 4.2 ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Î½ñ¼° ------------------------------ - - ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë dmp_site.ps ¤ÎÂç¤Þ¤«¤Ê½ñ¼°¤òÀâÌÀ¤·¤Þ¤¹¡£¹àÌÜÊ̤ξܺ٠-¤Ê½ñ¼°¤Ï³Æ¹àÌܤÎÀâÌÀ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ - -(1) ÀßÄê¥Õ¥¡¥¤¥ë¤Î³«»Ï¡¦½ªÎ»¥³¥Þ¥ó¥É - - ÉÕ°¤Î dmp_site.ps ¤ÎºÇ½é¤ÈºÇ¸å¤Î¹Ô¤Ë¤¢¤ë ¡ÖBeginConfig¡× ¤È - ¡ÖEndConfig¡× ¤È¤¤¤¦Ê¸»úÎó¤Î¤³¤È¤Ç¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤ÈºÇ¸å¤Î¹Ô - ¤Ë¤½¤ì¤¾¤ì¤³¤ì¤é¤Îʸ»úÎ󤬤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ÉÕ°¤Î dmp_site.ps ¤ò - ÊÔ½¸¤·¤Æ»È¤¦¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤é¤Î¹Ô¤òºï½ü¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ - -(2) ¥³¥á¥ó¥È - - '%' °Ê¹ß¹ÔËö¤Þ¤Ç¤Ï¥³¥á¥ó¥È¤È¤·¤Æ̵»ë¤µ¤ì¤Þ¤¹¡£ - -(3) ÏÀÍýÃÍ (¥¹¥¤¥Ã¥Á) - - true (¿¿ / on) Ëô¤Ï false (µ¶ / off) ¤Î¤É¤Á¤é¤«¤ÎÃͤǤ¹¡£ - -(4) ʸ»úÎó - - '(' ¤È ')' ¤Ç°Ï¤Þ¤ì¤¿¤â¤Î¤¬Ê¸»úÎó¤Ç¤¹¡£¤³¤ì¤é¤Î³ç¸Ì¤Î´Ö¤Ë¤Ï;ʬ¤Ê - ¶õÇò¤ò´Þ¤á¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ - -(5) Ťµ - dmp_site.ps ¤ÎÃæ¤Ç¡ÖŤµ¡×¤Ç»ØÄꤹ¤ë¹àÌܤǤÏñ°Ì¤òÉÕ¤±¤ë¤³¤È¤¬½ÐÍè - ¤Þ¤¹¡£»ÈÍѤǤ¤ëñ°Ì¤Ï¡¢ - - ¡¦ in ¥¤¥ó¥Á - ¡¦ cm ¥»¥ó¥Á¥á¡¼¥È¥ë - ¡¦ mm ¥ß¥ê¥á¡¼¥È¥ë - ¡¦ pt ¥Ý¥¤¥ó¥È (1/72.27 ¥¤¥ó¥Á) - ¡¦ bp ¥Ó¥Ã¥°¥Ý¥¤¥ó¥È (1/72 ¥¤¥ó¥Á) - ¡¦ dot ¥É¥Ã¥È - - ¤Ç¤¹¡£Ã±°Ì¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡Ö¥¤¥ó¥Á¡×¤òñ°Ì¤È¤·¤Æ½èÍý¤·¤Þ¤¹¡£ - - ñ°Ì¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢¿ôÃͤȤδ֤˶õÇòʸ»ú¤ò¾¯¤Ê¤¯¤È¤â°ì¤ÄÁÞÆþ¤· - ¤Æ¤¯¤À¤µ¤¤¡£¶õÇòʸ»ú¤¬¿ôÃͤȤδ֤ˤʤ¤¾ì¹ç¡¢¤¦¤Þ¤¯²ò¼á¤Ç¤¤Þ¤»¤ó¡£ - - (e.g.) /defaultsize [ 576 bp 792 bp ] - - - ¢¨´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Ï¼ÂºÝ¤Ë¤Ï PostScript ¥×¥í¥°¥é¥à¤È¤·¤Æ¼Â¹Ô¤µ¤ì²ò¼á - ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£½¾¤Ã¤Æ¡¢´Ä¶ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¤Ï PostScript ¸À¸ì¤¬µö¤¹ - µ½Ò¤Ï´ðËÜŪ¤Ëµö¤µ¤ì¤Þ¤¹¡£ - - ¤¿¤À¤·¡¢¤½¤Î¾ì¹ç¤Ëºî¶È¤ÎÅÔ¹ç¾å¼½ñ¤ËÅÐÏ¿¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ë¾ì¹ç¤Ë¤Ï - ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¥í¡¼¥«¥ë¤Ê¼½ñ¤òºî¤Ã¤Æ¡¢¤½¤Î¼½ñ¤ËÂФ·¤ÆÅÐÏ¿¤ò - ¹Ô¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤ (dictfull ¥¨¥é¡¼¤ä»×¤ï¤ÌÉûºîÍѤ¬µ¯¤¤ë²ÄǽÀ¤¬¤¢ - ¤ê¤Þ¤¹)¡£¤Þ¤¿¡¢¥ª¥Ú¥é¥ó¥É¥¹¥¿¥Ã¥¯¤ä¼½ñ¥¹¥¿¥Ã¥¯¤òÇ˲õ¤·¤Ê¤¤¤è¤¦¤Ë - ½½Ê¬¤Ëµ¤¤òÉÕ¤±¤Æ¤¯¤À¤µ¤¤ (¥´¥ß¤ò»Ä¤µ¤Ê¤¤¤è¤¦¤Ë!!)¡£ - - ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¤Ï Level 2 ¤Î¥ª¥Ú¥ì¡¼¥¿¤Ï»È¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯ - ¤À¤µ¤¤¡£ - ------------------------------ -¡ú 4.3 ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Î¹àÌÜ ------------------------------ - - ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë dmp_site.ps ¤Ï°Ê²¼¤Î¹àÌܤȥ³¥á¥ó¥È¤«¤é¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ - - /printer dviprt¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë - /resolution ²òÁüÅÙ - /offset ¸¶ÅÀ°ÜÆ°ÎÌ - /defaultsize ¥Ç¥Õ¥©¥ë¥È¤ÎÍѻ極¥¤¥º - /margin °õ»úÉÔ²ÄǽÎΰè - /maxsize °õ»ú²ÄǽÎΰè¤ÎºÇÂçÈÏ°Ï - /verbose ¤ª¤·¤ã¤Ù¤ê¥â¡¼¥É(^^; - - ¤³¤ì¤é¤ÏÁ´¤Æ¾Êά²Äǽ¤Ê¹àÌܤǤ¹¡£¤¿¤À¤·¡¢/printer ¤òÀßÄꤷ¤Ê¤¤¾ì¹ç¤Ë¤Ï -ESC/P 24 pins ¤Î¥×¥ê¥ó¥¿¥³¡¼¥É¤òÍѤ¤¤Æ½ÐÎϤ·¤Þ¤¹¤Î¤Ç¡¢¤³¤ì¤Ë³ºÅö¤·¤Ê¤¤¥× -¥ê¥ó¥¿¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤ÏºÇÄã¸Â¤³¤Î¹àÌܤÏÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ - - °Ê²¼¤Ë³Æ¹àÌܤλØÄêË¡¤òÀâÌÀ¤·¤Þ¤¹¡£³Æ¹àÌܤϹÔñ°Ì¤Ç»ØÄꤷ¡¢½ÅÊ£¤·¤¿»ØÄê -¤ÏºÇ½é¤Î»ØÄê¤Î¤ß¤¬Í¸ú¤È¤Ê¤ê¤Þ¤¹¡£¤Þ¤¿¡¢ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Îʸ»ú¤ÏÁ´¤ÆÂçʸ»ú¡¢ -¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤Þ¤¹¤Î¤ÇÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ - -(1) /printer - - ¡¦ ¡Ô»ØÄêË¡¡Õ - - /printer (¥Õ¥¡¥¤¥ë̾) - - dviprt ¤Î *.cfg/*.src ¤Î¥Õ¥¡¥¤¥ë̾¤òʸ»úÎó¤Ç»ØÄꤷ¤Þ¤¹¡£³ÈÄ¥»Ò - ¤Î¾Êά¤Ï¤Ç¤¤Þ¤»¤ó¡£ - - MS-DOS ¾å¤Ç»ÈÍѤ¹¤ë¾ì¹ç¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Î¶èÀÚ¤ê¤Ë¤Ï '\' ¤Ç¤Ï¤Ê¤¯ - '/' ¤òÍѤ¤¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£ - - ¡¦ ¡Ô»ØÄêÎã¡Õ - - /printer (/usr/local/lib/tex/dviprt/escp_24.cfg) - - ¡¦ ¡ÔÀâÌÀ¡Õ - - dviprt.exe ¤ÇÍѤ¤¤é¤ì¤ë¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¤½¤Î¥½¡¼¥¹¥Õ - ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ - - ¤³¤³¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï - - (A) Ghostscript ¤Î¥é¥¤¥Ö¥é¥ê¸¡º÷ (use.doc ¤Î File searching ¤Î¹à - Ìܤò»²¾È) ¤Ë½¾¤Ã¤¿¸¡º÷ - (B) »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ò´Ä¶ÊÑ¿ô TEXCFG ¤ËÀßÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È - ¥ê̾¤ËÏ¢·ë¤·¤¿¥Õ¥¡¥¤¥ë̾¤Î¥Õ¥¡¥¤¥ë (´Ä¶ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë - ¾ì¹ç¤Î¤ß) - - ¤Î½ç¤Ëõ¤µ¤ì¤Þ¤¹¡£ - - ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï»ÈÍѤ¹¤ë¥×¥ê¥ó¥¿¤Îµ¡¼ï¤Ë¤¢¤Ã¤¿¤â¤Î¤òÍÑ°Õ¤¹¤ëɬÍ× - ¤¬¤¢¤ê¤Þ¤¹¡£ - - dviprt ¤ÏÂçÊÑ¿¤¯¤Î¥æ¡¼¥¶¤ò»ý¤Ã¤Æ¤¤¤ë¤¿¤á¤¢¤ê¤¬¤¿¤¤¤³¤È¤Ë¤¿¤¯ - ¤µ¤ó¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤¬´û¤ËºîÀ®¡¦¸ø³«¡¦ÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤Þ - ¤º¤Ï dviprt ¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Ñ¥Ã¥±¡¼¥¸ tex???ut.lzh ¤ËÌÜŪ¤Î¥×¥ê - ¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤¬Ìµ¤¤¤«¤É¤¦¤«³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£ - - ±¿°¤¯¤´»ÈÍѤΥץê¥ó¥¿ÍѤΥץê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤¬ tex???ut.lzh - ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¤½¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ï¥Æ¥¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤¹¤Î - ¤Ç¥¨¥Ç¥£¥¿¤ÇºîÀ®¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£ - - ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¤½¤ì¤ò¥³¥ó¥Ð¡¼¥È¤·¤¿¥Ð¥¤ - ¥Ê¥ê¥Õ¥¡¥¤¥ë¤È¤Ï¤½¤ÎÆâÍƤ«¤é¼«Æ°È½Ê̤·¤Æ¤¤¤Þ¤¹¡£ - -(2) /resolution - - ¡¦ ¡Ô»ØÄêË¡¡Õ - - /resolution [ ²£¤Î²òÁüÅÙ ½Ä¤Î²òÁüÅÙ ] - - dot/inch(dpi) ñ°Ì¤Ç¤Î¼Â¿ôɽ¸½¡£ - - ¡¦ ¡ÔÀßÄêÎã¡Õ - - /resolution [ 160 180 ] - - ¡¦ ¡ÔÀâÌÀ¡Õ - - ²òÁüÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£Ä̾ï¤Ï¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤ËµÏ¿¤·¤Æ¤¢¤ë¥× - ¥ê¥ó¥¿¸ÇͤβòÁüÅÙ¤ò»²¾È¤·¤Þ¤¹¤Î¤Ç¤³¤Î¹àÌܤÎÀßÄê¤ÏɬÍפ¢¤ê¤Þ¤»¤ó - ¤¬ dviprt ¤Î¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤Ï½Ä²£¤Î²òÁüÅÙ¤¬Æ±¤¸¤Ç¤¢¤ë¤³¤È¤ò - ²¾Äꤷ¤Æ¤¤¤Þ¤¹¤Î¤Ç¤³¤ì¤Ë³ºÅö¤·¤Ê¤¤¥×¥ê¥ó¥¿ (½Ä²£¤Î²òÁüÅÙ¤¬°Û¤Ê¤ë - ¥×¥ê¥ó¥¿) ¤Ç¤Ï¼Â¹ÔËè¤Ë (Ghostscript ¤Î)-r ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤± - ¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤Þ¤¿¡¢²òÁüÅÙ¤¬µÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î¥× - ¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ç¤âƱÍͤǤ¹¡£ - - ²òÁüÅÙ¤ÎÍ¥Àè½ç°Ì¤Ï¡¢ - - (A) Ghostscript µ¯Æ°»þ¤Î -r ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ë»ØÄê - (B) ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Î "/resolution" ¤Î¹àÌܤˤè¤ë»ØÄê - (C) ¥×¥ê¥ó¥¿ÄêµÁ¥Õ¥¡¥¤¥ëÃæ¤Î²òÁüÅÙ - (D) 180dpi(¥Ç¥Õ¥©¥ë¥È) - - ¤Ç¤¹¡£ - -(3) /offset - - ¡¦ ¡ÔÀßÄêË¡¡Õ - - /offset [ ²£¤Î°ÜÆ°ÎÌ ½Ä¤Î°ÜÆ°ÎÌ ] - - Ťµ¤Ë¤è¤ë»ØÄê¡£ - - ¡¦ ¡ÔÀßÄêÎã¡Õ - - /offset [ 0.0 -0.2 ] - - ¡¦ ¡ÔÀâÌÀ¡Õ - - ¸¶ÅÀ (½ÐÎÏ¥¤¥á¡¼¥¸¤Îº¸²¼³Ñ) ¤Î²£ / ½ÄÊý¸þ¤Î°ÜÆ°Î̤ò»ØÄꤷ¤Þ¤¹¡£ - - °õ»ú²ÄǽÎΰè¤ÎÏȤ«¤éÇÁ¤¤¤Æ¸«¤¨¤ëÉôʬ¤¬¤³¤³¤Ç»ØÄꤵ¤ì¤¿Ê¬¤À¤±Ê¿ - ¹Ô°ÜÆ°¤¹¤ë¡¢¤È¤¤¤¦¥¤¥á¡¼¥¸¤ò»ý¤Ã¤Æ¤¤¤¿¤À¤±¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¡£ - - Íѻ汦¡¢¾åÊý¸þ¤¬¤½¤ì¤¾¤ì¤ÎÀµÊý¸þ¤Ç¤¹¡£ - - ¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï½Ä²£ÁÐÊý¸þ 0 ¥¤¥ó¥Á¤Ç¤¹¡£ - - ¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë¤Ï°ÌÃÖ¹ç¤ï¤»¤Î¤¿¤á¤Î PS ¥Õ¥¡¥¤¥ë (testpage.ps) - ¤¬ÉÕ°¤·¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤ÏÍÑ»æ¤Î±ï¤«¤é¡¢Æ⦠1.5cm¡¢1inch¡¢ - µÚ¤Ó 3cm ¤Î°ÌÃÖ¤Ë 1 dot Éý¤ÎºÙ¤¤Àþ¤ÇÏȤò½ñ¤¯¤À¤±¤Î¤â¤Î¤Ç¤¹¡£ - - testpage.ps ¤Ç¤ÏÍѻ極¥¤¥º¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÎÉÁ²èÈϰϤËÅù¤· - ¤¤¤â¤Î¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£Î㤨¤Ð -sPAPERSIZE=b5 ¤È¤¤¤¦¥ª¥×¥·¥ç¥ó¤òÉÕ - ¤±¤Æ Ghostscript ¤òµ¯Æ°¤¹¤ì¤ÐÍѻ極¥¤¥º¤Ï B5 ¤Ç¤¢¤ë¤È²¾Äꤵ¤ì¡¢ - ¤Þ¤¿¡¢Ghostscript ¤ËÉÁ²èÈϰϤò»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó (-g¡¢ - -sPAPERSIZE) ¤òÉÕ¤±¤º¤Ëµ¯Æ°¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤Î¥Ç¥Õ - ¥©¥ë¥È¤ÎÉÁ²èÈϰϤ¬Íѻ極¥¤¥º¤Ç¤¢¤ë¤È¤µ¤ì¤Þ¤¹¡£ - - -sPAPERSIZE ¥ª¥×¥·¥ç¥ó¤È -g ¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï Ghostscript - ¤Î¥É¥¥å¥á¥ó¥È use.doc ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£ - - Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£ - - gs -dNOPAUSE -sDEVICE=dmprt -sPAPERSIZE=b5 -- testpage.ps - - ¤³¤Î¥Õ¥¡¥¤¥ë testpage.ps ¤Î½ÐÎÏ°ÌÃÖ¤¬¤º¤ì¤ë¾ì¹ç¤Ë¤ÏÀµ¤·¤¤°ÌÃÖ - ¤ËÏȤ¬¤¯¤ë¤è¤¦¤Ë /offset ¤ÎÃͤòÄ´Àᤷ¤Æ¤¯¤À¤µ¤¤¡£ - -(4) /defaultsize - - ¡¦ ¡ÔÀßÄêË¡¡Õ - - /defaultsize [ Éý ¹â ] - - Ťµ¤Ë¤è¤ë»ØÄê¡£ - - ¡¦ ¡ÔÀßÄêÎã¡Õ - - /defaultsize [ 8.0 11.0 ] - - ¡¦ ¡ÔÀâÌÀ¡Õ - - Ghostscript ¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó¤Ç°õ»úÎΰè¤ÎÉý¡¦¹â¤Î»ØÄê (-g ¥ª¥× - ¥·¥ç¥ó¡¢-sPAPERSIZE ¥ª¥×¥·¥ç¥ó) ¤¬¤Ê¤¤¾ì¹ç¤Î°õ»úÎΰè¤ò»ØÄꤷ¤Þ¤¹¡£ - - »ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Éý 8.3 ¥¤¥ó¥Á¡¢¹â 11.7 ¥¤¥ó¥Á¤Ç¤¹¡£ - -(5) /margin - - ¡¦ ¡ÔÀßÄêË¡¡Õ - - /margin [ º¸ ²¼ ±¦ ¾å ] - - Ťµ¤Ë¤è¤ë»ØÄê¡£ - - ¡¦ ¡ÔÀßÄêÎã¡Õ - - /margin [ 3.675 mm 12.7 mm 3.675 mm 6.5 mm ] - - ¡¦ ¡ÔÀâÌÀ¡Õ - - ÍÑ»æ¤Î¤¦¤Á¥×¥ê¥ó¥¿¤¬°õ»ú¤¹¤ë¤³¤È¤¬½ÐÍè¤Ê¤¤Éôʬ¤òÍÑ»æ¾å²¼º¸±¦¤Î - ü¤«¤é¤ÎŤµ¤Ç»ØÄꤷ¤Þ¤¹¡£ - - ¤³¤³¤Ç»ØÄꤵ¤ì¤¿Îΰè¤Î¥¤¥á¡¼¥¸¤Ï¥×¥ê¥ó¥¿¤Ë½ÐÎϤµ¤ì¤Þ¤»¤ó (c.f. - /maxsize)¡£ - - »ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¤Ï¾å²¼º¸±¦Á´¤Æ 0 ¥¤¥ó¥Á¤Ç¤¹¡£ - -(6) /maxsize - - ¡¦ ¡ÔÀßÄêË¡¡Õ - - /maxsize [ Éý ¹â ] - - Ťµ¤Ë¤è¤ë»ØÄê¡£ - - ¡¦ ¡ÔÀßÄêÎã¡Õ - - /maxsize [ 8.0 11.0 ] - - ¡¦ ¡ÔÀâÌÀ¡Õ - - ¥×¥ê¥ó¥¿¤Î°õ»ú²ÄǽÎΰè¤ÎºÇÂ祵¥¤¥º¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¥µ¥¤¥º¤«¤é - ¤Ï¤ß½Ð¤¹Éôʬ¤Ï»ØÄꤵ¤ì¤¿Íѻ極¥¤¥º¤ä¥Þ¡¼¥¸¥ó¤Ë¤«¤«¤ï¤é¤º½ÐÎϤµ¤ì - ¤Ê¤¯¤Ê¤ê¤Þ¤¹ (±¦¡¢¾å¤¬ÀÚ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹)¡£ - - Î㤨¤ÐºÇÂç°õ»ú²ÄǽÉý¤ò±Û¤¨¤ë¥¤¥á¡¼¥¸¤òÁ÷¤Ã¤¿¾ì¹ç¤Ë¤½¤Î¤Ö¤ó¤ò̵ - »ë¤»¤º¤Ë¼¡¤Î¹Ô¤ËÀÞ¤êÊÖ¤·¤Æ°õ»ú¤·¤Æ¤·¤Þ¤¦¥×¥ê¥ó¥¿¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì - ¹ç¤ä¡¢Ä¹¤¹¤®¤ë¥Ú¡¼¥¸¤ò½ÐÎϤ·¤¿¾ì¹ç¤Ë¼¡¤ÎÍÑ»æ¤Ë³¤¤ò½ÐÎϤ·¤Æ¤·¤Þ - ¤¦¾ì¹ç¤Ê¤É¤Ë¤³¤Î¹àÌܤòÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ - - 0 Ëô¤ÏÉé¤ÎÃͤϡÖ̵¸ÂÂç¡×¤ò°ÕÌ£¤·¤Þ¤¹¡£Éý¡¢¹â¤µ¤Î»ØÄê¤ÏÆÈΩ¤Ç¤¹¡£ - ¤¹¤Ê¤ï¤ÁÎ㤨¤ÐÉý¤¬ 8 ¥¤¥ó¥Á¡¢¹â¤µ¤¬Ìµ¸ÂÂç¡¢¤È¤¤¤¦»ØÄê¤â²Äǽ¤Ç¤¹¡£ - - (e.g.) /maxsize [ 8.0 0 ] - - »ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï½Ä²£ÁÐÊý¸þ¤¬Ìµ¸ÂÂç¤Ç¤¹¡£ - - ½ÐÎϤµ¤ì¤ë¥¤¥á¡¼¥¸¤Î¥µ¥¤¥º¤¬Íѻ極¥¤¥º¤«¤é¥Þ¡¼¥¸¥ó¤òº¹¤·°ú¤¤¤¿ - ¥µ¥¤¥º¤è¤êÂ礤¤¤È¤¤Ë½ÐÎÏ¥¤¥á¡¼¥¸¤Î¥µ¥¤¥º¤ò¤³¤³¤ÇÀßÄꤵ¤ì¤¿ÃÍ¤Ë - ÃÖ¤´¹¤¨¤Æ½èÍý¤µ¤ì¤Þ¤¹ (ÀßÄꤵ¤ì¤¿Ãͤ¬ 0 °Ê²¼¤Ç¤¢¤ì¤Ð¤³¤ÎÃÖ¤´¹ - ¤¨¤Ï¹Ô¤ï¤ì¤Þ¤»¤ó)¡£ - -(7) /verbose - - ¡¦ ¡ÔÀßÄêË¡¡Õ - - /verbose ÏÀÍýÃÍ - - ¡¦ ¡ÔÀßÄêÎã¡Õ - - /verbose true - - ¡¦ ¡ÔÀâÌÀ¡Õ - - ¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÎÆ°ºî¾õÂÖ¤ò¾Ü¤·¤¯É½¼¨¤¹¤ë¤«¤É¤¦¤«¤Î»ØÄê¤Ç¤¹¡£½Ð - ÎÏÃæ¤Î¥Ú¡¼¥¸¤ÎÄ̤·ÈÖ¹æ¤ä½ÐÎÏ¥³¡¼¥É¤Î¥Ð¥¤¥È¿ô¤Ê¤É¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ - - ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï false (off) ¤Ç¤¹ (²¿¤âɽ¼¨¤µ¤ì¤Þ¤»¤ó)¡£ - - ¤³¤Î¹àÌܤ¬ true (on) ¤ËÀßÄꤷ¤Æ¤¢¤Ã¤Æ¤â¡¢Ghostscript ¤Îµ¯Æ°¥ª¥× - ¥·¥ç¥ó¤Ç -q ¥ª¥×¥·¥ç¥ó (QUIET) ¤¬»ØÄꤷ¤Æ¤¢¤ì¤Ð¡¢¤³¤Î¹àÌܤÎÀßÄê - ¤¬ off ¤Î¾ì¹ç¤ÈƱ¤¸Æ°ºî¤ò¤·¤Þ¤¹¡£ - ------------------------------ -¡ú 4.4 ´Ä¶ÀßÄê¥Õ¥¡¥¤¥ë¤Î»ØÄê ------------------------------ - dmprt ¥É¥é¥¤¥Ð¤¬ÁȤ߹þ¤Þ¤ì¤¿ Ghostscript ¤Ïµ¯Æ°»þ¤Ë dmp_init.ps µÚ¤Ó -dmp_site.ps ¤ò Ghostscript ¤Î¥Õ¥¡¥¤¥ë¸¡º÷¥Ñ¥¹¾å¤«¤éÆɤ߹þ¤ß¤Þ¤¹¡£¤³¤ì¤é -¤Î¥Õ¥¡¥¤¥ë¤Ï Ghostscript ¤Î¥Õ¥¡¥¤¥ë¸¡º÷¥Ñ¥¹¾å¤ËÃÖ¤¤¤Æ¤¯¤À¤µ¤¤¡£ -dmp_site.ps(´Ä¶ÄêµÁ¥Õ¥¡¥¤¥ë) ¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤ÐÆɤ߹þ¤ß¤òÄü¤á¤Æ¥Ç¥Õ¥©¥ë -¥È¤ÎÀßÄê (ESC/P 24 pin) ¤òÍѤ¤¤Þ¤¹¡£ - - dmp_site.ps ¤ÎÂå¤ï¤ê¤ËÊ̤Υե¡¥¤¥ë¤ò»ØÄꤷ¤ÆÆɤ߹þ¤à¤³¤È¤â²Äǽ¤Ç¤¹¡£ -Ghostscript µ¯Æ°»þ¤Ë¤½¤Î¥Õ¥¡¥¤¥ë̾¤ò -sDMPCONFIG= ¥Õ¥¡¥¤¥ë̾ ¤Î¤è¤¦¤Ë»Ø -Äꤷ¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾ì¹ç¤Ë»ØÄꤹ¤ë¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¤â -dmp_init.ps ¤Ê¤É¤ÈƱÍͤǤ¹¡£ - - (e.g.) gs -sDEVICE=dmprt -sDMPCONFIG=dmp_local.ps -dNOPAUSE -- tiger.ps - - -======================================================================== -¡ü £µ¡¥ »ÈÍÑË¡ -======================================================================== - - dmp_site.ps ¤ÎÀßÄê°Ê³°¤Ë¤ÏÆÃÊ̤ʤ³¤È¤ò¹Ô¤¦É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡£gs ¤Î¥Ç¥Ð -¥¤¥¹¤È¤·¤Æ "dmprt" ¤ò»ØÄꤷ¤Æµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤ (¾¤Î¥Ç¥Ð¥¤¥¹¥É¥é¥¤¥Ð¤ÈƱ -ÍͤλȤ¤Êý)¡£ - - (e.g.) gs -sDEVICE=dmprt sample.ps - - -======================================================================== -¡ü £¶¡¥ ¼Õ¼ -======================================================================== - - ¡þ PC-VAN SSCIENCE ¤Î FKR ¤µ¤ó¤Ë¤Ï 386BSD ¤Ç¤ÎÍøÍѤˤª¤±¤ëÉÔ¶ñ¹ç¤ò½¤Àµ - ¤·¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£ - - ¡þ CCITTFax ¥¨¥ó¥³¡¼¥À¤Î¼ÂÁõ¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¢¤½¤Î¥³¡¼¥É¤ò Godohoji ¤µ¤óµÚ - ¤Ó SHIMA ¤µ¤ó¤Ë¤è¤ë Fax Endode/Decode ¥é¥¤¥Ö¥é¥êÃæ¤Î¤â¤Î¤ò¸µ¤Ë¤µ¤»¤Æ - ¤¤¤¿¤À¤¤Þ¤·¤¿¡£ - - ¡þ ¤½¤·¤Æ²¿¤è¤ê dviprt/dviout ¤È¤¤¤¦¹âµ¡Ç½ DVI ¥É¥é¥¤¥Ð¤ò³«È¯¡¦³ÈÄ¥¤·¤Æ - ²¼¤µ¤Ã¤¿ PC-VAN SSCIENCE ¤Î SHIMA ¤µ¤ó¤ò¤Ï¤¸¤á¤È¤¹¤ë³«È¯¼Ô¤ÎÊý¡¹¤Ë´¶ - ¼Õ¤·¤Þ¤¹¡£ - - -======================================================================== -¡ü £·¡¥ ¥³¥ó¥Ñ¥¤¥ë -======================================================================== - - °Ê²¼¤Î¼ê½ç¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Æ²¼¤µ¤¤¡£ - -(1) gdevdmpr.c¡¢dviprlib.c¡¢dviprlib.h ¤ò¾¤Î Ghostscript ¤Î¥½¡¼¥¹¤ÈƱ¤¸ - ¥Ç¥£¥ì¥¯¥È¥ê¤ËÃÖ¤¯¡£ - -(2) devs.mak ¤Ë gdevdmpr.mak ¤ÎÆâÍƤòÄɲ乤롣 - -(3) *-head.mak Ãæ¤Î¥Þ¥¯¥í "DEVICE_DEVS?" ¤Ë "dmprt.dev" ¤ò²Ã¤¨¤ë¡£ - -(4) tar_cat ¤ò¼Â¹Ô¤¹¤ë¡£ - -(5) make ¤¹¤ë¡£ - - -======================================================================== -¡ü £¸¡¥ Ãøºî¸¢¡¦Êݾڡ¦ºÆÇÛÉÛ¡¦²þÊÑ -======================================================================== - - Ãøºî¸¢¤Ïºî¼Ô¤Ç¤¢¤ëÞÉ»³ (TPM03937@pcvan.or.jp) ¤¬ÊÝͤ·¤Þ¤¹¡£Ëܥѥ屡¼ -¥¸¤Ë´Þ¤Þ¤ì¤ëÁ´¤Æ¤Î¥×¥í¥°¥é¥àµÚ¤Ó¥É¥¥å¥á¥ó¥È¤Ï̵ÊݾڤǤ¹¡£ - - ÊݾڵڤӺÆÇÛÉÛ¡¦²þÊѤ˴ؤ¹¤ë¾ò·ï¤ÏÁ´¤Æ GNU General Public License (GNU -GPL) ¤Ë½¾¤¤¤Þ¤¹¡£GNU GPL ¤ÏÉÕ°¤Î COPYING ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤Þ -¤¹¡£ - - -======================================================================== -¡ü £¸¡¥ ÍúÎò -======================================================================== - -1997.5.13. - - ¡þ Ghostscript 4.03 ¤ËÂбþ¡£ - ¡þ *.src ¤¬Àµ¤·¤¯Æɤ߹þ¤á¤Ê¤¤¾ì¹ç (line_feed, form_feed ¤¬Ì¤ÄêµÁ¤Î *.src) - ¤¬¤¢¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¡£ - ¡þ -sDMPSITE ¤Î½èÍý¤¬Àµ¤·¤¯¤ª¤³¤Ê¤ï¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£ - ¡þ setpagedevice ¥ª¥Ú¥ì¡¼¥¿¤ÇÀßÄê²Äǽ¤ÊÀßÄê¹àÌܤο¤¯¤òºï½ü¡£ - ¡þ DJ's GPP ¤Ø¤ÎÂбþ¤òÅà·ë (³«È¯´Ä¶¤È²Ë¤¬¤Ê¤¯¤Ê¤Ã¤¿¤¿¤á)¡£ - ¡þ testpage.ps ¤¬ Level 2 ¤Ç¤¦¤Þ¤¯½ÐÎϤǤ¤Ê¤«¤Ã¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£ - - - ÞÉ»³ ÏÂŵ (ASAYAMA Kazunori) - TPM03937@pcvan.or.jp - GHF01532@niftyserve.or.jp - asayama@vsp.cpg.sony.co.jp diff --git a/contrib/japanese/dviprlib.c b/contrib/japanese/dviprlib.c deleted file mode 100644 index 97ad5526..00000000 --- a/contrib/japanese/dviprlib.c +++ /dev/null @@ -1,2823 +0,0 @@ -/* COPYRIGHT (C) 1990, 1992 Aladdin Enterprises. All rights reserved. - Distributed by Free Software Foundation, Inc. - - This file is part of Ghostscript. - - Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the Ghostscript General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute - Ghostscript, but only under the conditions described in the Ghostscript - General Public License. A copy of this license is supposed to have been - given to you along with Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. */ - -/* dviprlib.c */ - -#include "stdio_.h" -#include "ctype_.h" -#include "malloc_.h" -#include "string_.h" -#include "gstypes.h" -#include "gsmemory.h" -#include "gp.h" - -/* include library header. */ -#define dviprlib_implementation -#include "dviprlib.h" - -/* The remainder of this file is a copy of the library for dviprt. */ - -/***** From rcfg.c *****/ -/* $Id: RCFG.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */ - -/*--- forward declarations ---*/ -static int dviprt_read_S_cfg(dviprt_cfg_t *,dviprt_cfg_i *); -static int dviprt_read_QR_cfg(dviprt_cfg_t *,dviprt_cfg_i *); - -/*--- library functions ---*/ -int -dviprt_readcfg(const gs_memory_t *mem, char *ifname,dviprt_cfg_t *pcfg,uchar *pcodebuf,int codebuf_s, - uchar *pworkbuf,int workbuf_s) -{ - int code; - int ver; - dviprt_cfg_i info; - - info.fname = ifname; - info.line_no = -1; - if (ifname) { - info.file = gp_fopen(mem,ifname,gp_fmode_rb); - if (info.file == NULL) { - dviprt_printcfgerror(&info,"Cannot open.\n",-1); - return CFG_ERROR_FILE_OPEN; - } - } - else { - /* Broken, but unused in gs. Just return an error for now. */ - /* info.file = stdin; */ - return CFG_ERROR_FILE_OPEN; - } - - gp_fseek(info.file,16,0); - ver = gp_fgetc(info.file); - gp_fseek(info.file,0,0); - info.codebuf = pcodebuf; - info.readbuf = pworkbuf; - info.codebuf_size = codebuf_s; - info.readbuf_size = workbuf_s; - code = (ver == 'S') ? dviprt_read_S_cfg(pcfg,&info) - : dviprt_read_QR_cfg(pcfg,&info); - - if (ifname) gp_fclose(info.file); - return code; -} - -/*--- internal routines ---*/ -static int -dviprt_read_S_cfg(dviprt_cfg_t *pcfg,dviprt_cfg_i *pinfo) -{ - gp_file *ifp; - long intoff,stroff,codeoff; - int i,count; - uchar *pbuf,*rbuf; - int code; - char *ptype; - int n; - - if ((code = dviprt_setcfgbuffer_(pinfo,100,0)) < 0) return code; - dviprt_initcfg_(pcfg,pinfo); - - ifp = pinfo->file; - rbuf = pinfo->readbuf; - - if (gp_fread(rbuf,20,1,ifp) < 1) { - dviprt_printcfgerror(pinfo,"Read error.\n",-1); - } - if (rbuf[17] != 0xff || rbuf[18] != 0xff) { - not_cfg: - dviprt_printcfgerror(pinfo,"This file does not seem *.CFG.\n",-1); - return CFG_ERROR_OTHER; - } - if (memcmp(rbuf,CFG_MAGIC_NUMBER,2)) - goto not_cfg; - pcfg->version = rbuf[2] | ((uint)rbuf[3] << 8); - if (pcfg->version > CFG_VERSION) { - gs_sprintf(dviprt_message_buffer, - "This *.CFG file is too new version(ver.%u).\n",pcfg->version); - dviprt_printcfgerror(pinfo,dviprt_message_buffer,-1); - return CFG_ERROR_OTHER; - } - -#define bytes2long(p) ((p)[0] | ((long)(p)[1]<<8) | \ - ((long)(p)[2]<<16) | ((long)(p)[3]<<24)) - intoff = bytes2long(rbuf+4); - stroff = bytes2long(rbuf+8); - codeoff = bytes2long(rbuf+12); -#undef bytes2long - - gp_fseek(ifp,intoff,0); - count = gp_fgetc(ifp); - gp_fread(rbuf,count*3,1,ifp); - - pbuf = rbuf; - for (i=0;i<count;i++) { - n = pbuf[0]; - if (n >= CFG_INTEGER_TYPE_COUNT) { - ptype = "integer"; - unknown_no: - gs_sprintf(dviprt_message_buffer, - "Unknown %s type value No.%d is found.\n",ptype,n); - dviprt_printcfgerror(pinfo,dviprt_message_buffer,-1); - return CFG_ERROR_OTHER; - } - pcfg->integer[n] = pbuf[1] | ((uint)pbuf[2]<<8); - pbuf += 3; - } - - gp_fseek(ifp,stroff,0); - count = gp_fgetc(ifp); - pbuf = NULL; - for (i=0;i<count;i++) { - int l; - gp_fread(rbuf,3,1,ifp); - n = rbuf[0]; - l = rbuf[1] | ((uint)rbuf[2]<<8); - if (n >= CFG_STRINGS_TYPE_COUNT) { - ptype = "strings"; - goto unknown_no; - } - if (pinfo->codebuf == NULL) { - pcfg->strings[n] = (uchar *)malloc(l+1); - if (pcfg->strings[n] == NULL) { - no_memory: - dviprt_printcfgerror(pinfo,"Memory exhausted.\n",-1); - return CFG_ERROR_MEMORY; - } - } - else { - pcfg->strings[n] = pinfo->pcodebuf; - pinfo->pcodebuf += (l+1); - } - gp_fread(pcfg->strings[n],l,1,ifp); - *(pcfg->strings[n]+l) = 0; - } - - gp_fseek(ifp,codeoff,0); - count = gp_fgetc(ifp); - for (i=0;i<count;i++) { - int l; - gp_fread(rbuf,3,1,ifp); - n = rbuf[0]; - l = rbuf[1] | ((uint)rbuf[2]<<8); - - if (n >= CFG_PRTCODE_TYPE_COUNT) { - ptype = "printer code"; - goto unknown_no; - } - if (pinfo->codebuf == NULL) { - pcfg->prtcode[n] = (uchar *)malloc(l+1); - if (pcfg->prtcode[n] == NULL) - goto no_memory; - } - else { - pcfg->prtcode[n] = pinfo->pcodebuf; - pinfo->pcodebuf += (l+1); - } - gp_fread(pcfg->prtcode[n],l,1,ifp); - *(pcfg->prtcode[n]+l) = 0; - pcfg->prtcode_size[n] = l; - } - dviprt_resetcfgbuffer_(pinfo); - return 0; -} - -static int -dviprt_read_QR_cfg(dviprt_cfg_t *pcfg,dviprt_cfg_i *pinfo) -{ -#define TYPE_BIT 0xc0 - -#define NO_NUM 0 -#define BINARY_LTOH 1 -#define BINARY_HTOL 2 -#define DECIMAL_3 3 -#define DECIMAL_4 4 -#define DECIMAL_5 5 -#define DECIMAL_V 6 - -#define TOTAL_BYTE 0x80 -#define ISO_NUMBER 0x40 -#define DIVIDEBY_2 0x10 -#define DIVIDE_ALL 0x30 -#define MULT_CONST 0x08 - enum { - BIT_IMAGE_MODE, - NORML_MODE, - SEND_BIT_IMAGE, - SKIP_SPACES, - LINE_FEED, - FORM_FEED, - AFTER_BIT_IMAGE, - BIT_ROW_HEADER, - }; - uchar *cfg_buf,*ptr; - int ch, type, f_cont, f_type, pos, i, j, k, lens; - int f_r_format; - long offset; - int old2new[] = { - CFG_BIT_IMAGE_MODE, - CFG_NORMAL_MODE, - CFG_SEND_BIT_IMAGE, - CFG_SKIP_SPACES, - CFG_LINE_FEED, - CFG_FORM_FEED, - CFG_AFTER_BIT_IMAGE, - CFG_BIT_ROW_HEADER, - }; - - ch =dviprt_setcfgbuffer_(pinfo,300,TEMP_CODEBUF_SIZE); - if (ch < 0) return CFG_ERROR_MEMORY; - dviprt_initcfg_(pcfg,pinfo); - cfg_buf = pinfo->readbuf; - if (gp_fread(cfg_buf,30,1,pinfo->file) < 1) { - dviprt_printcfgerror(pinfo,"Read error.\n",-1); - } - if (cfg_buf[16] == 'P') { - dviprt_printcfgerror(pinfo,"This is made by old version.\n",-1); - return CFG_ERROR_OTHER; - } - else if (cfg_buf[16] == 'Q') - f_r_format = 0; - else if (cfg_buf[16] == 'R') - f_r_format = 1; - else - f_r_format = -1; - if (f_r_format == -1 || cfg_buf[18] != 0xff) { - dviprt_printcfgerror(pinfo,"This is not the *.CFG file for dviprt.\n",-1); - return CFG_ERROR_OTHER; - } - cfg_buf[16] = '\0'; - pcfg->version = 0; - if (pinfo->temp_codebuf_f) { - pcfg->strings[CFG_NAME] = malloc(strlen(cfg_buf)+1); - if (pcfg->strings[CFG_NAME] == NULL) { - no_memory: - dviprt_printcfgerror(pinfo,"Memory exhausted.\n",-1); - return CFG_ERROR_MEMORY; - } - } - else { - pcfg->strings[CFG_NAME] = pinfo->pcodebuf; - pinfo->pcodebuf += strlen(cfg_buf); - pinfo->pcodebuf++; - } - strcpy(pcfg->strings[CFG_NAME],cfg_buf); - - pcfg->integer[CFG_UPPER_POS] = - (cfg_buf[17] & (CFG_LEFT_IS_LOW|CFG_NON_MOVING)); - pcfg->integer[CFG_ENCODE] = - (cfg_buf[17] & 0x10) ? CFG_ENCODE_HEX : CFG_ENCODE_NULL; - pcfg->integer[CFG_PINS] = ((uint) (cfg_buf[17]) & 0x0f); - - ptr = cfg_buf+23; - pcfg->integer[CFG_MINIMAL_UNIT] = (uint)ptr[0] | ((uint)ptr[1]<<8); - pcfg->integer[CFG_MAXIMAL_UNIT] = (uint)ptr[2] | ((uint)ptr[3]<<8); - pcfg->integer[CFG_DPI] = - f_r_format ? ((uint)ptr[4] | ((uint)ptr[5]<<8)) : 180; - if (cfg_buf[20]) - pcfg->integer[CFG_CONSTANT] = cfg_buf[20]; - offset = cfg_buf[19]; - gp_fseek(pinfo->file,offset,0); - - for (i = 0; i <= BIT_ROW_HEADER; i++) { - uchar *pstart,*plength; - uchar prev = 1; - if (pinfo->temp_codebuf_f) { - pinfo->pcodebuf = pinfo->codebuf; - } - pstart = pinfo->pcodebuf; - do { - lens = gp_fgetc(pinfo->file); - if (lens == EOF) break; - gp_fread(cfg_buf,lens+3,1,pinfo->file); - ptr = cfg_buf; - f_cont = *ptr++; - pos = *ptr++; - f_type = *ptr++; - type = f_type & 0x7; - - for (j = 0; j < lens; j++) { - ch = *ptr++; - if (pos == j && type != NO_NUM) { - uchar *pfmt = pinfo->pcodebuf++; - plength = pinfo->pcodebuf++; - *pinfo->pcodebuf++ = CFG_VAL_DEFAULT; - *plength = 1; - j++; - ptr++; - switch (type) { - case (BINARY_LTOH): - *pfmt = CFG_FMT_BIT | CFG_FMT_BIN_LTOH | 2; - break; - case (BINARY_HTOL): - *pfmt = CFG_FMT_BIT | CFG_FMT_BIN_HTOL | 2; - break; - case (DECIMAL_3): - *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL | 3; - j++; - ptr++; - break; - case (DECIMAL_4): - *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL | 4; - j += 2; - ptr += 2; - break; - case (DECIMAL_5): - *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL | 5; - j += 3; - ptr += 3; - break; - case (DECIMAL_V): - *pfmt = CFG_FMT_BIT | CFG_FMT_DECIMAL; - j++; - ptr++; - break; - default: - gs_sprintf(dviprt_message_buffer,"Unknown format %02X",type); - dviprt_printcfgerror(pinfo,dviprt_message_buffer,-1); - goto ex_func; - } - if (f_type & TOTAL_BYTE) { - *pinfo->pcodebuf++ = CFG_VAL_PINS_BYTE; - *pinfo->pcodebuf++ = CFG_OP_MUL; - (*plength) += 2; - } - if ((k = (f_type & DIVIDE_ALL)) != 0) { - *pinfo->pcodebuf = 0; - for (; k > 0; k -= DIVIDEBY_2) { - (*pinfo->pcodebuf)++; - } - pinfo->pcodebuf++; - *pinfo->pcodebuf++ = CFG_OP_SHR; - (*plength) += 2; - } - if (f_type & ISO_NUMBER) { - *pfmt |= CFG_FMT_ISO_BIT; - } - if (f_type & MULT_CONST) { - *pinfo->pcodebuf++ = CFG_VAL_CONSTANT; - *pinfo->pcodebuf++ = CFG_OP_MUL; - (*plength) += 2; - } - prev = 1; - } - else { - if (prev == 1 || *plength >= 127) { - plength = pinfo->pcodebuf++; - *plength = 0; - } - (*plength)++; - *pinfo->pcodebuf++ = ch; - prev = 0; - } - } - } while (f_cont & 0x80); - *pinfo->pcodebuf++ = 0; - { int n = old2new[i]; - uint l = pinfo->pcodebuf-pstart; - pcfg->prtcode_size[n] = l - 1; - if (pinfo->temp_codebuf_f) { /* allocate buffer */ - pcfg->prtcode[n] = (uchar *)malloc(l); - if (pcfg->prtcode[n] == NULL) - goto no_memory; - memcpy(pcfg->prtcode[n],pstart,l); - } - else { - pcfg->prtcode[n] = pstart; - } - } - } - ex_func: - dviprt_resetcfgbuffer_(pinfo); - return 0; -} -/***** End of rcfg.c *****/ - -/***** From rsrc.c *****/ -/* $Id: RSRC.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */ - -typedef struct { - char *name; - signed char type; - uchar no; - uchar spec_f; - uchar req_f; - char *info; -} dviprt_cfg_item_t; - -typedef struct { - long min; - long max; -} dviprt_cfg_limit_t; - -/*--- forward declarations ---*/ -static int dviprt_set_select - (dviprt_cfg_item_t *,uchar **,dviprt_cfg_t *,dviprt_cfg_i *); -static int dviprt_set_integer - (dviprt_cfg_item_t *, uchar *, dviprt_cfg_t *,dviprt_cfg_i *); -static int dviprt_set_strings - (dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *); -static int dviprt_set_rpexpr - (dviprt_cfg_item_t *,uchar *,int , dviprt_cfg_t *,dviprt_cfg_i *,int); -static int dviprt_set_code - (dviprt_cfg_item_t *,uchar *,dviprt_cfg_t *,dviprt_cfg_i *); - -static long dviprt_oct2long(uchar *,uchar *,uchar **); -static long dviprt_dec2long(uchar *,uchar *,uchar **); -static long dviprt_hex2long(uchar *,uchar *,uchar **); - -static int dviprt_printtokenerror(dviprt_cfg_i *,char *,int ,int); - -/*--- macros ---*/ -#define strlcmp(tmplt,str,len) \ - (!(strncmp(tmplt,str,(int)(len)) == 0 && (int)(len) == strlen(tmplt))) -#define set_version(pcfg,v) ((pcfg)->version = MAX(v,(pcfg)->version)) - -enum { - ERROR_UNKNOWN_VALUE,ERROR_UNKNOWN_FORMAT,ERROR_UNKNOWN_ESCSEQ, - ERROR_OUTOFRANGE, - ERROR_INVALID_VALUE, - ERROR_COMPLICATED_EXPR, - ERROR_INCOMPLETE, -}; - -/*--- library functions ---*/ -int -dviprt_readsrc(const gs_memory_t *mem, char *fname,dviprt_cfg_t *pcfg,uchar *pcodebuf,int codebuf_s, - uchar *pworkbuf,int workbuf_s) -{ - dviprt_cfg_i info; - int code; - gp_file *ifp; - dviprt_cfg_item_t *pitem; - int enc = CFG_ENCODE_NULL; - enum { T_INTEGER,T_STRINGS,T_CODE,T_SELECT,T_UPPERPOS}; - static dviprt_cfg_limit_t pins_limit = { 8, 128 }; - static dviprt_cfg_limit_t positive_limit = { 1, 0x7fff }; - static dviprt_cfg_limit_t nonnegative_limit = { 0, 0x7fff}; - static dviprt_cfg_item_t dviprt_items[] = { - {NULL,T_STRINGS,CFG_NAME,0,1,NULL}, - {NULL,T_INTEGER,CFG_PINS,0,1,(char*)&pins_limit}, - {NULL,T_INTEGER,CFG_MINIMAL_UNIT,0,0,(char*)&positive_limit}, - {NULL,T_INTEGER,CFG_MAXIMAL_UNIT,0,0,(char*)&positive_limit}, - {NULL,T_INTEGER,CFG_DPI,0,0,(char*)&positive_limit}, - {NULL,T_INTEGER,CFG_CONSTANT,0,0,(char*)&nonnegative_limit}, - {NULL,T_INTEGER,CFG_Y_DPI,0,0,(char*)&positive_limit}, - {NULL,T_CODE,CFG_BIT_IMAGE_MODE,0,1,NULL}, - {NULL,T_CODE,CFG_SEND_BIT_IMAGE,0,1,NULL}, - {NULL,T_CODE,CFG_BIT_ROW_HEADER,0,0,NULL}, - {NULL,T_CODE,CFG_AFTER_BIT_IMAGE,0,0,NULL}, - {NULL,T_CODE,CFG_LINE_FEED,0,0,NULL}, - {NULL,T_CODE,CFG_FORM_FEED,0,0,NULL}, - {NULL,T_CODE,CFG_NORMAL_MODE,0,1,NULL}, - {NULL,T_CODE,CFG_SKIP_SPACES,0,1,NULL}, - {NULL,T_UPPERPOS,CFG_UPPER_POS,0,1,NULL}, - {NULL,T_SELECT,CFG_ENCODE,0,0,(char*)dviprt_encodename}, - {NULL,-1}, - }; - static dviprt_cfg_item_t encode_info = { - "encode",T_STRINGS,CFG_ENCODE_INFO,0,0,NULL - }; - int prtcode_output_bytes[CFG_PRTCODE_TYPE_COUNT]; - - info.line_no = -1; - info.fname = fname; - if (fname) { - info.file = gp_fopen(mem,fname,"r"); - if (info.file == NULL) { - dviprt_printcfgerror(&info,"Cannot open.\n",-1); - return CFG_ERROR_FILE_OPEN; - } - } - else { - ifp = stdin; - } - ifp = info.file; - - info.codebuf = pcodebuf; - info.readbuf = pworkbuf; - info.codebuf_size = codebuf_s; - info.readbuf_size = workbuf_s; - /* allocate buffer */ - if (dviprt_setcfgbuffer_(&info,TEMP_READBUF_SIZE,TEMP_CODEBUF_SIZE) < 0) { - gp_fclose(info.file); - return CFG_ERROR_MEMORY; - } - - /* initialize */ - dviprt_initcfg_(pcfg,&info); - for (pitem = dviprt_items;pitem->type>=0;pitem++) { - if (pitem->name == NULL) { - switch (pitem->type) { - case T_INTEGER: - case T_SELECT: - case T_UPPERPOS: - pitem->name = dviprt_integername[pitem->no]; - break; - case T_STRINGS: - pitem->name = dviprt_stringsname[pitem->no]; - break; - case T_CODE: - pitem->name = dviprt_prtcodename[pitem->no]; - break; - } - } - pitem->spec_f = 0; - } - encode_info.spec_f = 0; - { int i; - for (i=0;i<CFG_PRTCODE_TYPE_COUNT;i++) - prtcode_output_bytes[i] = 0; - } - - pcfg->version = 1; - for ( ; ; ) { - uchar *pbuf = info.readbuf; - uchar *pchar; - - if (fgets(info.readbuf,info.readbuf_size,ifp) == NULL) break; - info.line_no++; - { - int len = strlen(pbuf); - if ((pbuf[0] < 'a' || pbuf[0] > 'z') && pbuf[0] != '_') { - while (pbuf[len-1] != '\n') { - if (fgets(info.readbuf,info.readbuf_size,ifp) == NULL) - goto end_scan; - len = strlen(pbuf); - } - continue; - } - if ( len > 0 && pbuf[len-1] == '\n') - pbuf[len-1] = 0; - } - while (*pbuf && *pbuf != ':') pbuf++; - if (*pbuf != ':') { - dviprt_printcfgerror(&info,"Character ':' is expected.\n",-1); - code = CFG_ERROR_SYNTAX; - goto end_process; - } - pchar = pbuf-1; - while (pchar >= info.readbuf && isspace(*pchar)) pchar--; - *++pchar = 0; - pbuf++; - for (pitem = dviprt_items;pitem->name;pitem++) { - if (strcmp(pitem->name,info.readbuf) == 0) break; - } - if (pitem->name == NULL) { - dviprt_printcfgerror(&info,"Unknown item `",-1); - dviprt_printmessage(info.readbuf,-1); - dviprt_printmessage("'.\n",-1); - code = CFG_ERROR_RANGE; - goto end_process; - } - parse_more: - while (*pbuf && isspace(*pbuf)) pbuf++; - if (pitem->spec_f) { - dviprt_printcfgerror(&info,NULL,0); - gs_sprintf(dviprt_message_buffer, - "Item `%s' is specified twice.\n",pitem->name); - dviprt_printmessage(dviprt_message_buffer,-1); - code = CFG_ERROR_SYNTAX; - goto end_process; - } - switch (pitem->type) { - case T_INTEGER: - if ((code = dviprt_set_integer(pitem,pbuf,pcfg,&info)) < 0) - goto end_process; - if (pitem->no == CFG_PINS) { - if (pcfg->integer[CFG_PINS] % 8) { - dviprt_printcfgerror(&info,"Value must be a multiple of 8.\n",-1); - code = CFG_ERROR_RANGE; - goto end_process; - } - pcfg->integer[CFG_PINS] /= 8; - } - break; - case T_STRINGS: - if (info.temp_codebuf_f) - info.pcodebuf = info.codebuf; - if ((code = dviprt_set_strings(pitem,pbuf,pcfg,&info)) < 0) - goto end_process; - if (info.temp_codebuf_f) { - pcfg->strings[pitem->no] = - (uchar*)malloc(strlen(pcfg->strings[pitem->no])+1); - if (pcfg->strings[pitem->no] == NULL) { - goto no_more_memory; - } - strcpy(pcfg->strings[pitem->no],info.codebuf); - } - break; - case T_CODE: - if (info.temp_codebuf_f) - info.pcodebuf = info.codebuf; - if ((code = dviprt_set_code(pitem,pbuf,pcfg,&info)) < 0) - goto end_process; - prtcode_output_bytes[pitem->no] = code; - if (info.temp_codebuf_f) { - pcfg->prtcode[pitem->no] = - (uchar*)malloc(pcfg->prtcode_size[pitem->no]+1); - if (pcfg->prtcode[pitem->no] == NULL) { - no_more_memory: - dviprt_printcfgerror(&info,"Memory exhausted.\n",-1); - code = CFG_ERROR_MEMORY; - goto end_process; - } - memcpy(pcfg->prtcode[pitem->no],info.codebuf, - pcfg->prtcode_size[pitem->no]+1); - } - break; - case T_SELECT: - if ((code = dviprt_set_select(pitem,&pbuf,pcfg,&info)) < 0) - goto end_process; - if (pitem->no == CFG_ENCODE) { - pitem = &encode_info; - goto parse_more; - } - break; - case T_UPPERPOS: - { uchar *ptmp; - uchar upos=0; - uchar opt = 0; - if (*pbuf == 0) { - dviprt_printcfgerror(&info,"No value.\n",-1); - code = CFG_ERROR_SYNTAX; - goto end_process; - } - while (*pbuf) { - ptmp = pbuf; - while (*ptmp && !isspace(*ptmp)) ptmp++; - if (strlcmp("HIGH_BIT",pbuf,ptmp-pbuf) == 0) - upos = CFG_TOP_IS_HIGH; - else if (strlcmp("LOW_BIT",pbuf,ptmp-pbuf) == 0) - upos = CFG_TOP_IS_LOW; - else if (strlcmp("LEFT_IS_HIGH",pbuf,ptmp-pbuf) == 0) - upos = CFG_LEFT_IS_HIGH; - else if (strlcmp("LEFT_IS_LOW",pbuf,ptmp-pbuf) == 0) - upos = CFG_LEFT_IS_LOW; - else if (strlcmp("NON_MOVING",pbuf,ptmp-pbuf) == 0) - opt = CFG_NON_MOVING; - else if (strlcmp("HEX_MODE",pbuf,ptmp-pbuf) == 0) - enc = CFG_ENCODE_HEX; - else { - dviprt_printtokenerror(&info,pbuf,(int)(ptmp-pbuf),ERROR_UNKNOWN_VALUE); - code = CFG_ERROR_RANGE; - goto end_process; - } - pbuf = ptmp; - while (*pbuf && isspace(*pbuf)) pbuf++; - } - pcfg->integer[CFG_UPPER_POS] = upos | opt; - } - break; - } - pitem->spec_f = 1; - } - end_scan: - - info.line_no = -1; - code = 0; - for (pitem = dviprt_items;pitem->name;pitem++) { - if (!pitem->spec_f && pitem->req_f) { - gs_sprintf(dviprt_message_buffer,"%s not found.\n",pitem->name); - dviprt_printcfgerror(&info,dviprt_message_buffer,-1); - code++; - } - } - if (code) { code = CFG_ERROR_RANGE; goto end_process; } - - if (pcfg->prtcode[CFG_LINE_FEED] == NULL) { - if (info.temp_codebuf_f) { - pcfg->prtcode[CFG_LINE_FEED] = info.pcodebuf; - info.pcodebuf += 4; - } - else pcfg->prtcode[CFG_LINE_FEED] = (byte*)malloc(4); - memcpy(pcfg->prtcode[CFG_LINE_FEED],"\002\x0d\x0a\000",4); - pcfg->prtcode_size[CFG_LINE_FEED] = 3; - } - if (pcfg->prtcode[CFG_FORM_FEED] == NULL) { - if (info.temp_codebuf_f) { - pcfg->prtcode[CFG_FORM_FEED] = info.pcodebuf; - info.pcodebuf += 4; - } - else pcfg->prtcode[CFG_FORM_FEED] = (byte*)malloc(4); - memcpy(pcfg->prtcode[CFG_FORM_FEED],"\002\x0d\x0c\000",4); - pcfg->prtcode_size[CFG_FORM_FEED] = 3; - } - if (pcfg->integer[CFG_DPI] < 0 && pcfg->integer[CFG_Y_DPI] < 0) { - pcfg->integer[CFG_DPI] = 180; - } - else if (pcfg->integer[CFG_DPI] < 0 || pcfg->integer[CFG_Y_DPI] < 0) { - if (pcfg->integer[CFG_DPI] < 0) - pcfg->integer[CFG_DPI] = pcfg->integer[CFG_Y_DPI]; - pcfg->integer[CFG_Y_DPI] = -1; - } - else if (pcfg->integer[CFG_DPI] == pcfg->integer[CFG_Y_DPI]) { - pcfg->integer[CFG_Y_DPI] = -1; - } - else if (pcfg->integer[CFG_Y_DPI] >= 0) { /* has y_dpi. */ - set_version(pcfg,2); - } - if (pcfg->integer[CFG_ENCODE] < 0) { - pcfg->integer[CFG_ENCODE] = enc; - } - if (pcfg->integer[CFG_MAXIMAL_UNIT] < 0) { - pcfg->integer[CFG_MAXIMAL_UNIT] = 0x7fff; - } - if (pcfg->integer[CFG_MINIMAL_UNIT] < 0) { - uint v; - v = (MAX(prtcode_output_bytes[CFG_SEND_BIT_IMAGE],0) + - MAX(prtcode_output_bytes[CFG_AFTER_BIT_IMAGE],0) + - MAX(prtcode_output_bytes[CFG_SKIP_SPACES],0)) - / (pcfg->integer[CFG_PINS]*8) + - MAX(prtcode_output_bytes[CFG_BIT_ROW_HEADER],0); - if (v == 0) v = 1; - pcfg->integer[CFG_MINIMAL_UNIT] = v; - } - - for (pitem = dviprt_items;pitem->type>=0;pitem++) { - if (pitem->spec_f == 0) { - gs_sprintf(dviprt_message_buffer,": %s:",pitem->name); - switch (pitem->type) { - case T_INTEGER: - if (pcfg->integer[pitem->no] >= 0) { - uint v = pcfg->integer[pitem->no]; - dviprt_printmessage(fname,-1); - dviprt_printmessage(dviprt_message_buffer,-1); - gs_sprintf(dviprt_message_buffer," %d\n",v); - dviprt_printmessage(dviprt_message_buffer,-1); - } - break; - default: break; /* do nothing */ - } - } - } - - end_process: - if (fname) gp_fclose(ifp); - dviprt_resetcfgbuffer_(&info); - - return code; -} - -/*--- internal routines ---*/ -static int -dviprt_set_integer(dviprt_cfg_item_t *pitem,uchar *buf,dviprt_cfg_t *pcfg, - dviprt_cfg_i *pinfo) -{ - uchar *pbuf = buf; - long v = 0; - long max = -1 ,min = -1; - - if (pitem->info != NULL) { - dviprt_cfg_limit_t *plimit = (dviprt_cfg_limit_t *)pitem->info; - min = plimit->min; - max = plimit->max; - } - if (min < 0) min = 0; - if (max < 0) max = 0xffff; - if (*pbuf == 0) { - dviprt_printcfgerror(pinfo,"No value.\n",-1); - return CFG_ERROR_SYNTAX; - } - while (*pbuf) { - if (!isdigit(*pbuf)) { - if (isspace(*pbuf)) break; - else goto invalid_val; - } - v = v*10 + *pbuf - '0'; - if (v > max) { - out_of_range: - dviprt_printtokenerror(pinfo,buf,strlen(buf),ERROR_OUTOFRANGE); - dviprt_printcfgerror(pinfo,"",-1); - gs_sprintf(dviprt_message_buffer, - "(%u <= value <= %u).\n",(uint)min,(uint)max); - dviprt_printmessage(dviprt_message_buffer,-1); - return CFG_ERROR_RANGE; - } - pbuf++; - } - if (v < min) goto out_of_range; - - while (*pbuf) { - if (!isspace(*pbuf)) { - invalid_val: - dviprt_printtokenerror(pinfo,buf,strlen(buf),ERROR_INVALID_VALUE); - return CFG_ERROR_RANGE; - } - pbuf++; - } - pcfg->integer[pitem->no] = v; - - return 0; -} - -static int -dviprt_set_strings(dviprt_cfg_item_t *pitem,uchar *buf,dviprt_cfg_t *pcfg, - dviprt_cfg_i *pinfo) -{ - uchar *pend; - long len; - pend = buf+strlen(buf)-1; - while (pend >= buf && isspace(*pend)) pend--; - pend++; - len = pend - buf; - if (len > 0x7fffL) { - dviprt_printcfgerror(pinfo,"Too long strings.\n",-1); - return CFG_ERROR_RANGE; - } - - pcfg->strings[pitem->no] = pinfo->pcodebuf; - strncpy(pinfo->pcodebuf,buf,(int)len); - pinfo->pcodebuf[len] = 0; - pinfo->pcodebuf += len; - pinfo->pcodebuf++; - return 0; -} - -static int -dviprt_set_select(dviprt_cfg_item_t *pitem,uchar **buf,dviprt_cfg_t *pcfg, - dviprt_cfg_i *pinfo) -{ - int i; - uchar *ptmp = *buf; - uchar *pstart = *buf; - uchar **opt; - if (*pstart == 0) { - dviprt_printcfgerror(pinfo,"No value.\n",-1); - return CFG_ERROR_SYNTAX; - } - while (*ptmp && !isspace(*ptmp)) ptmp++; - - for (i=0,opt=(uchar**)pitem->info;*opt;i++,opt++) { - if (strlcmp(*opt,pstart,ptmp-pstart) == 0) { - pcfg->integer[pitem->no] = i; - *buf = ptmp; - return 0; - } - } - dviprt_printtokenerror(pinfo,pstart,(int)(ptmp-pstart),ERROR_UNKNOWN_VALUE); - return CFG_ERROR_RANGE; -} - -#define CFG_TOKEN_ERROR -1 -#define CFG_TOKEN_LIMIT_BIT 0x100 -#define CFG_TOKEN_FMT 0x200 - -static int -dviprt_get_codetype_token(dviprt_cfg_i *pinfo,uchar *pstart,uchar *pend,uchar *stopescseqchars, - uchar *limitchars) -{ - while (pstart < pend && isspace(*pstart)) pstart++; - if (pstart >= pend) { - pinfo->token = pinfo->endtoken = pstart; - return CFG_TOKEN_LIMIT_BIT; - } - else if (strchr(limitchars,*pstart)) { - pinfo->token = pstart; - pinfo->endtoken = pstart+1; - return CFG_TOKEN_LIMIT_BIT | *pstart; - } - else if (*pstart == '\\') { - int c; - long v; - uchar *pexpr,*pnext; - - pexpr = pinfo->token = pstart++; - while (pstart < pend && !isspace(*pstart) && - *pstart != '\\' && !strchr(stopescseqchars,*pstart)) { - pstart++; - } - pinfo->endtoken = pstart; - if (pinfo->token + 1 == pinfo->endtoken) { /* '\\' only */ - return '\\'; - } - pexpr++; - if (pinfo->endtoken - pexpr == 1) { - if (isdigit(*pexpr)) goto parse_decimal_numb; - switch (*pexpr) { - case 't': c = '\t'; break; /* tab */ - case 'v': c = '\v'; break; /* tab */ - case 'n': c = '\n'; break; /* line feed */ - case 'f': c = '\f'; break; /* form feed */ - case 'r': c = '\r'; break; /* carrige return */ - case 'e': c = 0x1b; break; /* escape code */ - case 's': c = 0x20; break; /* space */ - default: - dviprt_printtokenerror(pinfo,pinfo->token,2,ERROR_UNKNOWN_ESCSEQ); - return CFG_TOKEN_ERROR; - } - return c; - } - else if (strlcmp("SP",pexpr,pinfo->endtoken - pexpr) == 0) - return 0x20; - else if (strlcmp("ESC",pexpr,pinfo->endtoken - pexpr) == 0) - return 0x1b; - switch (*pexpr) { - case 'x': - case 'X': - v = dviprt_hex2long(pexpr+1,pinfo->endtoken,&pnext); - check_numb_range: - if (pstart != pnext) { - dviprt_printtokenerror(pinfo,pinfo->token, - (int)(pinfo->endtoken - pinfo->token), ERROR_INVALID_VALUE); - return CFG_TOKEN_ERROR; - } - if (v >= 256) { - dviprt_printtokenerror(pinfo,pinfo->token, - (int)(pinfo->endtoken - pinfo->token), ERROR_OUTOFRANGE); - return CFG_TOKEN_ERROR; - } - pinfo->endtoken = pnext; - return v; - case '0': - v = dviprt_oct2long(pexpr,pinfo->endtoken,&pnext); - goto check_numb_range; - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - parse_decimal_numb: - v = dviprt_dec2long(pexpr,pinfo->endtoken,&pnext); - goto check_numb_range; - default: - return CFG_TOKEN_FMT; - } - } - else { - pinfo->token = pstart; - pinfo->endtoken = pstart+1; - return *pstart; - } -} - -static long -dviprt_dec2long(uchar *start,uchar *end,uchar **next) -{ - long v = 0; - while (start < end) { - int c = *start; - if (isdigit(c)) v = v*10 + c - '0'; - else break; - start++; - } - *next = start; - return v; -} - -static long -dviprt_oct2long(uchar *start,uchar *end,uchar **next) -{ - long v = 0; - while (start < end) { - int c = *start; - if (c >= '0' && c <= '7') v = v*8 + c - '0'; - else break; - start++; - } - *next = start; - return v; -} - -static long -dviprt_hex2long(uchar *start,uchar *end,uchar **next) -{ - long v = 0; - while (start < end) { - int c = *start; - if (isdigit(c)) v = v*16 + c - '0'; - else if (c >= 'A' && c <= 'F') v = v*16 + c - 'A' + 10; - else if (c >= 'a' && c <= 'f') v = v*16 + c - 'a' + 10; - else break; - start++; - } - *next = start; - return v; -} - -static int -dviprt_set_rpexpr(dviprt_cfg_item_t *pitem,uchar *pbuf,int len,dviprt_cfg_t *pcfg, - dviprt_cfg_i *pinfo,int sp) -{ - uchar *pend = pbuf + len; - uchar *plastop = NULL; - int code; - - /* get left expr */ - while (pbuf < pend) { - int par_count = 0; - uchar *pcur = pbuf; - while (pcur < pend) { - if (*pcur == '(') par_count++; - else if (*pcur == ')') par_count--; - else if (!isdigit(*pcur) && !isalpha(*pcur) && par_count == 0) { - /* operator */ - plastop = pcur; - } - pcur++; - } - if (par_count != 0) { - dviprt_printtokenerror(pinfo,pbuf,(int)(pend-pbuf),ERROR_INCOMPLETE); - return CFG_ERROR_SYNTAX; - } - if (plastop == NULL) { - if (*pbuf != '(') break; - pbuf++; - pend--; - } - else break; - } - - if (plastop == NULL) { /* no operator */ - ulong v; - uchar *pdummy; - if (*pbuf == '0') { - uchar a,b,c; - v = dviprt_oct2long(pbuf,pend,&pdummy); - check_intval: - if (pdummy != pend) goto unknown_value; - if (v > 0xffff) { - dviprt_printtokenerror(pinfo,pbuf,(int)(pend-pbuf),ERROR_OUTOFRANGE); - return CFG_ERROR_RANGE; - } - a = v & 0x7f; - b = (v>>7) & 0x7f; - c = (v>>14) & 0x03; - if (c) { - *pinfo->pcodebuf++ = c; - *pinfo->pcodebuf++ = 14; - *pinfo->pcodebuf++ = CFG_OP_SHL; - } - if (b) { - *pinfo->pcodebuf++ = b; - *pinfo->pcodebuf++ = 7; - *pinfo->pcodebuf++ = CFG_OP_SHL; - if (c) *pinfo->pcodebuf++ = CFG_OP_OR; - } - if (a) { - *pinfo->pcodebuf++ = a; - if (b || c) *pinfo->pcodebuf++ = CFG_OP_OR; - } - code = 0; - } - else if (isdigit(*pbuf)) { - v = dviprt_dec2long(pbuf,pend,&pdummy); - goto check_intval; - } - else if (pend - pbuf > 1 && (*pbuf == 'x' || *pbuf == 'X')) { - v = dviprt_hex2long(pbuf+1,pend,&pdummy); - goto check_intval; - } - else if (pend - pbuf > 1) { - unknown_value: - dviprt_printtokenerror(pinfo,pbuf,(int)(pend-pbuf),ERROR_UNKNOWN_VALUE); - return CFG_ERROR_RANGE; - } - else { - switch (*pbuf) { - case 'd': v = CFG_VAL_DEFAULT; - if (pitem->no != CFG_SEND_BIT_IMAGE && - pitem->no != CFG_BIT_ROW_HEADER && - pitem->no != CFG_AFTER_BIT_IMAGE && - pitem->no != CFG_SKIP_SPACES) - goto unavailable_value; - break; - case 'c': v = CFG_VAL_CONSTANT; break; - case 'w': v = CFG_VAL_WIDTH; break; - case 'h': v = CFG_VAL_HEIGHT; break; - case 'r': v = CFG_VAL_X_DPI; break; - case 'R': v = CFG_VAL_Y_DPI; break; - case 'p': v = CFG_VAL_PAGE; break; - case 'x': v = CFG_VAL_X_POS; break; - case 'y': v = CFG_VAL_Y_POS; break; - case 'v': v = CFG_VAL_PINS_BYTE; break; - case 's': - v = CFG_VAL_DATASIZE; - if (pitem->no != CFG_SEND_BIT_IMAGE && - pitem->no != CFG_BIT_ROW_HEADER && - pitem->no != CFG_AFTER_BIT_IMAGE) { - unavailable_value: - dviprt_printcfgerror(pinfo,"",-1); - gs_sprintf(dviprt_message_buffer,"Variable `%c' in ",(int)*pbuf); - dviprt_printmessage(dviprt_message_buffer,-1); - dviprt_printmessage(pbuf,(int)(pend-pbuf)); - gs_sprintf(dviprt_message_buffer," cannot be used in %s.\n",pitem->name); - dviprt_printmessage(dviprt_message_buffer,-1); - return CFG_ERROR_RANGE; - } - break; - default: - goto unknown_value; - } - *pinfo->pcodebuf++ = v; - code = 0; - } - } - else { /* has operator */ - uchar op; - - code = dviprt_set_rpexpr(pitem,pbuf,(int)(plastop-pbuf),pcfg,pinfo,sp+1); - if (code < 0) return code; - code = dviprt_set_rpexpr(pitem,plastop+1,(int)(pend-plastop-1),pcfg,pinfo,sp+2); - if (code < 0) return code; - - switch (*plastop) { - case '+': op = CFG_OP_ADD; break; - case '-': op = CFG_OP_SUB; break; - case '*': op = CFG_OP_MUL; break; - case '/': op = CFG_OP_DIV; break; - case '%': op = CFG_OP_MOD; break; - case '<': op = CFG_OP_SHL; break; - case '>': op = CFG_OP_SHR; break; - case '&': op = CFG_OP_AND; break; - case '|': op = CFG_OP_OR ; break; - case '^': op = CFG_OP_XOR; break; - default: - dviprt_printcfgerror(pinfo,NULL,0); - gs_sprintf(dviprt_message_buffer,"Unknown operator %c in ",(int)*pbuf); - dviprt_printmessage(dviprt_message_buffer,-1); - dviprt_printmessage(pbuf,(int)(pend-pbuf)); - dviprt_printmessage(".\n",-1); - return CFG_ERROR_SYNTAX; - } - *pinfo->pcodebuf++ = op; - } - - return code; -} - -static int -dviprt_set_code(dviprt_cfg_item_t *pitem,uchar *buf,dviprt_cfg_t *pcfg, - dviprt_cfg_i *pinfo) -{ - long prev_line; - int prev_type = 1; - uchar *pcount; - uchar *pcode_begin; - uchar *rbuf; - int obytes = 0; - - prev_line = ftell(pinfo->file); - pcode_begin = pinfo->pcodebuf; - rbuf = pinfo->readbuf; - - for ( ; ; ) { - while (*buf) { - int c; - c = dviprt_get_codetype_token(pinfo,buf,buf+strlen(buf),",",""); - if (c == CFG_TOKEN_LIMIT_BIT) break; /* no elements remain */ - else if (c == CFG_TOKEN_ERROR) return CFG_ERROR_SYNTAX; - if ( c < 256) { /* character code (raw data) */ - if (prev_type) { - new_unit: - pcount = pinfo->pcodebuf++; - (*pcount) = 0; - prev_type = 0; - } - if (*pcount == 127) goto new_unit; - (*pcount)++; - *pinfo->pcodebuf++ = c; - buf = pinfo->endtoken; - obytes++; - } - else if (c == CFG_TOKEN_FMT) { /* format */ - uchar *pexpr = pinfo->token; - int div=0,iso=0,mul=0,tl=0; - int cols=0; - int fmt; - uchar *plength; - uchar *pstart; - - buf = pinfo->token+1; - - /* formats */ - switch (*buf) { - case 'b': fmt = CFG_FMT_BIN_LTOH; break; - case 'B': fmt = CFG_FMT_BIN_HTOL; break; - case 'H': fmt = CFG_FMT_HEX_UPPER; break; - case 'h': fmt = CFG_FMT_HEX_LOWER; break; - case 'd': fmt = CFG_FMT_DECIMAL; break; - case 'o': fmt = CFG_FMT_OCTAL; break; - case 's': - buf++; - if (*buf != 't') goto unknown_format; - fmt = CFG_FMT_STRINGS; - break; - default: - unknown_format: - dviprt_printtokenerror(pinfo,pexpr,(int)(pinfo->endtoken-pexpr), - ERROR_UNKNOWN_FORMAT); - return CFG_ERROR_SYNTAX; - } - buf++; - - /* columns */ - if (fmt == CFG_FMT_STRINGS) ; - else { - if (buf >= pinfo->endtoken) { - dviprt_printtokenerror(pinfo,pexpr,(int)(pinfo->token-pexpr),ERROR_INCOMPLETE); - return CFG_ERROR_SYNTAX; - } - - if (!(*buf >= '1' && *buf <= '7') && *buf != '?') { - invalid_cols: - dviprt_printtokenerror(pinfo,pexpr,(int)(pinfo->endtoken-pexpr), - ERROR_UNKNOWN_FORMAT); - return CFG_ERROR_SYNTAX; - } - cols = (*buf == '?') ? 0 : *buf - '0'; - if (cols == 0 && - (fmt == CFG_FMT_BIN_LTOH || fmt == CFG_FMT_BIN_HTOL)) - goto invalid_cols; - - buf++; - obytes += (cols == 0) ? 5 : cols; - } - - /* additional format */ - while (buf < pinfo->endtoken) { - switch (*buf) { - case 'D': div++; break; - case 'I': iso++; break; - case 'M': mul++; break; - case 'T': tl++; break; - default: - dviprt_printtokenerror(pinfo,pexpr,(int)(buf-pexpr),ERROR_UNKNOWN_FORMAT); - return CFG_ERROR_SYNTAX; - } - if (div > 3 || iso > 1 || mul > 1 || tl > 1) { - dviprt_printtokenerror(pinfo,pexpr,(int)(buf-pexpr),ERROR_UNKNOWN_FORMAT); - return CFG_ERROR_SYNTAX; - } - buf++; - } - *pinfo->pcodebuf++ = - CFG_FMT_BIT | fmt | (iso ? CFG_FMT_ISO_BIT : 0) | cols; - plength = pinfo->pcodebuf; - pinfo->pcodebuf++; - pstart = pinfo->pcodebuf; - - if (*buf == ',' && *(buf+1) != '\"') { - int code; - buf++; - pinfo->token = buf; - while (*pinfo->token && *pinfo->token != ',' && - *pinfo->token != '\\' && !isspace(*pinfo->token)) - pinfo->token++; - if (pinfo->token == buf) { - dviprt_printcfgerror(pinfo,"No expression is specified in ",-1); - dviprt_printmessage(pexpr,(int)(buf-pexpr)); - dviprt_printmessage(".\n",-1); - return CFG_ERROR_SYNTAX; - } - if ((code = dviprt_set_rpexpr(pitem,buf,(int)(pinfo->token-buf),pcfg,pinfo,0)) < 0) - return code; - buf = pinfo->token; - } - else { - *pinfo->pcodebuf++ = CFG_VAL_DEFAULT; - } - if (mul) { - *pinfo->pcodebuf++ = CFG_VAL_CONSTANT; - *pinfo->pcodebuf++ = CFG_OP_MUL; - } - if (tl) { - *pinfo->pcodebuf++ = CFG_VAL_PINS_BYTE; - *pinfo->pcodebuf++ = CFG_OP_MUL; - } - if (div) { - *pinfo->pcodebuf++ = div; - *pinfo->pcodebuf++ = CFG_OP_SHR; - } - { - int length = pinfo->pcodebuf-pstart; - if (length > 255) { - dviprt_printtokenerror(pinfo,pexpr,(int)(buf-pexpr),ERROR_COMPLICATED_EXPR); - return CFG_ERROR_RANGE; - } - *plength++ = length & 0xff; - } - if (fmt == CFG_FMT_STRINGS) { - uchar *pslen = pinfo->pcodebuf++; - int len; - if (strlen(buf) < 2 || *buf != ',' || *(buf+1) != '\"') { - dviprt_printcfgerror(pinfo,"No strings specified in ",-1); - dviprt_printmessage(pexpr,(int)(buf-pexpr)); - dviprt_printmessage(".\n",-1); - return CFG_ERROR_SYNTAX; - } - buf += 2; - for (len=0; ;len++) { - c = dviprt_get_codetype_token(pinfo,buf,buf+strlen(buf),"\"","\""); - if (c == CFG_TOKEN_ERROR) return CFG_ERROR_SYNTAX; - else if (c == CFG_TOKEN_FMT) { - dviprt_printcfgerror(pinfo,"The format ",-1); - dviprt_printmessage(pinfo->token, - (int)(pinfo->endtoken-pinfo->token)); - dviprt_printmessage(" cannot to be specified here.\n",-1); - return CFG_ERROR_SYNTAX; - } - else if (c & CFG_TOKEN_LIMIT_BIT) { - if ((c & 0xff) != '\"') { - dviprt_printcfgerror(pinfo, - "Strings must be enclosed with " - "double quotations (\").\n",-1); - return CFG_ERROR_SYNTAX; - } - buf = pinfo->endtoken; - break; - } - *pinfo->pcodebuf++ = c; - buf = pinfo->endtoken; - } - if (len > 255) { - dviprt_printcfgerror(pinfo,"Too long strings.\n",-1); - return CFG_ERROR_RANGE; - } - *pslen = len; - } - prev_type = 1; - } - else { - dviprt_printcfgerror(pinfo,"Parse error. Unexpected token ",-1); - dviprt_printmessage(pinfo->token,(int)(pinfo->endtoken-pinfo->token)); - dviprt_printmessage(".\n",-1); - return CFG_ERROR_SYNTAX; - } - } - next_line: - if (fgets(rbuf,pinfo->readbuf_size,pinfo->file) == NULL) break; - if (!isspace(rbuf[0]) && rbuf[0] != ';') { - gp_fseek(pinfo->file,prev_line,0); - break; - } - prev_line = ftell(pinfo->file); - pinfo->line_no++; - buf = rbuf; - while (*buf && isspace(*buf)) buf++; - if (*buf == ';') - goto next_line; /* comment */ - { - int len = strlen(rbuf); - if (len > 0 && rbuf[len-1] == '\n') - rbuf[len-1] = 0; - } - } - pcfg->prtcode[pitem->no] = pcode_begin; - pcfg->prtcode_size[pitem->no] = (pinfo->pcodebuf - pcode_begin) & 0xffff; - *pinfo->pcodebuf++ = 0; - return obytes; -} - -static char * -dviprt_src_errorno2message(int type) -{ - switch (type) { - case ERROR_OUTOFRANGE: - return "Out of range.\n"; - case ERROR_UNKNOWN_VALUE: - return "Unknown value.\n"; - case ERROR_UNKNOWN_ESCSEQ: - return "Unknown escape sequence.\n"; - case ERROR_COMPLICATED_EXPR: - return "Too complicated expression.\n"; - case ERROR_INCOMPLETE: - return "Incomplete specification.\n"; - case ERROR_UNKNOWN_FORMAT: - return "Unknown format.\n"; - case ERROR_INVALID_VALUE: - return "Invalid value.\n"; - default: - return NULL; - } -} - -static int -dviprt_printtokenerror(dviprt_cfg_i *pinfo,char *token,int len,int type) -{ - char *msg; - - dviprt_printcfgerror(pinfo,token,len); - dviprt_printmessage("\n",-1); - - if ((msg = dviprt_src_errorno2message(type)) != NULL) - dviprt_printcfgerror(pinfo,msg,-1); - return 0; -} - -#undef strlcmp -#undef set_version -/***** End of rsrc.c *****/ - -/***** From util.c *****/ -/* $Id: UTIL.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */ - -char *dviprt_integername[] = { CFG_INTEGER_NAME, NULL }; -char *dviprt_stringsname[] = { CFG_STRINGS_NAME, NULL }; -char *dviprt_prtcodename[] = { CFG_PRTCODE_NAME, NULL }; -char *dviprt_encodename[] = { CFG_ENCODE_NAME, NULL }; - -#if 0 -static FILE *dviprt_messagestream = stderr; -#else /* patch for glibc 2.1.x by Shin Fukui <shita@april.co.jp> */ -static FILE *dviprt_messagestream; -#endif - -/*--- library functions ---*/ -int -dviprt_setmessagestream(FILE *fp) -{ - dviprt_messagestream = fp; - return 0; -} - -/*--- internal routines ---*/ -static int -dviprt_initcfg_(dviprt_cfg_t *pcfg,dviprt_cfg_i *pinfo) -{ - int i; - - for (i=0;i<CFG_INTEGER_TYPE_COUNT;i++) - pcfg->integer[i] = -1; - for (i=0;i<CFG_STRINGS_TYPE_COUNT;i++) - pcfg->strings[i] = NULL; - for (i=0;i<CFG_PRTCODE_TYPE_COUNT;i++) { - pcfg->prtcode[i] = NULL; - pcfg->prtcode_size[i] = 0; - } - pinfo->pcodebuf = pinfo->codebuf; - pinfo->line_no = 0; - return 0; -} - -static int -dviprt_setcfgbuffer_(dviprt_cfg_i *pinfo,int rsize,int csize) -{ - pinfo->temp_readbuf_f = pinfo->temp_codebuf_f = 0; - - if (pinfo->readbuf == NULL) { - pinfo->readbuf_size = rsize; - if (rsize>0) { - pinfo->temp_readbuf_f = 1; - pinfo->readbuf = (uchar *)malloc(rsize); - if (pinfo->readbuf == NULL) { - no_mem: - dviprt_printmessage(pinfo->fname,-1); - dviprt_printmessage("Memory exhausted.\n",-1); - return CFG_ERROR_MEMORY; - } - } - } - if (pinfo->codebuf == NULL) { - pinfo->codebuf_size = csize; - if (csize>0) { - pinfo->temp_codebuf_f = 1; - pinfo->codebuf = (uchar *)malloc(csize); - if (pinfo->codebuf == NULL) goto no_mem; - } - } - return 0; -} - -static int -dviprt_resetcfgbuffer_(dviprt_cfg_i *pinfo) -{ - if (pinfo->temp_readbuf_f) free(pinfo->readbuf); - if (pinfo->temp_codebuf_f) free(pinfo->codebuf); - pinfo->temp_codebuf_f = pinfo->temp_readbuf_f = 0; - return 0; -} - -char dviprt_message_buffer[128]; - -static int -dviprt_printmessage(char *str,int len) -{ - if (dviprt_messagestream && str) { - if (len >= 0) fwrite(str,len,1,dviprt_messagestream); - else fputs(str,dviprt_messagestream); - fflush(dviprt_messagestream); - } - return 0; -} - -static int -dviprt_printcfgerrorheader(dviprt_cfg_i *pinfo) -{ - if (pinfo) { - char *fn = pinfo->fname; - if (fn == NULL) fn = "-"; - dviprt_printmessage(fn,-1); - dviprt_printmessage(": ",-1); - if (pinfo->line_no>0) { - gs_sprintf(dviprt_message_buffer,"%d: ",pinfo->line_no); - dviprt_printmessage(dviprt_message_buffer,-1); - } - } - return 0; -} - -static int -dviprt_printerror(char *msg,int len) -{ - dviprt_printmessage("*ERROR* ",-1); - dviprt_printmessage(msg,len); - return 0; -} - -static int -dviprt_printcfgerror(dviprt_cfg_i *pinfo,char *msg,int len) -{ - dviprt_printcfgerrorheader(pinfo); - dviprt_printerror(msg,len); - return 0; -} - -static int -dviprt_printwarning(char *msg,int len) -{ - dviprt_printmessage("*WARNING* ",-1); - dviprt_printmessage(msg,len); - return 0; -} - -static int -dviprt_printcfgwarning(dviprt_cfg_i *pinfo,char *msg,int len) -{ - dviprt_printcfgerrorheader(pinfo); - dviprt_printwarning(msg,len); - return 0; -} -/***** End of util.c *****/ - -/***** From print.c *****/ -/* $Id: PRINT.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */ - -/*--- forward declarations ---*/ -static int dviprt_getmaximalwidth(dviprt_print *); -static int dviprt_flush_buffer(dviprt_print *,uchar far *); -static int dviprt_output_transpose(dviprt_print *,uchar far *,uint); -static int dviprt_output_nontranspose(dviprt_print *,uchar far *,uint); -static int dviprt_output_nontranspose_reverse(dviprt_print *,uchar far *,uint); -static int dviprt_reverse_bits(uchar far *,uint); -static int dviprt_transpose8x8(uchar far *,uint, uchar far *,uint); -static int dviprt_output_expr(dviprt_print *,int,uint,uint); -static int dviprt_default_outputproc(uchar far *,long ,void *); -static long dviprt_getbuffersize(dviprt_print *); - -/*--- library functions ---*/ -long -dviprt_initlibrary(dviprt_print *pprint,dviprt_cfg_t *pprt,uint width,uint height) -{ - dviprt_encoder *pencode; - uint pins = pprt->integer[CFG_PINS]*8; - - pprint->printer = pprt; - height += (pins-1); - height /= pins; - height *= pins; - pprint->bitmap_width = width; /* width by bytes */ - pprint->bitmap_height = height; - pprint->buffer_width = MIN(width,pprt->integer[CFG_MAXIMAL_UNIT]); - pprint->page_count = 0; - pprint->output_bytes = 0; - pprint->tempbuffer_f = 0; - pencode = dviprt_getencoder_((int)pprt->integer[CFG_ENCODE]); - if (pencode == NULL) return CFG_ERROR_NOT_SUPPORTED; - pprint->encode_getbuffersize_proc = pencode->getworksize; - pprint->encode_encode_proc = pencode->encode; - - pprint->output_bytes = 0; - pprint->pstream = NULL; - pprint->output_proc = NULL; - - if (pprt->integer[CFG_UPPER_POS] & CFG_NON_TRANSPOSE_BIT) { - pprint->output_maximal_unit = - (pprt->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT) ? - dviprt_output_nontranspose_reverse : dviprt_output_nontranspose; - } - else - pprint->output_maximal_unit = dviprt_output_transpose; - return dviprt_getbuffersize(pprint); -} - -int - dviprt_setstream -#ifdef __PROTOTYPES__ - (dviprt_print *pprint,int (*func)(uchar far *,long ,void*),void *pstream) -#else -(pprint,func,pstream) -dviprt_print *pprint; -int (*func)(); -void *pstream; -#endif -{ - if (pprint->page_count) { - int code = dviprt_output_expr(pprint,CFG_FORM_FEED,0,0); - if (code < 0) return code; - pprint->page_count = 0; - } - pprint->output_bytes = 0; - pprint->pstream = pstream; - pprint->output_proc = (func == NULL) ? dviprt_default_outputproc : func; - return 0; -} - -int -dviprt_setbuffer(dviprt_print *pprint,uchar far *buf) -{ - if (pprint->tempbuffer_f) { - BufferFree(pprint->encode_buffer); - } - pprint->tempbuffer_f = 0; - if (buf == NULL) { - long s = dviprt_getbuffersize(pprint); - if (s) { - buf = (uchar far *)BufferAlloc(s); - if (buf == NULL) return CFG_ERROR_MEMORY; - pprint->tempbuffer_f = 1; - } - } - pprint->encode_buffer = buf; - pprint->source_buffer = - buf + pprint->encode_getbuffersize_proc(pprint,dviprt_getmaximalwidth(pprint)); - return 0; -} - -int -dviprt_beginpage(dviprt_print *pprint) -{ - int code; - pprint->device_x = pprint->device_y = 0; - pprint->bitmap_x = pprint->bitmap_y = 0; - if (pprint->page_count == 0) { /* bit_image_mode */ - code = dviprt_output_expr(pprint,CFG_BIT_IMAGE_MODE,0,0); - } - else { /* form_feed */ - code = dviprt_output_expr(pprint,CFG_FORM_FEED,0,0); - } - pprint->page_count++; - if (code < 0) return code; - return 0; -} - -int -dviprt_outputscanlines(dviprt_print *pprint,uchar far *fb) -{ - dviprt_cfg_t *pprt; - int code; - uint bw; - - pprt = pprint->printer; - bw = pprint->bitmap_width; - - if (pprt->prtcode_size[CFG_SKIP_SPACES] <= 0) { - pprint->bitmap_x = bw; - pprint->last_x = 0; - } - else { - uint uw,rw; - uint mu; - uint bx,lx; - uint pins = dviprt_getscanlines(pprint); - mu = pprt->integer[CFG_MINIMAL_UNIT]; - bx = lx = 0; - - for (rw= bw; rw > 0 ;rw -= uw) { - uint x,y; - uchar far *in; - - uw = MIN(mu,rw); - in = fb + bx; - for (x = uw; x>0 ; x--) { - uchar far *test; - test = in; - for (y = pins ; y > 0 ;y--) { - if (*test) goto next_unit; - test += bw; - } - in++; - } - - if (bx > lx) { - pprint->bitmap_x = bx; - pprint->last_x = lx; - code = dviprt_flush_buffer(pprint,fb); /* output buffered unit */ - if (code < 0) return code; - lx = pprint->last_x + uw; - } - else lx += uw; - - next_unit: - bx += uw; - } - pprint->bitmap_x = bx; - pprint->last_x = lx; - } - code = (pprint->last_x < pprint->bitmap_x) ? dviprt_flush_buffer(pprint,fb) : 0; - pprint->bitmap_y++; - return code; -} - -int -dviprt_endbitmap(dviprt_print *pprint) -{ - if (pprint->page_count) { - int code = dviprt_output_expr(pprint,CFG_NORMAL_MODE,0,0); - if (code < 0) return code; - } - return 0; -} - -int -dviprt_unsetbuffer(dviprt_print *pprint) -{ - if (pprint->tempbuffer_f) { - BufferFree(pprint->encode_buffer); - pprint->tempbuffer_f = 0; - } - return 0; -} - -int -dviprt_output(dviprt_print *pprint,uchar far *buf,long s) -{ - int c = pprint->output_proc(buf,s,pprint->pstream); - pprint->output_bytes += s; - return c; -} - -/*--- internal routines ---*/ -static int -dviprt_getmaximalwidth(dviprt_print *pprint) -{ - return MIN(pprint->printer->integer[CFG_MAXIMAL_UNIT],pprint->bitmap_width); -} - -static long -dviprt_getbuffersize(dviprt_print *pprint) -{ - long w = dviprt_getmaximalwidth(pprint); - long e = pprint->encode_getbuffersize_proc(pprint,w); - switch (pprint->printer->integer[CFG_UPPER_POS] - & (CFG_NON_TRANSPOSE_BIT | CFG_REVERSE_BIT)) { - case CFG_LEFT_IS_HIGH: - return e; - default: - return w * dviprt_getscanlines(pprint) + e; - } -} - -static int -dviprt_flush_buffer(dviprt_print *pprint,uchar far *fb) -{ - dviprt_cfg_t *pprt; - int code; - - pprt = pprint->printer; - while (pprint->device_y < pprint->bitmap_y) { /* skip vertical spaces */ - pprint->device_y++; - code = dviprt_output_expr(pprint,CFG_LINE_FEED,0,0); - pprint->device_x = 0; - } - while (pprint->last_x < pprint->bitmap_x) { - int w; - while (pprint->device_x < pprint->last_x) { /* skip horizontal spaces */ - w = MIN(pprt->integer[CFG_MAXIMAL_UNIT], - pprint->last_x - pprint->device_x); - code = dviprt_output_expr(pprint,CFG_SKIP_SPACES,w,0); - pprint->device_x += w; - } - w = MIN(pprt->integer[CFG_MAXIMAL_UNIT],pprint->bitmap_x-pprint->last_x); - code = pprint->output_maximal_unit(pprint,fb+pprint->last_x,w); - if (code < 0) return code; - pprint->last_x += w; - if (!(pprt->integer[CFG_UPPER_POS] & CFG_NON_MOVING)) - pprint->device_x += w; - } - return 0; -} - -static int -dviprt_output_nontranspose(dviprt_print *pprint,uchar far *fb,uint width) -{ - int code; - uint dsize; - uint y; - uint pins; - - pins = dviprt_getscanlines(pprint); - - dsize = 0; - pprint->psource = fb; - for (y = pins ; y>0 ; y--) { - int dsize_line; - dsize_line = pprint->encode_encode_proc(pprint,(long)width,0); - if (dsize_line < 0) return dsize_line; - dsize += dsize_line; - pprint->psource += pprint->bitmap_width; - } - - code = dviprt_output_expr(pprint,CFG_SEND_BIT_IMAGE,width,dsize); - if (code < 0) return code; - - pprint->psource = fb; - for (y = pins ; y>0 ; y--) { - int dsize_line; - dsize_line = pprint->encode_encode_proc(pprint,(long)width,1); - code = dviprt_output_expr(pprint,CFG_BIT_ROW_HEADER,width,dsize_line); - if (code < 0) return code; - code = dviprt_output(pprint,pprint->poutput,dsize_line); - if (code < 0) return code; - pprint->psource += pprint->bitmap_width; - } - - code = dviprt_output_expr(pprint,CFG_AFTER_BIT_IMAGE,width,dsize); - if (code < 0) return code; - - return 0; -} - -static int -dviprt_output_nontranspose_reverse(dviprt_print *pprint,uchar far *fb,uint width) -{ - uchar far *psrc; - uchar far *pbuf; - int code; - uint src_size; - uint dsize; - uint y; - uint pins; - - pins = dviprt_getscanlines(pprint); - src_size = width * pins; - - psrc = pprint->source_buffer; - for (y = pins ; y > 0; y--) { - uint i; - pbuf = fb; - for (i=width;i>0;i--) *psrc++ = *pbuf++; - fb += pprint->bitmap_width; - } - - /* here, reverse bits */ - psrc = pprint->source_buffer; - dviprt_reverse_bits(psrc,src_size); - - dsize = 0; - pprint->psource = pprint->source_buffer; - for (y = pins ; y>0 ; y--) { - int dsize_line; - dsize_line = pprint->encode_encode_proc(pprint,(long)width,0); - if (dsize_line < 0) return dsize_line; - dsize += dsize_line; - pprint->psource += width; - } - - code = dviprt_output_expr(pprint,CFG_SEND_BIT_IMAGE,width,dsize); - if (code < 0) return code; - - pprint->psource = pprint->source_buffer; - for (y = pins ; y>0 ; y--) { - int dsize_line; - dsize_line = pprint->encode_encode_proc(pprint,(long)width,1); - code = dviprt_output_expr(pprint,CFG_BIT_ROW_HEADER,width,dsize_line); - if (code < 0) return code; - code = dviprt_output(pprint,pprint->poutput,dsize_line); - if (code < 0) return code; - pprint->psource += width; - } - - code = dviprt_output_expr(pprint,CFG_AFTER_BIT_IMAGE,width,dsize); - if (code < 0) return code; - - return 0; -} - -static int -dviprt_output_transpose(dviprt_print *pprint,uchar far *fb,uint width) -{ - uchar far *psrc; - uchar far *pbuf; - int code; - uint src_size; - uint dsize; - uint pins,pins8; - int y; - - pins8 = pprint->printer->integer[CFG_PINS]; - pins = pins8 * 8; - src_size = width * pins; - psrc = pprint->source_buffer; - { - uchar far *pdst; - uint sskip; - sskip = pprint->bitmap_width * 8; - for (y = pins8-1; y >= 0 ; y--) { - uint i; - pbuf = fb; - pdst = psrc; - for (i=width;i>0;i--) { - dviprt_transpose8x8(pbuf,pprint->bitmap_width,pdst,pins8); - pbuf ++; - pdst += pins; - } - fb += sskip; - psrc++; - } - } - - psrc = pprint->source_buffer; - - /* here, reverse bits */ - if (pprint->printer->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT) - dviprt_reverse_bits(psrc,src_size); - - dsize = 0; - pprint->psource = pprint->source_buffer; - for (y = pins ; y>0 ; y--) { - int dsize_line; - dsize_line = pprint->encode_encode_proc(pprint,(long)width,0); - if (dsize_line < 0) return dsize_line; - dsize += dsize_line; - pprint->psource += width; - } - - code = dviprt_output_expr(pprint,CFG_SEND_BIT_IMAGE,width,dsize); - if (code < 0) return code; - - pprint->psource = pprint->source_buffer; - for (y = pins ; y>0 ; y--) { - uint dsize_line; - dsize_line = pprint->encode_encode_proc(pprint,(long)width,1); - code = dviprt_output(pprint,pprint->poutput,dsize_line); - if (code < 0) return code; - pprint->psource += width; - } - - code = dviprt_output_expr(pprint,CFG_AFTER_BIT_IMAGE,width,dsize); - if (code < 0) return code; - - return 0; -} - -static int -dviprt_transpose8x8(uchar far *inp,uint line_size,uchar far *outp,uint dist) -{ - register uint ae, bf, cg, dh; - { - uchar far *ptr4 = inp + (line_size << 2); - ae = ((uint)*inp << 8) + *ptr4; - inp += line_size, ptr4 += line_size; - bf = ((uint)*inp << 8) + *ptr4; - inp += line_size, ptr4 += line_size; - cg = ((uint)*inp << 8) + *ptr4; - inp += line_size, ptr4 += line_size; - dh = ((uint)*inp << 8) + *ptr4; - } - /* Check for all 8 bytes being the same. */ - /* This is especially worth doing for the case where all are zero. */ - if ( ae == bf && ae == cg && ae == dh && (ae >> 8) == (ae & 0xff) ) { - if ( ae == 0 ) goto store; - *outp = -((ae >> 7) & 1); - outp += dist; - *outp = -((ae >> 6) & 1); - outp += dist; - *outp = -((ae >> 5) & 1); - outp += dist; - *outp = -((ae >> 4) & 1); - outp += dist; - *outp = -((ae >> 3) & 1); - outp += dist; - *outp = -((ae >> 2) & 1); - outp += dist; - *outp = -((ae >> 1) & 1); - outp += dist; - *outp = -(ae & 1); - } - else { - register uint temp; - - /* Transpose a block of bits between registers. */ -#define transpose(r,s,mask,shift)\ - r ^= (temp = ((s >> shift) ^ r) & mask);\ - s ^= temp << shift - - /* Transpose blocks of 4 x 4 */ -#define transpose4(r) transpose(r,r,0x00f0,4) - transpose4(ae); - transpose4(bf); - transpose4(cg); - transpose4(dh); - - /* Transpose blocks of 2 x 2 */ - transpose(ae, cg, 0x3333, 2); - transpose(bf, dh, 0x3333, 2); - - /* Transpose blocks of 1 x 1 */ - transpose(ae, bf, 0x5555, 1); - transpose(cg, dh, 0x5555, 1); - - store: *outp = ae >> 8; - outp += dist; - *outp = bf >> 8; - outp += dist; - *outp = cg >> 8; - outp += dist; - *outp = dh >> 8; - outp += dist; - *outp = (uchar)ae; - outp += dist; - *outp = (uchar)bf; - outp += dist; - *outp = (uchar)cg; - outp += dist; - *outp = (uchar)dh; - } - return 0; -} - -static int -dviprt_reverse_bits(uchar far *buf,uint s) -{ - static uchar rev[256] = { - 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, - 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, - 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, - 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, - 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, - 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, - 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, - 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, - 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, - 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, - 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, - 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, - 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, - 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, - 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, - 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, - 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, - 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, - 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, - 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, - 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, - 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, - 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, - 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, - 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, - 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, - 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, - 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, - 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, - 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, - 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, - 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, - }; - while (s-- > 0) { - *buf = rev[*buf]; - buf++; - } - return 0; -} - -static int -dviprt_output_expr(dviprt_print *pprint,int numb,uint width,uint dsize) -{ - uchar *pcode; - dviprt_cfg_t *pprt; - uint v; - uint len; - - pprt = pprint->printer; - if (pprt->prtcode[numb] == NULL) return 0; - pcode = pprt->prtcode[numb]; - len = pprt->prtcode_size[numb]; - - while (*pcode && len>0) { - if (*pcode & CFG_FMT_BIT) { - uint stack[CFG_STACK_DEPTH]; - int stack_p = -1; - uchar fmt = *pcode++; - uint l = *pcode++; - len -=2; - while (l>0) { - if ((*pcode & CFG_EXPR_TYPE_BIT) == CFG_OP) { - uint v2 = stack[stack_p--]; - v = stack[stack_p--]; - switch (*pcode) { - case CFG_OP_ADD: v += v2; break; - case CFG_OP_SUB: v -= v2; break; - case CFG_OP_MUL: v *= v2; break; - case CFG_OP_DIV: - if (v2 == 0) { /* divided by zero. */ - div_by_zero: - return CFG_ERROR_DIV0; - } - v /= v2; - break; - case CFG_OP_MOD: - if (v2 == 0) goto div_by_zero; - v %= v2; - break; - case CFG_OP_SHL: v <<= v2; break; - case CFG_OP_SHR: v >>= v2; break; - case CFG_OP_AND: v &= v2; break; - case CFG_OP_OR : v |= v2; break; - case CFG_OP_XOR: v ^= v2; break; - default: - ; - } - stack[++stack_p] = v; - } - else if ((*pcode & CFG_EXPR_TYPE_BIT) == CFG_VAL) { - { - switch (*pcode) { - case CFG_VAL_DEFAULT: v = width*8; break; - case CFG_VAL_CONSTANT: v = pprt->integer[CFG_CONSTANT]; break; - case CFG_VAL_WIDTH: v = pprint->bitmap_width*8; break; - case CFG_VAL_HEIGHT: v = pprint->bitmap_height; break; - case CFG_VAL_PAGE: - case CFG_VAL_PAGECOUNT: v = pprint->page_count; break; - case CFG_VAL_DATASIZE: v = dsize; break; - case CFG_VAL_X_DPI: v = (int)pprt->integer[CFG_DPI]; break; - case CFG_VAL_Y_DPI: - v = pprt->integer[CFG_Y_DPI] > 0 ? - pprt->integer[CFG_Y_DPI] : pprt->integer[CFG_DPI]; - break; - case CFG_VAL_PINS_BYTE: v = pprt->integer[CFG_PINS]; break; - case CFG_VAL_X_POS: v = pprint->device_x*8; break; - case CFG_VAL_Y_POS: - v = pprint->device_y * dviprt_getscanlines(pprint); - break; - } - } - stack[++stack_p] = v; - } - else { - stack[++stack_p] = *pcode; - } - l--; pcode++; len--; - } - v = stack[stack_p]; - if ((fmt & CFG_FMT_FORMAT_BIT) == CFG_FMT_STRINGS) { - uint l = *pcode++; - len--; - while (v-- > 0) - dviprt_output(pprint,(uchar far *)pcode,l); - pcode += l; - len -= l; - } - else if ((fmt & CFG_FMT_FORMAT_BIT) == CFG_FMT_ASSIGNMENT) { - pprint->uservar[fmt&0x0f] = v; - } - else { uchar valbuf[10]; - int cols = fmt & CFG_FMT_COLUMN_BIT; - int i; - - switch (fmt & CFG_FMT_FORMAT_BIT) { - case CFG_FMT_BIN_LTOH: - for (i=0;i<cols;i++) { - valbuf[i] = v&0xff; - v >>= 8; - } - break; - case CFG_FMT_BIN_HTOL: - for (i=cols-1;i>=0;i--) { - valbuf[i] = v&0xff; - v >>= 8; - } - break; - default: - { char *f; - char fmtbuf[10]; - switch(fmt & CFG_FMT_FORMAT_BIT) { - case CFG_FMT_HEX_UPPER: f = "X"; break; - case CFG_FMT_HEX_LOWER: f = "x"; break; - case CFG_FMT_DECIMAL: f = "u"; break; - case CFG_FMT_OCTAL: f = "o"; break; - } - if (cols == 0) - strcpy(fmtbuf,"%"); - else - gs_sprintf(fmtbuf,"%%0%d",cols); - strcat(fmtbuf,f); - gs_sprintf(valbuf,fmtbuf,stack[stack_p]); - cols = strlen(valbuf); - if (fmt & CFG_FMT_ISO_BIT) - valbuf[cols-1] |= 0x10; - } - break; - } - dviprt_output(pprint,(uchar far *)valbuf, cols); - } - } - else { - uint l = *pcode++; - len--; - dviprt_output(pprint,(uchar far *)pcode,l); - pcode += l; - len -= l; - } - } - return 0; -} - -static int -dviprt_default_outputproc(uchar far *buf,long s,void *fp) -{ -#ifdef __MSDOS_REAL__ - while (s-- > 0) { - if (fputc(*buf++,fp) == EOF) - return CFG_ERROR_OUTPUT; - } - return 0; -#else - return fwrite(buf,s,1,fp) == 1 ? 0 : CFG_ERROR_OUTPUT; -#endif -} -/***** End of print.c *****/ - -/***** From encode.c *****/ -/* $Id: ENCODE.C 1.1 1994/08/30 02:27:02 kaz Exp kaz $ */ - -#define DVIPRT_SUPPORT_FAX 1 -#define DVIPRT_SUPPORT_PCL 1 - -/*--- forward declarations ---*/ -static long dviprt_null_getworksize(dviprt_print *,long ); -static long dviprt_null_encode(dviprt_print *,long ,int ); -static long dviprt_hex_getworksize(dviprt_print *,long ); -static long dviprt_hex_encode(dviprt_print *,long ,int ); -#if DVIPRT_SUPPORT_FAX -static long dviprt_fax_getworksize(dviprt_print *,long ); -static long dviprt_fax_encode(dviprt_print *,long ,int ); -#endif -#if DVIPRT_SUPPORT_PCL -static long dviprt_pcl1_getworksize(dviprt_print *,long ); -static long dviprt_pcl1_encode(dviprt_print *,long ,int ); -static long dviprt_pcl2_getworksize(dviprt_print *,long ); -static long dviprt_pcl2_encode(dviprt_print *,long ,int ); -#endif - -static dviprt_encoder dviprt_encoder_list[] = { - { CFG_ENCODE_NULL, dviprt_null_getworksize,dviprt_null_encode}, - { CFG_ENCODE_HEX, dviprt_hex_getworksize,dviprt_hex_encode}, -#if DVIPRT_SUPPORT_FAX - { CFG_ENCODE_FAX, dviprt_fax_getworksize,dviprt_fax_encode}, -#endif -#if DVIPRT_SUPPORT_PCL - { CFG_ENCODE_PCL1, dviprt_pcl1_getworksize,dviprt_pcl1_encode}, - { CFG_ENCODE_PCL2, dviprt_pcl2_getworksize,dviprt_pcl2_encode}, -#endif - { -1 }, -}; - -/*--- internal routines ---*/ -/* The users MUST NOT USE these functions */ -static dviprt_encoder * -dviprt_getencoder_(int no) -{ - int i; - for (i=0;dviprt_encoder_list[i].no >= 0;i++) - if (no == dviprt_encoder_list[i].no) - return dviprt_encoder_list+i; - return NULL; -} - -static long -dviprt_null_getworksize(dviprt_print *pprint,long s) -{ - return 0; -} -static long -dviprt_null_encode(dviprt_print *pprint,long s,int f) -{ - pprint->poutput = pprint->psource; - return s; -} - -static long -dviprt_hex_getworksize(dviprt_print *pprint,long s) -{ - return s*2; -} -static long -dviprt_hex_encode(dviprt_print *pprint,long s,int f) -{ - if (f) { - uchar far *w; - uchar far *buf; - static uchar hex[] = "0123456789ABCDEF"; - int i=s; - w = pprint->poutput = pprint->encode_buffer; - buf = pprint->psource; - while (i-->0) { - *w++ = hex[(*buf>>4)&0x0f]; - *w++ = hex[*buf&0x0f]; - buf++; - } - } - return s*2; -} - -#if DVIPRT_SUPPORT_PCL -static long -dviprt_pcl1_getworksize(dviprt_print *pprint,long s) -{ - return s*2; -} -static long -dviprt_pcl1_encode(dviprt_print *pprint,long s,int f) -{ - uchar far *src; - uchar far *end; - uchar far *out; - long total = 0; - - src = pprint->psource; - end = src + s; - out = pprint->poutput = pprint->encode_buffer; - - while ( src < end ) { - uchar test = *src++; - uchar far *run = src; - while ( src < end && *src == test ) src++; - if (f) { - while ( src - run > 255 ) { - *out++ = 255; - *out++ = test; - total += 2; - run += 256; - } - *out++ = src - run; - *out++ = test; - total += 2; - } - else { - total += (((src-run)/255 + ((src-run)%255) ? 1 : 0)) * 2; - } - } - return total; -} - -static long -dviprt_pcl2_getworksize(dviprt_print *pprint,long s) -{ - return s + s/127 + 1; -} -static long -dviprt_pcl2_encode(dviprt_print *pprint,long s,int f) -{ - uchar far *exam; - uchar far *cptr; - uchar far *end; - uchar far *src; - long total = 0; - - src = pprint->psource; - exam = src; - cptr = pprint->poutput = pprint->encode_buffer; - end = exam + s; - - for ( ; ; ) { - uchar test = *exam++; - int len; - while ((test != *exam) && (exam < end)) - test = *exam++; - if (exam < end) exam--; - len = exam - src; - if (f) { - while (len > 0){ - int i; - int count = len; - if (count>127) count=127; - *cptr++=count-1; - for (i = 0 ; i < count ; i++) *cptr++ = *src++; - len -= count; - total += (count+1); - } - } - else { - total += len + ((len/127)+(len%127 ? 1 : 0)); - } - if (exam >= end) break; - exam++; - while ((test == *exam) && (exam < end)) - exam++; - len = exam - src; - if (f) { - while (len > 0) { - int count = len; - if (count > 127) count = 127; - *cptr++ = (257-count); - *cptr++ = test; - len -= count; - total += 2; - } - } - else { - total += ((len/127 + (len%127) ? 1 : 0)) * 2; - } - if (exam >= end) break; - src = exam; - } - return total; -} -#endif /* DVIPRT_SUPPORT_PCL */ - -#if DVIPRT_SUPPORT_FAX -static long -dviprt_fax_getworksize(dviprt_print *pprint,long s) -{ - long size = s * 8 + 7; - return MAX(size*2/9+4,size/8) * dviprt_getscanlines(pprint) + 1; -} - -#define MAX_FAX_WIDTH 2623 -typedef struct { - int data; - int length; -} FaxEncode_t; -typedef struct { - uchar i_bitbuf; - uchar far *i_buf; - int i_count; - - uchar o_bitbuf; - uchar far *o_buf; - int o_count; - int o_bufcount; -} FaxEncodeInfo; -static int dviprt_fax_set_white(int,FaxEncodeInfo *); -static int dviprt_fax_set_black(int,FaxEncodeInfo *); -static int dviprt_fax_set_bitcount(FaxEncode_t *,FaxEncodeInfo *); - -static long -dviprt_fax_encode(dviprt_print *pprint,long s,int f) -{ - static FaxEncode_t eol_code = {0x800,12}; - int allruns = 0; - int width = s * 8; - int top_bit_count = 8; - FaxEncodeInfo info; - uchar far *src_end; - uchar recover; - - src_end = pprint->psource + s; - recover = *src_end; - *src_end = 0xaa; - - /* initializing */ - info.i_buf = pprint->psource; - info.i_bitbuf = *info.i_buf++; - info.i_count = 8; - info.o_buf = pprint->poutput = pprint->encode_buffer; - info.o_bitbuf = 0; - info.o_count = 8; - info.o_bufcount = 0; - - dviprt_fax_set_bitcount(&eol_code,&info); - - for(;;){ - static uchar ROW[9] = - {0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}; - static uchar MASK[9] = - {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; - int white_run_length; - int black_run_length; - - /* count run-length */ - /* remaining bits in the current byte are white? */ - if (!(info.i_bitbuf &= MASK[info.i_count])){ - do{ - top_bit_count += 8; /* next byte is also white */ - } while(!(info.i_bitbuf = *info.i_buf++)); - info.i_count = 8; - } - /* current byte contains white and black bits */ - while(!(info.i_bitbuf & ROW[info.i_count])) - info.i_count--; /* skip white bits */ - white_run_length = top_bit_count - (black_run_length = info.i_count); - - /* remaining bits in the current byte are black? */ - if (info.i_bitbuf == MASK[info.i_count]){ - do{ - black_run_length += 8; - /* next byte is also black */ - } while((info.i_bitbuf = *info.i_buf++) == 0xff); - info.i_count = 8; - } - else info.i_count--; /* skip the top black bit */ - - /* current byte contains white and black bits */ - while(info.i_bitbuf & ROW[info.i_count]) - info.i_count--; /* skip black bits */ - black_run_length -= (top_bit_count = info.i_count); - - /* output */ - if((allruns += white_run_length) < width) - dviprt_fax_set_white(white_run_length,&info); - else{ - dviprt_fax_set_white(white_run_length + width - allruns,&info); - break; - } - if((allruns += black_run_length) < width) - dviprt_fax_set_black(black_run_length,&info); - else{ - dviprt_fax_set_black(black_run_length + width - allruns,&info); - break; - } - } - - info.o_bufcount++; - if (info.o_count < 8) - *info.o_buf++ = info.o_bitbuf; - else - *info.o_buf++ = 0; - *src_end = recover; - - return info.o_bufcount; -} - -static int -dviprt_fax_set_bitcount(FaxEncode_t *pt,FaxEncodeInfo *info) -{ - int data, length; - - data = pt->data; - length = pt->length; - while( (length -= info->o_count) >= 0 ){ - *info->o_buf++ = ((data << (8 - info->o_count))|info->o_bitbuf); - info->o_bitbuf = 0; - info->o_bufcount++; - data >>= info->o_count; - info->o_count = 8; - } - info->o_bitbuf |= (data << (8 - info->o_count)); - info->o_count = -length; - return 0; -} - -static int -dviprt_fax_set_white(int count,FaxEncodeInfo *info) -{ - static FaxEncode_t white_count_list[]={ - { 0x00AC, 8, }, /* 0 */ - { 0x0038, 6, }, /* 1 */ - { 0x000E, 4, }, /* 2 */ - { 0x0001, 4, }, /* 3 */ - { 0x000D, 4, }, /* 4 */ - { 0x0003, 4, }, /* 5 */ - { 0x0007, 4, }, /* 6 */ - { 0x000F, 4, }, /* 7 */ - { 0x0019, 5, }, /* 8 */ - { 0x0005, 5, }, /* 9 */ - { 0x001C, 5, }, /* 10 */ - { 0x0002, 5, }, /* 11 */ - { 0x0004, 6, }, /* 12 */ - { 0x0030, 6, }, /* 13 */ - { 0x000B, 6, }, /* 14 */ - { 0x002B, 6, }, /* 15 */ - { 0x0015, 6, }, /* 16 */ - { 0x0035, 6, }, /* 17 */ - { 0x0072, 7, }, /* 18 */ - { 0x0018, 7, }, /* 19 */ - { 0x0008, 7, }, /* 20 */ - { 0x0074, 7, }, /* 21 */ - { 0x0060, 7, }, /* 22 */ - { 0x0010, 7, }, /* 23 */ - { 0x000A, 7, }, /* 24 */ - { 0x006A, 7, }, /* 25 */ - { 0x0064, 7, }, /* 26 */ - { 0x0012, 7, }, /* 27 */ - { 0x000C, 7, }, /* 28 */ - { 0x0040, 8, }, /* 29 */ - { 0x00C0, 8, }, /* 30 */ - { 0x0058, 8, }, /* 31 */ - { 0x00D8, 8, }, /* 32 */ - { 0x0048, 8, }, /* 33 */ - { 0x00C8, 8, }, /* 34 */ - { 0x0028, 8, }, /* 35 */ - { 0x00A8, 8, }, /* 36 */ - { 0x0068, 8, }, /* 37 */ - { 0x00E8, 8, }, /* 38 */ - { 0x0014, 8, }, /* 39 */ - { 0x0094, 8, }, /* 40 */ - { 0x0054, 8, }, /* 41 */ - { 0x00D4, 8, }, /* 42 */ - { 0x0034, 8, }, /* 43 */ - { 0x00B4, 8, }, /* 44 */ - { 0x0020, 8, }, /* 45 */ - { 0x00A0, 8, }, /* 46 */ - { 0x0050, 8, }, /* 47 */ - { 0x00D0, 8, }, /* 48 */ - { 0x004A, 8, }, /* 49 */ - { 0x00CA, 8, }, /* 50 */ - { 0x002A, 8, }, /* 51 */ - { 0x00AA, 8, }, /* 52 */ - { 0x0024, 8, }, /* 53 */ - { 0x00A4, 8, }, /* 54 */ - { 0x001A, 8, }, /* 55 */ - { 0x009A, 8, }, /* 56 */ - { 0x005A, 8, }, /* 57 */ - { 0x00DA, 8, }, /* 58 */ - { 0x0052, 8, }, /* 59 */ - { 0x00D2, 8, }, /* 60 */ - { 0x004C, 8, }, /* 61 */ - { 0x00CC, 8, }, /* 62 */ - { 0x002C, 8, }, /* 63 */ - - { 0x001B, 5, }, /* 64 */ - { 0x0009, 5, }, /* 128 */ - { 0x003A, 6, }, /* 192 */ - { 0x0076, 7, }, /* 256 */ - { 0x006C, 8, }, /* 320 */ - { 0x00EC, 8, }, /* 384 */ - { 0x0026, 8, }, /* 448 */ - { 0x00A6, 8, }, /* 512 */ - { 0x0016, 8, }, /* 576 */ - { 0x00E6, 8, }, /* 640 */ - { 0x0066, 9, }, /* 704 */ - { 0x0166, 9, }, /* 768 */ - { 0x0096, 9, }, /* 832 */ - { 0x0196, 9, }, /* 896 */ - { 0x0056, 9, }, /* 960 */ - { 0x0156, 9, }, /* 1024 */ - { 0x00D6, 9, }, /* 1088 */ - { 0x01D6, 9, }, /* 1152 */ - { 0x0036, 9, }, /* 1216 */ - { 0x0136, 9, }, /* 1280 */ - { 0x00B6, 9, }, /* 1344 */ - { 0x01B6, 9, }, /* 1408 */ - { 0x0032, 9, }, /* 1472 */ - { 0x0132, 9, }, /* 1536 */ - { 0x00B2, 9, }, /* 1600 */ - { 0x0006, 6, }, /* 1664 */ - { 0x01B2, 9, }, /* 1728 */ - - { 0x0080, 11, }, /* 1792 */ - { 0x0180, 11, }, /* 1856 */ - { 0x0580, 11, }, /* 1920 */ - { 0x0480, 12, }, /* 1984 */ - { 0x0C80, 12, }, /* 2048 */ - { 0x0280, 12, }, /* 2112 */ - { 0x0A80, 12, }, /* 2176 */ - { 0x0680, 12, }, /* 2240 */ - { 0x0E80, 12, }, /* 2304 */ - { 0x0380, 12, }, /* 2368 */ - { 0x0B80, 12, }, /* 2432 */ - { 0x0780, 12, }, /* 2496 */ - { 0x0F80, 12, }, /* 2560 */ - }; - while (count >= 64){ - if(count <= MAX_FAX_WIDTH){ - dviprt_fax_set_bitcount((white_count_list + 63) + (count/64),info); - break; - } - dviprt_fax_set_white(MAX_FAX_WIDTH,info); - dviprt_fax_set_black(0,info); - count -= MAX_FAX_WIDTH; - } - dviprt_fax_set_bitcount(white_count_list + (count & 63) ,info); - return 0; -} - -static int -dviprt_fax_set_black(int count,FaxEncodeInfo *info) -{ - static FaxEncode_t black_count_list[]={ - { 0x03B0, 10, }, /* 0 */ - { 0x0002, 3, }, /* 1 */ - { 0x0003, 2, }, /* 2 */ - { 0x0001, 2, }, /* 3 */ - { 0x0006, 3, }, /* 4 */ - { 0x000C, 4, }, /* 5 */ - { 0x0004, 4, }, /* 6 */ - { 0x0018, 5, }, /* 7 */ - { 0x0028, 6, }, /* 8 */ - { 0x0008, 6, }, /* 9 */ - { 0x0010, 7, }, /* 10 */ - { 0x0050, 7, }, /* 11 */ - { 0x0070, 7, }, /* 12 */ - { 0x0020, 8, }, /* 13 */ - { 0x00E0, 8, }, /* 14 */ - { 0x0030, 9, }, /* 15 */ - { 0x03A0, 10, }, /* 16 */ - { 0x0060, 10, }, /* 17 */ - { 0x0040, 10, }, /* 18 */ - { 0x0730, 11, }, /* 19 */ - { 0x00B0, 11, }, /* 20 */ - { 0x01B0, 11, }, /* 21 */ - { 0x0760, 11, }, /* 22 */ - { 0x00A0, 11, }, /* 23 */ - { 0x0740, 11, }, /* 24 */ - { 0x00C0, 11, }, /* 25 */ - { 0x0530, 12, }, /* 26 */ - { 0x0D30, 12, }, /* 27 */ - { 0x0330, 12, }, /* 28 */ - { 0x0B30, 12, }, /* 29 */ - { 0x0160, 12, }, /* 30 */ - { 0x0960, 12, }, /* 31 */ - { 0x0560, 12, }, /* 32 */ - { 0x0D60, 12, }, /* 33 */ - { 0x04B0, 12, }, /* 34 */ - { 0x0CB0, 12, }, /* 35 */ - { 0x02B0, 12, }, /* 36 */ - { 0x0AB0, 12, }, /* 37 */ - { 0x06B0, 12, }, /* 38 */ - { 0x0EB0, 12, }, /* 39 */ - { 0x0360, 12, }, /* 40 */ - { 0x0B60, 12, }, /* 41 */ - { 0x05B0, 12, }, /* 42 */ - { 0x0DB0, 12, }, /* 43 */ - { 0x02A0, 12, }, /* 44 */ - { 0x0AA0, 12, }, /* 45 */ - { 0x06A0, 12, }, /* 46 */ - { 0x0EA0, 12, }, /* 47 */ - { 0x0260, 12, }, /* 48 */ - { 0x0A60, 12, }, /* 49 */ - { 0x04A0, 12, }, /* 50 */ - { 0x0CA0, 12, }, /* 51 */ - { 0x0240, 12, }, /* 52 */ - { 0x0EC0, 12, }, /* 53 */ - { 0x01C0, 12, }, /* 54 */ - { 0x0E40, 12, }, /* 55 */ - { 0x0140, 12, }, /* 56 */ - { 0x01A0, 12, }, /* 57 */ - { 0x09A0, 12, }, /* 58 */ - { 0x0D40, 12, }, /* 59 */ - { 0x0340, 12, }, /* 60 */ - { 0x05A0, 12, }, /* 61 */ - { 0x0660, 12, }, /* 62 */ - { 0x0E60, 12, }, /* 63 */ - - { 0x03C0, 10, }, /* 64 */ - { 0x0130, 12, }, /* 128 */ - { 0x0930, 12, }, /* 192 */ - { 0x0DA0, 12, }, /* 256 */ - { 0x0CC0, 12, }, /* 320 */ - { 0x02C0, 12, }, /* 384 */ - { 0x0AC0, 12, }, /* 448 */ - { 0x06C0, 13, }, /* 512 */ - { 0x16C0, 13, }, /* 576 */ - { 0x0A40, 13, }, /* 640 */ - { 0x1A40, 13, }, /* 704 */ - { 0x0640, 13, }, /* 768 */ - { 0x1640, 13, }, /* 832 */ - { 0x09C0, 13, }, /* 896 */ - { 0x19C0, 13, }, /* 960 */ - { 0x05C0, 13, }, /* 1024 */ - { 0x15C0, 13, }, /* 1088 */ - { 0x0DC0, 13, }, /* 1152 */ - { 0x1DC0, 13, }, /* 1216 */ - { 0x0940, 13, }, /* 1280 */ - { 0x1940, 13, }, /* 1344 */ - { 0x0540, 13, }, /* 1408 */ - { 0x1540, 13, }, /* 1472 */ - { 0x0B40, 13, }, /* 1536 */ - { 0x1B40, 13, }, /* 1600 */ - { 0x04C0, 13, }, /* 1664 */ - { 0x14C0, 13, }, /* 1728 */ - - { 0x0080, 11, }, /* 1792 */ - { 0x0180, 11, }, /* 1856 */ - { 0x0580, 11, }, /* 1920 */ - { 0x0480, 12, }, /* 1984 */ - { 0x0C80, 12, }, /* 2048 */ - { 0x0280, 12, }, /* 2112 */ - { 0x0A80, 12, }, /* 2176 */ - { 0x0680, 12, }, /* 2240 */ - { 0x0E80, 12, }, /* 2304 */ - { 0x0380, 12, }, /* 2368 */ - { 0x0B80, 12, }, /* 2432 */ - { 0x0780, 12, }, /* 2496 */ - { 0x0F80, 12, }, /* 2560 */ - }; - - while (count >= 64){ - if(count <= MAX_FAX_WIDTH){ - dviprt_fax_set_bitcount((black_count_list + 63) + (count/64),info); - break; - } - dviprt_fax_set_black(MAX_FAX_WIDTH,info); - dviprt_fax_set_white(0,info); - count -= MAX_FAX_WIDTH; - } - dviprt_fax_set_bitcount(black_count_list + (count & 63),info); - return 0; -} -#endif /* DVIPRT_SUPPORT_FAX */ -/***** End of encode.c *****/ diff --git a/contrib/japanese/escp_24.src b/contrib/japanese/escp_24.src deleted file mode 100644 index 5536aa23..00000000 --- a/contrib/japanese/escp_24.src +++ /dev/null @@ -1,12 +0,0 @@ -name : ESC/P 24 pin -pins : 24 -minimal_unit : 1 -maximal_unit : 180 -dpi : 180 -upper_position : HIGH_BIT -bit_image_mode : \e 3 \x18 \e ?Z' -send_bit_image : \e Z \b2,d -line_feed : \r \n -form_feed : \r \f -normal_mode : \r \f \e 2 -skip_spaces : \e \ \b2,d diff --git a/contrib/japanese/gdevdmpr.c b/contrib/japanese/gdevdmpr.c deleted file mode 100644 index f675cbb5..00000000 --- a/contrib/japanese/gdevdmpr.c +++ /dev/null @@ -1,888 +0,0 @@ -/* COPYRIGHT (C) 1990, 1992 Aladdin Enterprises. All rights reserved. - Distributed by Free Software Foundation, Inc. - - This file is part of Ghostscript. - - Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility - to anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer - to the Ghostscript General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute - Ghostscript, but only under the conditions described in the Ghostscript - General Public License. A copy of this license is supposed to have been - given to you along with Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. */ - -/* gdevdmpr.c - * - * Dot matrix printer driver for Ghostscript - * - * The first version written by ... K.Asayama Nov 1992 - * NEC PC-H98 high resolution mode supported by ... OkI Dec 1992 - * IBM PC AT/Compatible machines supported by ... hero.h Mar 1993 - * Modified for 386BSD by ... FKR Mar 1993 - * Modified for Ghostscript version 2.5.2 by ... K.Asayama Mar 1993 - * Modified for Ghostscript version 2.6.1 by ... K.Asayama Oct 1993 - * Modified for Ghostscript version 4.03 by ... K.Asayama May 1997 - */ - -#include "gdevprn.h" -#include "gp.h" -#include "gserrors.h" -#include "gsparam.h" -#include "gsstate.h" -#include "math_.h" -#include "malloc_.h" - -/* include library header. */ -#include "dviprlib.h" - -#define LOCAL_DEBUG 0 - -#define DEVICE_NAME "dmprt" -#define DEVICE_VERSION 201 /* 2.01 */ - -typedef struct gx_device_dmprt_local_s gx_device_dmprt_local; -struct gx_device_dmprt_local_s { - int orig_x_dpi; - int orig_y_dpi; - - int x_offset; - int y_offset; - - int spec_width; - int spec_height; - int max_width; - int max_height; - int dev_margin[4]; /* left bottom right top */ - - int prtcfg_init_f; - int verbose_f; - int debug_f; - dviprt_cfg_t prtcfg; - dviprt_print prtinfo; -}; - -/* declaration of the structure to describe `DMPRT' device driver */ -typedef struct gx_device_dmprt_s gx_device_dmprt; -struct gx_device_dmprt_s { - gx_device_common; - gx_prn_device_common; - - gx_device_dmprt_local dmprt; -}; - -/* declarations of main functions */ -static dev_proc_get_params(gdev_dmprt_get_params); -static dev_proc_put_params(gdev_dmprt_put_params); -static dev_proc_get_initial_matrix(gdev_dmprt_get_initial_matrix); -static dev_proc_open_device(gdev_dmprt_open); -static dev_proc_print_page(gdev_dmprt_print_page); -static dev_proc_close_device(gdev_dmprt_close); - -/* declarations of sub functions to get printer properties. */ -static void gdev_dmprt_init_printer_props(gx_device_dmprt *); -static int gdev_dmprt_get_printer_props(gx_device_dmprt *,char *); -static int gdev_dmprt_check_code_props(byte * ,int ); -static gp_file *gdev_dmprt_dviprt_lib_fopen(const gs_memory_t *mem,const char *,char *); - -static int gdev_dmprt_error_no_dviprt_to_gs(int ); - -/* The device descriptor */ -gx_device_procs prn_dmprt_procs = { - gdev_dmprt_open, - gdev_dmprt_get_initial_matrix, - 0, /* sync_output */ - gdev_prn_output_page, - gdev_dmprt_close, - gdev_prn_map_rgb_color, - gdev_prn_map_color_rgb, - 0, /* fill_rectangle */ - 0, /* tile_rectangle */ - 0, /* copy_mono */ - 0, /* copy_color */ - 0, /* draw_line */ - 0, /* get_bits */ - gdev_dmprt_get_params, - gdev_dmprt_put_params, - gx_default_map_cmyk_color, - 0, -}; - -#define DEFAULT_DPI 180 -#define DEFAULT_WIDTH 8.3 -#define DEFAULT_HEIGHT 11.7 - -gx_device_dmprt gs_dmprt_device = { - prn_device_body(gx_device_dmprt, prn_dmprt_procs, DEVICE_NAME, - DEFAULT_WIDTH*10, /* width 10'th */ - DEFAULT_HEIGHT*10, /* height 10'th */ - DEFAULT_DPI, /* X resolution */ - DEFAULT_DPI, /* Y resolution */ - 0,0,0,0, /* margins (top,left,bottom,right) */ - 1,1,1,1,2,2, /* color info. */ - gdev_dmprt_print_page), - - { - DEFAULT_DPI, DEFAULT_DPI, - 0, 0, /* offset */ - DEFAULT_DPI*DEFAULT_WIDTH, /* specified width */ - DEFAULT_DPI*DEFAULT_HEIGHT, /* specified height */ - -1,-1, /* maximal width,height */ - { 0,0,0,0 }, /* margins */ - - /* status of the device */ - 0, /* printer configuration is not initialized */ - 0, /* verbose mode */ - 0, /* debug flag */ - }, -}; - -#define ppdev ((gx_device_printer *)pdev) -#define pddev ((gx_device_dmprt *)pdev) - -typedef struct { - char *name; - int no; -} dmprt_encoding; -static dmprt_encoding gdev_dmprt_encode_list[] = { - {"Null",CFG_ENCODE_NULL}, - {"AsciiHex",CFG_ENCODE_HEX }, - {"CCITTFax",CFG_ENCODE_FAX }, - {"PCLMode1Compress",CFG_ENCODE_PCL1 }, - {"PCLMode2Compress",CFG_ENCODE_PCL2 }, - {0}, -}; - -/* --- Get properties of printer device. --- */ -static int gdev_dmprt_get_dmprt_params(gx_device *pdev, gs_param_list *plist); -static int -gdev_dmprt_get_dviprt_params(gx_device *pdev, gs_param_list *plist); - -static int -gdev_dmprt_get_params(gx_device *pdev, gs_param_list *plist) -{ - int code; - gs_param_dict dict; - const char *param_name; - - if (!pddev->dmprt.prtcfg_init_f) - gdev_dmprt_init_printer_props(pddev); - - dict.size = 30; - code = param_begin_write_dict(plist, (param_name = "DmprtParams"), - &dict, false); - if (code < 0) return code; - if (code == 0) { - code = gdev_dmprt_get_dmprt_params(pdev, dict.list); - param_end_write_dict(plist, param_name, &dict); - if (code < 0) return code; - } - - dict.size = 30; - code = param_begin_write_dict(plist, (param_name = "DviprtParams"), - &dict, false); - if (code < 0) return code; - if (code == 0) { - code = gdev_dmprt_get_dviprt_params(pdev, dict.list); - param_end_write_dict(plist, param_name, &dict); - if (code < 0) return code; - } - - { - int w = pddev->width; - int h = pddev->height; - pddev->width = pddev->dmprt.spec_width; - pddev->height = pddev->dmprt.spec_height; - code = gdev_prn_get_params(pdev, plist); - pddev->width = w; - pddev->height = h; - } - - return code; -} - -/* internal routines for get_params */ -static int -gdev_dmprt_get_dmprt_params(gx_device *pdev, gs_param_list *plist) -{ - int code; - long vlong; - bool vbool; - gs_param_int_array vaint; - int int_data[4]; - - vlong = DEVICE_VERSION; - code = param_write_long(plist, "Version", &vlong); - if (code < 0) return code; - - vbool = pddev->dmprt.debug_f; - code = param_write_bool(plist, "Debug", &vbool); - if (code < 0) return code; - - vbool = pddev->dmprt.verbose_f; - code = param_write_bool(plist, "Verbose", &vbool); - if (code < 0) return code; - - vaint.size = 2; - vaint.data = int_data; - vaint.persistent = false; - int_data[0] = pddev->dmprt.max_width; - int_data[1] = pddev->dmprt.max_height; - code = param_write_int_array(plist, "MaxSize", &vaint); - if (code < 0) return code; - - vaint.size = 2; - vaint.data = int_data; - vaint.persistent = false; - int_data[0] = pddev->dmprt.x_offset; - int_data[1] = pddev->dmprt.y_offset; - code = param_write_int_array(plist, "Offsets", &vaint); - if (code < 0) return code; - - vaint.size = 4; - vaint.data = int_data; - vaint.persistent = false; - { int i; - for (i=0;i<4;i++) int_data[i] = pddev->dmprt.dev_margin[i]; - } - code = param_write_int_array(plist, "Margins", &vaint); - if (code < 0) return code; - - return code; -} - -static int -gdev_dmprt_get_dviprt_params(gx_device *pdev, gs_param_list *plist) -{ - dviprt_cfg_t *pprt = &pddev->dmprt.prtcfg; - long vlong; - bool vbool; - gs_param_string vstr; - const char *vchar; - int code; - int i; - - vlong = pprt->integer[CFG_PINS] * 8; - code = param_write_long(plist,"Pins", &vlong); - if (code < 0) return code; - code = param_write_long(plist, "MinimalUnit", - pprt->integer+CFG_MINIMAL_UNIT); - if (code < 0) return code; - code = param_write_long(plist,"MaximalUnit", - pprt->integer+CFG_MAXIMAL_UNIT); - if (code < 0) return code; - code = param_write_int(plist,"HDpi" , &pddev->dmprt.orig_x_dpi); - if (code < 0) return code; - code = param_write_int(plist,"VDpi", &pddev->dmprt.orig_y_dpi); - if (code < 0) return code; - code = param_write_long(plist,"Constant", pprt->integer+CFG_CONSTANT); - if (code < 0) return code; - - vbool = pprt->integer[CFG_UPPER_POS] & CFG_NON_TRANSPOSE_BIT ? 0 : 1; - code = param_write_bool(plist,"Transpose", &vbool); - if (code < 0) return code; - vbool = pprt->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT ? 1 : 0; - code = param_write_bool(plist,"Reverse", &vbool); - if (code < 0) return code; - vbool = (pprt->integer[CFG_UPPER_POS] & CFG_NON_MOVING) ? 1 : 0; - code = param_write_bool(plist,"NonMoving", &vbool); - if (code < 0) return code; - - vchar = pprt->strings[CFG_NAME] ? (const char*)pprt->strings[CFG_NAME] : ""; - param_string_from_string(vstr, vchar); - code = param_write_string(plist, "Name", &vstr); - if (code < 0) return code; - - for (i=0;gdev_dmprt_encode_list[i].name;i++) { - if (pprt->integer[CFG_ENCODE] == gdev_dmprt_encode_list[i].no) - break; - } - if (gdev_dmprt_encode_list[i].name == 0) i = 0; - param_string_from_string(vstr, gdev_dmprt_encode_list[i].name); - code = param_write_string(plist, "Encoding", &vstr); - if (code < 0) return code; - -#define param_string_from_prt(ps, pprt, n) \ - ((ps).data = pprt->prtcode[n] ? pprt->prtcode[n] : (const byte*)"", \ - (ps).size = pprt->prtcode[n] ? pprt->prtcode_size[n] : 0, \ - (ps).persistent = true) -#define param_write_prt(plist, name, pprt, n) \ - (param_string_from_prt(vstr, pprt, n), \ - param_write_string(plist, name, &vstr)) - - code = param_write_prt(plist, "BitImageMode", - pprt, CFG_BIT_IMAGE_MODE); - if (code < 0) return code; - code = param_write_prt(plist, "SendBitImage", - pprt, CFG_SEND_BIT_IMAGE); - if (code < 0) return code; - code = param_write_prt(plist, "BitRowHeader", - pprt, CFG_BIT_ROW_HEADER); - if (code < 0) return code; - code = param_write_prt(plist, "AfterBitImage", - pprt, CFG_AFTER_BIT_IMAGE); - if (code < 0) return code; - code = param_write_prt(plist, "LineFeed", pprt, CFG_LINE_FEED); - if (code < 0) return code; - code = param_write_prt(plist, "FormFeed", pprt, CFG_FORM_FEED); - if (code < 0) return code; - code = param_write_prt(plist, "NormalMode", pprt, CFG_NORMAL_MODE); - if (code < 0) return code; - code = param_write_prt(plist, "SkipSpaces", pprt, CFG_SKIP_SPACES); - if (code < 0) return code; - - return code; -} -/* end of internal routines for get_params */ - -/* --- Put properties of printer device. --- */ -static int gdev_dmprt_put_dmprt_params(gx_device *pdev, gs_param_list *plist); -static int -gdev_dmprt_put_dviprt_params(gx_device *pdev, gs_param_list *plist); -static int gdev_dmprt_put_prt_code_param(gs_param_list *plist, - dviprt_cfg_t *pprt, - const char* name, int idx); -static int -gdev_dmprt_put_prt_string_param(gs_param_list *plist, - dviprt_cfg_t *pprt, const char* name, int idx); - -static int -gdev_dmprt_put_params(gx_device *pdev, gs_param_list *plist) -{ - int code = 0; - const char *param_name; - gs_param_dict dict; - - if (!pddev->dmprt.prtcfg_init_f) - gdev_dmprt_init_printer_props(pddev); - - /* dmprt parameters */ - code = param_begin_read_dict(plist, (param_name = "DmprtParams"), - &dict, false); - if (code < 0) return code; - if (code == 0) { - code = gdev_dmprt_put_dmprt_params(pdev, dict.list); - param_end_read_dict(plist, param_name, &dict); - if (code < 0) return code; - } - - /* dviprt parameters */ - code = param_begin_read_dict(plist, (param_name = "DviprtParams"), - &dict, false); - if (code < 0) return code; - if (code == 0) { - code = gdev_dmprt_put_dviprt_params(pdev, dict.list); - param_end_read_dict(plist, param_name, &dict); - if (code < 0) return code; - } - - if (pdev->is_open && code) { - int ccode = gs_closedevice(pdev); - if (ccode < 0) return ccode; - } - - pddev->width = pddev->dmprt.spec_width; - pddev->height = pddev->dmprt.spec_height; - code = gdev_prn_put_params(pdev, plist); - pddev->dmprt.spec_width = pddev->width; - pddev->dmprt.spec_height = pddev->height; - pddev->width -= (pddev->dmprt.dev_margin[0] + pddev->dmprt.dev_margin[2]); - pddev->height -= (pddev->dmprt.dev_margin[1] + pddev->dmprt.dev_margin[3]); - if (code < 0) return code; - - if (pddev->dmprt.max_width>0 && pddev->dmprt.max_width<pddev->width) - pddev->width = pddev->dmprt.max_width; - if (pddev->dmprt.max_height>0 && pddev->dmprt.max_height<pddev->height) - pddev->height = pddev->dmprt.max_height; - - dviprt_setmessagestream(pddev->dmprt.debug_f ? stderr : NULL); - - return code; -} - -/* internal routines for put_params */ - -static int -gdev_dmprt_put_dmprt_params(gx_device *pdev, gs_param_list *plist) -{ - int code; - long vlong; - bool vbool; - gs_param_int_array vaint; - - /* debug flag */ - code = param_read_bool(plist, "Debug", &vbool); - if (code < 0) return code; - if (code == 0) pddev->dmprt.debug_f = vbool; - - dviprt_setmessagestream(pddev->dmprt.debug_f ? stderr : NULL); - - code = param_read_bool(plist, "Verbose", &vbool); - if (code < 0) return code; - pddev->dmprt.verbose_f = vbool; - - /* dummy */ - code = param_read_long(plist, "Version", &vlong); - if (code < 0) return code; - - code = param_read_int_array(plist, "MaxSize", &vaint); - if (code < 0) return code; - if (code == 0) { - if (vaint.size != 2) return_error(gs_error_typecheck); - pddev->dmprt.max_width = vaint.data[0]; - pddev->dmprt.max_height = vaint.data[1]; - } - - code = param_read_int_array(plist, "Offsets", &vaint); - if (code < 0) return code; - if (code == 0) { - if (vaint.size != 2) return_error(gs_error_typecheck); - pddev->dmprt.x_offset = vaint.data[0]; - pddev->dmprt.y_offset = vaint.data[1]; - } - - code = param_read_int_array(plist, "Margins", &vaint); - if (code < 0) return code; - if (code == 0) { - int i; - if (vaint.size != 4) return_error(gs_error_typecheck); - for (i=0;i<4;i++) pddev->dmprt.dev_margin[i] = vaint.data[i]; - } - - return code; -} - -static int -gdev_dmprt_put_dviprt_params(gx_device *pdev, gs_param_list *plist) -{ - int code; - dviprt_cfg_t *pprt = &pddev->dmprt.prtcfg; - gs_param_string vstr; - long vlong; - bool vbool; - - /* load .cfg/.src file */ - code = param_read_string(plist, "FileName", &vstr); - if (code < 0) return code; - if (code == 0) { - char *filename = gs_malloc(pdev->memory->non_gc_memory, vstr.size + 1, 1, - "gdev_dmprt_put_props(filename)"); - int ccode; - if (filename == 0) return_error(gs_error_VMerror); - strncpy(filename, (const char*)vstr.data, vstr.size); - filename[vstr.size] = '\0'; - ccode = gdev_dmprt_get_printer_props(pddev,filename); - gs_free(pdev->memory->non_gc_memory, filename, vstr.size+1, 1, "gdev_dmprt_put_props(filename)"); - if (ccode < 0) return ccode; - } - - code = param_read_long(plist, "Pins", &vlong); - if (code < 0) return code; - if (code == 0) pprt->integer[CFG_PINS] = vlong / 8; - - code = param_read_long(plist, "MinimalUnit", &vlong); - if (code < 0) return code; - if (code == 0) pprt->integer[CFG_MINIMAL_UNIT] = vlong; - - code = param_read_long(plist, "MaximalUnit", &vlong); - if (code < 0) return code; - if (code == 0) pprt->integer[CFG_MAXIMAL_UNIT] = vlong; - - code = param_read_long(plist, "HDpi", &vlong); - if (code < 0) return code; - if (code == 0) pddev->dmprt.orig_x_dpi = vlong; - - code = param_read_long(plist, "VDpi", &vlong); - if (code < 0) return code; - if (code == 0) pddev->dmprt.orig_y_dpi = vlong; - - code = param_read_long(plist, "Constant", &vlong); - if (code < 0) return code; - if (code == 0) pprt->integer[CFG_CONSTANT] = vlong; - - { - long tr = pprt->integer[CFG_UPPER_POS] & CFG_NON_TRANSPOSE_BIT; - long rv = pprt->integer[CFG_UPPER_POS] & CFG_REVERSE_BIT; - long nm = pprt->integer[CFG_UPPER_POS] & CFG_NON_MOVING; - param_read_bool(plist,"Transpose", &vbool); - if (code < 0) return code; - if (code == 0) tr = vbool ? 0 : CFG_NON_TRANSPOSE_BIT; - param_read_bool(plist,"Reverse", &vbool); - if (code < 0) return code; - if (code == 0) rv = vbool ? CFG_REVERSE_BIT : 0; - param_read_bool(plist,"NonMoving", &vbool); - if (code < 0) return code; - if (code == 0) nm = vbool ? CFG_NON_MOVING : 0; - pprt->integer[CFG_UPPER_POS] = tr | rv | nm; - } - - code = gdev_dmprt_put_prt_code_param(plist, pprt, "BitImageMode", - CFG_BIT_IMAGE_MODE); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "SendBitImage", - CFG_SEND_BIT_IMAGE); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "BitRowHeader", - CFG_BIT_ROW_HEADER); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "AfterBitImage", - CFG_AFTER_BIT_IMAGE); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "LineFeed", - CFG_LINE_FEED); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "FormFeed", - CFG_FORM_FEED); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "NormalMode", - CFG_NORMAL_MODE); - if (code < 0) return code; - code = gdev_dmprt_put_prt_code_param(plist, pprt, "SkipSpaces", - CFG_SKIP_SPACES); - if (code < 0) return code; - - code = gdev_dmprt_put_prt_string_param(plist, pprt, "Name", - CFG_NAME); - if (code < 0) return code; - - code = param_read_string(plist, "Encoding", &vstr); - if (code < 0) return code; - if (code == 0) { - int i; - for (i=0; gdev_dmprt_encode_list[i].name ; i++) { - if (strlen(gdev_dmprt_encode_list[i].name) == vstr.size) { - if (strncmp(gdev_dmprt_encode_list[i].name, - vstr.data, vstr.size) == 0) { - pprt->integer[CFG_ENCODE] = gdev_dmprt_encode_list[i].no; - break; - } - } - } - if (gdev_dmprt_encode_list[i].name == 0) - return_error(gs_error_rangecheck); - } - - return code; -} - -static int -gdev_dmprt_put_prt_code_param(gs_param_list *plist, - dviprt_cfg_t *pprt, const char* name, int idx) -{ - gs_param_string vstr; - - int code = param_read_string(plist, name, &vstr); - if (code == 0) { - int ccode = gdev_dmprt_check_code_props(vstr.data, vstr.size); - byte *pbyte; - if (ccode < 0) return_error(gs_error_rangecheck); - pbyte = (byte *)malloc(vstr.size+1); - if (pbyte == 0) return_error(gs_error_VMerror); - memcpy(pbyte, vstr.data, vstr.size); - pbyte[vstr.size] = 0; - pprt->prtcode[idx] = pbyte; - pprt->prtcode_size[idx] = vstr.size; - if (code == 0) code = 1; - } - return code; -} - -static int -gdev_dmprt_put_prt_string_param(gs_param_list *plist, - dviprt_cfg_t *pprt, const char* name, int idx) -{ - gs_param_string vstr; - - int code = param_read_string(plist, name, &vstr); - if (code == 0) { - byte *pbyte; - pbyte = (byte *)malloc(vstr.size+1); - if (pbyte == 0) return_error(gs_error_VMerror); - memcpy(pbyte, vstr.data, vstr.size); - pbyte[vstr.size] = 0; - pprt->strings[idx] = pbyte; - if (code == 0) code = 1; - } - return code; -} -/* end of internal routines for put_params */ - -/* --- Get initial matrix. --- */ -static void -gdev_dmprt_get_initial_matrix(gx_device *pdev, gs_matrix *pmat) -{ - gx_default_get_initial_matrix(pdev,pmat); - pmat->tx += (pddev->dmprt.x_offset - pddev->dmprt.dev_margin[0]); - pmat->ty += (pddev->dmprt.y_offset + pddev->dmprt.dev_margin[3]); -} - -/* --- Open printer device. --- */ -static int -gdev_dmprt_open(gx_device *pdev) -{ - int code; - dviprt_cfg_t *pcfg; - dviprt_print *pprint; - - pprint = &pddev->dmprt.prtinfo; - pcfg = &pddev->dmprt.prtcfg; - - if ((code = gdev_prn_open(pdev)) < 0) - return code; - pcfg->integer[CFG_DPI] = (int)ppdev->x_pixels_per_inch; - pcfg->integer[CFG_Y_DPI] = (int)ppdev->y_pixels_per_inch; - code = dviprt_initlibrary(pprint,pcfg,gdev_prn_raster(pdev),pdev->height); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - code = dviprt_setbuffer(pprint,NULL); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - - return 0; -} - -/* --- Close printer device. --- */ -static int -gdev_dmprt_close(gx_device *pdev) -{ - int code; - dviprt_print *pprint; - - pprint = &pddev->dmprt.prtinfo; - - if (!strchr(pddev->fname,'%')) { - code = dviprt_endbitmap(pprint); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - } - if (pddev->dmprt.verbose_f && pddev->PageCount>0) { - emprintf2(pdev->memory, - "%s: Total %lu bytes output.\n", - pddev->dname, - dviprt_getoutputbytes(pprint)); - } - code = dviprt_unsetbuffer(pprint); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - return gdev_prn_close(pdev); -} - -/* Output the PAGE. */ -static int -gdev_dmprt_print_page(gx_device_printer *pdev, gp_file *prn_stream) -{ - int code = 0; - dviprt_print *pprint = &pddev->dmprt.prtinfo; - int line_size = gdev_prn_raster((gx_device *)pdev); - int pins = dviprt_getscanlines(pprint); - int i_buf_size = pins * line_size; - int lnum = 0; - ulong prev_bytes; - byte *in; - - /* get work buffer */ - in = (byte *)gs_malloc(pdev->memory->non_gc_memory, 1, i_buf_size ,"gdev_dmprt_print_page(in)"); - if ( in == 0 ) - return_error(gs_error_VMerror); - - /* Initialize this printer driver */ - if (pdev->file_is_new) { - code = dviprt_setstream(pprint,NULL,prn_stream); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - } - if (pddev->dmprt.verbose_f) { - if (pddev->PageCount == 1) - emprintf2(pdev->memory, - "%s: %s\n", - pddev->dname, - pddev->dmprt.prtcfg.strings[CFG_NAME]); - emprintf2(pdev->memory, - "%s: [%ld]", - pddev->dname, - pddev->PageCount); - } - prev_bytes = dviprt_getoutputbytes(pprint); - code = dviprt_beginpage(pprint); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - - /* Transfer pixels to printer */ - while ( lnum < pdev->height ) { - int num_lines; - - num_lines = pdev->height-lnum; - if (num_lines > pins) - num_lines = pins; - - code = gdev_prn_copy_scan_lines(pdev,lnum,in,line_size*num_lines); - if (code < 0) goto error_ex; - - lnum += num_lines; - if (num_lines < pins) { - memset(in+line_size*num_lines,0,line_size*(pins-num_lines)); - } - - code = dviprt_outputscanlines(pprint,in); - if (code < 0) { - code = gdev_dmprt_error_no_dviprt_to_gs(code); - goto error_ex; - } - } - - /* Eject the page and set printer normal mode. */ - if (strchr(pdev->fname,'%')) { - code = dviprt_endbitmap(pprint); - if (code < 0) return gdev_dmprt_error_no_dviprt_to_gs(code); - } - fflush(pddev->file); - if (pddev->dmprt.verbose_f) { - emprintf1(pdev->memory, - " %lu bytes\n", - dviprt_getoutputbytes(pprint)-prev_bytes); - } -error_ex: - gs_free(pdev->memory->non_gc_memory, (char *)in, 1, i_buf_size,"gdev_dmprt_print_page(in)"); - - return code; -} - -/************************** Internal Routines **************************/ - -/************************ Get printer properties. ***********************/ -static int -gdev_dmprt_check_code_props(byte *str,int len) -{ - byte *end = str+len; - while (str < end) { - byte fmt = *str++; - if (fmt & CFG_FMT_BIT) { - int s = *str++; - str += s; - if (str > end) return_error(gs_error_rangecheck); - if ((fmt & CFG_FMT_FORMAT_BIT) == CFG_FMT_STRINGS) { - s = *str++; - str += s; - if (str > end) return_error(gs_error_rangecheck); - } - } - else { - str += fmt; - if (str > end) return_error(gs_error_rangecheck); - } - } - return str == end ? 0 : gs_error_rangecheck; -} - -static void -gdev_dmprt_init_printer_props(gx_device_dmprt *pdev) -{ - dviprt_cfg_t *pprt; - int i; - - pprt = &pdev->dmprt.prtcfg; - - for (i=0;i<CFG_INTEGER_TYPE_COUNT;i++) - pprt->integer[i] = 0; - for (i=0;i<CFG_STRINGS_TYPE_COUNT;i++) - pprt->strings[i] = 0; - for (i=0;i<CFG_PRTCODE_TYPE_COUNT;i++) { - pprt->prtcode[i] = 0; - pprt->prtcode_size[i] = 0; - } - pdev->dmprt.prtcfg_init_f = 1; -} - -static int -gdev_dmprt_get_printer_props(gx_device_dmprt *pdev,char *fnamebase) -{ - int code; - gp_file *fp; - dviprt_cfg_t cfg; - char *fname; - - fname = gs_malloc(pdev->memory->non_gc_memory, 256,1,"dviprt_lib_fname"); - if (fname == NULL) return_error(gs_error_VMerror); - - fp = gdev_dmprt_dviprt_lib_fopen(pdev->memory,fnamebase,fname); - if (fp == NULL) { - return_error(gs_error_undefinedfilename); - } - if (fseek(fp,18,0) < 0) - return_error(gs_error_ioerror); - code = fgetc(fp); - fclose(fp); - - if (code == EOF) - code = gs_error_ioerror; - else if (code == 0xff) { - code = dviprt_readcfg(pdev->memory,fname,&cfg,NULL,0,NULL,0); - } - else { - code = dviprt_readsrc(pdev->memory,fname,&cfg,NULL,0,NULL,0); - } - - if (code < 0) { - code = gdev_dmprt_error_no_dviprt_to_gs(code); - } - else { /* success */ - memcpy(&pdev->dmprt.prtcfg,&cfg,sizeof(dviprt_cfg_t)); - pddev->dmprt.orig_x_dpi = cfg.integer[CFG_DPI]; - pddev->dmprt.orig_y_dpi = - cfg.integer[CFG_Y_DPI] > 0 ? cfg.integer[CFG_Y_DPI] : pddev->dmprt.orig_x_dpi; - } - - gs_free(pdev->memory->non_gc_memory, fname,256,1,"dviprt_lib_fname"); - - return code; -} - -static const char * gp_file_name_concat_string(const char *, unsigned); -static gp_file * -gdev_dmprt_dviprt_lib_fopen(const gs_memory_t *mem,const char *fnamebase,char *fname) -{ - gp_file *fp = NULL; - char *env; - - strcpy(fname,fnamebase); - /* lib_fopen is no longer called like this. Use gp_fopen - * instead. */ - /* fp = lib_fopen(fname); */ - gp = gp_fopen(mem, fname, gp_fmode_rb); - if (fp == NULL) - { - env = getenv("TEXCFG"); - if (env) { - strcpy(fname,env); - strcat(fname, gp_file_name_concat_string(env,strlen(env))); - strcat(fname,fnamebase); - fp = gp_fopen(mem,fname,gp_fmode_rb); - } - } - return fp; -} - -/* Misc. */ -static int -gdev_dmprt_error_no_dviprt_to_gs(int code) -{ - switch (code) { - case CFG_ERROR_MEMORY: - return_error(gs_error_VMerror); - case CFG_ERROR_FILE_OPEN: - case CFG_ERROR_OUTPUT: - return gs_errpr_ioerror; - default: - return -1; - } -} - -/* Answer the string to be used for combining a directory/device prefix */ -/* with a base file name. The prefix directory/device is examined to */ -/* determine if a separator is needed and may return an empty string */ -static const char * -gp_file_name_concat_string(const char *prefix, unsigned plen) -{ - if (plen > 0 && prefix[plen - 1] == '/') - return ""; - return "/"; -} diff --git a/contrib/lips4/gdevlips.h b/contrib/lips4/gdevlips.h index 1e3dd72c..26819998 100644 --- a/contrib/lips4/gdevlips.h +++ b/contrib/lips4/gdevlips.h @@ -21,6 +21,9 @@ /*$Id: gdevlips.h,v 1.4 2002/10/12 23:24:34 tillkamppeter Exp $ */ /* Common header file for LIPS driver */ +#ifndef gdevlips_h_INCLUDED +#define gdevlips_h_INCLUDED + #define LIPS_ESC 0x1b #define LIPS_FF 0x0c #define LIPS_CSI 0x9b /* LIPS_ESC "[" */ @@ -195,3 +198,5 @@ int lips_media_selection(int width, int height); int lips_packbits_encode(byte * inBuff, byte * outBuff, int Length); int lips_mode3format_encode(byte * inBuff, byte * outBuff, int Length); int lips_rle_encode(byte * inBuff, byte * outBuff, int Length); + +#endif diff --git a/contrib/lips4/gdevlprn.h b/contrib/lips4/gdevlprn.h index 248911cf..6b9245a7 100644 --- a/contrib/lips4/gdevlprn.h +++ b/contrib/lips4/gdevlprn.h @@ -20,6 +20,9 @@ /*$Id: gdevlprn.h,v 1.4 2002/10/12 23:24:34 tillkamppeter Exp $ */ /* Library for Laser Printer Driver */ +#ifndef gdevlprn_h_INCLUDED +#define gdevlprn_h_INCLUDED + /* Main part of this library was taked from Hiroshi Narimatsu's Ghostscript driver, epag-3.08. @@ -143,3 +146,5 @@ dev_proc_get_params(lprn_get_params); dev_proc_put_params(lprn_put_params); int lprn_print_image(gx_device_printer * pdev, gp_file * fp); + +#endif |