diff options
Diffstat (limited to 'Build/source/utils/psutils')
67 files changed, 8367 insertions, 0 deletions
diff --git a/Build/source/utils/psutils/LICENSE b/Build/source/utils/psutils/LICENSE new file mode 100644 index 00000000000..e5e718ac10c --- /dev/null +++ b/Build/source/utils/psutils/LICENSE @@ -0,0 +1,47 @@ + + PS Utilities Package + +The constituent files of this package listed below are copyright (C) 1991-1995 +Angus J. C. Duggan. + +LICENSE Makefile.msc Makefile.nt Makefile.os2 +Makefile.unix README config.h descrip.mms +epsffit.c epsffit.man extractres.man extractres.pl +fixdlsrps.man fixdlsrps.pl fixfmps.man fixfmps.pl +fixmacps.man fixmacps.pl fixpsditps.man fixpsditps.pl +fixpspps.man fixpspps.pl fixscribeps.man fixscribeps.pl +fixtpps.man fixtpps.pl fixwfwps.man fixwfwps.pl +fixwpps.man fixwpps.pl fixwwps.man fixwwps.pl +getafm getafm.man includeres.man includeres.pl +maketext patchlev.h psbook.c psbook.man +pserror.c pserror.h psmerge.man psmerge.pl +psnup.c psnup.man psresize.c psresize.man +psselect.c psselect.man psspec.c psspec.h +pstops.c pstops.man psutil.c psutil.h +showchar + +They may be copied and used for any purpose (including distribution as part of +a for-profit product), provided: + +1) The original attribution of the programs is clearly displayed in the product + and/or documentation, even if the programs are modified and/or renamed as + part of the product. + +2) The original source code of the programs is provided free of charge (except + for reasonable distribution costs). For a definition of reasonable + distribution costs, see the Gnu General Public License or Larry Wall's + Artistic License (provided with the Perl 4 kit). The GPL and Artistic + License in NO WAY affect this license; they are merely used as examples of + the spirit in which it is intended. + +3) These programs are provided "as-is". No warranty or guarantee of their + fitness for any particular task is provided. Use of these programs is + completely at your own risk. + +Basically, I don't mind how you use the programs so long as you acknowledge +the author, and give people the originals if they want them. + +The included files, md68_0.ps and md71_0.ps (and their uuencoded forms) are +(to the best of my knowledge) copyright Apple Computer, Inc. + + AJCD 4/4/95 diff --git a/Build/source/utils/psutils/Makefile.bcc b/Build/source/utils/psutils/Makefile.bcc new file mode 100644 index 00000000000..89ab6bbcc04 --- /dev/null +++ b/Build/source/utils/psutils/Makefile.bcc @@ -0,0 +1,108 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under MSDOS + +OS = DOS + +BINDIR = \psutils +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = \psutils\include + +# Flags for Borland C Compiler +CC = bcc +CFLAGS = -DPAPER="$(PAPER)" -DMSDOS -w -v -O + +BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ + psresize.exe +SHELLSCRIPTS = +PERLSCRIPTS = \ + \ + +MANPAGES = \ + \ + \ + \ + +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.obj: psutil.h patchlev.h pserror.h psutil.c + +psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.obj: psutil.h patchlev.h pserror.h pserror.c + +epsffit.obj: epsffit.c pserror.h patchlev.h + +epsffit.exe: epsffit.obj pserror.obj + $(CC) -e epsffit.exe pserror.obj epsffit.obj + +psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj + $(CC) -e psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj + +psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj + $(CC) -e psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj + +psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook.exe: psbook.obj psutil.obj pserror.obj + $(CC) -e psbook.exe psutil.obj pserror.obj psbook.obj + +psbook.obj: psutil.h patchlev.h pserror.h psbook.c + +psselect.exe: psselect.obj psutil.obj pserror.obj + $(CC) -e psselect.exe psutil.obj pserror.obj psselect.obj + +psselect.obj: psutil.h patchlev.h pserror.h psselect.c + +pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj + $(CC) -e pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj + +pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c + + + +clean: + del *.obj + +veryclean realclean: clean + del $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.include + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) + +install.script: $(PERLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) + diff --git a/Build/source/utils/psutils/Makefile.in b/Build/source/utils/psutils/Makefile.in new file mode 100644 index 00000000000..a631dcd3ebc --- /dev/null +++ b/Build/source/utils/psutils/Makefile.in @@ -0,0 +1,229 @@ +# +# Makefile for psutils +# + +VPATH = @srcdir@ +srcdir = @srcdir@ + +CC = @CC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +defines = -DUNIX -DPAPER=\"$(PAPER)\" + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +scriptdir = $(bindir) +mandir = @mandir@ +man1dir = $(mandir)/man$(manext) +manext = 1 + +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL = @INSTALL@ + +BIN = psbook psselect pstops epsffit psnup psresize +SHELLSCRIPTS = getafm showchar +PERLSCRIPTS = fixfmps fixmacps fixpsditps fixpspps fixtpps fixwfwps fixwpps fixscribeps fixwwps fixdlsrps extractres includeres psmerge +MANPAGES = psbook.$(manext) psselect.$(manext) pstops.$(manext) epsffit.$(manext) psnup.$(manext) psresize.$(manext) psmerge.$(manext) fixscribeps.$(manext) getafm.$(manext) fixdlsrps.$(manext) fixfmps.$(manext) fixmacps.$(manext) fixpsditps.$(manext) fixpspps.$(manext) fixtpps.$(manext) fixwfwps.$(manext) fixwpps.$(manext) fixwwps.$(manext) extractres.$(manext) includeres.$(manext) +INCLUDES = md68_0.ps md71_0.ps +OS = UNIX +PAPER = a4 + +default all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +.SUFFIXES: +.SUFFIXES: .o .c .h .ps .dvi .info .texinfo + +.c.o: + $(CC) $(defines) -c -I. -I$(srcdir) $(CPPFLAGS) $(CFLAGS) $< + +PERL = /usr/bin/env perl +BINMODE = 0755 +MANMODE = 0644 +CHMOD = chmod +MAKETEXT = $(PERL) $(srcdir)/maketext + +epsffit: epsffit.o pserror.o + $(CC) $(LDFLAGS) -o epsffit pserror.o epsffit.o + +psnup: psnup.o psutil.o psspec.o pserror.o + $(CC) $(LDFLAGS) -o psnup psutil.o psspec.o pserror.o psnup.o + +psresize: psresize.o psutil.o pserror.o psspec.o + $(CC) $(LDFLAGS) -o psresize psutil.o psspec.o pserror.o psresize.o + +psbook: psbook.o psutil.o pserror.o + $(CC) $(LDFLAGS) -o psbook psutil.o pserror.o psbook.o + +psselect: psselect.o psutil.o pserror.o + $(CC) $(LDFLAGS) -o psselect psutil.o pserror.o psselect.o + +pstops: pstops.o psutil.o psspec.o pserror.o + $(CC) $(LDFLAGS) -o pstops psutil.o psspec.o pserror.o pstops.o + +getafm: getafm.sh + cp $(srcdir)/getafm.sh getafm + $(CHMOD) $(BINMODE) getafm + +showchar: showchar.sh + cp $(srcdir)/showchar.sh showchar + $(CHMOD) $(BINMODE) showchar + +psmerge: psmerge.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/psmerge.pl > psmerge + $(CHMOD) $(BINMODE) psmerge + +fixfmps: fixfmps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixfmps.pl > fixfmps + $(CHMOD) $(BINMODE) fixfmps + +fixmacps: fixmacps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" INCLUDE=$(INCLUDEDIR) $(srcdir)/fixmacps.pl > fixmacps + $(CHMOD) $(BINMODE) fixmacps + +fixpsditps: fixpsditps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixpsditps.pl > fixpsditps + $(CHMOD) $(BINMODE) fixpsditps + +fixpspps: fixpspps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixpspps.pl > fixpspps + $(CHMOD) $(BINMODE) fixpspps + +fixscribeps: fixscribeps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixscribeps.pl > fixscribeps + $(CHMOD) $(BINMODE) fixscribeps + +fixtpps: fixtpps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixtpps.pl > fixtpps + $(CHMOD) $(BINMODE) fixtpps + +fixwfwps: fixwfwps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixwfwps.pl > fixwfwps + $(CHMOD) $(BINMODE) fixwfwps + +fixwpps: fixwpps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixwpps.pl > fixwpps + $(CHMOD) $(BINMODE) fixwpps + +fixwwps: fixwwps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixwwps.pl > fixwwps + $(CHMOD) $(BINMODE) fixwwps + +fixdlsrps: fixdlsrps.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixdlsrps.pl > fixdlsrps + $(CHMOD) $(BINMODE) fixdlsrps + +extractres: extractres.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/extractres.pl > extractres + $(CHMOD) $(BINMODE) extractres + +includeres: includeres.pl + $(MAKETEXT) OS=$(OS) PERL="$(PERL)" INCLUDE=$(INCLUDEDIR) $(srcdir)/includeres.pl > includeres + $(CHMOD) $(BINMODE) includeres + +epsffit.$(manext): epsffit.man + $(MAKETEXT) MAN="$(MANPAGES)" $(srcdir)/epsffit.man > epsffit.$(manext) + +psnup.$(manext): psnup.man + $(MAKETEXT) MAN="$(MANPAGES)" PAPER=$(PAPER) $(srcdir)/psnup.man > psnup.$(manext) + +psresize.$(manext): psresize.man + $(MAKETEXT) MAN="$(MANPAGES)" PAPER=$(PAPER) $(srcdir)/psresize.man > psresize.$(manext) + +psbook.$(manext): psbook.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/psbook.man > psbook.$(manext) + +psselect.$(manext): psselect.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/psselect.man > psselect.$(manext) + +pstops.$(manext): pstops.man + $(MAKETEXT) "MAN=$(MANPAGES)" PAPER=$(PAPER) $(srcdir)/pstops.man > pstops.$(manext) + +psmerge.$(manext): psmerge.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/psmerge.man > psmerge.$(manext) + +fixfmps.$(manext): fixfmps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixfmps.man > fixfmps.$(manext) + +fixmacps.$(manext): fixmacps.man + $(MAKETEXT) "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $(srcdir)/fixmacps.man > fixmacps.$(manext) + +fixpsditps.$(manext): fixpsditps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixpsditps.man > fixpsditps.$(manext) + +fixpspps.$(manext): fixpspps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixpspps.man > fixpspps.$(manext) + +fixscribeps.$(manext): fixscribeps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixscribeps.man > fixscribeps.$(manext) + +fixtpps.$(manext): fixtpps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixtpps.man > fixtpps.$(manext) + +fixwfwps.$(manext): fixwfwps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixwfwps.man > fixwfwps.$(manext) + +fixwpps.$(manext): fixwpps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixwpps.man > fixwpps.$(manext) + +fixwwps.$(manext): fixwwps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixwwps.man > fixwwps.$(manext) + +fixdlsrps.$(manext): fixdlsrps.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixdlsrps.man > fixdlsrps.$(manext) + +extractres.$(manext): extractres.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/extractres.man > extractres.$(manext) + +includeres.$(manext): includeres.man + $(MAKETEXT) "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $(srcdir)/includeres.man > includeres.$(manext) + +getafm.$(manext): getafm.man + $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/getafm.man > getafm.$(manext) + +info: +dvi: + +SHELL = /bin/sh +@SET_MAKE@ + +.PHONY: install installdirs install-exec install-man clean realclean distclean mostlyclean all check info dvi +install: install-exec install-man + +install-exec: installdirs + for p in $(BIN); do $(INSTALL_PROGRAM) $$p $(bindir)/$$p; done + for p in $(SHELLSCRIPTS) $(PERLSCRIPTS); do $(INSTALL_PROGRAM) $$p $(scriptdir)/$$p; done + +install-man: installdirs + for p in $(MANPAGES); do $(INSTALL_DATA) $$p $(man1dir)/$$p; done + +installdirs: + $(SHELL) ${srcdir}/../../texk/mkinstalldirs $(bindir) $(scriptdir) $(man1dir) + +clean: + rm -f *.o $(BIN) $(SHELLSCRIPTS) $(PERLSCRIPTS) $(MANPAGES) + +distclean: mostlyclean + rm -f Makefile config.cache config.log config.status patchlev.h + +realclean: distclean +mostlyclean: clean + +Makefile: config.status $(srcdir)/Makefile.in + $(SHELL) config.status + +# This tells versions [3.59,3.63) of GNU make not to export all variables. +.NOEXPORT: + +# Automatically generated dependencies will be put at the end of the file. +psutil.o: psutil.h patchlev.h pserror.h psutil.c +psspec.o: psutil.h patchlev.h psspec.h pserror.h psspec.c +pserror.o: psutil.h patchlev.h pserror.h pserror.c +epsffit.o: epsffit.c pserror.h patchlev.h +psnup.o: psutil.h patchlev.h psspec.h pserror.h psnup.c +psresize.o: psutil.h patchlev.h psspec.h pserror.h psresize.c +psbook.o: psutil.h patchlev.h pserror.h psbook.c +psselect.o: psutil.h patchlev.h pserror.h psselect.c +pstops.o: psutil.h patchlev.h psspec.h pserror.h pstops.c diff --git a/Build/source/utils/psutils/Makefile.msc b/Build/source/utils/psutils/Makefile.msc new file mode 100644 index 00000000000..90d1383e5f3 --- /dev/null +++ b/Build/source/utils/psutils/Makefile.msc @@ -0,0 +1,108 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under MSDOS + +OS = DOS + +BINDIR = \psutils +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = \psutils\include + +# Flags for Microsoft C/C++ Compiler +CC = cl +CFLAGS = -DPAPER=\"$(PAPER)\" -DMSDOS -W4 -Zi -Ox + +BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ + psresize.exe +SHELLSCRIPTS = +PERLSCRIPTS = \ + \ + +MANPAGES = \ + \ + \ + \ + +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.obj: psutil.h patchlev.h pserror.h psutil.c + +psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.obj: psutil.h patchlev.h pserror.h pserror.c + +epsffit.obj: epsffit.c pserror.h patchlev.h + +epsffit.exe: epsffit.obj pserror.obj + link -out:epsffit.exe pserror.obj epsffit.obj + +psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj + link -out:psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj + +psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj + link -out:psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj + +psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook.exe: psbook.obj psutil.obj pserror.obj + link -out:psbook.exe psutil.obj pserror.obj psbook.obj + +psbook.obj: psutil.h patchlev.h pserror.h psbook.c + +psselect.exe: psselect.obj psutil.obj pserror.obj + link -out:psselect.exe psutil.obj pserror.obj psselect.obj + +psselect.obj: psutil.h patchlev.h pserror.h psselect.c + +pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj + link -out:pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj + +pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c + + + +clean: + del *.obj + +veryclean realclean: clean + del $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.include + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) + +install.script: $(PERLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) + diff --git a/Build/source/utils/psutils/Makefile.nt b/Build/source/utils/psutils/Makefile.nt new file mode 100644 index 00000000000..41d9b054d3c --- /dev/null +++ b/Build/source/utils/psutils/Makefile.nt @@ -0,0 +1,146 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under Windows NT, Microsoft C/C++ Compiler + +OS = WINNT + +BINDIR = \psutils +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = \psutils\include +PERL = perl + +CFLAGS = -DPAPER=\"$(PAPER)\" -DWINNT /W4 + +BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ + psresize.exe +SHELLSCRIPTS = +PERLSCRIPTS = fixfmps.cmd fixmacps.cmd fixpsditps.cmd fixpspps.cmd \ + fixtpps.cmd fixwfwps.cmd fixwpps.cmd fixscribeps.cmd fixwwps.cmd \ + fixdlsrps.cmd extractres.cmd includeres.cmd psmerge.cmd +MANPAGES = \ + \ + \ + \ + +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.obj: psutil.h patchlev.h pserror.h psutil.c + +psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.obj: psutil.h patchlev.h pserror.h pserror.c + +epsffit.obj: epsffit.c pserror.h patchlev.h + +epsffit.exe: epsffit.obj pserror.obj + link -out:epsffit.exe pserror.obj epsffit.obj + +psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj + link -out:psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj + +psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj + link -out:psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj + +psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook.exe: psbook.obj psutil.obj pserror.obj + link -out:psbook.exe psutil.obj pserror.obj psbook.obj + +psbook.obj: psutil.h patchlev.h pserror.h psbook.c + +psselect.exe: psselect.obj psutil.obj pserror.obj + link -out:psselect.exe psutil.obj pserror.obj psselect.obj + +psselect.obj: psutil.h patchlev.h pserror.h psselect.c + +pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj + link -out:pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj + +pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c + + +psmerge.cmd: psmerge.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixfmps.cmd: fixfmps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixmacps.cmd: fixmacps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ + +fixpsditps.cmd: fixpsditps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixpspps.cmd: fixpspps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixscribeps.cmd: fixscribeps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixtpps.cmd: fixtpps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixwfwps.cmd: fixwfwps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixwpps.cmd: fixwpps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixwwps.cmd: fixwwps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +fixdlsrps.cmd: fixdlsrps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +extractres.cmd: extractres.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + +includeres.cmd: includeres.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ + + +clean: + del *.obj + +veryclean realclean: clean + del $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.include + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) + +install.script: $(PERLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) + diff --git a/Build/source/utils/psutils/Makefile.os2 b/Build/source/utils/psutils/Makefile.os2 new file mode 100644 index 00000000000..ba99fcd81f6 --- /dev/null +++ b/Build/source/utils/psutils/Makefile.os2 @@ -0,0 +1,245 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under OS/2, GCC C Compiler + +OS = OS2 + +BINDIR = \psutils +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = /lib/psutils +PERL = perl5 + +BINMODE = 0755 +MANMODE = 0644 +CHMOD = chmod +INSTALL = install -c -m $(BINMODE) +INSTALLMAN = install -c -m $(MANMODE) +MANEXT = 1 +MANDIR = /man/man$(MANEXT) + +CC = gcc +CFLAGS = -DPAPER=\"$(PAPER)\" -DOS2 -Wall -O2 -Zomf -Zmtd -s -Zlinker /PM:VIO + +.c.obj: + $(CC) -o $*.obj $(CFLAGS) -c $< + +BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ + psresize.exe +SHELLSCRIPTS = getafm.cmd showchar.cmd +PERLSCRIPTS = fixfmps.cmd fixmacps.cmd fixpsditps.cmd fixpspps.cmd \ + fixtpps.cmd fixwfwps.cmd fixwpps.cmd fixscribeps.cmd fixwwps.cmd \ + fixdlsrps.cmd extractres.cmd includeres.cmd psmerge.cmd +MANPAGES = psbook.$(MANEXT) psselect.$(MANEXT) pstops.$(MANEXT) epsffit.$(MANEXT) psnup.$(MANEXT) \ + psresize.$(MANEXT) psmerge.$(MANEXT) fixscribeps.$(MANEXT) getafm.$(MANEXT) \ + fixdlsrps.$(MANEXT) fixfmps.$(MANEXT) fixmacps.$(MANEXT) fixpsditps.$(MANEXT) \ + fixpspps.$(MANEXT) fixtpps.$(MANEXT) fixwfwps.$(MANEXT) fixwpps.$(MANEXT) \ + fixwwps.$(MANEXT) extractres.$(MANEXT) includeres.$(MANEXT) +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.obj: psutil.h patchlev.h pserror.h psutil.c + +psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.obj: psutil.h patchlev.h pserror.h pserror.c + +epsffit.obj: epsffit.c pserror.h patchlev.h + +epsffit.exe: epsffit.obj pserror.obj + $(CC) $(CFLAGS) -o epsffit pserror.obj epsffit.obj + +psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj + $(CC) $(CFLAGS) -o psnup psutil.obj psspec.obj pserror.obj psnup.obj + +psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj + $(CC) $(CFLAGS) -o psresize psutil.obj psspec.obj pserror.obj psresize.obj + +psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook.exe: psbook.obj psutil.obj pserror.obj + $(CC) $(CFLAGS) -o psbook psutil.obj pserror.obj psbook.obj + +psbook.obj: psutil.h patchlev.h pserror.h psbook.c + +psselect.exe: psselect.obj psutil.obj pserror.obj + $(CC) $(CFLAGS) -o psselect psutil.obj pserror.obj psselect.obj + +psselect.obj: psutil.h patchlev.h pserror.h psselect.c + +pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj + $(CC) $(CFLAGS) -o pstops psutil.obj psspec.obj pserror.obj pstops.obj + +pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c + +getafm.cmd: getafm.sh + echo extproc sh $(BINDIR)/$@ >$@ + head -n 2 $? >>$@ + echo shift >>$@ + tail -n +2 $? >>$@ + +showchar.cmd: showchar.sh + echo extproc sh $(BINDIR)/$@ >$@ + head -n 5 $? >>$@ + echo shift >>$@ + tail -n +5 $? >>$@ + +psmerge.cmd: psmerge.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixfmps.cmd: fixfmps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixmacps.cmd: fixmacps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixpsditps.cmd: fixpsditps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixpspps.cmd: fixpspps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixscribeps.cmd: fixscribeps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixtpps.cmd: fixtpps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixwfwps.cmd: fixwfwps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixwpps.cmd: fixwpps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixwwps.cmd: fixwwps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixdlsrps.cmd: fixdlsrps.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +extractres.cmd: extractres.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) $? > $@ + $(CHMOD) $(BINMODE) $@ + +includeres.cmd: includeres.pl + $(PERL) maketext OS=$(OS) PERL=$(PERL) INCLUDE=$(INCLUDEDIR) $? > $@ + $(CHMOD) $(BINMODE) $@ + +epsffit.$(MANEXT): epsffit.man + $(PERL) maketext MAN="$(MANPAGES)" $? > $@ + +psnup.$(MANEXT): psnup.man + $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ + +psresize.$(MANEXT): psresize.man + $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ + +psbook.$(MANEXT): psbook.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +psselect.$(MANEXT): psselect.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +pstops.$(MANEXT): pstops.man + $(PERL) maketext "MAN=$(MANPAGES)" PAPER=$(PAPER) $? > $@ + +psmerge.$(MANEXT): psmerge.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixfmps.$(MANEXT): fixfmps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixmacps.$(MANEXT): fixmacps.man + $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ + +fixpsditps.$(MANEXT): fixpsditps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixpspps.$(MANEXT): fixpspps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixscribeps.$(MANEXT): fixscribeps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixtpps.$(MANEXT): fixtpps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixwfwps.$(MANEXT): fixwfwps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixwpps.$(MANEXT): fixwpps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixwwps.$(MANEXT): fixwwps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixdlsrps.$(MANEXT): fixdlsrps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +extractres.$(MANEXT): extractres.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +includeres.$(MANEXT): includeres.man + $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ + +getafm.$(MANEXT): getafm.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +clean: + RM *.obj + +veryclean realclean: clean + RM $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.include install.man + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) + +install.script: $(PERLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) + +install.man: $(MANPAGES) + -mkdir $(MANDIR) + @for %1 in ( $(MANPAGES) ); do copy %1 $(MANDIR) + diff --git a/Build/source/utils/psutils/Makefile.sc b/Build/source/utils/psutils/Makefile.sc new file mode 100644 index 00000000000..d2b4c43818e --- /dev/null +++ b/Build/source/utils/psutils/Makefile.sc @@ -0,0 +1,108 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under MSDOS + +OS = DOS + +BINDIR = \psutils +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = \psutils\include + +# Flags for Symantec C Compiler +CC = sc +CFLAGS = -DPAPER=\"$(PAPER)\" -DMSDOS -g + +BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ + psresize.exe +SHELLSCRIPTS = +PERLSCRIPTS = \ + \ + +MANPAGES = \ + \ + \ + \ + +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.obj: psutil.h patchlev.h pserror.h psutil.c + +psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.obj: psutil.h patchlev.h pserror.h pserror.c + +epsffit.obj: epsffit.c pserror.h patchlev.h + +epsffit.exe: epsffit.obj pserror.obj + $(CC) -oEXE(epsffit) pserror.obj epsffit.obj + +psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj + $(CC) -oEXE(psnup) psutil.obj psspec.obj pserror.obj psnup.obj + +psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj + $(CC) -oEXE(psresize) psutil.obj psspec.obj pserror.obj psresize.obj + +psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook.exe: psbook.obj psutil.obj pserror.obj + $(CC) -oEXE(psbook) psutil.obj pserror.obj psbook.obj + +psbook.obj: psutil.h patchlev.h pserror.h psbook.c + +psselect.exe: psselect.obj psutil.obj pserror.obj + $(CC) -oEXE(psselect) psutil.obj pserror.obj psselect.obj + +psselect.obj: psutil.h patchlev.h pserror.h psselect.c + +pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj + $(CC) -oEXE(pstops) psutil.obj psspec.obj pserror.obj pstops.obj + +pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c + + + +clean: + del *.obj + +veryclean realclean: clean + del $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.include + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) + +install.script: $(PERLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) + diff --git a/Build/source/utils/psutils/Makefile.unix b/Build/source/utils/psutils/Makefile.unix new file mode 100644 index 00000000000..11c7ef311fb --- /dev/null +++ b/Build/source/utils/psutils/Makefile.unix @@ -0,0 +1,250 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under Unix + +OS = UNIX + +BINDIR = /usr/local/bin +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = /usr/local/share/psutils +PERL = /usr/local/bin/perl + +BINMODE = 0755 +MANMODE = 0644 +CHMOD = chmod +INSTALL = install -c -m $(BINMODE) +INSTALLMAN = install -c -m $(MANMODE) +MANEXT = 1 +MANDIR = /usr/local/share/man/man$(MANEXT) + +CFLAGS = -DPAPER=\"$(PAPER)\" -DUNIX -O + +BIN = psbook psselect pstops epsffit psnup \ + psresize +SHELLSCRIPTS = getafm showchar +PERLSCRIPTS = fixfmps fixmacps fixpsditps fixpspps \ + fixtpps fixwfwps fixwpps fixscribeps fixwwps \ + fixdlsrps extractres includeres psmerge +MANPAGES = psbook.$(MANEXT) psselect.$(MANEXT) pstops.$(MANEXT) epsffit.$(MANEXT) psnup.$(MANEXT) \ + psresize.$(MANEXT) psmerge.$(MANEXT) fixscribeps.$(MANEXT) getafm.$(MANEXT) \ + fixdlsrps.$(MANEXT) fixfmps.$(MANEXT) fixmacps.$(MANEXT) fixpsditps.$(MANEXT) \ + fixpspps.$(MANEXT) fixtpps.$(MANEXT) fixwfwps.$(MANEXT) fixwpps.$(MANEXT) \ + fixwwps.$(MANEXT) extractres.$(MANEXT) includeres.$(MANEXT) +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.o: psutil.h patchlev.h pserror.h psutil.c + +psspec.o: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.o: psutil.h patchlev.h pserror.h pserror.c + +epsffit.o: epsffit.c pserror.h patchlev.h + +epsffit: epsffit.o pserror.o + $(CC) $(CCFLAGS) -o epsffit pserror.o epsffit.o + +psnup: psnup.o psutil.o psspec.o pserror.o + $(CC) $(CCFLAGS) -o psnup psutil.o psspec.o pserror.o psnup.o + +psnup.o: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize: psresize.o psutil.o pserror.o psspec.o + $(CC) $(CCFLAGS) -o psresize psutil.o psspec.o pserror.o psresize.o + +psresize.o: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook: psbook.o psutil.o pserror.o + $(CC) $(CCFLAGS) -o psbook psutil.o pserror.o psbook.o + +psbook.o: psutil.h patchlev.h pserror.h psbook.c + +psselect: psselect.o psutil.o pserror.o + $(CC) $(CCFLAGS) -o psselect psutil.o pserror.o psselect.o + +psselect.o: psutil.h patchlev.h pserror.h psselect.c + +pstops: pstops.o psutil.o psspec.o pserror.o + $(CC) $(CCFLAGS) -o pstops psutil.o psspec.o pserror.o pstops.o + +pstops.o: psutil.h patchlev.h psspec.h pserror.h pstops.c + +getafm: getafm.sh + cp $? $@ + +showchar: showchar.sh + cp $? $@ + +psmerge: psmerge.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixfmps: fixfmps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixmacps: fixmacps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" INCLUDE=$(INCLUDEDIR) $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixpsditps: fixpsditps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixpspps: fixpspps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixscribeps: fixscribeps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixtpps: fixtpps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixwfwps: fixwfwps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixwpps: fixwpps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixwwps: fixwwps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +fixdlsrps: fixdlsrps.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +extractres: extractres.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" $? > $@ + $(CHMOD) $(BINMODE) $@ + +includeres: includeres.pl + $(PERL) maketext OS=$(OS) PERL="$(PERL)" INCLUDE=$(INCLUDEDIR) $? > $@ + $(CHMOD) $(BINMODE) $@ + +epsffit.$(MANEXT): epsffit.man + $(PERL) maketext MAN="$(MANPAGES)" $? > $@ + +psnup.$(MANEXT): psnup.man + $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ + +psresize.$(MANEXT): psresize.man + $(PERL) maketext MAN="$(MANPAGES)" PAPER=$(PAPER) $? > $@ + +psbook.$(MANEXT): psbook.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +psselect.$(MANEXT): psselect.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +pstops.$(MANEXT): pstops.man + $(PERL) maketext "MAN=$(MANPAGES)" PAPER=$(PAPER) $? > $@ + +psmerge.$(MANEXT): psmerge.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixfmps.$(MANEXT): fixfmps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixmacps.$(MANEXT): fixmacps.man + $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ + +fixpsditps.$(MANEXT): fixpsditps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixpspps.$(MANEXT): fixpspps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixscribeps.$(MANEXT): fixscribeps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixtpps.$(MANEXT): fixtpps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixwfwps.$(MANEXT): fixwfwps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixwpps.$(MANEXT): fixwpps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixwwps.$(MANEXT): fixwwps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +fixdlsrps.$(MANEXT): fixdlsrps.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +extractres.$(MANEXT): extractres.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +includeres.$(MANEXT): includeres.man + $(PERL) maketext "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $? > $@ + +getafm.$(MANEXT): getafm.man + $(PERL) maketext "MAN=$(MANPAGES)" $? > $@ + +clean: + rm -f *.o + +veryclean realclean: clean + rm -f $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.man install.include + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for i in $(BIN); do \ + echo Installing $$i; \ + $(INSTALL) $$i $(BINDIR); \ + $(CHMOD) u+w $(BINDIR)/$$i; \ + done + +install.script: $(PERLSCRIPTS) $(SHELLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for i in $(PERLSCRIPTS) $(SHELLSCRIPTS); do \ + echo Installing $$i; \ + $(INSTALL) $$i $(SCRIPTDIR); \ + $(CHMOD) u+w $(SCRIPTDIR)/$$i; \ + done + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for i in $(INCLUDES); do \ + echo Installing $$i; \ + $(INSTALLMAN) $$i $(INCLUDEDIR); \ + $(CHMOD) u+w $(INCLUDEDIR)/$$i; \ + done + +install.man: $(MANPAGES) + -mkdir $(MANDIR) + @for i in $(MANPAGES); do \ + echo Installing manual page for $$i; \ + $(INSTALLMAN) $$i $(MANDIR)/$$i; \ + done + diff --git a/Build/source/utils/psutils/Makefile.wat b/Build/source/utils/psutils/Makefile.wat new file mode 100644 index 00000000000..71e289d6742 --- /dev/null +++ b/Build/source/utils/psutils/Makefile.wat @@ -0,0 +1,108 @@ +# Makefile for PS utilities release 1 patchlevel 17 +# +# Copyright (C) Angus J. C. Duggan 1991-1996 +# See file LICENSE for details. +# +# updated AJCD 3/1/96 +# +# Multiple makefiles for different OSes are generated from a single master +# now. +# +# There are so many incompatible makes around that putting all of the +# non-standard targets explicitly seems to be the only way of ensuring +# portability. + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page +# psresize scales and moves pages to fit on different paper sizes + +PAPER=a4 + +# Makefile for PSUtils under MSDOS + +OS = DOS + +BINDIR = \psutils +SCRIPTDIR = $(BINDIR) +INCLUDEDIR = \psutils\include + +# Flags for Watcom C Compiler +CC = wcc386 +CFLAGS = -dPAPER=\"$(PAPER)\" -dMSDOS -zq -oxt + +BIN = psbook.exe psselect.exe pstops.exe epsffit.exe psnup.exe \ + psresize.exe +SHELLSCRIPTS = +PERLSCRIPTS = \ + \ + +MANPAGES = \ + \ + \ + \ + +INCLUDES = md68_0.ps md71_0.ps + +all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS) + +psutil.obj: psutil.h patchlev.h pserror.h psutil.c + +psspec.obj: psutil.h patchlev.h psspec.h pserror.h psspec.c + +pserror.obj: psutil.h patchlev.h pserror.h pserror.c + +epsffit.obj: epsffit.c pserror.h patchlev.h + +epsffit.exe: epsffit.obj pserror.obj + wcc386 -epsffite=epsffit.exe pserror.obj epsffit.obj + +psnup.exe: psnup.obj psutil.obj psspec.obj pserror.obj + wcc386 -psnupe=psnup.exe psutil.obj psspec.obj pserror.obj psnup.obj + +psnup.obj: psutil.h patchlev.h psspec.h pserror.h psnup.c + +psresize.exe: psresize.obj psutil.obj pserror.obj psspec.obj + wcc386 -psresizee=psresize.exe psutil.obj psspec.obj pserror.obj psresize.obj + +psresize.obj: psutil.h patchlev.h psspec.h pserror.h psresize.c + +psbook.exe: psbook.obj psutil.obj pserror.obj + wcc386 -psbooke=psbook.exe psutil.obj pserror.obj psbook.obj + +psbook.obj: psutil.h patchlev.h pserror.h psbook.c + +psselect.exe: psselect.obj psutil.obj pserror.obj + wcc386 -psselecte=psselect.exe psutil.obj pserror.obj psselect.obj + +psselect.obj: psutil.h patchlev.h pserror.h psselect.c + +pstops.exe: pstops.obj psutil.obj psspec.obj pserror.obj + wcc386 -pstopse=pstops.exe psutil.obj psspec.obj pserror.obj pstops.obj + +pstops.obj: psutil.h patchlev.h psspec.h pserror.h pstops.c + + + +clean: + del *.obj + +veryclean realclean: clean + del $(BIN) $(PERLSCRIPTS) $(MANPAGES) + +install: install.bin install.script install.include + +install.bin: $(BIN) + -mkdir $(BINDIR) + @for %1 in ( $(BIN) ) do copy %1 $(BINDIR) + +install.script: $(PERLSCRIPTS) + -mkdir $(SCRIPTDIR) + @for %1 in ( $(PERLSCRIPTS) ) do copy %1 $(SCRIPTDIR) + +install.include: $(INCLUDES) + -mkdir $(INCLUDEDIR) + @for %1 in ( $(INCLUDES) ) do copy %1 $(INCLUDEDIR) + diff --git a/Build/source/utils/psutils/README b/Build/source/utils/psutils/README new file mode 100644 index 00000000000..cc2018357d4 --- /dev/null +++ b/Build/source/utils/psutils/README @@ -0,0 +1,245 @@ +PostScript Utilities Angus Duggan 9th March 1997 + +This archive contains some utilities for manipulating PostScript documents. +Page selection and rearrangement are supported, including arrangement into +signatures for booklet printing, and page merging for n-up printing. + +ENVIRONMENT + +These utilities have been compiled and run on Sun-3 and Sun-4 machines under +SunOS Solaris 2.3, Solaris 2.1, 4.1.3, 4.1.2, 4.1.1 and 4.0.1, HP9000/375 +machines under HPUX 7.0 and HPUX 8.0, Sequent Symmetry machines under Dynix +3.1.4 and PTX 3.2.0, IBM RS/6000, VAX/VMS, Decstation 3100 machines under +Ultrix 4.0, SGI 4k5 under Irix 4.1 and 5.2, and x86 machines under MSDOS 6.0 +and Windows NT 3.5 and 4.0. + +FILES + +The files contained are: +-rw-r--r-- 1 angus 2317 Jun 19 1995 LICENSE +-rw-r--r-- 1 angus 2899 Mar 09 09:26 Makefile.bcc +-rw-r--r-- 1 angus 2915 Mar 09 09:26 Makefile.msc +-rw-r--r-- 1 angus 4135 Mar 09 09:26 Makefile.nt +-rw-r--r-- 1 angus 7146 Mar 09 09:26 Makefile.os2 +-rw-r--r-- 1 angus 2895 Mar 09 09:26 Makefile.sc +-rw-r--r-- 1 angus 6913 Mar 09 09:26 Makefile.unix +-rw-r--r-- 1 angus 11345 Mar 09 09:20 README +-rw-r--r-- 1 angus 678 Nov 02 1995 config.h +-rw-r--r-- 1 angus 2373 Jun 19 1995 descrip.mms +-rw-r--r-- 1 angus 5773 Mar 14 1996 epsffit.c +-rw-r--r-- 1 angus 1291 Nov 02 1995 epsffit.man +-rw-r--r-- 1 angus 1236 Nov 02 1995 extractres.man +-rw-r--r-- 1 angus 2780 Nov 02 1995 extractres.pl +-rw-r--r-- 1 angus 561 Nov 02 1995 fixdlsrps.man +-rw-r--r-- 1 angus 1554 Nov 02 1995 fixdlsrps.pl +-rw-r--r-- 1 angus 527 Nov 02 1995 fixfmps.man +-rw-r--r-- 1 angus 556 Nov 02 1995 fixfmps.pl +-rw-r--r-- 1 angus 644 Nov 02 1995 fixmacps.man +-rw-r--r-- 1 angus 2170 Nov 02 1995 fixmacps.pl +-rw-r--r-- 1 angus 556 Nov 02 1995 fixpsditps.man +-rw-r--r-- 1 angus 655 Nov 02 1995 fixpsditps.pl +-rw-r--r-- 1 angus 523 Nov 02 1995 fixpspps.man +-rw-r--r-- 1 angus 1298 Nov 02 1995 fixpspps.pl +-rw-r--r-- 1 angus 531 Nov 02 1995 fixscribeps.man +-rw-r--r-- 1 angus 434 Nov 02 1995 fixscribeps.pl +-rw-r--r-- 1 angus 553 Nov 02 1995 fixtpps.man +-rw-r--r-- 1 angus 663 Nov 02 1995 fixtpps.pl +-rw-r--r-- 1 angus 547 Nov 02 1995 fixwfwps.man +-rw-r--r-- 1 angus 826 Nov 02 1995 fixwfwps.pl +-rw-r--r-- 1 angus 533 Nov 02 1995 fixwpps.man +-rw-r--r-- 1 angus 699 Nov 02 1995 fixwpps.pl +-rw-r--r-- 1 angus 531 Nov 02 1995 fixwwps.man +-rw-r--r-- 1 angus 383 Nov 02 1995 fixwwps.pl +-rw-r--r-- 1 angus 711 Apr 06 1995 getafm.man +-rwxr-xr-x 1 angus 6482 Jun 19 1995 getafm.sh +-rw-r--r-- 1 angus 1107 Nov 02 1995 includeres.man +-rw-r--r-- 1 angus 1435 Nov 02 1995 includeres.pl +-rw-r--r-- 1 angus 1901 Jan 03 1996 maketext +-rw-r--r-- 1 angus 31406 Jun 19 1995 md68_0.ps +-rw-r--r-- 1 angus 35734 Jun 19 1995 md71_0.ps +-rw-r--r-- 1 angus 132 Nov 02 1995 patchlev.h +-rw-r--r-- 1 angus 2875 Nov 02 1995 psbook.c +-rw-r--r-- 1 angus 1156 Nov 02 1995 psbook.man +-rw-r--r-- 1 angus 3201 Nov 02 1995 pserror.c +-rw-r--r-- 1 angus 561 Nov 02 1995 pserror.h +-rw-r--r-- 1 angus 957 Nov 02 1995 psmerge.man +-rw-r--r-- 1 angus 2028 Nov 02 1995 psmerge.pl +-rw-r--r-- 1 angus 10396 Nov 02 1995 psnup.c +-rw-r--r-- 1 angus 4002 Nov 02 1995 psnup.man +-rw-r--r-- 1 angus 5379 Nov 02 1995 psresize.c +-rw-r--r-- 1 angus 1696 Nov 02 1995 psresize.man +-rw-r--r-- 1 angus 6096 Jun 05 1996 psselect.c +-rw-r--r-- 1 angus 2117 Mar 09 09:12 psselect.man +-rw-r--r-- 1 angus 7784 Dec 06 1995 psspec.c +-rw-r--r-- 1 angus 877 Feb 21 1996 psspec.h +-rw-r--r-- 1 angus 5159 Nov 02 1995 pstops.c +-rw-r--r-- 1 angus 4091 Nov 02 1995 pstops.man +-rw-r--r-- 1 angus 9323 Mar 04 13:41 psutil.c +-rw-r--r-- 1 angus 1494 Nov 02 1995 psutil.h +-rwxr-xr-x 1 angus 2685 Jun 19 1995 showchar.sh + + +PROGRAMS + +psbook rearranges pages into signatures +psselect selects pages and page ranges +pstops performs general page rearrangement and selection +psnup put multiple pages per physical sheet of paper +psresize alter document paper size +epsffit fits an EPSF file to a given bounding box + +psselect in modeled after Chris Torek's dviselect program, and pstops is +modeled after Tom Rokicki's dvidvi program. psbook is modeled on my own +dvibook program, which borrows heavily from Chris Torek's dviselect. + +SCRIPTS + +getafm (sh) outputs PostScript to retrieve AFM file from printer +showchar (sh) outputs PostScript to draw a character with metric info +fixdlsrps (perl) filter to fix DviLaser/PS output so that PSUtils works +fixfmps (perl) filter to fix framemaker documents so that psselect etc. work +fixmacps (perl) filter to fix Macintosh documents with saner version of md +fixpsditps (perl) filter to fix Transcript psdit documents to work with PSUtils +fixpspps (perl) filter to fix PSPrint PostScript so that psselect etc. work +fixscribeps (perl) filter to fix Scribe PostScript so that psselect etc. work +fixtpps (perl) filter to fix Troff Tpscript documents +fixwfwps (perl) filter to fix Word for Windows documents for PSUtils +fixwpps (perl) filter to fix WordPerfect documents for PSUtils +fixwwps (perl) filter to fix Windows Write documents for PSUtils +extractres (perl) filter to extract resources from PostScript files +includeres (perl) filter to include resources into PostScript files +psmerge (perl) hack script to merge multiple PostScript files + +INSTALLATION + +UUdecode md71_0.uue and md68_0.uue (if supplied encoded). Copy the most +appropriate makefile to "Makefile", and edit the copy to put in required paths +for BINDIR, SCRIPTDIR, MANDIR, INCLUDEDIR, and PERL. Alter values of MANEXT to +put the manual pages in a different section if desired, change PAPER to set +the default paper size, "make", and "make install". + +BUGS + +The utilities don't check for PS-Adobe-?.? conformance; they assume documents +conform. Utilities need an extra save/restore around whole document on a +SPARCPrinter with NeWSPrint 1.0, because of bugs in the xnews server. + +Bug fixes and suggestions to angus@harlequin.co.uk + +UPDATES + +The definitive archive sites for PSUtils updates are ftp.dcs.ed.ac.uk, in the +directory pub/ajcd/, and ftp.tardis.ed.ac.uk, in the directory users/ajcd. The +latest version will be in psutils.tar.gz older versions may also be in +psutils-*.tar.gz + +NOTE + +This is an interim release; these utilities are currently being re-written +from scratch, with a full DSC-3.0 parser and more extraction, merging, and +inclusion options included. + +WINDOWS USERS + +*Please* make sure that you have selected "Generate DSC Comments" in your +printer driver setup. These utilities need DSC comments to tell where page +boundaries are. + +DVIPS USERS + +The latest versions of dvips have changed the default setting of the DSC +comment flag; you must generate with DSC comments for PSUtils to work. + +ACKNOWLEDGEMENTS + +Bug fixes and suggestions for improvements to PSUtils have come from many +people, including: + + Brian Colfer brianc@labmed.ucsf.edu + Charles A. Finnell finnell@org.mitre.lear + Conrad Kimball cek@com.boeing.sdc + J.W.Hawtin + Jochen Schwarze schwarze@de.isa + Ken Carpenter khc@edu.ksu.eece + Kristian Jorg etxkrjg@se.ericsson.solsta + Larry Weissman larryw@nsr.bioeng.washington.edu + Michael L. Brown brown@wi.extrel.com + Hunter Goatley goathunter@wkuvx1.bitnet + John Interrante interran@uluru.Stanford.edu + Maurizio Cremonesi MAUCREM@imiclvx.earn + Matthew Stier Matthew.Stier@East.Sun.com + Gerry Pratt cca13@seq1.kl.ac.uk + Robert Joop rj@rainbow.in-berlin.de + Johan Vromans jv@mh.nl + Bryan Faubion bryanf@tc.fluke.com + Chris Ritson C.R.Ritson@ncl.ac.uk + Michele Marziani MARZIANI@VAXFE.INFN.IT + Michael I. Schwartz mschwart@diana.cair.du.edu + Chris Ritson C.R.Ritson@newcastle.ac.uk + Joerg Eisenreich + Anreas Borchert borchert@mathematik.uni-ulm.de + Mike Coleman + Dale Scheetz dwarf@polaris.net + Yves Arrouye arrouye@marin.fdn.fr + +(Apologies to anyone who I have left out, it was not intentional.) + +NEWS + +Patchlevel 11 contains some significant enhancements to PSUtils, in +preparation for the eventual release of version 2 (don't hold your breath +waiting for it). These include: + +* Specify paper sizes by name for pstops and psnup. +* Psnup re-written in C to be much more versatile (do any number n-up). +* Epsffit can input broken %%BoundingBox comments which use real numbers. +* Should work on MSDOS and VMS machines as well as Unix. +* Accept more DSC compliant documents (Page labels are better supported). + +Patchlevel 12 was a bug-fix release. + +* Long standing fixmacps bug fixed. +* fixwfwps fixes WFW EPSF files as well as DSC files. +* md71_0.ps and md68_0.ps files were automatically uudecoded. + +Patchlevel 13 contained two new scripts for resource management, and fixes to +the Makefile, page labels, and output chaining. + +* Epsffit can output to a file as well as standard output. +* extractres takes resources out of PostScript files and saves them +* includeres puts resources from a resource library into PostScript files. +* maketext script is now used to do substitutions in Perl scripts and man pages +* page labels in psnup and pstops now show where pages came from. +* page labels in psbook and psselect fixed. +* prologues fixed to be extractable and re-usable +* Makefile doesn't use SUFFIXES any more +* pstops and psnup output can now be chained through each other. +* psresize alters the paper size used by a document +* patchlevel.h shortened to patchlev.h as a concession to MSDOS +* psnup now has -n nup form for compatibility with other n-up programs + +Patchlevel 14 has some minor bug fixes. + +* psselect can take end-relative page ranges +* Makefiles restructured to generate machine specific versions from one source +* MSDOS, Windows NT and OS/2 support +* corrections to psbook output for empty pages when rearranging pstops output + +Patchlevel 15 was a stabilisation release + +* All code converted to ANSI C, improved error and warning procedures +* Portability fixes in the Makefiles +* psnup can take different sized input and output pages +* Minor fixes to fixwpps script +* psselect reversed pages fixed +* maketext and fix scripts updated for Perl 5 + +Patchlevel 16 was a minor bugfix release + +* Piped output and input works correctly in NT + +Patchlevel 17 had some minor bugfixes and improvements + +* Trailer information now put before %%EOF comments if no %%Trailer +* psselect can now add blank pages. +* Piped input works in Linux diff --git a/Build/source/utils/psutils/config.h b/Build/source/utils/psutils/config.h new file mode 100644 index 00000000000..13562326755 --- /dev/null +++ b/Build/source/utils/psutils/config.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * OS specific configuration for PSUtils + */ + +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) +#define TMPDIR "\\tmp" +#define OPEN_READ "rb" +#define OPEN_WRITE "wb" +#include <fcntl.h> +#include <io.h> +#ifdef WIN32 +#include <win32lib.h> +#endif /* WIN32 */ +#else /* ! MSDOS && ! WINNT && ! WIN32 */ +#if defined(OS2) +#define TMPDIR "." +#define OPEN_READ "rb" +#define OPEN_WRITE "wb" +#else /* ! OS2 */ +#define OPEN_READ "r" +#define OPEN_WRITE "w" +#ifdef VMS +#define unlink delete +#define TMPDIR "/tmp" +#else /* assumes UNIX-like OS */ +#include <unistd.h> +#define TMPDIR "/tmp" +#endif /* ! VMS */ +#endif /* ! OS2 */ +#endif /* ! MSDOS && ! WINNT && !WIN32 */ + diff --git a/Build/source/utils/psutils/configure b/Build/source/utils/psutils/configure new file mode 100755 index 00000000000..f9674a24d46 --- /dev/null +++ b/Build/source/utils/psutils/configure @@ -0,0 +1,1317 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-multiplatform put executables in bin/PLATFORM" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=psutil.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in ../../config $srcdir/../../config; do + if test -f $ac_dir/install-sh; then + case $ac_dir in + /*|[A-z]:/*) ac_aux_dir=$ac_dir;; + *) ac_aux_dir=`pwd`/$ac_dir;; + esac + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + case $ac_dir in + /*|[A-z]:/*) ac_aux_dir=$ac_dir;; + *) ac_aux_dir=`pwd`/$ac_dir;; + esac + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../../config $srcdir/../../config" 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:557: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test $ac_x $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:588: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test $ac_x $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:640: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test $ac_x $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:673: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 684 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:715: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:720: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:748: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:780: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 795 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 812 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 829 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:860: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:892: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + # Hack for MSDOS and descendants. + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test $ac_x $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:947: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:981: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +# Check whether --enable-multiplatform or --disable-multiplatform was given. +if test "${enable_multiplatform+set}" = set; then + enableval="$enable_multiplatform" + if test "x$enable_multiplatform" = xyes && + test "x$bindir" = 'x${exec_prefix}/bin' +then + bindir="$bindir/$host" +fi +fi + +test "x$enable_multiplatform" = xyes && export enable_multiplatform + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012\015' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile patchlev.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@CPP@%$CPP%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@SET_MAKE@%$SET_MAKE%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile patchlev.h"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*|[A-z]:/*) # Absolute path. + srcdir="$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + "") ;; + [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"` + # Replace lines of the form ac_include foo with the contents of foo: + # first, from the ac_include lines construct a list of file names. + # From that list, we construct a second list of those files that exist. + # Then we construct lists of sed commands for including those files, + # and a sed command that removes the ac_include lines. We don't attempt + # to read non-existent files because some (buggy) versions of sed choke + # on this. Have to use sed because old (Ultrix, SunOS) awk does not support + # getline or system. (Anyway, configure scripts aren't supposed to use awk.) + # Can't use only one -e and commands {dr foo} because foo has to be last. + # Be careful, because the filename may contain /. Be careful with + # whitespace; we need to use echo. + # + # No support for the multiple-output file :-separated stuff. + # + file_substs=`sed -n \ +'/^ac_include/s%ac_include[ ]*\(.*\)%\1%p' \ + "$ac_given_srcdir/$ac_file_in"` + # Create the sed command line ... + file_subst_cmd='sed' + for ac_inc in $file_substs; do + if test -f "$ac_given_srcdir/$ac_inc"; then + ac_mung=`echo $ac_inc | sed 's,/,%,g'` + file_subst_cmd="$file_subst_cmd -e '/^ac_include $ac_mung$/r $ac_inc'" + fi + done + file_subst_cmd="$file_subst_cmd -e '/^ac_include/d'" + # ... and fix the whitespace and escaped slashes. + file_subst_cmd=`echo "$file_subst_cmd" | sed -e 's,%,\\\/,g' \ +-e 's/ac_include /ac_include[ ]*/g'` + # cd into the srcdir because the files being included more or less + # must be part of the distribution. I can't find any way to do + # variable substitution in the sed commands (so the user could have, + # e.g., $top_srcdir in their ac_include line). + (cd $ac_given_srcdir && eval $file_subst_cmd $ac_file_in) \ + | sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/Build/source/utils/psutils/configure.in b/Build/source/utils/psutils/configure.in new file mode 100644 index 00000000000..31a1999d864 --- /dev/null +++ b/Build/source/utils/psutils/configure.in @@ -0,0 +1,14 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(psutil.c) + +AC_CONFIG_AUX_DIR(../../config) + +AC_PROG_CC +AC_PROG_CPP +AC_ISC_POSIX +AC_PROG_INSTALL +AC_SET_MAKE + +sinclude(../../multiplatform.ac) + +AC_OUTPUT(Makefile patchlev.h) diff --git a/Build/source/utils/psutils/depend.mak b/Build/source/utils/psutils/depend.mak new file mode 100644 index 00000000000..f658d60aa68 --- /dev/null +++ b/Build/source/utils/psutils/depend.mak @@ -0,0 +1,58 @@ +$(objdir)/psutil.obj: \ + psutil.h \ + config.h \ + pserror.h \ + patchlev.h + +$(objdir)/psselect.obj: \ + psutil.h \ + config.h \ + pserror.h \ + patchlev.h + +$(objdir)/psspec.obj: \ + psutil.h \ + config.h \ + psspec.h \ + pserror.h \ + patchlev.h + +$(objdir)/psresize.obj: \ + psutil.h \ + config.h \ + psspec.h \ + pserror.h \ + patchlev.h + +$(objdir)/pserror.obj: \ + psutil.h \ + config.h \ + pserror.h \ + patchlev.h + +$(objdir)/psnup.obj: \ + psutil.h \ + config.h \ + psspec.h \ + pserror.h \ + patchlev.h + +$(objdir)/pstops.obj: \ + psutil.h \ + config.h \ + psspec.h \ + pserror.h \ + patchlev.h + +$(objdir)/psbook.obj: \ + psutil.h \ + config.h \ + pserror.h \ + patchlev.h + +$(objdir)/epsffit.obj: \ + psutil.h \ + config.h \ + pserror.h \ + patchlev.h + diff --git a/Build/source/utils/psutils/descrip.mms b/Build/source/utils/psutils/descrip.mms new file mode 100644 index 00000000000..f3f98e5cdac --- /dev/null +++ b/Build/source/utils/psutils/descrip.mms @@ -0,0 +1,63 @@ +# +# VMS MMS build file for PS utilities +# +# Hunter Goatley, 16-MAR-1993 14:47 +# +CFLAGS = /NOLIST/OBJECT=$(MMS$TARGET) +LFLAGS = /NOTRACE/EXEC=$(MMS$TARGET) + +.IFDEF __ALPHA__ #If building with Alpha cross-compilers, OBJ +OPTIONS_FILE = #... is defined already +LINKOPT = +CFLAGS = /NOLIST/OBJECT=$(MMS$TARGET)/STANDARD=VAXC +.ELSE +OBJ = .OBJ +EXE = .EXE +OPTIONS_FILE = ,VAXC.OPT +LINKOPT = $(options_file)/OPTIONS +.ENDIF + +# epsffit fits an epsf file to a given bounding box +# psbook rearranges pages into signatures +# psselect selects page ranges +# pstops performs general page rearrangement and merging +# psnup puts multiple logical pages on one physical page + +all : psbook$(exe), psselect$(exe), pstops$(exe), epsffit$(exe), psnup$(exe), psresize$(exe) + @ write sys$output "PSUTILS build complete" + +epsffit$(exe) : epsffit$(obj), pserror$(obj) + $(LINK)$(LFLAGS) epsffit$(obj),pserror$(obj)$(linkopt) + +psnup$(exe) : psnup$(obj), psutil$(obj), psspec$(obj), pserror$(obj) + $(LINK)$(LFLAGS) psnup$(obj),psutil$(obj),psspec$(obj),pserror$(obj)$(linkopt) + +psresize$(exe) : psresize$(obj), psutil$(obj), psspec$(obj), pserror$(obj) + $(LINK)$(LFLAGS) psresize$(obj),psutil$(obj),psspec$(obj),pserror$(obj)$(linkopt) + +psbook$(exe) : psbook$(obj), psutil$(obj)$(options_file), pserror$(obj) + $(LINK)$(LFLAGS) psbook$(obj),psutil$(obj),pserror$(obj)$(linkopt) + +psselect$(exe) : psselect$(obj), psutil$(obj), pserror$(obj) + $(LINK)$(LFLAGS) psselect$(obj),psutil$(obj),pserror$(obj)$(linkopt) + +pstops$(exe) : pstops$(obj), psutil$(obj), psspec$(obj), pserror$(obj) + $(LINK)$(LFLAGS) pstops$(obj),psutil$(obj),psspec$(obj),pserror$(obj)$(linkopt) + +psnup$(obj) : psnup.c, psutil.h patchlev.h psspec.h pserror.h + +psresize$(obj) : psresize.c, psutil.h patchlev.h psspec.h pserror.h + +psbook$(obj) : psbook.c, psutil.h patchlev.h pserror.h + +pstops$(obj) : pstops.c, psutil.h patchlev.h psspec.h pserror.h + +psutil$(obj) : psutil.c, psutil.h patchlev.h pserror.h + +psselect$(obj) : psselect.c, psutil.h patchlev.h pserror.h + +psspec$(obj) : psspec.c, psutil.h patchlev.h psspec.h pserror.h + +clean : + delete/log *$(obj);*,psnup$(exe);*,psresize$(exe);*,psbook$(exe);*,- + psselect$(exe);*,pstops$(exe);*,epsffit$(exe);* diff --git a/Build/source/utils/psutils/epsffit.c b/Build/source/utils/psutils/epsffit.c new file mode 100644 index 00000000000..c31eaece28f --- /dev/null +++ b/Build/source/utils/psutils/epsffit.c @@ -0,0 +1,190 @@ +/* epsffit.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * fit epsf file into constrained size + * Usage: + * epsffit [-c] [-r] [-a] [-s] llx lly urx ury [infile [outfile]] + * -c centres the image in the bounding box given + * -r rotates the image by 90 degrees anti-clockwise + * -a alters the aspect ratio to fit the bounding box + * -s adds a showpage at the end of the image + * + * Added filename spec (from Larry Weissman) 5 Feb 93 + * Accepts double %%BoundingBox input, outputs proper BB, 4 Jun 93. (I don't + * like this; developers should read the Big Red Book before writing code which + * outputs PostScript. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +#include "psutil.h" +#include "pserror.h" +#include "patchlev.h" +#include "config.h" + +#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#define MAX(x,y) ((x) > (y) ? (x) : (y)) + +char *program; + +static void usage(void) +{ + fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); + fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); + fprintf(stderr, "Usage: %s [-c] [-r] [-a] [-s] llx lly urx ury [infile [outfile]]\n", + program); + exit(1); +} + +void main(int argc, char **argv) +{ + int bbfound = 0; /* %%BoundingBox: found */ + int urx, ury, llx, lly; + int furx, fury, fllx, flly; + int showpage = 0, centre = 0, rotate = 0, aspect = 0, maximise = 0; + char buf[BUFSIZ]; + FILE *input; + FILE *output; + + program = *argv++; argc--; + + while (argc > 0 && argv[0][0] == '-') { + switch (argv[0][1]) { + case 'c': centre = 1; break; + case 's': showpage = 1; break; + case 'r': rotate = 1; break; + case 'a': aspect = 1; break; + case 'm': maximise = 1; break; + case 'v': + default: usage(); + } + argc--; + argv++; + } + + if (argc < 4 || argc > 6) usage(); + fllx = atoi(argv[0]); + flly = atoi(argv[1]); + furx = atoi(argv[2]); + fury = atoi(argv[3]); + + if (argc > 4) { + if(!(input = fopen(argv[4], OPEN_READ))) + message(FATAL, "can't open input file %s\n", argv[4]); + } else { +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + int fd = fileno(stdin) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdin to binary mode\n"); +#endif + input = stdin ; + } + + if (argc > 5) { + if(!(output = fopen(argv[5], OPEN_WRITE))) + message(FATAL, "can't open output file %s\n", argv[5]); + } else { +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + int fd = fileno(stdout) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdout to binary mode\n"); +#endif + output = stdout ; + } + + while (fgets(buf, BUFSIZ, input)) { + if (buf[0] == '%' && (buf[1] == '%' || buf[1] == '!')) { + /* still in comment section */ + if (!strncmp(buf, "%%BoundingBox:", 14)) { + double illx, illy, iurx, iury; /* input bbox parameters */ + if (sscanf(buf, "%%%%BoundingBox:%lf %lf %lf %lf\n", + &illx, &illy, &iurx, &iury) == 4) { + bbfound = 1; + llx = (int)illx; /* accept doubles, but convert to int */ + lly = (int)illy; + urx = (int)(iurx+0.5); + ury = (int)(iury+0.5); + } + } else if (!strncmp(buf, "%%EndComments", 13)) { + strcpy(buf, "\n"); /* don't repeat %%EndComments */ + break; + } else fputs(buf, output); + } else break; + } + + if (bbfound) { /* put BB, followed by scale&translate */ + int fwidth, fheight; + double xscale, yscale; + double xoffset = fllx, yoffset = flly; + double width = urx-llx, height = ury-lly; + + if (maximise) + if ((width > height && fury-flly > furx-fllx) || + (width < height && fury-flly < furx-fllx)) + rotate = 1; + + if (rotate) { + fwidth = fury - flly; + fheight = furx - fllx; + } else { + fwidth = furx - fllx; + fheight = fury - flly; + } + + xscale = fwidth/width; + yscale = fheight/height; + + if (!aspect) { /* preserve aspect ratio ? */ + xscale = yscale = MIN(xscale,yscale); + } + width *= xscale; /* actual width and height after scaling */ + height *= yscale; + if (centre) { + if (rotate) { + xoffset += (fheight - height)/2; + yoffset += (fwidth - width)/2; + } else { + xoffset += (fwidth - width)/2; + yoffset += (fheight - height)/2; + } + } + fprintf(output, + "%%%%BoundingBox: %d %d %d %d\n", (int)xoffset, (int)yoffset, + (int)(xoffset+(rotate ? height : width)), + (int)(yoffset+(rotate ? width : height))); + if (rotate) { /* compensate for original image shift */ + xoffset += height + lly * yscale; /* displacement for rotation */ + yoffset -= llx * xscale; + } else { + xoffset -= llx * xscale; + yoffset -= lly * yscale; + } + fputs("%%EndComments\n", output); + if (showpage) + fputs("save /showpage{}def /copypage{}def /erasepage{}def\n", output); + else + fputs("%%BeginProcSet: epsffit 1 0\n", output); + fputs("gsave\n", output); + fprintf(output, "%.3f %.3f translate\n", xoffset, yoffset); + if (rotate) + fputs("90 rotate\n", output); + fprintf(output, "%.3f %.3f scale\n", xscale, yscale); + if (!showpage) + fputs("%%EndProcSet\n", output); + } + do { + fputs(buf, output); + } while (fgets(buf, BUFSIZ, input)); + if (bbfound) { + fputs("grestore\n", output); + if (showpage) + fputs("restore showpage\n", output); /* just in case */ + } else + message(FATAL, "no %%%%BoundingBox:\n"); + + exit(0); +} diff --git a/Build/source/utils/psutils/epsffit.man b/Build/source/utils/psutils/epsffit.man new file mode 100644 index 00000000000..9f1bf66beb1 --- /dev/null +++ b/Build/source/utils/psutils/epsffit.man @@ -0,0 +1,51 @@ +.TH EPSFFIT 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +epsffit \- fit encapsulated PostScript file (EPSF) into constrained size +.SH SYNOPSIS +.B epsffit +[ +.B \-c +] [ +.B \-r +] [ +.B \-a +] [ +.B \-m +] [ +.B \-s +] +.I "llx lly urx ury" +[ +.B infile +[ +.B outfile +] ] +.SH DESCRIPTION +.I Epsffit +fits an EPSF file (encapsulated PostScript) to a given bounding box. +The coordinates of the box are given by \fB(llx,lly)\fR for the lower +left, and \fB(urx,ury)\fR for the upper right, in PostScript units (points). +.PP +If no input or output files are specified, +.I epsffit +read from the standard input and writes to the standard output. +.SH OPTIONS +.IP \fB\-c\fP 1i +Center the image in the given bounding box. +.IP \fB\-r\fP 1i +Rotate the image by 90 degrees counter-clockwise. +.IP \fB\-a\fP 1i +Adjust the aspect ratio to fit the bounding box. The default is to preserve +the aspect ratio. +.IP \fB\-m\fP 1i +Rotates the image to maximise the size if it would fit the specified bounding +box better. +.IP \fB\-s\fP 1i +Add a \fIshowpage\fP at the end of the file to force the image to print. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/extractres.man b/Build/source/utils/psutils/extractres.man new file mode 100644 index 00000000000..e0702233827 --- /dev/null +++ b/Build/source/utils/psutils/extractres.man @@ -0,0 +1,47 @@ +.TH EXTRACTRES 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +extractres \- filter to extract resources from a PostScript document +.SH SYNOPSIS +.B extractres +[ +.B \-m +] < +.I document.ps +> +.I output.ps +.SH DESCRIPTION +.I Extractres +extracts resources (fonts, procsets, patterns, files, etc) appearing in a +PostScript document, and puts appropriate +.I %%IncludeResource +comments in the document prologue. The extracted resources are written to +files with the same name as the resource, and an appropriate extension. The +pipeline +.sp +.ce +extractres file.ps | includeres >out.ps +.sp +will move all resources appearing in a document to the document prologue, +removing redundant copies. The output file can then be put through page +re-arrangement filters such as +.I psnup +or +.I pstops +safely. +.PP +The +.B \-m +option combines the resources of the same name into one file; this must be +used for some programs which download fonts a bit at a time. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I extractres +does not alter the +.I %%DocumentSuppliedResources +comments. diff --git a/Build/source/utils/psutils/extractres.pl b/Build/source/utils/psutils/extractres.pl new file mode 100644 index 00000000000..d7520c47d33 --- /dev/null +++ b/Build/source/utils/psutils/extractres.pl @@ -0,0 +1,96 @@ +@PERL@ +# extractres: extract resources from PostScript file +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$prog = ($0 =~ s=.*/==); + +%resources = (); # list of resources included +%merge = (); # list of resources extracted this time +%extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns + "pattern", ".pat", "form", ".frm", "encoding", ".enc"); +%type = ("%%BeginFile:", "file", "%%BeginProcSet:", "procset", + "%%BeginFont:", "font"); # resource types + +while (@ARGV) { + $_ = shift; + if (/^-m(erge)?$/) { $merge = 1; } + elsif (/^-/) { + print STDERR "Usage: $prog [-merge] [file]\n"; + exit 1; + } else { + unshift(@ARGV, $_); + last; + } +} + +if (defined($ENV{TMPDIR})) { # set body file name + $body = "$ENV{TMPDIR}/body$$.ps"; +} else { + $body = "body$$.ps"; +} + +open(BODY, $body) && die "Temporary file $body already exists"; +open(BODY, ">$body") || die "Can't write file $body"; + +sub filename { # make filename for resource in @_ + local($name); + foreach (@_) { # sanitise name + s/[!()\$\#*&\\\|\`\'\"\~\{\}\[\]\<\>\?]//g; + $name .= $_; + } + $name =~ s@.*/@@; # drop directories + die "Filename not found for resource ", join(" ", @_), "\n" + if $name =~ /^$/; + $name; +} + +$output = STDOUT; # start writing header out +while (<>) { + if (/^%%BeginResource:/ || /^%%BeginFont:/ || /^%%BeginProcSet:/) { + local($comment, @res) = split(/\s+/); # look at resource type + local($type) = defined($type{$comment}) ? $type{$comment} : shift(@res); + local($name) = &filename(@res, $extn{$type}); # make file name + $saveout = $output; + if (!$resources{$name}) { + print "%%IncludeResource: $type ", join(" ", @res), "\n"; + if (!open(RES, $name)) { + open(RES, ">$name") || die "Can't write file $name"; + $resources{$name} = $name; + $merge{$name} = $merge; + $output = RES; + } else { # resource already exists + close(RES); + undef $output; + } + } elsif ($merge{$name}) { + open(RES, ">>$name") || die "Can't append to file $name"; + $output = RES; + } else { # resource already included + undef $output; + } + } elsif (/^%%EndResource/ || /^%%EndFont/ || /^%%EndProcSet/) { + if (defined $output) { + print $output $_; + close($output); + } + $output = $saveout; + next; + } elsif ((/^%%EndProlog/ || /^%%BeginSetup/ || /^%%Page:/)) { + $output = BODY; + } + print $output $_ + if defined $output; +} + +close(BODY); # close body output file + +open(BODY, $body); # reopen body for input +while (<BODY>) { # print it all + print $_; +} +close(BODY); + +unlink($body); # dispose of body file +@END@ diff --git a/Build/source/utils/psutils/fixdlsrps.man b/Build/source/utils/psutils/fixdlsrps.man new file mode 100644 index 00000000000..d392691cc83 --- /dev/null +++ b/Build/source/utils/psutils/fixdlsrps.man @@ -0,0 +1,24 @@ +.TH FIXDLSRPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixdlsrps \- filter to fix DviLaser/PS documents to work with PSUtils +.SH SYNOPSIS +.B fixdlsrps +< +.I dvilaser.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixdlsrps +is a +.I perl +filter which "fixes" PostScript generated from the DviLaser/PS driver so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixdlsrps.pl b/Build/source/utils/psutils/fixdlsrps.pl new file mode 100644 index 00000000000..324109d1b50 --- /dev/null +++ b/Build/source/utils/psutils/fixdlsrps.pl @@ -0,0 +1,54 @@ +@PERL@ +# fixdlsrps: fix DviLaser/PS document to work with PSUtils +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$nesting = 0; +$page = 1; +$infont = 0; + +@fonts = (); +@body = (); +$header = 1; + +while (<>) { + if (/^XP/) { + $infont++; + push(@fonts, $_); + $infont-- if /PXL.*RP/ || /DN?F.*RP/; + } elsif ($infont) { + push(@fonts, $_); + $infont-- if /PXL.*RP/ || /DN?F.*RP/; + } elsif ((/^%%EndSetup/ || /^%%Page:/) && $header) { + print @body; + @body = ("%%EndSetup\n"); + $header = 0; + } elsif (/^%%EndProlog/ && !$nesting) { + push(@body, + "\$DviLaser begin/GlobalMode{}bdef/LocalMode{}bdef/XP{}def/RP{}def", + "/DoInitialScaling{72.0 Resolution div dup scale}bdef end\n", $_); + } elsif (/^%%BeginPageSetup/ && !$nesting) { + push(@body, "%%Page: $page $page\n", $_, + "Resolution 72 div dup scale Magnification 1000 div dup scale\n", + "/DocumentInitState where {\n", + "/DocumentInitState [ matrix currentmatrix currentlinewidth", + " currentlinecap currentlinejoin currentdash currentgray", + " currentmiterlimit] cvx put}if\n"); + $page++; + } elsif (/^%%BeginDocument:/ || /^%%BeginBinary:/ || /^%%BeginFile:/) { + push(@body, $_); + $nesting++; + } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { + push(@body, $_); + $nesting--; + } elsif (!/^%%PageBoundingBox:/ && !/^%%Page:/) { + push(@body, $_); + } +} + +print @fonts; +print @body; + +exit 0; +@END@ diff --git a/Build/source/utils/psutils/fixfmps.man b/Build/source/utils/psutils/fixfmps.man new file mode 100644 index 00000000000..2276cfd052e --- /dev/null +++ b/Build/source/utils/psutils/fixfmps.man @@ -0,0 +1,24 @@ +.TH FIXFMPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixfmps \- filter to fix Framemaker documents so PSUtils work +.SH SYNOPSIS +.B fixfmps +< +.I Framemaker.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixfmps +is a +.I perl +filter which "fixes" PostScript from Framemaker so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixfmps.pl b/Build/source/utils/psutils/fixfmps.pl new file mode 100644 index 00000000000..f09a3c04b40 --- /dev/null +++ b/Build/source/utils/psutils/fixfmps.pl @@ -0,0 +1,21 @@ +@PERL@ +# fixfmps: get conforming PostScript out of FrameMaker version 2 file +# move all FMDEFINEFONTs to start of pages +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +%fonts=(); + +while (<>) { + if (/^([0-9]+) [0-9]+ .* FMDEFINEFONT$/) { + $fonts{$1} = $_; + } elsif (/^[0-9.]+ [0-9.]+ [0-9]+ FMBEGINPAGE$/) { + print $_, join('',values(%fonts)); + } elsif (m%(.*/PageSize \[paperwidth paperheight\]put )setpagedevice(.*)%) { + print "$1pop$2\n"; + } else { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/fixmacps.man b/Build/source/utils/psutils/fixmacps.man new file mode 100644 index 00000000000..ce0ae891e66 --- /dev/null +++ b/Build/source/utils/psutils/fixmacps.man @@ -0,0 +1,27 @@ +.TH FIXMACPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixmacps \- filter to fix Macintosh documents with saner version of md +.SH SYNOPSIS +.B fixmacps +< +.I Macintosh.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixmacps +is a +.I perl +filter which "fixes" PostScript generated from a Macintosh PC +that it works correctly with Angus Duggan's +.B psutils +package. +.SH FILES +md68_0.ps, md71_0.ps - sanitised versions of the md +prologue. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixmacps.pl b/Build/source/utils/psutils/fixmacps.pl new file mode 100644 index 00000000000..9dcdb8517ce --- /dev/null +++ b/Build/source/utils/psutils/fixmacps.pl @@ -0,0 +1,95 @@ +@PERL@ +# fixmacps: swap to sanitised appledict +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$line = 0; # keep line count +$predir = `kpsewhich -progname=psutils md71_0.ps`; +$dir=`basename $predir`; +$prefix = "md"; +$default = "md71_0.ps"; + +while ($_ = shift(@ARGV)) { + if (/^-d(ir)?$/) { $dir = shift(@ARGV); } + elsif (/^-n(ame)?$/) { $prefix = shift(@ARGV); } + else { + unshift(@ARGV, $_); + last; + } +} + +%fonts = (); +$nesting = 0; + +while (<>) { + if (/^%!/) { + if (! $line) { + print; + } + } elsif (/^%%(Begin|Include)ProcSet: "?\(AppleDict md\)"? ([0-9]+) ([0-9]+)$/) { + local($inc, $mdv, $mdr) = ($1, $2, $3); + if (open(SANE, "<$dir/$prefix${mdv}_$mdr.ps") || + open(SANE, "<$dir/$default")) { + $sane = <SANE>; + local($snv, $snr) = + $sane =~ /^%%BeginProcSet: \(AppleDict md\) ([0-9]+) ([0-9]+)$/; + if ($mdv == $snv && $mdr == $snr) { + if ( $inc eq "Include" ) { + print STDERR "Inserting ProcSet \"(AppleDict md)\" $snv $snr\n"; + print $sane; + while(<SANE>) { + print; + } + close(SANE); + } + else { + print STDERR "Substituting ProcSet \"(AppleDict md)\" $snv $snr\n"; + $ignore = 1; + } + } else { + print STDERR "Unrecognised AppleDict version $mdv $mdr\n"; + print "%!\n" if !$line; + print; + } + } else { + print STDERR "Can't find sanitised AppleDict\n"; + print "%!\n" if !$line; + print; + } + } elsif (/^%%EndProcSet/) { + if ($ignore) { + $ignore = 0; + print "%!\n" if !$line; + print $sane; + while(<SANE>) { + print; + } + close(SANE); + } else { + print "%!\n" if !$line; + print; + } + } elsif (/^%%Page:/ && $nesting == 0) { + print $_; + print values(%fonts); + } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) { + print $_; + $nesting++; + } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { + print $_; + $nesting--; + } else { + if (! $ignore) { + if (/^\{\}mark .*rf$/) { + $fonts{$_} = $_; + print; + } else { + print "%!\n" if !$line; + print; + } + } + } + $line++; +} +@END@ diff --git a/Build/source/utils/psutils/fixpsditps.man b/Build/source/utils/psutils/fixpsditps.man new file mode 100644 index 00000000000..7ff19b34c51 --- /dev/null +++ b/Build/source/utils/psutils/fixpsditps.man @@ -0,0 +1,24 @@ +.TH FIXPSDITPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixpsditps \- filter to fix Transcript psdit documents so PSUtils work +.SH SYNOPSIS +.B fixpsditps +< +.I psdit.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixpsditps +is a +.I perl +filter which "fixes" PostScript from Transcript's psdit program so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixpsditps.pl b/Build/source/utils/psutils/fixpsditps.pl new file mode 100644 index 00000000000..a9008f58408 --- /dev/null +++ b/Build/source/utils/psutils/fixpsditps.pl @@ -0,0 +1,25 @@ +@PERL@ +# fixpsditps: fix psdit output for use in psutils +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$nesting = 0; + +while (<>) { + if (/^\/p{pop showpage pagesave restore \/pagesave save def}def$/) { + print "/p{pop showpage pagesave restore}def\n"; + } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/ ) { + print $_; + $nesting++; + } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { + print $_; + $nesting--; + } elsif (/^%%Page:/ && $nesting == 0) { + print $_; + print "xi\n"; + } elsif (! /^xi$/) { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/fixpspps.man b/Build/source/utils/psutils/fixpspps.man new file mode 100644 index 00000000000..9a6ed98c87c --- /dev/null +++ b/Build/source/utils/psutils/fixpspps.man @@ -0,0 +1,24 @@ +.TH FIXPSPPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixpspps \- filter to fix PSPrint PostScript so PSUtils work +.SH SYNOPSIS +.B fixpspps +< +.I PSPrint.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixpspps +is a +.I perl +filter which "fixes" PostScript from PSPrint so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixpspps.pl b/Build/source/utils/psutils/fixpspps.pl new file mode 100644 index 00000000000..c10c93e7666 --- /dev/null +++ b/Build/source/utils/psutils/fixpspps.pl @@ -0,0 +1,58 @@ +@PERL@ +# mangle PostScript produced by PSPrint to make it almost conforming +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$header = 1; $ignore = 0; +$verbose = 0; +@body = (); +%fonts = (); $font = ""; +$inchar = 0; @char = (); + +while (<>) { + if (/^\@end$/) { + $ignore = 1; + } elsif (/^[0-9]+ \@bop0$/) { + $ignore = 0; + $header = 1; + } elsif ($header) { + if (/^\/([a-z.0-9]+) \@newfont$/) { + if (! defined($fonts{$1})) { + $fonts{$1} = 1; + print; + } elsif ($verbose) { + print STDERR "$font already defined\n"; + } + } elsif (/^([a-z.0-9]+) sf$/) { + $font = $1; + print; + } elsif (/^\[</) { + $inchar = 1; + push (@char, $_); + } elsif ($inchar) { + push (@char, $_); + if (/.*\] ([0-9]+) dc$/) { + if (! defined($fonts{$font,$1})) { + $fonts{$font,$1} = 1; + print (@char); + } elsif ($verbose) { + print STDERR "$font character $1 already defined\n"; + } + $inchar = 0; + @char = (); + } + } elsif (/^([0-9]+) \@bop1$/) { + $header = 0; + push (@body, "%%Page: ? $1\n"); + push (@body, $_); + } else { + print; + } + } elsif (! $ignore) { + push (@body, $_); + } +} +print (@body); +print ("\@end\n"); +@END@ diff --git a/Build/source/utils/psutils/fixscribeps.man b/Build/source/utils/psutils/fixscribeps.man new file mode 100644 index 00000000000..68904461df1 --- /dev/null +++ b/Build/source/utils/psutils/fixscribeps.man @@ -0,0 +1,24 @@ +.TH FIXSCRIBEPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixscribeps \- filter to fix Scribe documents so PSUtils work +.SH SYNOPSIS +.B fixscribeps +< +.I Scribe.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixscribeps +is a +.I perl +filter which "fixes" PostScript from Scribe so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixscribeps.pl b/Build/source/utils/psutils/fixscribeps.pl new file mode 100644 index 00000000000..d8ed1e86aa3 --- /dev/null +++ b/Build/source/utils/psutils/fixscribeps.pl @@ -0,0 +1,19 @@ +@PERL@ +# fixscribeps: get conforming PostScript out of Scribe +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$inepsf = 0; +$epsfn = 0; +while (<>) { + if (/^([0-9]+ [0-9]+ [0-9]+ PB) (%!.*)/) { + print "$1\n%%BeginDocument: Scribe-EPSF $epsfn 0\n$2\n"; + $inepsf++; + } elsif (/^ PE/ && $inepsf) { + print "%%EndDocument\n", $_; + } else { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/fixtpps.man b/Build/source/utils/psutils/fixtpps.man new file mode 100644 index 00000000000..c6309f12cca --- /dev/null +++ b/Build/source/utils/psutils/fixtpps.man @@ -0,0 +1,24 @@ +.TH FIXTPPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixtpps \- filter to fix Tpscript documents to work with PSUtils +.SH SYNOPSIS +.B fixtpps +< +.I Tpscript.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixtpps +is a +.I perl +filter which "fixes" PostScript generated from the Troff Tpscript driver so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixtpps.pl b/Build/source/utils/psutils/fixtpps.pl new file mode 100644 index 00000000000..29c2cebb15c --- /dev/null +++ b/Build/source/utils/psutils/fixtpps.pl @@ -0,0 +1,28 @@ +@PERL@ +# fixtpps: fix tpscript document to work with PSUtils +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$nesting = 0; +$header = 1; + +while (<>) { + if (/^%%Page:/ && $nesting == 0) { + print $_; + print "save home\n"; + $header = 0; + } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) { + print $_; + $nesting++; + } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { + print $_; + $nesting--; + } elsif (/save home/) { + s/save home//; + print $_; + } elsif (!$header || (! /^save$/ && ! /^home$/)) { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/fixwfwps.man b/Build/source/utils/psutils/fixwfwps.man new file mode 100644 index 00000000000..42810c26995 --- /dev/null +++ b/Build/source/utils/psutils/fixwfwps.man @@ -0,0 +1,24 @@ +.TH FIXWFWPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixwfwps \- filter to fix Word for Windows documents so PSUtils work +.SH SYNOPSIS +.B fixwfwps +< +.I WordforWindows.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixwfwps +is a +.I perl +filter which "fixes" PostScript from Word for Windows so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixwfwps.pl b/Build/source/utils/psutils/fixwfwps.pl new file mode 100644 index 00000000000..03b0cdaca38 --- /dev/null +++ b/Build/source/utils/psutils/fixwfwps.pl @@ -0,0 +1,33 @@ +@PERL@ +# fixwfwps: fix Word for windows PostScript for printing. +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$nesting = 0; +while (<>) { + tr/\000-\010\012-\014\016-\037//d; + foreach (grep($_ ne "", split("\015"))) { + s!/SVDoc\s+save\s+def!!g; + s!SVDoc\s+restore!!g; + if (/^(%!PS-Adobe-\d*\.\d*) EPSF-/ && !$nesting) { + print "$1\n"; + $wfwepsf = 1; + } elsif (/^SS\s*$/ && $wfwepsf) { + print "%%Page: $wfwepsf $wfwepsf\n"; + $wfwepsf++; + print "$_\n"; + } elsif (/^%MSEPS Preamble/) { + print "%%BeginDocument: (Included EPSF)\n"; + print "$_\n"; + $nesting++; + } elsif (/^%MSEPS Trailer/) { + $nesting--; + print "$_\n"; + print "%%EndDocument\n"; + } elsif (! /^%%BoundingBox/) { + print "$_\n"; + } + } +} +@END@ diff --git a/Build/source/utils/psutils/fixwpps.man b/Build/source/utils/psutils/fixwpps.man new file mode 100644 index 00000000000..d6ab4a274ed --- /dev/null +++ b/Build/source/utils/psutils/fixwpps.man @@ -0,0 +1,24 @@ +.TH FIXWPPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixwpps \- filter to fix WP documents so PSUtils work +.SH SYNOPSIS +.B fixwpps +< +.I WordPerfect.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixwpps +is a +.I perl +filter which "fixes" PostScript from WordPerfect 5.0 and 5.1 so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixwpps.pl b/Build/source/utils/psutils/fixwpps.pl new file mode 100644 index 00000000000..059119daf48 --- /dev/null +++ b/Build/source/utils/psutils/fixwpps.pl @@ -0,0 +1,31 @@ +@PERL@ +# fixwpps: get semi-conforming PostScript out of WordPerfect 5.0 file +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$page = 1; +$nesting = 0; + +while (<>) { + s/([^\/]_t)([0-9]+)/\1 \2/g; # fix wp 5.0 bug + if (m!/_[be][dp]! || m!_bp \d+ \d+ roll!) { + print $_; + } elsif (/^(.*)(_bp.*)$/) { + print "$1\n" if $1 ne ""; + print "%%Page: $page $page\n"; + print "$2\n"; + $page++; + $nesting++; + } elsif (/_ep$/) { + print $_; + $nesting--; + } elsif (/^(.*)(_ed.*)/) { + print "$1\n" if $1 ne ""; + print "%%Trailer:\n"; + print "$2\n"; + } else { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/fixwwps.man b/Build/source/utils/psutils/fixwwps.man new file mode 100644 index 00000000000..1fb1aea4d9a --- /dev/null +++ b/Build/source/utils/psutils/fixwwps.man @@ -0,0 +1,24 @@ +.TH FIXWWPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +fixwwps \- filter to fix Windows Write documents so PSUtils work +.SH SYNOPSIS +.B fixwwps +< +.I WinWrite.ps +> +.I Fixed.ps +.SH DESCRIPTION +.I Fixwwps +is a +.I perl +filter which "fixes" PostScript from Windows Write so +that it works correctly with Angus Duggan's +.B psutils +package. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. diff --git a/Build/source/utils/psutils/fixwwps.pl b/Build/source/utils/psutils/fixwwps.pl new file mode 100644 index 00000000000..a0096998b83 --- /dev/null +++ b/Build/source/utils/psutils/fixwwps.pl @@ -0,0 +1,20 @@ +@PERL@ +# fixwwps: get semi-conforming PostScript out of Windows Write file +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$page = 1; + +while (<>) { + if (/^(%!.*) EPSF-\d.\d/) { + print $1, "\n"; + } elsif (/^SS/) { + print "%%Page: $page $page\n"; + print $_; + $page++; + } else { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/getafm.man b/Build/source/utils/psutils/getafm.man new file mode 100644 index 00000000000..661c8c19f81 --- /dev/null +++ b/Build/source/utils/psutils/getafm.man @@ -0,0 +1,29 @@ +.TH GETAFM 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +getafm \- create an AFM file for a PostScript font. +.SH SYNOPSIS +.B getafm +.I FontName +> +.I output.ps +.SH DESCRIPTION +.I Getafm +generates a PostScript file which prints an AFM file for a font to the +printer's output channel. The output of +.I getafm +should be sent to a printer, or to GhostScript. For example, +.sp +.ce +getafm Times-Roman | gsnd - >Times-Roman.afm +.sp +.SH AUTHOR +Robert Joop (rj@rainbow.in-berlin.de), Angus Duggan +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +Kerning information is not generated by +.I getafm; +it is best to use original AFM files if possible. diff --git a/Build/source/utils/psutils/getafm.sh b/Build/source/utils/psutils/getafm.sh new file mode 100644 index 00000000000..1c6cd21cf77 --- /dev/null +++ b/Build/source/utils/psutils/getafm.sh @@ -0,0 +1,358 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "usage: $0 font-name | gsnd - >font-name.afm" >&2 + exit 1 +fi + +cat << EOF +%! +% produce .afm for $1 +% (c) 1993 by Robert Joop <rj@rainbow.in-berlin.de> +% inspired by two other versions of this theme which are +% getafm 1.00 (c) AJCD +% and getafm.ps by an unknown author, +% modified by J. Daniel Smith <dsmith@mailhost.aa.cad.slb.com> + +% Metrics dictionary code added by AJCD, 7/6/93 + +/getafmdict 100 dict dup begin + + /buf 256 string def + /buf2 16 string def + + /prany % dict dictname printname -> dict + { + 2 index 2 index cvn known + { + print % printname + ( ) print + 1 index exch cvn get = + } + { + (Comment /FontInfo contains no /) print + 2 copy eq + { + = % printname + pop % dictname + } + { + exch + print % dictname + (, therefore no ) print + = % printname + } + ifelse + } + ifelse + } + bind def + + /printfontname + { + (FontName)dup prany + } + bind def + + /printfontinfo + { + dup /FontInfo known + { + dup /FontInfo get + (FullName)dup prany + (FamilyName)dup prany + (Weight)dup prany + (ItalicAngle)dup prany + (isFixedPitch)(IsFixedPitch) prany + (UnderlinePosition)dup prany + (UnderlineThickness)dup prany + (Version)(version) prany + (Notice)dup prany + pop + } + { + (Comment Font lacks a /FontInfo!)= + } + ifelse + } + bind def + + /prbbox % llx lly urx ury -> - + { + 4 1 roll 3 1 roll exch % swap top 4 elements + 4 { ( ) print buf cvs print } repeat + } + bind def + + /getbbox % fontdict chardict character -> fontdict chardict llx lly urx ury + { + gsave + 2 index setfont 0 0 moveto + false charpath flattenpath pathbbox + grestore + } + bind def + + /printmiscinfo + { + dup /FontBBox known + { + (FontBBox) print + dup /FontBBox get aload pop prbbox ()= + } + { + (Comment missing required /FontBBox)= + quit + } + ifelse + 2 copy exch get + dup /H known + 1 index /x known and + 1 index /d known and + 1 index /p known and + dup /looksRoman exch def + { + (CapHeight ) print + (H) getbbox + ceiling cvi = pop pop pop + (XHeight ) print + (x) getbbox + ceiling cvi = pop pop pop + (Ascender ) print + (d) getbbox + ceiling cvi = pop pop pop + (Descender ) print + (p) getbbox + pop pop floor cvi = pop + } + { + (Comment font doesn't contain H, x, d and p; therefore no CapHeight, XHeight, Ascender and Descender)= + } + ifelse + pop + dup /Encoding get + [ + [ (ISOLatin1Encoding) /ISOLatin1Encoding ] + [ (AdobeStandardEncoding) /StandardEncoding ] + ] + { + aload pop dup where + { + exch get 2 index eq + { + (EncodingScheme ) print + buf cvs = + } + { + pop + } + ifelse + } + { + pop pop + } + ifelse + } + forall + pop + } + bind def + + /printcharmetric + { + % chardictname fontdict charnamedict encoding charindex charname + + 4 index dup length dict dup begin exch + { + 1 index /FID ne + 2 index /UniqueID ne + and + { + 1 index /Encoding eq { 256 array copy } if + def + } + { pop pop } + ifelse + } + forall + end + dup /Encoding get 32 3 index put + /f2 exch definefont + setfont + + (C ) print + 1 index buf cvs print + + ( ; WX ) print +% Metrics entries are: +% 1 number: which is the character width +% an array of 2 numbers: which are the left sidebearing and width +% an array of 4 numbers: x & y left sidebearing, width and height + dup 5 index % /charname fontdict + dup /Metrics known { + /Metrics get exch 2 copy known { + get dup type /arraytype eq { + dup length 2 eq + {1 get} {2 get} ifelse + } if + round cvi buf cvs print + } { + pop pop ( ) stringwidth pop round cvi buf cvs print + } ifelse + } { + pop pop ( ) stringwidth pop round cvi buf cvs print + } ifelse + + ( ; N ) print + dup buf cvs print + + ( ; B) print + gsave + newpath 0 0 moveto + ( ) true charpath flattenpath pathbbox + grestore + 2 { ceiling cvi 4 1 roll } repeat + 2 { floor cvi 4 1 roll } repeat + prbbox + + looksRoman + { + [ + [ /f [ /i /f /l ] ] + [ /ff [ /i /l ] ] + ] + { + aload pop 1 index 3 index eq + { + { + 1 index buf cvs + length + 1 index buf2 cvs dup length + 2 index add + buf + 4 2 roll putinterval + buf 0 + 3 -1 roll getinterval + dup cvn + 7 index + exch known + { + exch + ( ; L ) print + buf2 cvs print + ( ) print + print + } + { + pop pop + } + ifelse + } + forall + pop + } + { + pop pop + } + ifelse + } + forall + } + if + pop + + ( ;)= + } + bind def + + /printcharmetrics + { + (StartCharMetrics ) print + 2 copy exch get length 1 sub buf cvs = + + 256 dict dup begin + 1 index /Encoding get + { null def } + forall + end + % chardictname fontdict charnamedict + 1 index /Encoding get + 0 1 255 + { + % encoding index + 2 copy get + dup /.notdef eq { pop } { printcharmetric } ifelse + pop % index + } for + + -1 + 3 index 5 index get + { + pop + dup /.notdef eq + { pop } + { + % chardictname fontdict charnamedict encoding charindex charname + dup 4 index exch known + { pop } + { printcharmetric } + ifelse + } + ifelse + } + forall + % charnamedict encoding index + pop pop pop + + (EndCharMetrics)= + } + bind def + + /printfontmetrics + { + (StartFontMetrics 3.0)= + (Comment Produced by getafm 3.0 (which is by rj@rainbow.in-berlin.de))= + + printfontname + printfontinfo + printmiscinfo + printcharmetrics + + (EndFontMetrics)= + } + bind def + +end def + +/getafm +{ + getafmdict begin + save exch + findfont 1000 scalefont + + null + [ /CharDefs /CharData /CharProcs /CharStrings ] + { + 2 index 1 index known { exch } if + pop + } + forall + dup null eq + { + (can't find dictionary with character data!)= + quit + } + if + exch % dictname fontdict + + printfontmetrics + + pop pop + restore + end +} +bind def + +/$1 getafm + +EOF diff --git a/Build/source/utils/psutils/includeres.man b/Build/source/utils/psutils/includeres.man new file mode 100644 index 00000000000..24a2615c396 --- /dev/null +++ b/Build/source/utils/psutils/includeres.man @@ -0,0 +1,41 @@ +.TH INCLUDERES 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +includeres \- filter to include resources in a PostScript document +.SH SYNOPSIS +.B includeres +< +.I document.ps +> +.I output.ps +.SH DESCRIPTION +.I Includeres +includes resources (fonts, procsets, patterns, files, etc) in place of +.I %%IncludeResource +comments in a PostScript document. The resources are searched for in the +current directory and the system default directory under the resource name, +and with an appropriate extension. +The pipeline +.sp +.ce +extractres file.ps | includeres >out.ps +.sp +will move all resources appearing in a document to the document prologue, +removing redundant copies. The output file can then be put through page +re-arrangement filters such as +.I psnup +or +.I pstops +safely. +.SH FILES +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I includeres +does not alter the +.I %%DocumentNeededResources +comments. diff --git a/Build/source/utils/psutils/includeres.pl b/Build/source/utils/psutils/includeres.pl new file mode 100644 index 00000000000..083e0bfa52e --- /dev/null +++ b/Build/source/utils/psutils/includeres.pl @@ -0,0 +1,46 @@ +@PERL@ +# includeres: include resources in PostScript file +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$prog = ($0 =~ s=.*/==); + +%extn = ("font", ".pfa", "file", ".ps", "procset", ".ps", # resource extns + "pattern", ".pat", "form", ".frm", "encoding", ".enc"); +%type = ("%%BeginFile:", "file", "%%BeginProcSet:", "procset", + "%%BeginFont:", "font"); # resource types + +sub filename { # make filename for resource in @_ + local($name); + foreach (@_) { # sanitise name + s/[!()\$\#*&\\\|\`\'\"\~\{\}\[\]\<\>\?]//g; + $name .= $_; + } + $name =~ s@.*/@@; # drop directories + die "Filename not found for resource ", join(" ", @_), "\n" + if $name =~ /^$/; + $name; +} + +while (<>) { + if (/^%%IncludeResource:/ || /^%%IncludeFont:/ || /^%%IncludeProcSet:/) { + local($comment, @res) = split(/\s+/); + local($type) = defined($type{$comment}) ? $type{$comment} : shift(@res); + local($name) = &filename(@res); + local($inc) = ""; # system include directory + if (open(RES, $name) || open(RES, "$name$extn{$type}") || + open(RES, "$inc/$name") || open(RES, "$inc/$name$extn{$type}")) { + while (<RES>) { + print $_; + } + close(RES); + } else { + print "%%IncludeResource: ", join(" ", $type, @res), "\n"; + print STDERR "Resource $name not found\n"; + } + } else { + print $_; + } +} +@END@ diff --git a/Build/source/utils/psutils/maketext b/Build/source/utils/psutils/maketext new file mode 100644 index 00000000000..b5715b3a25d --- /dev/null +++ b/Build/source/utils/psutils/maketext @@ -0,0 +1,51 @@ +#!/usr/bin/env perl +# maketext: perl filter to substitute names in scripts and man pages. + +%change = (); # names -> substitutions + +# get release and patchlevel for all scripts +open(H, "patchlev.h") || die "can't open patchlev.h"; +while(<H>) { + $change{$1} = $2 if /^\#define\s*(\S*)\s*(\S*)/; +} +close(H); + +$os = "" ; + +%perlstart = ("UNIX", "\#!PERL", + "DOS", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", + "WINNT", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", + "Win32", "\@rem = '-*- Perl -*-\n\@echo off\nPERL -S %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9\ngoto endofperl\n';\n", + "OS2", "extproc PERL -x\n\#! PERL\n", + "", "PSUTILS MAKEFILE CONFIGURATION ERROR") ; +%perlend = ("UNIX", "", + "DOS", "__END__\n:endofperl\n", + "WINNT", "__END__\n:endofperl\n", + "Win32", "__END__\n:endofperl\n", + "OS2", "\# End of Script", + "", "PSUTILS MAKEFILE CONFIGURATION ERROR"); + +foreach (@ARGV) { + if (/MAN=(.*)/) { # name.ext name.ext -> name(ext), name(ext) + local(@man) = split(' ', $1); + $change{"MAN"} = join(", ", grep(s/\.(.)/($1)/, @man)); + } elsif (/OS=(.*)/) { # set operating system name + $os = $1 ; + } elsif (/PERL=(.*)/) { # substitute name for value + local($perl) = $1 ; + $change{"PERL"} = $perlstart{$os} ; + $change{"END"} = $perlend{$os} ; + $change{"PERL"} =~ s/PERL/$perl/g ; + $change{"END"} =~ s/PERL/$perl/g ; + } elsif (/(.*)=(.*)/) { # substitute name for value + $change{$1} = $2; + } else { # open file and substitute + local(@change) = keys %change; + open(FILE, $_) || die "can't open $_"; + while ($line = <FILE>) { + grep($line =~ s/\@$_\@/$change{$_}/g, @change); + print $line; + } + close(FILE); + } +} diff --git a/Build/source/utils/psutils/md68_0.ps b/Build/source/utils/psutils/md68_0.ps new file mode 100644 index 00000000000..1934c7f7ab3 --- /dev/null +++ b/Build/source/utils/psutils/md68_0.ps @@ -0,0 +1,437 @@ +%%BeginProcSet: (AppleDict md) 68 0 +/readtocleartomark{/markindex 0 def %AJCD-skip up to next "cleartomark"% +{dup read pop (cleartomark) markindex get +eq {/markindex markindex 1 add def +markindex 11 ge {exit}if} +{/markindex 0 def} ifelse +}loop pop}bind def +%AJCD% statusdict begin waittimeout 300 lt{0 60 300 setdefaulttimeouts}if end +currentfile statusdict begin serverdict begin product (LaserWriter II NT) eq revision 1 eq and {/setrealdevice {//setrealdevice exec 31 sendpcmd 4 eq tonerlight} bind def +/execjob {31 sendpcmd 4 eq tonerlight //execjob exec} bind def end end eexec}{end end readtocleartomark}ifelse +35de8eabfc7fa5eac0431edc501ad43f5fcbdf9fdd321cce93b525f4439dd94696bf56ac13a0a2aad1e6bcf444711e941d7217138d20ae0500145f815439cc14e697ad201df728ea4ccad4ac331aa03a7aacde10760bf4ee12bbf73c77cdcbf1796f26f0dd255d2407e1ac41 +d27489a69d6b69c6a841468b46720b75ad65650700e0c528e7af61e7e3e821b59445c44b69831ebc9deaf0e3aecc14b7a1c2e18bc1fa42a59219f1e36f236e3d6c89114b1f231999c3dbce6b43f3e2918fcb85575941a9d1e65c86aa08e6eea86cc66ce90e5e4add57f2585e +7b1c0b5203cfc46868d6e3c0d66db79174e7091e32e307679732da062e440e41dabd36a161b611a7e4523a49694026206803dbfd5be5c5fe433f0f18a40057db6f1302848c8da4a10a7f14c63d512806362b1be092ad5dbd36d75fe63e4cae2ba9b72390f580cac344a08bdf +6eb9e36ec45bad2a0b82829a72e0efa2d87332c482196e690361168271c55053341ab3 +mark cleartomark %AJCD-dummy cleartomark for skip% +/sc {60 45 {abs exch abs 2 copy add 1 gt{1.0 sub dup mul exch 1.0 sub dup mul add 1.0 sub}{dup mul exch dup mul add 1.0 exch sub} +ifelse}setscreen} bind def statusdict begin product(LaserWriter II)anchorsearch end +{pop pop/letter [/letter load /exec load /sc load /exec load]cvx def/legal [/legal load /exec load /sc load /exec load]cvx def/a4 [/a4 load /exec load /sc load /exec load]cvx def/b5 [/b5 load /exec load /sc load /exec load]cvx def +/lettersmall [/lettersmall load /exec load /sc load /exec load]cvx def/a4small [/a4small load /exec load /sc load /exec load]cvx def/note [/note load /exec load /sc load /exec load]cvx def}{pop}ifelse +systemdict/currentpacking known{currentpacking true setpacking}if +/LW{save statusdict/product get(LaserWriter)anchorsearch +exch pop{length 0 eq{1}{2}ifelse}{0}ifelse exch restore}bind def +/LW+{LW 2 eq}bind def +/ok{systemdict/statusdict known dup{LW 0 gt and}if}bind def +%AJCD% ok{statusdict begin 9 sccinteractive 3 ne exch 0 ne or{9 0 3 setsccinteractive}if end}if +/md 250 dict def md begin +/av 0 def +/T true def/F false def/mtx matrix def/s75 75 string def/s8 8 string def/s1 ( ) def/pxs 1 def/pys 1 def +1 0 mtx defaultmatrix dtransform exch atan/pa exch def/nlw .24 def/ppr [-32 -29.52 762 582.48] def +/pgs 1 def/por true def/xb 500 array def/so true def/tso true def/fillflag false def/pnm 1 def/fmv true def +/sfl false def/ma 0 def/invertflag false def/dbinvertflag false def/xflip false def/yflip false def/noflips true def/scaleby96 false def/fNote true def/fBitStretch true def +/fg (Rvd\001\001\000\000\177) def +/bdf{bind def}bind def +/xdf{exch def}bdf +/xl{neg exch neg translate}bdf +/fp{pnsh 0 ne pnsv 0 ne and}bdf +/nop{}bdf/lnop[/nop load]cvx bdf +/vrb[ +{fp{fg 6 get 0 ne{gsave stroke grestore}{gsave 1 setlinewidth pnsh pnsv scale stroke grestore}ifelse}if newpath}bind +/eofill load +dup +/newpath load +2 index +dup +{clip newpath}bind +{}bind +dup +2 copy +]def +currentscreen/spf xdf/rot xdf/freq xdf +/doop{vrb exch get exec}bdf +/psu{/tso xdf /fNote xdf/fBitStretch xdf/scaleby96 xdf/yflip xdf/xflip xdf +/invertflag xdf/dbinvertflag invertflag statusdict begin version cvr 47.0 ge product (LaserWriter) eq not and end invertflag and {not}if def +xflip yflip or{/noflips false def}if +/pgs xdf 2 index .72 mul exch div/pys xdf div .72 mul/pxs xdf ppr astore pop/por xdf sn and/so xdf}bdf +/tab{statusdict /11x17 known{statusdict begin /11x17 load end}{statusdict /setpage known{statusdict begin 792 1224 1 setpage end}{statusdict /setpageparams known{statusdict begin 792 1224 0 1 setpageparams end}if}ifelse}ifelse}bdf +/txpose{fNote{smalls}{bigs}ifelse pgs get exec pxs pys scale ppr aload pop por{noflips{pop exch neg exch translate pop 1 -1 scale}if +xflip yflip and{pop exch neg exch translate 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if +xflip yflip not and{pop exch neg exch translate pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{ppr 1 get neg ppr 0 get neg translate}if} +{noflips{translate pop pop 270 rotate 1 -1 scale}if xflip yflip and{translate pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if +xflip yflip not and{translate pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{translate pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 exch translate}if}ifelse +%AJCD% statusdict begin waittimeout 300 lt{/waittimeout 300 def}if end +scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy translate .96 dup scale neg exch neg exch translate}if}bdf +/fr{4 copy ppr aload pop 3 -1 roll add 3 1 roll exch add 6 2 roll 3 -1 roll +sub 3 1 roll exch sub 3 -1 roll exch div 3 1 roll div exch scale pop pop xl}bdf +/obl{{0.212557 mul}{pop 0}ifelse}bdf +/sfd{ps fg 5 -1 roll get mul 100 div 0 ps 5 -1 roll obl ps neg 0 0 6a astore makefont setfont}bdf +/fnt{findfont sfd}bdf +/bt{sa 3 1 roll 3 index and put}bdf +/sa(\000\000\000\000\000\000\000\000\000\000)def +/fs{0 1 bt 1 2 bt 2 4 bt 3 8 bt 4 16 bt 5 32 bt 6 64 bt 7 128 bt sa exch 8 exch put}bdf +/mx1 matrix def +/mx2 matrix def +/mx3 matrix def +/bu{currentpoint currentgray currentlinewidth currentlinecap currentlinejoin currentdash exch aload length +fg 5 sfl{1}{0}ifelse put pnsv pnsh +2t aload pop 3a aload pop mx2 aload pop mx1 aload pop mtx currentmatrix aload pop +mx3 aload pop ps pm restore/ps xdf mx3 astore pop}bdf +/bn{/pm save def mx3 setmatrix newpath 0 0 moveto ct dup 39 get 0 exch getinterval cvx exec +mtx astore setmatrix mx1 astore pop mx2 astore pop 3a astore pop +2t astore pop/pnsh xdf/pnsv xdf gw +/sfl fg 5 get 0 ne def array astore exch setdash setlinejoin setlinecap +setlinewidth setgray moveto}bdf +/fc{}bdf +/tc{32768 div add 3 1 roll 32768 div add 2t astore pop}bdf +/3a [0 0 0] def +/2t 2 array def +/tp{3a astore pop}bdf +/tt{mx2 currentmatrix pop currentpoint 2 copy 2t aload pop qa 2 copy translate 3a aload pop exch dup 0 eq +{pop}{1 eq{-1 1}{1 -1}ifelse scale}ifelse rotate pop neg exch neg exch translate moveto}bdf +/te{mx2 setmatrix}bdf +/th{3 -1 roll div 3 1 roll exch div 2 copy mx1 scale pop scale/sfl true def}bdf +/tu{1 1 mx1 itransform scale/sfl false def}bdf +/ts{1 1 mx1 transform scale/sfl true def}bdf +/fz{/ps xdf}bdf +/dv{dup 0 ne{div}{pop}ifelse}bdf +/pop4{pop pop pop pop}bdf +/it{sfl{mx1 itransform}if}bdf +/gm{exch it moveto}bdf/rm{it rmoveto}bdf +/lm{currentpoint sfl{mx1 transform}if exch pop sub 0 exch it rmoveto}bdf +/fm{statusdict/manualfeed known}bdf +/se{statusdict exch/manualfeed exch put}bdf +/mf{dup/ma exch def 0 gt{fm se/t1 5 st ok ma 1 gt and{/t2 0 st/t3 0 st +%AJCD% statusdict/manualfeedtimeout 3600 put +}if}if}bdf +/jn{/statusdict where exch pop{statusdict exch /jobname exch put}if}bdf +/pen{pnm mul/pnsh xdf pnm mul/pnsv xdf pnsh setlinewidth}bdf +/min{2 copy gt{exch}if pop}bdf +/max{2 copy lt{exch}if pop}bdf +/dh{fg 6 1 put array astore dup {1 pxs div mul exch}forall astore exch pop exch pop exch setdash}bdf +/ih[currentdash]def +/rh{fg 6 0 put ih aload pop setdash}bdf +/dl{gsave nlw pys div setlinewidth 0 setgray}bdf +/dlin{exch currentpoint currentlinewidth 2 div dup +translate newpath moveto lineto currentpoint stroke grestore moveto}bdf +/lin{fg 6 get 0 ne{exch lineto currentpoint 0 doop moveto} +{exch currentpoint/pnlv xdf/pnlh xdf gsave newpath/@1 xdf/@2 xdf fp{pnlh @2 lt{pnlv @1 ge +{pnlh pnlv moveto @2 @1 lineto pnsh 0 rlineto +0 pnsv rlineto pnlh pnsh add pnlv pnsv add lineto pnsh neg 0 rlineto} +{pnlh pnlv moveto pnsh 0 rlineto @2 pnsh add @1 lineto 0 pnsv rlineto +pnsh neg 0 rlineto pnlh pnlv pnsv add lineto}ifelse}{pnlv @1 gt +{@2 @1 moveto pnsh 0 rlineto pnlh pnsh add pnlv lineto 0 pnsv rlineto +pnsh neg 0 rlineto @2 @1 pnsv add lineto}{pnlh pnlv moveto pnsh 0 rlineto +0 pnsv rlineto @2 pnsh add @1 pnsv add lineto pnsh neg 0 rlineto +0 pnsv neg rlineto}ifelse}ifelse +closepath fill}if @2 @1 grestore moveto}ifelse}bdf +/gw{/pnm fg 3 get fg 4 get div def}bdf +/lw{fg exch 4 exch put fg exch 3 exch put gw pnsv pnsh pen}bdf +/barc{/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf +/@6 xdf/@7 xdf/@8 xdf gsave +@5 @7 add 2 div @6 @8 add 2 div translate newpath 0 0 moveto +@5 @7 sub @6 @8 sub mtx currentmatrix pop scale @1{newpath}if +0 0 0.5 @4 @3 arc @4 @3 sub abs 360 ge{closepath}if +mtx setmatrix @2 doop grestore}bdf +/ar{dup 0 eq barc}bdf +/ov{0 exch 360 exch true barc}bdf +/rc{/@t xdf currentpoint 6 2 roll newpath 4 copy 4 2 roll exch moveto +6 -1 roll lineto lineto lineto closepath @t doop moveto}bdf +/mup{dup pnsh 2 div le exch pnsv 2 div le or}bdf +/rr{/@1 xdf 2. div/@2 xdf 2. div/@3 xdf +/@4 xdf/@5 xdf/@6 xdf/@7 xdf +@7 @5 eq @6 @4 eq @2 mup or or{@7 @6 @5 @4 @1 rc} +{@4 @6 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse +@5 @7 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse +@1 0 eq{/@2 @2 pnsh 2 div 2 copy gt{sub def}{0 pop4}ifelse}if +currentpoint newpath +@4 @6 add 2. div @7 moveto +@4 @7 @4 @5 @2 arcto pop4 +@4 @5 @6 @5 @2 arcto pop4 +@6 @5 @6 @7 @2 arcto pop4 +@6 @7 @4 @7 @2 arcto pop4 +closepath @1 doop moveto}ifelse}bdf +/pr{gsave newpath/pl{exch moveto/pl{exch lineto}def}def}bdf +/pl{exch lineto}bdf +/ep{dup 0 eq{{moveto}{exch lin}{}{(%%[|1|]%%)= flush}pathforall +pop grestore}{doop grestore}ifelse currentpoint newpath moveto}bdf +/gr{64. div setgray}bdf +/pat{s8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi s8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}setscreen gr}bdf +/sg{freq rot/spf load setscreen gr}bdf +/dc{transform round .5 sub exch round .5 sub exch itransform}bdf +/sn{userdict/smooth4 known}bdf +/x8{3 bitshift}bdf +/x4{2 bitshift}bdf +/d4{-2 bitshift}bdf +/d8{-3 bitshift}bdf +/rb{15 add -4 bitshift 1 bitshift}bdf +/db{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf/@6 @5 @3 4 add mul def +dc translate scale/xdbit 1 1 idtransform abs/ydbit exch def abs def{0 0 1 ydbit add 1 10 rc clip}if +@1 0 eq @1 4 eq or{1 setgray ydbit 0 1 ydbit add 1 2 rc}if +@1 3 eq @1 7 eq or{1}{0}ifelse setgray/@9 @1 0 eq @1 1 eq @1 3 eq or or dbinvertflag xor def/@13 @6 def +@2 fBitStretch or{/@10 @4 x4 def/@11 @3 x4 def/@12 @10 rb def/@13 @12 @11 mul def/@15 1 1 dtransform abs/calcY 1 index def round cvi/@14 exch def +abs/calcX 1 index def round cvi scaleby96 not{1 add}if def/@16 @15 rb def/@17 @16 @14 mul def}if +sn @13 60000 lt and @2 fBitStretch or and{mtx currentmatrix dup 1 get exch 2 get 0. eq exch 0. eq and @17 60000 lt and fBitStretch and{@16 3 bitshift @14 @9 [calcX 0 0 calcY 0 0]{@17 string @13 string +currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4 +@10 @11 @12 dup string 5 index @15 @14 @16 dup string stretch}imagemask}{@12 x8 @11 @9 [@10 0 0 @11 0 0]{@13 string +currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4}imagemask}ifelse}{@5 3 bitshift @3 4 add @9 [@4 0 0 @3 0 2]{currentfile @6 string readhexstring pop}imagemask}ifelse +@7 restore}bdf +/multibit{/mbdeep exch def/mbY exch def/mbX exch def +save mbX mbY mbdeep[mbX 0 0 mbY 0 0]{currentfile picstr readhexstring pop}image +restore}bdf +/wd 16 dict def +/mfont 14 dict def +/mdf{mfont wcheck not{/mfont 14 dict def}if mfont begin xdf end}bdf +/cf{{1 index/FID ne{def}{pop pop}ifelse}forall}bdf/rf{/@1 exch def/@2 exch def +FontDirectory @2 known{cleartomark pop}{findfont dup begin dup length @1 add dict begin +cf{/Encoding macvec def}{Encoding dup length array copy/Encoding exch def +counttomark 2 idiv{Encoding 3 1 roll put}repeat}ifelse +pop +exec currentdict end end @2 exch definefont pop}ifelse}bdf +/bmbc{exch begin wd begin +/cr xdf +save +CharTable cr 6 mul 6 getinterval{}forall +/bitheight xdf/bitwidth xdf +.96 div/width xdf +Gkernmax add/XOffset xdf Gdescent add/YOffset xdf/rowbytes xdf +rowbytes 255 eq{0 0 0 0 0 0 setcachedevice} +{Gnormsize dup scale +width 0 XOffset YOffset bitwidth XOffset add bitheight YOffset add +setcachedevice +rowbytes 0 ne{ +XOffset YOffset translate newpath 0 0 moveto +bitwidth bitheight scale +sn{ +/xSmt bitwidth x4 def +/ySmt bitheight x4 def +/rSmt xSmt rb def +rSmt x8 ySmt true +[xSmt 0 0 ySmt neg 0 ySmt] +{rSmt ySmt mul string CharData cr get +1 index bitwidth bitheight rowbytes rSmt tso smooth4} +}{rowbytes 3 bitshift bitheight 4 add true +[bitwidth 0 0 bitheight neg 0 bitheight 2 add] +{CharData cr get} +}ifelse +imagemask +}if +}ifelse +restore +end end +}bdf +/bb{.96 exch div/Gnormsize mdf 2 index +/Gkernmax mdf 1 index/Gdescent mdf +3 index div 4 1 roll +2 index div 1. 5 2 roll +exch div 4 1 roll +4 array astore/FontBBox mdf +}bdf +/cdf{mfont/CharData get 3 1 roll put}bdf +/bf{ +mfont begin +/FontType 3 def +/FontMatrix [1 0 0 1 0 0] def +/Encoding macvec def +/BuildChar/bmbc load def +end +mfont definefont pop +}bdf +/wi LW 1 eq{{gsave 0 0 0 0 0 0 0 0 moveto lineto lineto lineto closepath clip stringwidth grestore}bind}{/stringwidth load}ifelse def +/aps{0 get 124 eq}bdf +/xc{s75 cvs dup}bdf +/xp{put cvn}bdf +/scs{xc 3 67 put dup 0 95 xp}bdf +/sos{xc 3 79 xp}bdf +/sbs{xc 1 66 xp}bdf +/sis{xc 2 73 xp}bdf +/sob{xc 2 79 xp}bdf +/sss{xc 4 83 xp}bdf +/dd{exch 1 index add 3 1 roll add exch}bdf +/smc{moveto dup show}bdf +/kwn{FontDirectory 1 index known{findfont exch pop}}bdf +/gl{1 currentgray sub setgray}bdf +/mm{/mfont 10 dict def mfont begin +/FontMatrix [1 0 0 1 0 0] def +/FontType 3 def +/Encoding macvec def +/df 4 index findfont def +/FontBBox [0 0 1 1] def +/xda xdf/mbc xdf +/BuildChar{wd begin/cr xdf/fd xdf/cs s1 dup 0 cr put def fd/mbc get exec end}def +exec end mfont definefont}bdf +/ac{dup scs kwn{exch findfont dup length 1 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall +fmv{/Encoding macvec def}if/StrokeWidth nlw 1000 mul pys div ps div dup 12 lt{pop 12}if def +/PaintType 2 def currentdict end definefont}ifelse}bdf +/mb{dup sbs kwn{exch{pop}{bbc}{}mm}ifelse sfd}bdf +/mo{dup sos kwn{exch{pop}{boc}{}mm}ifelse sfd}bdf +/ms{dup sss kwn{exch{pop}{bsc}{}mm}ifelse sfd}bdf +/ou{dup sos kwn{exch dup ac pop{scs findfont /df2 xdf}{aoc}{}mm}ifelse sfd}bdf +/su{dup sss kwn{exch dup ac pop{scs findfont /df2 xdf}{asc}{}mm}ifelse sfd}bdf +/ao{/fmv true def ou}bdf/as{/fmv true def su}bdf +/vo{/fmv false def ou}bdf/vs{/fmv false def su}bdf +/bbc{/da .03 def fd/df get setfont +gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth +cs 0 0 smc da 0 smc da da smc 0 da moveto show}bdf +/boc{/da 1 ps div def fd/df get setfont +gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth +cs 0 0 smc da 0 smc da da smc 0 da smc gl da 2. div dup moveto show}bdf +/bsc{/da 1 ps div def +/ds .05 def/da2 da 2. div def fd/df get setfont +gsave cs wi 1 index 0 ne{exch ds add da2 add exch}if grestore setcharwidth +cs ds da2 add .01 add 0 smc 0 ds da2 sub translate 0 0 smc +da 0 smc da da smc 0 da smc gl da 2. div dup moveto show}bdf +/aoc{fd/df get setfont +gsave cs wi grestore setcharwidth +gl cs 0 0 smc fd/df2 get setfont gl 0 0 moveto show}bdf +/asc{/da .05 def fd/df get setfont +gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth +cs da .01 add 0 smc 0 da translate gl 0 0 smc gl fd/df2 get setfont 0 0 moveto show}bdf +/st{1000 mul usertime add dup 2147483647 gt{2147483647 sub}if def}bdf +/the{usertime sub dup 0 lt exch -2147483648 gt and}bdf +/6a 6 array def +/2a 2 array def +/3q 3 array def +/qs{3 -1 roll sub exch 3 -1 roll sub exch}bdf +/qa{3 -1 roll add exch 3 -1 roll add exch}bdf +/qm{3 -1 roll 1 index mul 3 1 roll mul}bdf +/qn{6a exch get mul}bdf +/qA .166667 def/qB .833333 def/qC .5 def +/qx{6a astore pop +qA 0 qn qB 2 qn add qA 1 qn qB 3 qn add +qB 2 qn qA 4 qn add qB 3 qn qA 5 qn add +qC 2 qn qC 4 qn add qC 3 qn qC 5 qn add}bdf +/qp{6 copy 12 -2 roll pop pop}bdf +/qc{exch qp qx curveto}bdf +/qi{{exch 4 copy 2a astore aload pop qa .5 qm newpath moveto}{exch 2 copy 6 -2 roll 2 qm qs 4 2 roll}ifelse}bdf +/qq{{qc 2a aload pop qx curveto}{exch 4 copy qs qa qx curveto}ifelse}bdf +/pt{currentpoint newpath moveto}bdf +/qf{/fillflag true def}bdf +/ec{1 and 0 ne{0 doop}if grestore currentpoint newpath moveto/fillflag false def}bdf +/eu{currentpoint fp{0 ep}{grestore newpath}ifelse moveto/fillflag false def}bdf +/bp{currentpoint newpath 2 copy moveto}bdf +/ef{gsave fillflag{gsave eofill grestore}if}bdf +/sm{0 exch{@1 eq{1 add}if}forall}bdf +/lshow{4 1 roll exch/@1 exch def{1 index wi pop sub 1 index sm dv 0 @1 4 -1 roll widthshow}{1 index wi pop sub +1 index dup sm 10 mul exch length 1 sub add dv dup 10. mul 0 @1 4 -1 roll 0 6 -1 roll awidthshow}ifelse}bdf +/setTxMode{sa 9 2 index put 3 eq{1}{0}ifelse setgray}bdf +/SwToSym{{}mark false/Symbol/|______Symbol 0 rf 0 sa 6 get 0 ne{pop 1}{sa 7 get 0 eq{pop 2}if}ifelse +sa 1 get 0 ne/|______Symbol +sa 4 get 0 ne{vs}{sa 3 get 0 ne{vo}{fnt}ifelse}ifelse}bdf +/mc{0 3 1 roll transform neg exch pop}bdf +/ul{dup 0 ne sa 2 get 0 ne and{gsave 0 0 +/UnderlinePosition kif{mc}{ps -10 div}ifelse/UnderlineThickness kif{mc}{ps 15 div}ifelse +abs setlinewidth neg rmoveto +sa 4 get 0 ne{gsave currentlinewidth 2. div dup rmoveto currentpoint newpath moveto +2 copy rlineto stroke grestore}if +sa 3 get sa 4 get or 0 ne{gsave gl 2 copy rlineto stroke grestore rlineto strokepath nlw pys div setlinewidth}{rlineto}ifelse +stroke grestore}{pop}ifelse}bdf +/sgt{2 copy known{get true}{pop pop false}ifelse}bdf +/kif{currentfont dup/FontMatrix get exch/FontInfo sgt{true}{currentfont/df sgt +{dup/FontInfo sgt{3 1 roll/FontMatrix get mtx concatmatrix exch true}{pop pop pop false} +ifelse}{pop pop false}ifelse}ifelse{3 -1 roll sgt{exch true}{pop false}ifelse}{false}ifelse}bdf +/blank/Times-Roman findfont/CharStrings get/space get def +/macvec 256 array def +/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI +/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US +macvec 0 32 getinterval astore pop +macvec 32/Times-Roman findfont/Encoding get +32 96 getinterval putinterval macvec dup 39/quotesingle put 96/grave put +/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute +/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave +/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute +/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis +/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls +/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash +/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation +/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash +/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft +/guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe +/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge +/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl +/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute +/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex +/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde +/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron +macvec 128 128 getinterval astore pop +{}mark true/Courier/|______Courier 0 rf +{/Metrics 21 dict begin/zero 600 def/one 600 def/two 600 def/three 600 def/four 600 def/five 600 def/six 600 def/seven 600 def/eight 600 def +/nine 600 def/comma 600 def/period 600 def/dollar 600 def/numbersign 600 def/percent 600 def/plus 600 def/hyphen 600 def/E 600 def/parenleft 600 def/parenright 600 def/space 600 def +currentdict end def currentdict/UniqueID known{/UniqueID 16#800000 def}if/FontBBox FontBBox 4 array astore def}mark true/Helvetica/|______Seattle 1 rf +/oldsettransfer/settransfer load def +/concatprocs{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def +newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def +/settransfer{currenttransfer concatprocs oldsettransfer}def +/PaintBlack{{1 exch sub}settransfer gsave newpath clippath 1 setgray fill grestore}def +/od{(Rvd\001\001\000\000\177) fg copy pop txpose +1 0 mtx defaultmatrix dtransform exch atan/pa exch def +newpath clippath mark +{transform{itransform moveto}}{transform{itransform lineto}} +{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform +{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}} +{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put +10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if}bdf +/cd{}bdf +/op{/sfl false def/pm save def}bdf +/cp{not{userdict/#copies 0 put}if ma 0 gt{{t1 the{exit}if}loop}if{copypage}{showpage}ifelse pm restore}def +/px{0 3 1 roll tp tt}bdf +/psb{/us save def}bdf +/pse{us restore}bdf +/ct 40 string def +/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if} +forall clip newpath moveto}def +/kp{ct 0 2 index length 2 index 39 2 index put getinterval copy cvx exec mx3 currentmatrix pop}bdf +/av 68 def +end +LW 1 eq userdict/a4small known not and{/a4small +[[300 72 div 0 0 -300 72 div -120 3381] +280 3255 +{statusdict/jobstate (printing) put 0 setblink +margins +exch 196 add exch 304 add 8 div round cvi frametoroket +statusdict/jobstate (busy) put +1 setblink} +/framedevice load +60 45{dup mul exch dup mul add 1.0 exch sub}/setscreen load +{}/settransfer load/initgraphics load/erasepage load]cvx +statusdict begin bind end readonly def}if +md begin/bigs[lnop userdict/letter known{/letter load}{lnop}ifelse userdict/legal known{/legal load}{lnop}ifelse userdict/a4 known{/a4 load}{lnop}ifelse userdict/b5 known{/b5 load}{lnop}ifelse +lnop lnop lnop /tab load]def +/smalls[lnop userdict/lettersmall known{/lettersmall load}{userdict/note known{/note load}{lnop}ifelse}ifelse +userdict/legal known{/legal load}{lnop}ifelse userdict/a4small known{/a4small load}{lnop}ifelse +userdict/b5 known{/b5 load}{userdict/note known{/note load}{lnop}ifelse}ifelse lnop lnop lnop /tab load]def end +systemdict/currentpacking known{setpacking}if +currentfile ok userdict/stretch known not and{eexec}{readtocleartomark}ifelse +373A767D4B7FD94FE5903B7014B1B8D3BED02632C855D56F458B118ACF3AF73FC4EF5E81F5749042B5F9CF1016D093B75F250B7D8280B2EACE05A37037F7BDF6E12226D7D4E2DF2C52FAFD5FD40FE72A0D3AC4BD485D8369D4C87636E920D1DAF222D92155A9CB1667E715F0B82799B37CC8F5B32B74B39CF494536DC39C7EF04A7BCB29E2CEC79073CADCCFB23B4AA1363F876F5121B618071B7B4EB1E5DE75FAA2368A3E5DB2B198623AFE92AE9484270FE7F57A850E88C0D3EEA156611C91D8E480D4370B025CCA6929A2BF40AD3D01B2CB7EE6DFB46E12A830542337F7819B67F9765210F76DB06F34DA5B13A11759305C582E16D2B854939F6D9121F2A4F285282F5DCD3D15896D121E3D6F5BE79E087451BB0ED233CDBEF090D3B4AC2DC34B97E70C61D95FB072B8C12D2ABD843520949A39DCF99E2C1AA8FBCD025E47E0A82A8D96E75BAF40F52AD402495BBD4DE0F356C8B14E764874E639C9F045A0D1908EC6456EB6C5B8A6F826192F767EF2C55A21C58F5F9CC1F59247B55F2387828C7FE89D5E7D8484D1BC86CB6673BDBE4FE17DD9BDE95224FE645136F41330BF155A4DDE1B0A32233BF471CE58FBC660DC7E641B0A0D30018454E2191C414A3011FF3FED1C0D88FE1FF9F75DCC456D097947226FBEC92509146D3A4CFFC0471B31C53222ED9DD88566F60F6C0D705AD79DACF53B070026F083ED28B5CF75 + +7XAAA0A169F6F320A75E9D2ED50ABD939AF85B6346C2ADB25D168F10508E1516D194C635E6B187FADEA0829DBF0390C0F003F0265E215BC96CA3CC13D4A8E01570BE193CA75A620728CD275ACF1986EFFB3A13419FE55EA7C4467B7E7EEDC1FC29C9F8C46A557D2CCDB914EF7B93E7530D555DFC2398AFC68CAD991F062EF85BAA1884EC166C7C5DF8543666D8C41BE267D706BD1588F1F662F705CAE4D29DC38EF66BFAA89470D8A099B6F1B4587F7B024412276106FCD3EB5AE17A5D1DF1781992DC40EA0A992F706F701304CEA9D9073E7A74F1E687D81C3E5841D31CF86855BAAAD9B5D30317C75150A857C6B114735315CDD1AEF36C26BBB0645499406DEE2F24B3B1C72FEC97C7BA31AA2CDAB25418BB1DC4C7E4757F1D625087B0FD0300C03A65F2A72CE734925735277E034CDCF599129679F70CC8B66E03878851DB75041F275E1E5761F3EC753BE1359CA364A22047AE4886217F9259FE19FF5B116E8019B98B143114B313E8BEF87EC949D85C82E0812E6F50525E73890AF362CC8EE8A85F4197E6AC18638EF12E56A808D439AF1BFD363F140314BF4E534485C42F1856688CC35288E8D770120A420FB9F1FCF8AE8BD6D6156CC23E6C51119FE4DE1B68C9DF3487E9974BF9ED31F8D3CE93FF101867319F2FF492D5D398B4F09A66F2F55BCAB34B99173B7EE89039D00DD21A7B3A52E9F028F8301B5FC12D409 + +41X2E064513BC579AAC498F577EA8ECD1FE3E42DC3CC320786C7B00194FEDF344402C33FC492D4BA86992B01683F440220FFE756BC88A94223D316078D69D33560E8EAB76B24CB7AA4320CF435593D76F624324ABE00B5587A4F283C725EA24567133F25F472B5E2E4474DDB5A16AC5F2DF32350395D3E3892FE361F4D5C9A610C654C9227614FBBAFF3356A90A2266E00F66234061075491571A65616211257F160000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +currentfile ok userdict/smooth4 known not and{eexec}{readtocleartomark}ifelse +F94E00EE41A71C59E5CAEED1EDBCF23D1DBA1EE99B9BB356492923BD8B1BA83A87CEB0E07377A31FD6241E814681118E17DC7CACE570399506E6E441B871B6043831BD03EFC11DBBD8001EE2FF8CFBD485065D455A2E15AC36F1A84AD8789FA6461199C7CD14CB9FD64D4B06452B7FC0A8FC263F70F1CCB893295D4DE70ADAB771C0F84396FA98C60B11DA02ABA157298DF0A23621853BEF167443A985ADC09BEFFD51CB4D29179E2B34609EF38A49DA61F4BFC256A3DE0732D7D29754A194857B9C9E9971227AA1DD0611FBB10E44E5FF66C062D9C24ED3290529330BC317825E876929582DB0E39B9FC5EFD20CC1D4F94920EB9C534D0DA90DE70D25BC7287319CF28602B3F46633C242CAFC8905E960317E3C2FA20AB8DB06ADBAF292FC7BA2CA14EE65DF28B99CC11666B70AD33E8E1D57D63D4B89ECC615AE5747C1CA752C833D8D6DE54CD4A0350B44310555CE3BD2C615ADD27B634CDB350AF3A432CE78AACD2909A5B586F666CD87919A36DB1CBE86B3CE281DFD01CD7E1B8A18A4B415CECBFF79A5C4390A15EA77D14D6BE12BAB5A8268C3F286D0590060647CABED674443CD258F11415E866AB330A251691B61F2422A61AFE59B6B4FBDCF85ED9BA0F8E483C034089E6877FF5923698D3A0DC0EED6B9CFD32DF0839BC4EA5F6D1FCB6DD0920391E57E84745131D02D100179F4E0A68EC0A5FF6680A6F463D038 + +BX04AF63FFA13D743B995A26A743C26D387209023C91DE43DF047A16F328AC9DDC08573B38BE9EA341EA16C78EC32F3A1B36B90D95A50610F4D050EC1C33497F3F3A81A1B4C8BEF0BA84EE2FAA32DC112DAC490AF53E1749C4A0D866CAF7B893E52383B0D38065C333FB122B700D7246F7EE87D942AE3DB5C1DD77E9E76C80CC5AD63D28DFED0E229CE604673F78CD47F258FDF5BF3A3EAEC5C9BC8E482D8DBA9D268A35DA8C095A690679ED2123E8B8F5E4826FA3B199EAA5D482D4B6AA86572E387CECEB7149C8947F41D6339328A748A17F8C4AD3B0555F1E409450BA0C564F1F488BB5096EB003568D4D5EF6489897E27409547D0EE4487D30184793B0F27BD265A64BDB3EA6761569DA955620C612E718677B77D6D81B999C6298877AFE0D1D6F6F358377A8BD2402F669C64B972B3A065EF7DD4BDEFFFE17E63DB8898FA6E69166B710AAD6BA2EA9AF61E4B8C8701638D4D6E4DFFFC192AEF6BC027095C4C72D748979675BA29FAF61E75343E14E61034602E5A79CD2519796ED6A9CC4EDEA46A9B59D4A807E786B5EE46F25B0360BC8E7C12D723122CDEEF247C9776F4C99C8EBED6828AA19744B5ADF0D07D95D98B3072372388D41B0FAB1CCE2775170679575ECDCA13B22A17FE9C6605C3445F58F1A829512DAB6C528F83580C8AA53C35D605F626F5AD0B7FC1EA87D69A835E3F53A1F450FB0AF42A5772F89D92 + +A5X0D10F15BDBDA409F50C0B8AB93FE8A16D029DD8BB5C480D1466735ED4D9CAF637E5ECD6C2ECB6BF3B3EFBEE7AB936D2C568E3009D156B87CACB1FB3A48A70BC91B2EC35CC9147FFB1A524E2B2F2E4E2C1B12F1C1C63768BB95CD62FEC01CBA79B9FA282DD4DF49990F27FF8EE4E2DDE2F0ACD83BC9D4BE0090192C7A799967EC4DC2D63C0835E22D4C4B366D7FDCF3A05A4B53DF780F986EF25C79B665D5C00EFF7F17C0BB6D544F9D83A7FDAC47D9C5683A656011374253C918FF6EA64749DD971B2300DD5320033E01EC591F6318CCE94CE2B81C04322EC52B624E50643B5239 +1CCD2AB56396A2AD8E2D3CA61B80D9D4CC363B2DF7863526958CDF3497E36648406C317E58EC563E7C26149A2A3C643ADFB39A8DD92974C6D2A2A9D7B71CDF3FEBBF32BB02E7B45CF53AAEAD5E963A4AA4AF9A149A08A4EC303D5F2369977E93F54897EEAD31B06C5845D63F49D65F8E5573962241A57CCD717CE6CA8C784A11192943616EA059B51BC38429E18D0121FCBB6FBD5D909B0D89E616C66DEF6A0F165A7030BD911A1B120468329CBB006C8D37720E531CF31E878CB4AAAC137633675C3D546F5162487AB35F470C042BDEB945E0F2532BF92AA6FD53434440221ECD3533A7AA89900CB19EFE2CD872DF8B7969AF0D3B72BF31DC5DD69CA6460966F61AB17CB507964098DBA3AF122EEC3128A9BAFE1034493F372B36BD13512X05E9043A67C544402D8BCE24358C8A5CE33867A00794CF7097D59C88279A11EE9C854E7E7AAE881F9828C569D208F5F33375F59E9A3818CFA38AAD0CBFBA32F9F44A8BB79DE4C40E3886457C16DA4A27953AA1E99472E35F2323F0BAA5E37DC28CBA46FEFB73B190016055ADD4D27615D748499A0E1C4B8C7EC339C1C4D95A813A85918A8D01EEB485DDCDCEA6EA3F2C2A9D85C139CD90CCB352634F9AFE836BCAC0C274E352BA2071B5269D5DE4CCDE3FF990CBA974980C7332AE1545A9C60D5D1459D3AE95C1AC065733AF14FADB440A110DD539563B8D850CD0704C52F3F7C + +CCB53630D776560CBD22D8FF08F5B354487A171AEC15F5F54DE9CAB668BCAC573E788D92762EF63E76087005F4AC2D02E0CAC173C11BE62ACE5DC4D3374F2F9746C9981E125FF9AB8CAE76D13039E2C54DFD708E028A619EA1ED78E6B46F06DF0D0B74BBEDD8C190C7C0CEBDE8F7A4888CC36575313478DD2CFE392E9BB7B2416955D44B7024A3BA43FBF37293B386D64746D7748895411D243FAEC50638F2AA33337D7FA018ADDAC5835A0DDFAE99AD6299DFB4CA6872C59853E3AC12FC9E3D26629C5B49CF844C87B3C4BFBE3074E3A1CE6984758C20C661084381CD6B4582D84F19C0000B5FC0DCB42B567E396031601C095D7016283EBE5F13CD8A3A374A74DDBBABD36081149F8BC242085F2F7297CC97FD3B8BAD206D8AC9707A39ECXCC7963B522E08DA391A1EF12DD4D746DBDDDCC0834F88160CF189A9645567CEC2F023A571AF0DFD15DB85B744C28C000DF53B05F8F210841F6E87A04F20C777B7C0BE6182BE2E90226E5301A12532A745F2FAAA81637CF11B78CD2B99A4D18B862D6C5DBD31793FB16A2D9AAD376D4484D75AA833D0068B1D34DB74E3302480854E3B5484D8A47E39A89A2FA927BC3641EA7F8E004FDE4C2F08D40D99F1ACB47CAF6887629BF6DFE12968D297596D28CE0CF148B12E7DCB49FB94F5ADBD214C3A6CE1E249831BA9EB8A189F2CE1ABE39A7B537253E369A508A2AF2ADB9463F9B + +56BBBFF31D535FF997F537C6675C196E7ECBD493F652FA7CC6D9C1CA3379BFDB5AF7513C6E834054494296B91A6EE800114363D5D5D0759F41B4DECB653B9DE3E94583579EF549ED5F3FAFB12661ABC0C57A332406517ED3454EDED34B386C60F78DC976266E0EAF54FC245FB0E3EFC8016236436B599C1C97A8C5E0AC8F7836161873C71F01ED9CC25C236420F41FD8277993D3959205912FA0927B59E3DAE7377D82079447D6E41EE5AEC0DFFF79AF8F4ED47F17EE708FEA45877860D56F8CBCE65A061E8E1CA4A5FBAF0E13429A7F0ADB6F178FA449F46CC539BBC0107E3A53B1C +362A04B20E6D721E7E6E1E4976A11DDC98C7614D22B53DFBB6DAE533AC9BE882021A735C30DAA4A44AED09F49A390E8CFF59BD9C30667AF21B03EC5CEBXD5C2C3AA2769E8D714191A48E7DDF50B13D1560E82EFB65FCE601AE9E8C351FBA1DED80B7351314E7F9F9A784BFE3759B7E322A84E7B51F9DC5F5D9C8050CD79B27C0A4B0DD68A3C27A948AD6858E35B960D2DEA838C479CAEA83B1A912174ACB2100E55E7A14892D7A9B3711FF0B20065C1995B49E1F23464A92DD140642E3A7B1973849E64D1A3CF60000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +%%EndProcSet diff --git a/Build/source/utils/psutils/md71_0.ps b/Build/source/utils/psutils/md71_0.ps new file mode 100644 index 00000000000..43c102c4f2f --- /dev/null +++ b/Build/source/utils/psutils/md71_0.ps @@ -0,0 +1,461 @@ +%%BeginProcSet: (AppleDict md) 71 0 +% +/readtocleartomark{/markindex 0 def %AJCD-skip up to next "cleartomark"% +{dup read pop (cleartomark) markindex get eq {/markindex markindex 1 add def +markindex 11 ge {exit}if} {/markindex 0 def} ifelse }loop pop}bind def +% +/cexec where {pop}{userdict/cexec{pop} put}ifelse +% +userdict/LW{save statusdict/product get(LaserWriter)anchorsearch +exch pop{dup length 0 eq{pop 1}{( Plus)eq{2}{3}ifelse}ifelse}{0}ifelse exch restore}bind put +userdict/patchOK known not{save LW dup 1 ne exch 2 ne and false +<b2141b454416935af37a7aaa0da9c65dc132b2769a52440afe20a0cbebb10165dd489cfea1d364af8c057775a06614ecf9e854768266a93ceba928c4b99fdd5901ac5017c6924439ddfdde5 +a3d2320213ad0e7bed9f6d9584d8d366f97ce8b329c8ad68dd069c712530e3fec4a44ecb416b5a972f60f9392b77f99b19b747ec8911c49fcbe0a84ebbeafc9ab5cfeea6fb158a765d07fefa +2738c3fee54c71fae54bce3bfb575801b442350e1fcf39ff41e73cf98b04d560cb39ec9e0407484ff349706> +{eexec}stopped{dup type/stringtype eq{pop}if}if and exch restore userdict/patchOK 3 -1 roll put}if +userdict/downloadOK known not{userdict/downloadOK{ vmstatus exch sub exch pop 120000 gt patchOK and}bind put}if +userdict/type42known known not{userdict/type42known systemdict/resourcestatus known{42/FontType resourcestatus{pop pop true}{false}ifelse }{false}ifelse put}if +type42known not downloadOK and {userdict begin /*charpath /charpath load def/charpathflag false def/charpath{userdict/charpathflag true put userdict/*charpath get exec userdict/charpathflag false put}bind def end}if +userdict/checkload known not{userdict/checkload{{pop exec} {save 3 dict begin/mystring 6050 string def +exch/endstring exch def{currentfile mystring readline not{stop}if endstring eq{exit}if}loop end restore pop}ifelse}bind put}if +userdict/LW+{LW 2 eq}bind put +userdict/ok known not{userdict/ok{systemdict/statusdict known dup{LW 0 gt and}if}bind put}if +systemdict/currentpacking known{currentpacking true setpacking}if +/md 270 dict def md begin +/av 71 def +/T true def/F false def/mtx matrix def/s75 75 string def/sa8 8 string def/sb8 8 string def +/sc8 8 string def/sd8 8 string def/s1 ( ) def/pxs 1 def/pys 1 def +/ns false def +1 0 mtx defaultmatrix dtransform exch atan/pa exch def/nlw .24 def/ppr [-32 -29.52 762 582.48] def +/pgr [0 0 0 0] def +/pgs 1 def/por true def/xb 500 array def/so true def/tso true def/fillflag false def/pnm 1 def/fmv true def +/sfl false def/ma 0 def/invertflag false def/dbinvertflag false def/xflip false def/yflip false def/noflips true def/scaleby96 false def/fNote true def/fBitStretch true def +/4colors false def/fg (Rvd\001\001\000\000\177) def +/bdf{bind def}bind def +/xdf{exch def}bdf +/xl{neg exch neg translate}bdf +/fp{pnsh 0 ne pnsv 0 ne and}bdf +/nop{}bdf/lnop[/nop load]cvx bdf +/vrb[ +{fp{fg 6 get 0 ne{gsave stroke grestore}{gsave 1 setlinewidth pnsh pnsv scale stroke grestore}ifelse}if newpath}bind +/eofill load +dup +/newpath load +2 index +dup +{clip newpath}bind +{}bind +dup +2 copy +]def +/sgd systemdict/setpagedevice known{{2 dict begin/PreRenderingEnhance exch def/Policies 1 dict dup/PreRenderingEnhance 1 put def currentdict end setpagedevice}}{{pop}}ifelse bdf +/svsc systemdict/currentcolorscreen known{{currentcolorscreen/dkspf xdf/dkrot xdf/dkfreq xdf/dyspf xdf/dyrot xdf/dyfreq xdf/dmspf xdf/dmrot xdf/dmfreq xdf +/dcspf xdf/dcrot xdf/dcfreq xdf}}{{currentscreen/spf xdf/rot xdf/freq xdf}}ifelse bdf +/doop{vrb exch get exec}bdf +/psu{/udf xdf/tso xdf /fNote xdf/fBitStretch xdf/scaleby96 xdf/yflip xdf/xflip xdf +/invertflag xdf/dbinvertflag invertflag statusdict begin version cvr 47.0 ge product (LaserWriter) eq not and end invertflag and {not}if def +xflip yflip or{/noflips false def}if +/pgs xdf 2 index .72 mul exch div/pys xdf div .72 mul/pxs xdf ppr astore pop pgr astore pop/por xdf sn and/so xdf}bdf +/tab{userdict /11x17 known{userdict begin /11x17 load exec end}{statusdict /setpage known{statusdict begin 792 1224 1 setpage end}{statusdict /setpageparams known{statusdict begin 792 1224 0 1 setpageparams end}if}ifelse}ifelse}bdf +/a3Size{userdict /a3 known{userdict begin /a3 load exec end}{statusdict /setpageparams known{statusdict begin 842 1191 0 1 setpageparams end}if}ifelse}bdf +/txpose{fNote{smalls}{bigs}ifelse pgs get exec pxs pys scale ppr aload pop por{noflips{pop exch neg exch translate pop 1 -1 scale}if +xflip yflip and{pop exch neg exch translate 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if +xflip yflip not and{pop exch neg exch translate pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{ppr 1 get neg ppr 0 get neg translate}if} +{noflips{translate pop pop 270 rotate 1 -1 scale}if xflip yflip and{translate pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg translate}if +xflip yflip not and{translate pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 translate}if yflip xflip not and{translate pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 exch translate}if}ifelse +statusdict begin/waittimeout where{pop waittimeout 300 lt{statusdict/waittimeout 300 put}if}if end +scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy translate .96 dup scale neg exch neg exch translate}if}bdf +/fr{4 copy pgr aload pop 3 -1 roll add 3 1 roll exch add 6 2 roll 3 -1 roll +sub 3 1 roll exch sub 3 -1 roll exch div 3 1 roll div exch scale pop pop xl}bdf +/obl{{0.212557 mul}{pop 0}ifelse}bdf +/sfd{ps fg 5 -1 roll get mul 100 div 0 ps 5 -1 roll obl ps neg 0 0 6a astore makefont setfont}bdf +/fnt{findfont sfd}bdf +/bt{sa 3 1 roll 3 index and put}bdf +/sa(\000\000\000\000\000\000\000\000\000\000)def +/fs{0 1 bt 1 2 bt 2 4 bt 3 8 bt 4 16 bt 5 32 bt 6 64 bt 7 128 bt sa exch 8 exch put}bdf +/mx1 matrix def +/mx2 matrix def +/mx3 matrix def +/bu{currentpoint 4colors{currentcmykcolor}{currentrgbcolor}ifelse currentlinewidth currentlinecap currentlinejoin +currentdash exch aload length fg 5 sfl{1}{0}ifelse put pnsv pnsh +2t aload pop 3a aload pop mx2 aload pop mx1 aload pop mtx currentmatrix aload pop +mx3 aload pop ps pm restore/ps xdf mx3 astore pop}bdf +/bn{/pm save def mx3 setmatrix newpath 0 0 moveto ct dup 39 get 0 exch getinterval cvx exec mtx astore setmatrix mx1 astore pop mx2 astore pop 3a +astore pop 2t astore pop/pnsh xdf/pnsv xdf gw +/sfl fg 5 get 0 ne def array astore exch setdash setlinejoin setlinecap +setlinewidth 4colors{mysetcmykcolor}{setrgbcolor}ifelse moveto}bdf +/fc{}bdf +/tc{32768 div add 3 1 roll 32768 div add 2t astore pop}bdf +/3a [0 0 0] def +/2t 2 array def +/tp{3a astore pop}bdf +/tt{mx2 currentmatrix pop currentpoint 2 copy 2t aload pop qa 2 copy translate 3a aload pop exch dup 0 eq +{pop}{1 eq{-1 1}{1 -1}ifelse scale}ifelse rotate pop neg exch neg exch translate moveto}bdf +/te{mx2 setmatrix}bdf +/th{3 -1 roll div 3 1 roll exch div 2 copy mx1 scale pop scale/sfl true def}bdf +/tu{1 1 mx1 itransform scale/sfl false def}bdf +/ts{1 1 mx1 transform scale/sfl true def}bdf +/fz{/ps xdf}bdf +/dv{dup 0 ne{div}{pop}ifelse}bdf +/pop4{pop pop pop pop}bdf +/it{sfl{mx1 itransform}if}bdf +/gm{exch it moveto}bdf/rm{it rmoveto}bdf +/lm{currentpoint sfl{mx1 transform}if exch pop sub 0 exch it rmoveto}bdf +/fm{statusdict/manualfeed known}bdf +/se{statusdict exch/manualfeed exch put}bdf +/mf{dup/ma exch def 0 gt{fm se/t1 5 st ok ma 1 gt and{/t2 0 st/t3 0 st +statusdict/manualfeedtimeout 3600 put +}if}if}bdf +/jn{/statusdict where exch pop{statusdict exch /jobname exch put}if}bdf +/pen{pnm mul/pnsh xdf pnm mul/pnsv xdf pnsh setlinewidth}bdf +/min{2 copy gt{exch}if pop}bdf +/max{2 copy lt{exch}if pop}bdf +/dh{fg 6 1 put array astore dup {1 pxs div mul exch}forall astore exch pop exch pop exch setdash}bdf +/ih[currentdash]def +/rh{fg 6 0 put ih aload pop setdash}bdf +/dl{gsave nlw pys div setlinewidth 0 setgray}bdf +/dlin{exch currentpoint currentlinewidth 2 div dup +translate newpath moveto lineto currentpoint stroke grestore moveto}bdf +/lin{fg 6 get 0 ne{exch lineto currentpoint 0 doop moveto} +{exch currentpoint/pnlv xdf/pnlh xdf gsave newpath/@1 xdf/@2 xdf fp{pnlh @2 lt{pnlv @1 ge +{pnlh pnlv moveto @2 @1 lineto pnsh 0 rlineto +0 pnsv rlineto pnlh pnsh add pnlv pnsv add lineto pnsh neg 0 rlineto} +{pnlh pnlv moveto pnsh 0 rlineto @2 pnsh add @1 lineto 0 pnsv rlineto +pnsh neg 0 rlineto pnlh pnlv pnsv add lineto}ifelse}{pnlv @1 gt +{@2 @1 moveto pnsh 0 rlineto pnlh pnsh add pnlv lineto 0 pnsv rlineto +pnsh neg 0 rlineto @2 @1 pnsv add lineto}{pnlh pnlv moveto pnsh 0 rlineto +0 pnsv rlineto @2 pnsh add @1 pnsv add lineto pnsh neg 0 rlineto +0 pnsv neg rlineto}ifelse}ifelse +closepath fill}if @2 @1 grestore moveto}ifelse}bdf +/gw{/pnm fg 3 get fg 4 get div def}bdf +/lw{fg exch 4 exch put fg exch 3 exch put gw pnsv pnsh pen}bdf +/barc{/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf +/@6 xdf/@7 xdf/@8 xdf gsave +@5 @7 add 2 div @6 @8 add 2 div translate newpath 0 0 moveto +@5 @7 sub @6 @8 sub mtx currentmatrix pop scale @1{newpath}if +0 0 0.5 @4 @3 arc @4 @3 sub abs 360 ge{closepath}if +mtx setmatrix @2 doop grestore}bdf +/ar{dup 0 eq barc}bdf +/ov{0 exch 360 exch true barc}bdf +/rc{dup/@t xdf 0 eq{4 copy 3 -1 roll eq 3 1 roll eq and{pnsv 2 div sub exch pnsh 2 div sub exch 4 2 roll pnsv 2 div add exch pnsh 2 div add exch +/@t 1 def}if}if currentpoint 6 2 roll newpath 4 copy 4 2 roll exch moveto 6 -1 roll lineto lineto lineto closepath @t doop moveto}bdf +/mup{dup pnsh 2 div le exch pnsv 2 div le or}bdf +/rr{/@1 xdf 2. div/@2 xdf 2. div/@3 xdf +/@4 xdf/@5 xdf/@6 xdf/@7 xdf +@7 @5 eq @6 @4 eq @2 mup or or{@7 @6 @5 @4 @1 rc} +{@4 @6 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse +@5 @7 sub 2. div dup @2 lt{/@2 xdf}{pop}ifelse +@1 0 eq{/@2 @2 pnsh 2 div 2 copy gt{sub def}{0 pop4}ifelse}if +currentpoint newpath +@4 @6 add 2. div @7 moveto +@4 @7 @4 @5 @2 arcto pop4 +@4 @5 @6 @5 @2 arcto pop4 +@6 @5 @6 @7 @2 arcto pop4 +@6 @7 @4 @7 @2 arcto pop4 +closepath @1 doop moveto}ifelse}bdf +/pr{gsave newpath/pl{exch moveto/pl{exch lineto}def}def}bdf +/pl{exch lineto}bdf +/ep{dup 0 eq{{moveto}{exch lin}{}{(%%[|1|]%%)= flush}pathforall +pop grestore}{doop grestore}ifelse currentpoint newpath moveto}bdf +/gr{64. div setgray}bdf +/savescreen{ns not{/ns true def systemdict/currentcolorscreen known{currentcolorscreen/pkspf xdf/pkrot xdf/pkfreq xdf/pyspf xdf/pyrot xdf/pyfreq xdf/pmspf xdf/pmrot xdf/pmfreq xdf +/pcspf xdf/pcrot xdf/pcfreq xdf}{currentscreen/sspf xdf/srot xdf/sfreq xdf}ifelse}if}bdf +/restorescreen{/ns false def systemdict/setcolorscreen known{pcfreq pcrot/pcspf load pmfreq pmrot/pmspf load pyfreq pyrot/pyspf load +pkfreq pkrot/pkspf load setcolorscreen}{sfreq srot/sspf load setscreen}ifelse}bdf +/pat{savescreen sa8 +copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}setscreen exch not{gr}{pop}ifelse}bdf +/sg{restorescreen gr}bdf +/cpat{savescreen 10 2 roll 7 -1 roll sa8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}8 -1 roll sb8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sb8 +exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}9 -1 roll sc8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sc8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}10 -1 roll sd8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sd8 +exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}psuedo1 dsc 4{4 -1 roll 1 exch 64 div sub}repeat mysetcmykcolor pop pop}bdf +systemdict/setcolorscreen known{/psuedo1 lnop bdf/dsc/setcolorscreen load def}{/psuedo1{16{pop}repeat sa8 copy pop 9.375 pa por not{90 add}if{1 add 4 mul cvi sa8 exch get exch 1 add 4 mul cvi 7 sub bitshift 1 and}}bdf +/bwsc{setscreen dup gr 0 exch 0 exch 64 exch 64 exch 64 exch}bdf/dsc/bwsc load def +}ifelse +systemdict/setcmykcolor known{/mysetcmykcolor /setcmykcolor load def}{/mysetcmykcolor{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll}repeat setrgbcolor pop}bdf}ifelse +/dc{transform round .5 sub exch round .5 sub exch itransform}bdf +/sn{userdict/smooth4 known}bdf +/x8{3 bitshift}bdf +/x4{2 bitshift}bdf +/d4{-2 bitshift}bdf +/d8{-3 bitshift}bdf +/rb{15 add -4 bitshift 1 bitshift}bdf +/db{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf/@6 @5 @3 4 add mul def +dc translate scale/xdbit 1 1 idtransform abs/ydbit exch def abs def{0 0 1 ydbit add 1 10 rc clip}if +@1 0 eq @1 4 eq or{currentrgbcolor 1 setgray ydbit 0 1 ydbit add 1 2 rc setrgbcolor}if +@1 3 eq @1 7 eq or{1 setgray}{currentrgbcolor 2 index eq exch 2 index eq and exch pop{0 setgray}if}ifelse/@9 @1 0 eq @1 1 eq @1 3 eq or or dbinvertflag xor def/@13 @6 def +@2 fBitStretch or{/@10 @4 x4 def/@11 @3 x4 def/@12 @10 rb def/@13 @12 @11 mul def/@15 1 1 dtransform abs/calcY 1 index def round cvi/@14 exch def +abs/calcX 1 index def round cvi scaleby96 not{1 add}if def/@16 @15 rb def/@17 @16 @14 mul def}if +sn @13 60000 lt and @2 fBitStretch or and{mtx currentmatrix dup 1 get exch 2 get 0. eq exch 0. eq and @17 60000 lt and fBitStretch and{@16 3 bitshift @14 @9 [calcX 0 0 calcY 0 0]{@17 string @13 string +currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4 +@10 @11 @12 dup string 5 index @15 @14 @16 dup string stretch}imagemask}{@12 x8 @11 @9 [@10 0 0 @11 0 0]{@13 string +currentfile @6 string readhexstring pop 1 index @4 @3 @5 @12 @2 smooth4}imagemask}ifelse}{@5 3 bitshift @3 4 add @9 [@4 0 0 @3 0 2]{currentfile @6 string readhexstring pop}imagemask}ifelse +@7 restore}bdf +systemdict/setcmykcolor known{/psuedo lnop bdf/di/colorimage load def}{/routines[{.3 mul add 1}bind{.59 mul add 2}bind{.11 mul add round cvi str exch i exch put/i i 1 add def 0 0}bind]def +/psuedo{/i 0 def 0 exch 0 exch{exch routines exch get exec}forall pop pop str}bdf/bwi{pop pop image}bdf/di/bwi load def}ifelse +/cdb{/@7 save def/@1 xdf/@2 xdf/@3 xdf/@4 xdf/@5 xdf +systemdict/setcmykcolor known not{dc}if translate scale /@6 xdf +/@18 @5 dup 60000 ge{pop 60000}if string def @6 not{/str @18 0 @18 length 3 idiv getinterval def}if @4 @3 8 [@4 0 0 @3 0 0]@6{{currentfile @18 readhexstring pop}image}{{currentfile @18 readhexstring pop psuedo}false 3 di}ifelse @7 restore}bdf +/wd 16 dict def +/mfont 14 dict def +/mdf{mfont wcheck not{/mfont 14 dict def}if mfont begin xdf end}bdf +/cf{{1 index/FID ne{def}{pop pop}ifelse}forall}bdf/rf{/@1 exch def/@2 exch def +FontDirectory @2 known{cleartomark pop}{findfont dup begin dup length @1 add dict begin +cf{/Encoding macvec def}{Encoding dup length array copy/Encoding exch def +counttomark 2 idiv{Encoding 3 1 roll put}repeat}ifelse +pop +exec currentdict end end @2 exch definefont pop}ifelse}bdf +/bmbc{exch begin wd begin +/cr xdf +save +CharTable cr 6 mul 6 getinterval{}forall +/bitheight xdf/bitwidth xdf +.96 div/width xdf +Gkernmax add/XOffset xdf Gdescent add/YOffset xdf/rowbytes xdf +rowbytes 255 eq{0 0 0 0 0 0 setcachedevice} +{Gnormsize dup scale +width 0 XOffset YOffset bitwidth XOffset add bitheight YOffset add +setcachedevice +rowbytes 0 ne{ +XOffset YOffset translate newpath 0 0 moveto +bitwidth bitheight scale +sn{ +/xSmt bitwidth x4 def +/ySmt bitheight x4 def +/rSmt xSmt rb def +rSmt x8 ySmt true +[xSmt 0 0 ySmt neg 0 ySmt] +{rSmt ySmt mul string CharData cr get +1 index bitwidth bitheight rowbytes rSmt tso smooth4} +}{rowbytes 3 bitshift bitheight 4 add true +[bitwidth 0 0 bitheight neg 0 bitheight 2 add] +{CharData cr get} +}ifelse +imagemask +}if +}ifelse +restore +end end +}bdf +/bb{.96 exch div/Gnormsize mdf 2 index +/Gkernmax mdf 1 index/Gdescent mdf +3 index div 4 1 roll +2 index div 1. 5 2 roll +exch div 4 1 roll +4 array astore/FontBBox mdf +}bdf +/cdf{mfont/CharData get 3 1 roll put}bdf +/bf{ +mfont begin +/FontType 3 def +/FontMatrix [1 0 0 1 0 0] def +/Encoding macvec def +/MFontType 0 def +/BuildChar/bmbc load def +end +mfont definefont pop +}bdf +/wi LW 1 eq{{gsave 0 0 0 0 0 0 0 0 moveto lineto lineto lineto closepath clip stringwidth grestore}bind}{/stringwidth load}ifelse def +/aps{0 get 124 eq}bdf +/xc{s75 cvs dup}bdf +/xp{put cvn}bdf +/scs{xc 3 67 put dup 0 95 xp}bdf +/sos{xc 3 79 xp}bdf +/sbs{xc 1 66 xp}bdf +/sis{xc 2 73 xp}bdf +/sob{xc 2 79 xp}bdf +/sss{xc 4 83 xp}bdf +/dd{exch 1 index add 3 1 roll add exch}bdf +/smc{moveto dup show}bdf +/ndf2{udf{dup /FontType get 0 eq{/FDepVector get{dup /FontType get 0 eq{ndf2}{dup /df2 known{begin df2 0 null put end +}{pop}ifelse}ifelse}forall}{/df2 known{dup begin df2 0 null put end}if}ifelse}{pop}ifelse}bdf +/kwn{FontDirectory 1 index known{findfont dup ndf2 exch pop}}bdf +/gl{1 currentgray sub setgray}bdf +/newmm{dup /FontType get 0 eq{dup maxlength dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall currentdict end +dup /FDepVector 2 copy get[exch 6 index exch 6 index exch{newmm 3 1 roll}forall pop pop] put dup +}{/mfont 10 dict def mfont begin/FontMatrix [1 0 0 1 0 0] def +/FontType 3 def/Encoding macvec def/df 1 index def/df2 1 array def/FontBBox [0 0 1 1] def/StyleCode 2 index def +/mbc{bcarray StyleCode get}def/BuildChar{exch begin wd begin/cr exch def/cs s1 dup 0 cr put def df /MFontType known not{ +df2 0 get null eq{df dup length 2 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall +/StrokeWidth 1 0 FontMatrix idtransform pop dup nlw mul pys div ps div exch 0.012 mul 2 copy le{exch}if pop def/PaintType 2 def currentdict end +/q exch definefont df2 exch 0 exch put}if}if mbc exec end end}def end mfont}ifelse +3 index exch definefont exch pop}bdf +/mb{dup sbs kwn{0 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf +/mo{dup sos kwn{2 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf +/ms{dup sss kwn{4 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf +/ou{dup sos kwn{mfont/df2 known{mfont begin df2 0 null put end}if 3 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf +/su{dup sss kwn{mfont/df2 known{mfont begin df2 0 null put end}if 5 2 index findfont newmm exch pop exch pop exch pop}ifelse sfd}bdf +/ao{/fmv true def ou}bdf/as{/fmv true def su}bdf +/vo{/fmv false def ou}bdf/vs{/fmv false def su}bdf +/c{currentrgbcolor dup 4 1 roll eq 3 1 roll eq and/gray xdf}bdf +/bcarray[{/da .03 def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth +cs 0 0 smc da 0 smc da da smc 0 da moveto show}bind dup{/da 1 ps div def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth +cs 0 0 smc da 0 smc da da smc 0 da smc c gray{gl}{1 setgray}ifelse da 2. div dup moveto show}bind +{df setfont gsave cs wi grestore setcharwidth c gray{gl}{currentrgbcolor 1 setgray}ifelse cs 0 0 smc df2 0 get setfont +gray{gl}{4 1 roll setrgbcolor}ifelse 0 0 moveto show}bind +{/da 1 ps div def/ds .05 def/da2 da 2. div def df setfont gsave cs wi 1 index 0 ne{exch ds add da2 add exch}if grestore setcharwidth +cs ds da2 add .01 add 0 smc 0 ds da2 sub translate 0 0 smc da 0 smc da da smc 0 da smc c gray{gl}{1 setgray}ifelse da 2. div dup moveto show}bind +{/da .05 def df setfont gsave cs wi 1 index 0 ne{exch da add exch}if grestore setcharwidth c cs da .01 add 0 smc 0 da translate +gray{gl}{currentrgbcolor 1 setgray 4 -1 roll}ifelse 0 0 smc gray{gl}{4 1 roll setrgbcolor}ifelse df2 0 get setfont 0 0 moveto show}bind]def +/st{1000 mul usertime add dup 2147483647 gt{2147483647 sub}if def}bdf +/the{usertime sub dup 0 lt exch -2147483648 gt and}bdf +/6a 6 array def +/2a 2 array def +/3q 3 array def +/qs{3 -1 roll sub exch 3 -1 roll sub exch}bdf +/qa{3 -1 roll add exch 3 -1 roll add exch}bdf +/qm{3 -1 roll 1 index mul 3 1 roll mul}bdf +/qn{6a exch get mul}bdf +/qA .166667 def/qB .833333 def/qC .5 def +/qx{6a astore pop +qA 0 qn qB 2 qn add qA 1 qn qB 3 qn add +qB 2 qn qA 4 qn add qB 3 qn qA 5 qn add +qC 2 qn qC 4 qn add qC 3 qn qC 5 qn add}bdf +/qp{6 copy 12 -2 roll pop pop}bdf +/qc{exch qp qx curveto}bdf +/qi{{exch 4 copy 2a astore aload pop qa .5 qm newpath moveto}{exch 2 copy 6 -2 roll 2 qm qs 4 2 roll}ifelse}bdf +/qq{{qc 2a aload pop qx curveto}{exch 4 copy qs qa qx curveto}ifelse}bdf +/pt{currentpoint newpath moveto}bdf +/qf{/fillflag true def}bdf +/ec{dup 4 and 0 ne{closepath}if 1 and 0 ne{0 doop}if grestore currentpoint newpath moveto/fillflag false def}bdf +/eu{currentpoint fp{0 ep}{grestore newpath}ifelse moveto/fillflag false def}bdf +/bp{currentpoint newpath 2 copy moveto}bdf +/ef{gsave fillflag{gsave eofill grestore}if}bdf +/sm{0 exch{@1 eq{1 add}if}forall}bdf +/lshow{4 1 roll exch/@1 exch def{1 index wi pop sub 1 index sm dv 0 @1 4 -1 roll widthshow}{1 index wi pop sub +1 index dup sm 10 mul exch length 1 sub add dv dup 10. mul 0 @1 4 -1 roll 0 6 -1 roll awidthshow}ifelse}bdf +/setTxMode{sa 9 2 index put exch not{3 eq{1}{0}ifelse setgray}{pop}ifelse}bdf +/SwToSym{{}mark false/Symbol/|______Symbol 0 rf 0 sa 6 get 0 ne{pop 1}{sa 7 get 0 eq{pop 2}if}ifelse +sa 1 get 0 ne/|______Symbol +sa 4 get 0 ne{vs}{sa 3 get 0 ne{vo}{fnt}ifelse}ifelse}bdf +/mc{0 3 1 roll transform neg exch pop}bdf +/ul{dup 0 ne sa 2 get 0 ne and{gsave 0 0 +/UnderlinePosition kif{mc}{ps -10 div}ifelse/UnderlineThickness kif{mc}{ps 15 div}ifelse +abs setlinewidth neg rmoveto +sa 4 get 0 ne{gsave currentlinewidth 2. div dup rmoveto currentpoint newpath moveto +2 copy rlineto stroke grestore}if +sa 3 get sa 4 get or 0 ne{gsave currentrgbcolor dup 4 1 roll eq 3 1 roll eq and{gl}{1 setgray}ifelse 2 copy rlineto stroke grestore rlineto strokepath nlw pys div setlinewidth}{rlineto}ifelse +stroke grestore}{pop}ifelse}bdf +/sgt{2 copy known{get true}{pop pop false}ifelse}bdf +/kif{currentfont dup/FontMatrix get exch/FontInfo sgt{true}{currentfont/df sgt +{dup/FontInfo sgt{3 1 roll/FontMatrix get mtx concatmatrix exch true}{pop pop pop false} +ifelse}{pop pop false}ifelse}ifelse{3 -1 roll sgt{exch true}{pop false}ifelse}{false}ifelse}bdf +/blank/Times-Roman findfont/CharStrings get/space get def +/macvec 256 array def +/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI +/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US +macvec 0 32 getinterval astore pop +macvec 32/Times-Roman findfont/Encoding get +32 96 getinterval putinterval macvec dup 39/quotesingle put 96/grave put +/Adieresis/Aring/Ccedilla/Eacute/Ntilde/Odieresis/Udieresis/aacute +/agrave/acircumflex/adieresis/atilde/aring/ccedilla/eacute/egrave +/ecircumflex/edieresis/iacute/igrave/icircumflex/idieresis/ntilde/oacute +/ograve/ocircumflex/odieresis/otilde/uacute/ugrave/ucircumflex/udieresis +/dagger/degree/cent/sterling/section/bullet/paragraph/germandbls +/registered/copyright/trademark/acute/dieresis/notequal/AE/Oslash +/infinity/plusminus/lessequal/greaterequal/yen/mu/partialdiff/summation +/product/pi/integral/ordfeminine/ordmasculine/Omega/ae/oslash +/questiondown/exclamdown/logicalnot/radical/florin/approxequal/Delta/guillemotleft +/guillemotright/ellipsis/blank/Agrave/Atilde/Otilde/OE/oe +/endash/emdash/quotedblleft/quotedblright/quoteleft/quoteright/divide/lozenge +/ydieresis/Ydieresis/fraction/currency/guilsinglleft/guilsinglright/fi/fl +/daggerdbl/periodcentered/quotesinglbase/quotedblbase/perthousand/Acircumflex/Ecircumflex/Aacute +/Edieresis/Egrave/Iacute/Icircumflex/Idieresis/Igrave/Oacute/Ocircumflex +/apple/Ograve/Uacute/Ucircumflex/Ugrave/dotlessi/circumflex/tilde +/macron/breve/dotaccent/ring/cedilla/hungarumlaut/ogonek/caron +macvec 128 128 getinterval astore pop +{}mark true/Courier/|______Courier 0 rf +{/Metrics 21 dict begin/zero 600 def/one 600 def/two 600 def/three 600 def/four 600 def/five 600 def/six 600 def/seven 600 def/eight 600 def +/nine 600 def/comma 600 def/period 600 def/dollar 600 def/numbersign 600 def/percent 600 def/plus 600 def/hyphen 600 def/E 600 def/parenleft 600 def/parenright 600 def/space 600 def +currentdict end def currentdict/UniqueID known{/UniqueID 16#800000 def}if/FontBBox FontBBox 4 array astore def}mark true/Helvetica/|______Seattle 1 rf +/oldsettransfer/settransfer load def +/concatprocs{/proc2 exch cvlit def/proc1 exch cvlit def/newproc proc1 length proc2 length add array def +newproc 0 proc1 putinterval newproc proc1 length proc2 putinterval newproc cvx}def +/settransfer{currenttransfer concatprocs oldsettransfer}def +/PaintBlack{{1 exch sub}settransfer gsave newpath clippath 1 setgray fill grestore}def +/od{(Rvd\001\001\000\000\177) fg copy pop txpose +1 0 mtx defaultmatrix dtransform exch atan/pa exch def +newpath clippath mark +{transform{itransform moveto}}{transform{itransform lineto}} +{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform +{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}} +{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put +10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if +statusdict/processcolors known{statusdict begin processcolors end 4 eq{/4colors true def}if}if}bdf +/cd{}bdf +/op{/sfl false def systemdict/currentcolorscreen known{dcfreq dcrot/dcspf load dmfreq dmrot/dmspf load dyfreq dyrot/dyspf load +dkfreq dkrot/dkspf load setcolorscreen}{freq rot/spf load setscreen}ifelse savescreen +/ns false def/pm save def}bdf +/cp{not{userdict/#copies 0 put}if ma 0 gt{{t1 the{exit}if}loop}if{/copypage load exec}{/showpage load exec}ifelse pm restore}bdf +/px{0 3 1 roll tp tt}bdf +/psb{/us save def}bdf +/pse{us restore}bdf +/ct 40 string def +/nc{currentpoint initclip newpath gc{dup type dup/arraytype eq exch/packedarraytype eq or{exec}if} +forall clip newpath moveto}def +/kp{ct 0 2 index length 2 index 39 2 index put getinterval copy cvx exec mx3 currentmatrix pop}bdf +end +LW 1 eq userdict/a4small known not and{/a4small +[[300 72 div 0 0 -300 72 div -120 3381] +280 3255 +{statusdict/jobstate (printing) put 0 setblink +margins +exch 196 add exch 304 add 8 div round cvi frametoroket +statusdict/jobstate (busy) put +1 setblink} +/framedevice load +60 45{dup mul exch dup mul add 1.0 exch sub}/setscreen load +{}/settransfer load/initgraphics load/erasepage load]cvx +statusdict begin bind end readonly def}if +md begin/bigs[lnop userdict/letter known{/letter load}{lnop}ifelse userdict/legal known{/legal load}{lnop}ifelse userdict/a4 known{/a4 load}{lnop}ifelse userdict/b5 known{/b5 load}{lnop}ifelse +lnop lnop lnop /tab load/a3Size load]def +/smalls[lnop userdict/lettersmall known{/lettersmall load}{userdict/note known{/note load}{lnop}ifelse}ifelse +userdict/legal known{/legal load}{lnop}ifelse userdict/a4small known{/a4small load}{lnop}ifelse +userdict/b5 known{/b5 load}{userdict/note known{/note load}{lnop}ifelse}ifelse lnop lnop lnop /tab load/a3Size load]def end +systemdict/currentpacking known{setpacking}if +%{currentfile eexec} ( %endeexec) ok userdict/stretch known not and checkload +currentfile ok userdict/stretch known not and {eexec}{readtocleartomark}ifelse +373A767D4B7FD94FE5903B7014B1B8D3BED02632C855D56F458B118ACF3AF73FC4EF5E81F5749042B5F9CF1016D093B75F250B7D8280B2EACE05A37037F7BDF6E12226D7D4E2DF2C52FAFD5FD40FE72A0D3AC4BD485D8369D4C87636E920D1DAF222D92155A9CB1667E715F0B82799B37CC8F5B32B74B39CF494536DC39C7EF04A7BCB29E2CEC79073CADCCFB23B4AA1363F876F5121B618071B7B4EB1E5DE75FAA2368A3E5DB2B198623AFE92AE9484270FE7F57A850E88C0D3EEA156611C91D8E480D4370B025CCA6929A2BF40AD3D01B2CB7EE6DFB46E12A830542337F7819B67F9765210F76DB06F34DA5B13A11759305C582E16D2B854939F6D9121F2A4F285282F5DCD3D15896D121E3D6F5BE79E087451BB0ED233CDBEF090D3B4AC2DC34B97E70C61D95FB072B8C12D2ABD843520949A39DCF99E2C1AA8FBCD025E47E0A82A8D96E75BAF40F52AD402495BBD4DE0F356C8B14E764874E639C9F045A0D1908EC6456EB6C5B8A6F826192F767EF2C55A21C58F5F9CC1F59247B55F2387828C7FE89D5E7D8484D1BC86CB6673BDBE4FE17DD9BDE95224FE645136F41330BF155A4DDE1B0A32233BF471CE58FBC660DC7E641B0A0D30018454E2191C414A3011FF3FED1C0D88FE1FF9F75DCC456D097947226FBEC92509146D3A4CFFC0471B31C53222ED9DD88566F60F6C0D705AD79DACF53B070026F083ED28B5CF75 + +7X +AAA0A169F6F320A75E9D2ED50ABD939AF85B6346C2ADB25D168F10508E1516D194C635E6B187FADEA0829DBF0390C0F003F0265E215BC96CA3CC13D4A8E01570BE193CA75A620728CD275ACF1986EFFB3A13419FE55EA7C4467B7E7EEDC1FC29C9F8C46A557D2CCDB914EF7B93E7530D555DFC2398AFC68CAD991F062EF85BAA1884EC166C7C5DF8543666D8C41BE267D706BD1588F1F662F705CAE4D29DC38EF66BFAA89470D8A099B6F1B4587F7B024412276106FCD3EB5AE17A5D1DF1781992DC40EA0A992F706F701304CEA9D9073E7A74F1E687D81C3E5841D31CF86855BAAAD9B5D30317C75150A857C6B114735315CDD1AEF36C26BBB0645499406DEE2F24B3B1C72FEC97C7BA31AA2CDAB25418BB1DC4C7E4757F1D625087B0FD0300C03A65F2A72CE734925735277E034CDCF599129679F70CC8B66E03878851DB75041F275E1E5761F3EC753BE1359CA364A22047AE4886217F9259FE19FF5B116E8019B98B143114B313E8BEF87EC949D85C82E0812E6F50525E73890AF362CC8EE8A85F4197E6AC18638EF12E56A808D439AF1BFD363F140314BF4E534485C42F1856688CC35288E8D770120A420FB9F1FCF8AE8BD6D6156CC23E6C51119FE4DE1B68C9DF3487E9974BF9ED31F8D3CE93FF101867319F2FF492D5D398B4F09A66F2F55BCAB34B99173B7EE89039D00DD21A7B3A52E9F028F8301B5FC12D4094 + +1X +2E064513BC579AAC498F577EA8ECD1FE3E42DC3CC320786C7B00194FEDF344402C33FC492D4BA86992B01683F440220FFE756BC88A94223D316078D69D33560E8EAB76B24CB7AA4320CF435593D76F624324ABE00B5587A4F283C725EA24567133F25F472B5E2E4474DDB5A16AC5F2DF32350395D3E3892FE361F4D5C9A610C654C9227614FBBAFF3356A90A2266E00F66234061075491571A65616211257F160000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + %endeexec + +%{currentfile eexec} ( %endeexec) ok userdict/smooth4 known not and checkload +currentfile ok userdict/smooth4 known not and {eexec}{readtocleartomark}ifelse +F94E00EE41A71C59E5CAEED1EDBCF23D1DBA1EE99B9BB356492923BD8B1BA83A87CEB0E07377A31FD6241E814681118E17DC7CACE570399506E6E441B871B6043831BD03EFC11DBBD8001EE2FF8CFBD485065D455A2E15AC36F1A84AD8789FA6461199C7CD14CB9FD64D4B06452B7FC0A8FC263F70F1CCB893295D4DE70ADAB771C0F84396FA98C60B11DA02ABA157298DF0A23621853BEF167443A985ADC09BEFFD51CB4D29179E2B34609EF38A49DA61F4BFC256A3DE0732D7D29754A194857B9C9E9971227AA1DD0611FBB10E44E5FF66C062D9C24ED3290529330BC317825E876929582DB0E39B9FC5EFD20CC1D4F94920EB9C534D0DA90DE70D25BC7287319CF28602B3F46633C242CAFC8905E960317E3C2FA20AB8DB06ADBAF292FC7BA2CA14EE65DF28B99CC11666B70AD33E8E1D57D63D4B89ECC615AE5747C1CA752C833D8D6DE54CD4A0350B44310555CE3BD2C615ADD27B634CDB350AF3A432CE78AACD2909A5B586F666CD87919A36DB1CBE86B3CE281DFD01CD7E1B8A18A4B415CECBFF79A5C4390A15EA77D14D6BE12BAB5A8268C3F286D0590060647CABED674443CD258F11415E866AB330A251691B61F2422A61AFE59B6B4FBDCF85ED9BA0F8E483C034089E6877FF5923698D3A0DC0EED6B9CFD32DF0839BC4EA5F6D1FCB6DD0920391E57E84745131D02D100179F4E0A68EC0A5FF6680A6F463D038 + +BX +04AF63FFA13D743B995A26A743C26D387209023C91DE43DF047A16F328AC9DDC08573B38BE9EA341EA16C78EC32F3A1B36B90D95A50610F4D050EC1C33497F3F3A81A1B4C8BEF0BA84EE2FAA32DC112DAC490AF53E1749C4A0D866CAF7B893E52383B0D38065C333FB122B700D7246F7EE87D942AE3DB5C1DD77E9E76C80CC5AD63D28DFED0E229CE604673F78CD47F258FDF5BF3A3EAEC5C9BC8E482D8DBA9D268A35DA8C095A690679ED2123E8B8F5E4826FA3B199EAA5D482D4B6AA86572E387CECEB7149C8947F41D6339328A748A17F8C4AD3B0555F1E409450BA0C564F1F488BB5096EB003568D4D5EF6489897E27409547D0EE4487D30184793B0F27BD265A64BDB3EA6761569DA955620C612E718677B77D6D81B999C6298877AFE0D1D6F6F358377A8BD2402F669C64B972B3A065EF7DD4BDEFFFE17E63DB8898FA6E69166B710AAD6BA2EA9AF61E4B8C8701638D4D6E4DFFFC192AEF6BC027095C4C72D748979675BA29FAF61E75343E14E61034602E5A79CD2519796ED6A9CC4EDEA46A9B59D4A807E786B5EE46F25B0360BC8E7C12D723122CDEEF247C9776F4C99C8EBED6828AA19744B5ADF0D07D95D98B3072372388D41B0FAB1CCE2775170679575ECDCA13B22A17FE9C6605C3445F58F1A829512DAB6C528F83580C8AA53C35D605F626F5AD0B7FC1EA87D69A835E3F53A1F450FB0AF42A5772F89D92A + +5X +0D10F15BDBDA409F50C0B8AB93FE8A16D029DD8BB5C480D1466735ED4D9CAF637E5ECD6C2ECB6BF3B3EFBEE7AB936D2C568E3009D156B87CACB1FB3A48A70BC91B2EC35CC9147FFB1A524E2B2F2E4E2C1B12F1C1C63768BB95CD62FEC01CBA79B9FA282DD4DF49990F27FF8EE4E2DDE2F0ACD83BC9D4BE0090192C7A799967EC4DC2D63C0835E22D4C4B366D7FDCF3A05A4B53DF780F986EF25C79B665D5C00EFF7F17C0BB6D544F9D83A7FDAC47D9C5683A656011374253C918FF6EA64749DD971B2300DD5320033E01EC591F6318CCE94CE2B81C04322EC52B624E50643B52391CC +D2AB56396A2AD8E2D3CA61B80D9D4CC363B2DF7863526958CDF3497E36648406C317E58EC563E7C26149A2A3C643ADFB39A8DD92974C6D2A2A9D7B71CDF3FEBBF32BB02E7B45CF53AAEAD5E963A4AA4AF9A149A08A4EC303D5F2369977E93F54897EEAD31B06C5845D63F49D65F8E5573962241A57CCD717CE6CA8C784A11192943616EA059B51BC38429E18D0121FCBB6FBD5D909B0D89E616C66DEF6A0F165A7030BD911A1B120468329CBB006C8D37720E531CF31E878CB4AAAC137633675C3D546F5162487AB35F470C042BDEB945E0F2532BF92AA6FD53434440221ECD3533A7AA89900CB19EFE2CD872DF8B7969AF0D3B72BF31DC5DD69CA6460966F61AB17CB507964098DBA3AF122EEC3128A9BAFE1034493F372B36BD1351205E9043A67C544402D8BCE24358C8A5CE33867A00794CF7097D59C88279A11EE9C854E7E7AAE881F9828C569D208F5F33375F59E9A3818CFA38AAD0CBFBA32F9F44A8BB79DE4C40E3886457C16DA4A27953AA1E99472E35F2323F0BAA5E37DC28CBA46FEFB73B190016055ADD4D27615D748499A0E1C4B8C7EC339C1C4D95A813A85918A8D01EEB485DDCDCEA6EA3F2C2A9D85C139CD90CCB352634F9AFE836BCAC0C274E352BA2071B5269D5DE4CCDE3FF990CBA974980C7332AE1545A9C60D5D1459D3AE95C1AC065733AF14FADB440A110DD539563B8D850CD0704C52F3F7CCCB + +5X +3630D776560CBD22D8FF08F5B354487A171AEC15F5F54DE9CAB668BCAC573E788D92762EF63E76087005F4AC2D02E0CAC173C11BE62ACE5DC4D3374F2F9746C9981E125FF9AB8CAE76D13039E2C54DFD708E028A619EA1ED78E6B46F06DF0D0B74BBEDD8C190C7C0CEBDE8F7A4888CC36575313478DD2CFE392E9BB7B2416955D44B7024A3BA43FBF37293B386D64746D7748895411D243FAEC50638F2AA33337D7FA018ADDAC5835A0DDFAE99AD6299DFB4CA6872C59853E3AC12FC9E3D26629C5B49CF844C87B3C4BFBE3074E3A1CE6984758C20C661084381CD6B4582D84F19C0000B5FC0DCB42B567E396031601C095D7016283EBE5F13CD8A3A374A74DDBBABD36081149F8BC242085F2F7297CC97FD3B8BAD206D8AC9707A39ECCC7963B522E08DA391A1EF12DD4D746DBDDDCC0834F88160CF189A9645567CEC2F023A571AF0DFD15DB85B744C28C000DF53B05F8F210841F6E87A04F20C777B7C0BE6182BE2E90226E5301A12532A745F2FAAA81637CF11B78CD2B99A4D18B862D6C5DBD31793FB16A2D9AAD376D4484D75AA833D0068B1D34DB74E3302480854E3B5484D8A47E39A89A2FA927BC3641EA7F8E004FDE4C2F08D40D99F1ACB47CAF6887629BF6DFE12968D297596D28CE0CF148B12E7DCB49FB94F5ADBD214C3A6CE1E249831BA9EB8A189F2CE1ABE39A7B537253E369A508A2AF2ADB9463F9B56BB + +BX +FF31D535FF997F537C6675C196E7ECBD493F652FA7CC6D9C1CA3379BFDB5AF7513C6E834054494296B91A6EE800114363D5D5D0759F41B4DECB653B9DE3E94583579EF549ED5F3FAFB12661ABC0C57A332406517ED3454EDED34B386C60F78DC976266E0EAF54FC245FB0E3EFC8016236436B599C1C97A8C5E0AC8F7836161873C71F01ED9CC25C236420F41FD8277993D3959205912FA0927B59E3DAE7377D82079447D6E41EE5AEC0DFFF79AF8F4ED47F17EE708FEA45877860D56F8CBCE65A061E8E1CA4A5FBAF0E13429A7F0ADB6F178FA449F46CC539BBC0107E3A53B1C362A0 +4B20E6D721E7E6E1E4976A11DDC98C7614D22B53DFBB6DAE533AC9BE882021A735C30DAA4A44AED09F49A390E8CFF59BD9C30667AF21B03EC5CEBD5C2C3AA2769E8D714191A48E7DDF50B13D1560E82EFB65FCE601AE9E8C351FBA1DED80B7351314E7F9F9A784BFE3759B7E322A84E7B51F9DC5F5D9C8050CD79B27C0A4B0DD68A3C27A948AD6858E35B960D2DEA838C479CAEA83B1A912174ACB2100E55E7A14892D7A9B3711FF0B20065C1995B49E1F23464A92DD140642E3A7B1973849E64D1A3CF60000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + %endeexec + +%%EndProcSet diff --git a/Build/source/utils/psutils/patchlev.h.in b/Build/source/utils/psutils/patchlev.h.in new file mode 100644 index 00000000000..8f957dcf464 --- /dev/null +++ b/Build/source/utils/psutils/patchlev.h.in @@ -0,0 +1,6 @@ +/* + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + */ +#define RELEASE 1 +#define PATCHLEVEL 17 diff --git a/Build/source/utils/psutils/psbook.c b/Build/source/utils/psutils/psbook.c new file mode 100644 index 00000000000..6bc468e1a50 --- /dev/null +++ b/Build/source/utils/psutils/psbook.c @@ -0,0 +1,111 @@ +/* psbook.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * rearrange pages in conforming PS file for printing in signatures + * + * Usage: + * psbook [-q] [-s<signature>] [infile [outfile]] + */ + +#include "psutil.h" +#include "pserror.h" +#include "patchlev.h" + +char *program ; +int pages ; +int verbose ; +FILE *infile ; +FILE *outfile ; +char pagelabel[BUFSIZ] ; +int pageno ; + +static void usage(void) +{ + fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); + fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); + fprintf(stderr, "Usage: %s [-q] [-s<signature>] [infile [outfile]]\n", + program); + fprintf(stderr, " <signature> must be positive and divisible by 4\n"); + fflush(stderr); + exit(1); +} + + +void main(int argc, char *argv[]) +{ + int signature = 0; + int currentpg, maxpage; + + infile = stdin; + outfile = stdout; + verbose = 1; + for (program = *argv++; --argc; argv++) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case 's': /* signature size */ + signature = atoi(*argv+2); + if (signature < 1 || signature % 4) usage(); + break; + case 'q': /* quiet */ + verbose = 0; + break; + case 'v': /* version */ + default: + usage(); + } + } else if (infile == stdin) { + if ((infile = fopen(*argv, OPEN_READ)) == NULL) + message(FATAL, "can't open input file %s\n", *argv); + } else if (outfile == stdout) { + if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) + message(FATAL, "can't open output file %s\n", *argv); + } else usage(); + } +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + if ( infile == stdin ) { + int fd = fileno(stdin) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't open input file %s\n", argv[4]); + } + if ( outfile == stdout ) { + int fd = fileno(stdout) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdout to binary mode\n"); + } +#endif + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + scanpages(); + + if (!signature) + signature = maxpage = pages+(4-pages%4)%4; + else + maxpage = pages+(signature-pages%signature)%signature; + + /* rearrange pages */ + writeheader(maxpage); + writeprolog(); + writesetup(); + for (currentpg = 0; currentpg < maxpage; currentpg++) { + int actualpg = currentpg - currentpg%signature; + switch(currentpg%4) { + case 0: + case 3: + actualpg += signature-1-(currentpg%signature)/2; + break; + case 1: + case 2: + actualpg += (currentpg%signature)/2; + break; + } + if (actualpg < pages) + writepage(actualpg); + else + writeemptypage(); + } + writetrailer(); + + exit(0); +} diff --git a/Build/source/utils/psutils/psbook.man b/Build/source/utils/psutils/psbook.man new file mode 100644 index 00000000000..6f5ad6d7927 --- /dev/null +++ b/Build/source/utils/psutils/psbook.man @@ -0,0 +1,42 @@ +.TH PSBOOK 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +psbook \- rearrange pages in PostScript file into signatures +.SH SYNOPSIS +.B psbook +[ +.B \-q +] [ +.B \-s\fIsignature\fR +] [ +.I infile +[ +.I outfile +] ] +.SH DESCRIPTION +.I Psbook +rearranges pages from a PostScript document into ``signatures'' for +printing books or booklets, creating a new PostScript file. The +input PostScript file should follow the Adobe Document Structuring +Conventions. +.PP +The +.I \-s +option selects the size of signature which will be used. The signature size is +the number of sides which will be folded and bound together; the number given +should be a multiple of four. The default is to use one signature for the +whole file. Extra blank sides will be added if the file does not contain a +multiple of four pages. +.PP +Psbook normally prints the page numbers of the pages rearranged; the +.I \-q +option suppresses this. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I Psbook +does not accept all DSC comments. diff --git a/Build/source/utils/psutils/pserror.c b/Build/source/utils/psutils/pserror.c new file mode 100644 index 00000000000..114d7e1b5fa --- /dev/null +++ b/Build/source/utils/psutils/pserror.c @@ -0,0 +1,122 @@ +/* pserror.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * Warnings and errors for PS programs + */ + +extern char *program ; /* Defined by main program, giving program name */ + +#include "psutil.h" +#include "pserror.h" +#include "patchlev.h" + +#include <string.h> + +/* Message functions; there is a single are varargs functions for messages, + warnings, and errors sent to stderr. If called with the flags MESSAGE_EXIT + set, the routine does not return */ + +#define MAX_MESSAGE 256 /* maximum formatted message length */ +#define MAX_FORMAT 16 /* maximum format length */ +#define MAX_COLUMN 78 /* maximum column to print upto */ + +void message(int flags, char *format, ...) +{ + va_list args ; + static column = 0 ; /* current screen column for message wrap */ + char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */ + char *bufptr = msgbuf ; /* message buffer pointer */ + + if ( (flags & MESSAGE_NL) && column != 0 ) { /* new line if not already */ + putc('\n', stderr) ; + column = 0 ; + } + + if ( flags & MESSAGE_PROGRAM ) { + strcpy(bufptr, program) ; + bufptr += strlen(program) ; + *bufptr++ = ':' ; + *bufptr++ = ' ' ; + } + + va_start(args, format) ; + if ( format != NULL ) { + char c ; + while ( (c = *format++) != '\0' ) { + if (c == '%') { + int done, longform, index ; + char fmtbuf[MAX_FORMAT] ; + longform = index = 0 ; + fmtbuf[index++] = c ; + do { + done = 1 ; + fmtbuf[index++] = c = *format++ ; + fmtbuf[index] = '\0' ; + switch (c) { + case '%': + *bufptr++ = '%' ; + case '\0': + break ; + case 'e': case 'E': case 'f': case 'g': case 'G': + { + double d = va_arg(args, double) ; + sprintf(bufptr, fmtbuf, d) ; + bufptr += strlen(bufptr) ; + } + break ; + case 'c': case 'd': case 'i': case 'o': + case 'p': case 'u': case 'x': case 'X': + if ( longform ) { + long l = va_arg(args, long) ; + sprintf(bufptr, fmtbuf, l) ; + } else { + int i = va_arg(args, int) ; + sprintf(bufptr, fmtbuf, i) ; + } + bufptr += strlen(bufptr) ; + break ; + case 's': + { + char *s = va_arg(args, char *) ; + sprintf(bufptr, fmtbuf, s) ; + bufptr += strlen(bufptr) ; + } + break ; + case 'l': + longform = 1 ; + /* FALLTHRU */ + default: + done = 0 ; + } + } while ( !done ) ; + } else if ( c == '\n' ) { /* write out message so far and reset column */ + int len = bufptr - msgbuf ; /* length of current message */ + *bufptr++ = '\n' ; + *bufptr = '\0' ; + if ( column + len > MAX_COLUMN && column > 0 ) { + putc('\n', stderr) ; + column = 0 ; + } + fputs(bufptr = msgbuf, stderr) ; + column = 0 ; + } else + *bufptr++ = c ; + } + *bufptr = '\0' ; + { + int len = bufptr - msgbuf ; /* length of current message */ + if ( column + len > MAX_COLUMN && column > 0 ) { + putc('\n', stderr) ; + column = 0 ; + } + fputs(msgbuf, stderr) ; + column += len ; + } + fflush(stderr) ; + } + va_end(args) ; + + if ( flags & MESSAGE_EXIT ) /* don't return to program */ + exit(1) ; +} diff --git a/Build/source/utils/psutils/pserror.h b/Build/source/utils/psutils/pserror.h new file mode 100644 index 00000000000..21eee15aaa4 --- /dev/null +++ b/Build/source/utils/psutils/pserror.h @@ -0,0 +1,20 @@ +/* pserror.h + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * Header file for external functions in pserror.c + */ + +#include <stdarg.h> + +/* message flags */ +#define MESSAGE_NL 1 /* Newline before message if necessary */ +#define MESSAGE_PROGRAM 2 /* announce program name */ +#define MESSAGE_EXIT 4 /* do not return */ + +/* message types */ +#define FATAL (MESSAGE_EXIT|MESSAGE_PROGRAM|MESSAGE_NL) +#define WARN (MESSAGE_NL|MESSAGE_PROGRAM) +#define LOG 0 + +extern void message(int flags, char *format, ...) ; diff --git a/Build/source/utils/psutils/psmerge.man b/Build/source/utils/psutils/psmerge.man new file mode 100644 index 00000000000..4bce92da61b --- /dev/null +++ b/Build/source/utils/psutils/psmerge.man @@ -0,0 +1,36 @@ +.TH PSMERGE 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +psmerge \- filter to merge several PostScript files into one +.SH SYNOPSIS +.B psmerge +[ +.B \-o\fIout.ps\fB +] +[ +.I file.ps ... +] +.SH DESCRIPTION +.I Psmerge +merges PostScript documents into a single document. It only works in the +specific case the the files were created using the same application, with the +same device setup and resources (fonts, procsets, patterns, files, etc) +loaded. + +If the +.B \-o +option is used, output will be sent to the file named, otherwise it will go to +standard output. + +.I Psmerge +will merge multiple files concatenated into a single file as if they +were in separate files. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I psmerge +is for a very specific case; it does not merge files in the general case. diff --git a/Build/source/utils/psutils/psmerge.pl b/Build/source/utils/psutils/psmerge.pl new file mode 100644 index 00000000000..a1a9db7c086 --- /dev/null +++ b/Build/source/utils/psutils/psmerge.pl @@ -0,0 +1,85 @@ +@PERL@ +# psmerge: merge PostScript files produced by same application and setup +# usage: psmerge [-oout.ps] [-thorough] file1.ps file2.ps ... +# +# Copyright (C) Angus J. C. Duggan 1991-1995 +# See file LICENSE for details. + +$prog = ($0 =~ s=.*/==); + +while ($ARGV[0] =~ /^-/) { + $_ = shift; + if (/^-o(.+)/) { + if (!close(STDOUT) || !open(STDOUT, ">$1")) { + print STDERR "$prog: can't open $1 for output\n"; + exit 1; + } + } elsif (/^-t(horough)?$/) { + $thorough = 1; + } else { + print STDERR "Usage: $prog [-oout] [-thorough] file...\n"; + exit 1; + } +} + +$page = 0; +$first = 1; +$nesting = 0; + +@header = (); +$header = 1; + +@trailer = (); +$trailer = 0; + +@pages = (); +@body = (); + +@resources = (); +$inresource = 0; + +while (<>) { + if (/^%%BeginFont:/ || /^%%BeginResource:/ || /^%%BeginProcSet:/) { + $inresource = 1; + push(@resources, $_); + } elsif ($inresource) { + push(@resources, $_); + $inresource = 0 if /^%%EndFont/ || /^%%EndResource/ || /^%%EndProcSet/; + } elsif (/^%%Page:/ && $nesting == 0) { + $header = $trailer = 0; + push(@pages, join("", @body)) if @body; + $page++; + @body = ("%%Page: ($page) $page\n"); + } elsif (/^%%Trailer/ && $nesting == 0) { + push(@trailer, $_); + push(@pages, join("", @body)) if @body; + @body = (); + $trailer = 1; + $header = 0; + } elsif ($header) { + push(@trailer, $_); + push(@pages, join("", @body)) if @body; + @body = (); + $trailer = 1; + $header = 0; + } elsif ($trailer) { + if (/^%!/ || /%%EOF/) { + $trailer = $first = 0; + } elsif ($first) { + push(@trailer, $_); + } + } elsif (/^%%BeginDocument/ || /^%%BeginBinary/ || /^%%BeginFile/) { + push(@body, $_); + $nesting++; + } elsif (/^%%EndDocument/ || /^%%EndBinary/ || /^%%EndFile/) { + push(@body, $_); + $nesting--; + } else { + print $_ if $print; + } +} + +print @trailer; + +exit 0; +@END@ diff --git a/Build/source/utils/psutils/psnup.c b/Build/source/utils/psutils/psnup.c new file mode 100644 index 00000000000..03fa0e901ef --- /dev/null +++ b/Build/source/utils/psutils/psnup.c @@ -0,0 +1,336 @@ +/* psnup.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * put multiple pages onto one physical sheet of paper + * + * Usage: + * psnup [-q] [-w<dim>] [-h<dim>] [-ppaper] [-b<dim>] [-m<dim>] + * [-l] [-c] [-f] [-sscale] [-d<wid>] [-nup] [in [out]] + * -w<dim> sets the paper width + * -h<dim> sets the paper height + * -ppaper sets the paper size (width and height) by name + * -W<dim> sets the input paper width, if different from output + * -H<dim> sets the input paper height, if different from output + * -Ppaper sets the input paper size, if different from output + * -m<dim> sets the margin around the paper + * -b<dim> sets the border around each page + * -sscale alters the scale at which the pages are displayed + * -l used if pages are in landscape orientation (rot left) + * -r used if pages are in seascape orientation (rot right) + * -c for column-major layout + * -f for flipped (wider than tall) pages + * -d<wid> to draw the page boundaries + */ + +#include "psutil.h" +#include "psspec.h" +#include "pserror.h" +#include "patchlev.h" + +char *program ; +int pages ; +int verbose ; +FILE *infile ; +FILE *outfile ; +char pagelabel[BUFSIZ] ; +int pageno ; + +static void usage(void) +{ + fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); + fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); + fprintf(stderr, "Usage: %s [-q] [-wwidth] [-hheight] [-ppaper] [-Wwidth] [-Hheight] [-Ppaper] [-l] [-r] [-c] [-f] [-mmargin] [-bborder] [-dlwidth] [-sscale] [-nup] [infile [outfile]]\n", + program); + fflush(stderr); + exit(1); +} + +static void argerror(void) +{ + message(FATAL, "bad dimension\n"); +} + +#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#define MAX(x,y) ((x) > (y) ? (x) : (y)) + +/* return next larger exact divisor of number, or 0 if none. There is probably + * a much more efficient method of doing this, but the numbers involved are + * small, so it's not a big loss. */ +static int nextdiv(int n, int m) +{ + while (++n <= m) { + if (m%n == 0) + return (n); + } + return (0); +} + +void main(int argc, char *argv[]) +{ + int horiz, vert, rotate, column, flip, leftright, topbottom; + int nup = 1; + double draw = 0; /* draw page borders */ + double scale; /* page scale */ + double uscale = 0; /* user supplied scale */ + double ppwid, pphgt; /* paper dimensions */ + double margin, border; /* paper & page margins */ + double vshift, hshift; /* page centring shifts */ + double iwidth, iheight ; /* input paper size */ + double tolerance = 100000; /* layout tolerance */ + Paper *paper; + +#ifdef PAPER + if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { + width = (double)PaperWidth(paper); + height = (double)PaperHeight(paper); + } +#endif + + margin = border = vshift = hshift = column = flip = 0; + leftright = topbottom = 1; + iwidth = iheight = -1 ; + + infile = stdin; + outfile = stdout; + verbose = 1; + for (program = *argv++; --argc; argv++) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case 'q': /* quiet */ + verbose = 0; + break; + case 'd': /* draw borders */ + if (argv[0][2]) + draw = singledimen(*argv+2, argerror, usage); + else + draw = 1; + break; + case 'l': /* landscape (rotated left) */ + column = !column; + topbottom = !topbottom; + break; + case 'r': /* seascape (rotated right) */ + column = !column; + leftright = !leftright; + break; + case 'f': /* flipped */ + flip = 1; + break; + case 'c': /* column major layout */ + column = !column; + break; + case 'w': /* page width */ + width = singledimen(*argv+2, argerror, usage); + break; + case 'W': /* input page width */ + iwidth = singledimen(*argv+2, argerror, usage); + break; + case 'h': /* page height */ + height = singledimen(*argv+2, argerror, usage); + break; + case 'H': /* input page height */ + iheight = singledimen(*argv+2, argerror, usage); + break; + case 'm': /* margins around whole page */ + margin = singledimen(*argv+2, argerror, usage); + break; + case 'b': /* border around individual pages */ + border = singledimen(*argv+2, argerror, usage); + break; + case 't': /* layout tolerance */ + tolerance = atof(*argv+2); + break; + case 's': /* override scale */ + uscale = atof(*argv+2); + break; + case 'p': /* output (and by default input) paper type */ + if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { + width = (double)PaperWidth(paper); + height = (double)PaperHeight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", *argv+2); + break; + case 'P': /* paper type */ + if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { + iwidth = (double)PaperWidth(paper); + iheight = (double)PaperHeight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", *argv+2); + break; + case 'n': /* n-up, for compatibility with other psnups */ + if (argc >= 2) { + argv++; + argc--; + if ((nup = atoi(*argv)) < 1) + message(FATAL, "-n %d too small\n", nup); + } else + message(FATAL, "argument expected for -n\n"); + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + nup = atoi(*argv+1); + break; + case 'v': /* version */ + default: + usage(); + } + } else if (infile == stdin) { + if ((infile = fopen(*argv, OPEN_READ)) == NULL) + message(FATAL, "can't open input file %s\n", *argv); + } else if (outfile == stdout) { + if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) + message(FATAL, "can't open output file %s\n", *argv); + } else usage(); + } +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + if ( infile == stdin ) { + int fd = fileno(stdin) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't open input file %s\n", argv[4]); + } + if ( outfile == stdout ) { + int fd = fileno(stdout) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdout to binary mode\n"); + } +#endif + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + if (width <= 0 || height <= 0) + message(FATAL, "page width and height must be set\n"); + + /* subtract paper margins from height & width */ + ppwid = width - margin*2; + pphgt = height - margin*2; + + if (ppwid <= 0 || pphgt <= 0) + message(FATAL, "paper margins are too large\n"); + + /* set default values of input height & width */ + if ( iwidth > 0 ) + width = iwidth ; + if ( iheight > 0 ) + height = iheight ; + + /* Finding the best layout is an optimisation problem. We try all of the + * combinations of width*height in both normal and rotated form, and + * minimise the wasted space. */ + { + double best = tolerance; + int hor; + for (hor = 1; hor; hor = nextdiv(hor, nup)) { + int ver = nup/hor; + /* try normal orientation first */ + double scl = MIN(pphgt/(height*ver), ppwid/(width*hor)); + double optim = (ppwid-scl*width*hor)*(ppwid-scl*width*hor) + + (pphgt-scl*height*ver)*(pphgt-scl*height*ver); + if (optim < best) { + best = optim; + /* recalculate scale to allow for internal borders */ + scale = MIN((pphgt-2*border*ver)/(height*ver), + (ppwid-2*border*hor)/(width*hor)); + hshift = (ppwid/hor - width*scale)/2; + vshift = (pphgt/ver - height*scale)/2; + horiz = hor; vert = ver; + rotate = flip; + } + /* try rotated orientation */ + scl = MIN(pphgt/(width*hor), ppwid/(height*ver)); + optim = (pphgt-scl*width*hor)*(pphgt-scl*width*hor) + + (ppwid-scl*height*ver)*(ppwid-scl*height*ver); + if (optim < best) { + best = optim; + /* recalculate scale to allow for internal borders */ + scale = MIN((pphgt-2*border*hor)/(width*hor), + (ppwid-2*border*ver)/(height*ver)); + hshift = (ppwid/ver - height*scale)/2; + vshift = (pphgt/hor - width*scale)/2; + horiz = ver; vert = hor; + rotate = !flip; + } + } + + /* fail if nothing better than worst tolerance was found */ + if (best == tolerance) + message(FATAL, "can't find acceptable layout for %d-up\n", nup); + } + + if (flip) { /* swap width & height for clipping */ + double tmp = width; + width = height; + height = tmp; + } + + if (rotate) { /* rotate leftright and topbottom orders */ + int tmp = topbottom; + topbottom = !leftright; + leftright = tmp; + column = !column; + } + + /* now construct specification list and run page rearrangement procedure */ + { + int page = 0; + PageSpec *specs, *tail; + + tail = specs = newspec(); + + while (page < nup) { + int up, across; /* page index */ + + if (column) { + if (leftright) /* left to right */ + across = page/vert; + else /* right to left */ + across = horiz-1-page/vert; + if (topbottom) /* top to bottom */ + up = vert-1-page%vert; + else /* bottom to top */ + up = page%vert; + } else { + if (leftright) /* left to right */ + across = page%horiz; + else /* right to left */ + across = horiz-1-page%horiz; + if (topbottom) /* top to bottom */ + up = vert-1-page/horiz; + else /* bottom to top */ + up = page/horiz; + } + if (rotate) { + tail->xoff = margin + (across+1)*ppwid/horiz - hshift; + tail->rotate = 90; + tail->flags |= ROTATE; + } else { + tail->xoff = margin + across*ppwid/horiz + hshift; + } + tail->pageno = page; + if (uscale > 0) + tail->scale = uscale; + else + tail->scale = scale; + tail->flags |= SCALE; + tail->yoff = margin + up*pphgt/vert + vshift; + tail->flags |= OFFSET; + if (++page < nup) { + tail->flags |= ADD_NEXT; + tail->next = newspec(); + tail = tail->next; + } + } + + pstops(nup, 1, 0, specs, draw); /* do page rearrangement */ + } + + exit(0); +} + diff --git a/Build/source/utils/psutils/psnup.man b/Build/source/utils/psutils/psnup.man new file mode 100644 index 00000000000..3edd10b4f40 --- /dev/null +++ b/Build/source/utils/psutils/psnup.man @@ -0,0 +1,160 @@ +.TH PSNUP 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +psnup \- multiple pages per sheet +.SH SYNOPSIS +.B psnup +[ +.B \-w\fIwidth\fR +] [ +.B \-h\fIheight\fR +] [ +.B \-p\fIpaper\fR +] [ +.B \-W\fIwidth\fR +] [ +.B \-H\fIheight\fR +] [ +.B \-P\fIpaper\fR +] [ +.B \-l +] [ +.B \-r +] [ +.B \-f +] [ +.B \-c +] [ +.B \-m\fImargin\fR +] [ +.B \-b\fIborder\fR +] [ +.B \-d\fIlwidth\fR +] [ +.B \-s\fIscale\fR +] [ +.B \-\fInup\fR +] [ +.B \-q +] [ +.I infile +[ +.I outfile +] ] +.SH DESCRIPTION +.I Psnup +puts multiple logical pages onto each physical sheet of paper. +The input PostScript file should follow the Adobe Document Structuring +Conventions. +.PP +The +.I \-w +option gives the paper width, and the +.I \-h +option gives the paper height, +normally specified in +.B "cm" +or +.B "in" +to convert +PostScript's points (1/72 of an inch) +to centimeters or inches. +The +.I \-p +option can be used as an alternative, to set the paper size to +.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto +or +.B 10x14. +The default paper size is +.B @PAPER@. +The +.I \-W, \-H, +and +.I \-P +options set the input paper size, if it is different from the output +size. This makes it easy to impose pages of one size on a different size of +paper. +.PP +The +.I \-l +option should be used for pages which are in landscape orientation (rotated 90 +degrees anticlockwise). The +.I \-r +option should be used for pages which are in seascape orientation (rotated 90 +degrees clockwise), and the +.I \-f +option should be used for pages which have the width and height interchanged, +but are not rotated. +.PP +.I Psnup +normally uses `row-major' layout, where adjacent pages are placed in rows +across the paper. +The +.I \-c +option changes the order to `column-major', where successive pages are placed +in columns down the paper. +.PP +A margin to leave around the whole page can be specified with the +.I \-m +option. This is useful for sheets of `thumbnail' pages, because the normal +page margins are reduced by putting multiple pages on a single sheet. +.PP +The +.I \-b +option is used to specify an additional margin around each page on a sheet. +.PP +The +.I \-d +option draws a line around the border of each page, of the specified width. +If the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is +assumed. The linewidth is relative to the original page dimensions, +\fIi.e.\fR it is scaled down with the rest of the page. +.PP +The scale chosen by +.I psnup +can be overridden with the +.I \-s +option. This is useful to merge pages which are already reduced. +.PP +The +.I \-\fInup\fR +option selects the number of logical pages to put on each sheet of paper. This +can be any whole number; +.I psnup +tries to optimise the layout so that the minimum amount of space is wasted. If +.I psnup +cannot find a layout within its tolerance limit, it will abort with an error +message. The alternative form +.I \i \fInup\fR +can also be used, for compatibility with other n-up programs. +.PP +.I Psnup +normally prints the page numbers of the pages re-arranged; the +.I \-q +option suppresses this. +.SH EXAMPLES +The potential use of this utility is varied but one particular +use is in conjunction with +.I psbook(1). +For example, using groff to create a PostScript document and lpr as +the +.SM UNIX +print spooler a typical command line might look like this: +.sp +groff -Tps -ms \fIfile\fP | psbook | psnup -2 | lpr +.sp +Where file is a 4 page document this command will result in a +two page document printing two pages of \fIfile\fP per page and +rearranges the page order to match the input pages 4 and 1 +on the first output page and +pages 2 then 3 of the input document +on the second output page. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I Psnup +does not accept all DSC comments. diff --git a/Build/source/utils/psutils/psresize.c b/Build/source/utils/psutils/psresize.c new file mode 100644 index 00000000000..9a8fd984abe --- /dev/null +++ b/Build/source/utils/psutils/psresize.c @@ -0,0 +1,180 @@ +/* psresize.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * alter pagesize of document + * + * Usage: + * psresize [-q] [-w<dim>] [-h<dim>] [-ppaper] [-W<dim>] [-H<dim>] + * [-Ppaper] [in [out]] + * -w<dim> sets the output paper width + * -h<dim> sets the output paper height + * -ppaper sets the output paper size (width and height) by name + * -W<dim> sets the input paper width + * -H<dim> sets the input paper height + * -Ppaper sets the input paper size (width and height) by name + */ + +#include "psutil.h" +#include "psspec.h" +#include "pserror.h" +#include "patchlev.h" + +char *program ; +int pages ; +int verbose ; +FILE *infile ; +FILE *outfile ; +char pagelabel[BUFSIZ] ; +int pageno ; + +static void usage(void) +{ + fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); + fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); + fprintf(stderr, "Usage: %s [-q] [-wwidth] [-hheight] [-ppaper] [-Wwidth] [-Hheight] [-Ppaper] [infile [outfile]]\n", + program); + fflush(stderr); + exit(1); +} + +static void argerror(void) +{ + message(FATAL, "bad dimension\n"); +} + +#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#define MAX(x,y) ((x) > (y) ? (x) : (y)) + +void main(int argc, char *argv[]) +{ + double scale, rscale; /* page scale */ + double waste, rwaste; /* amount wasted */ + double vshift, hshift; /* page centring shifts */ + int rotate; + double inwidth = -1; + double inheight = -1; + Paper *paper; + PageSpec *specs; + +#ifdef PAPER + if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { + inwidth = width = (double)PaperWidth(paper); + inheight = height = (double)PaperHeight(paper); + } +#endif + + vshift = hshift = 0; + rotate = 0; + + infile = stdin; + outfile = stdout; + verbose = 1; + for (program = *argv++; --argc; argv++) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case 'q': /* quiet */ + verbose = 0; + break; + case 'w': /* page width */ + width = singledimen(*argv+2, argerror, usage); + break; + case 'h': /* page height */ + height = singledimen(*argv+2, argerror, usage); + break; + case 'p': /* paper type */ + if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { + width = (double)PaperWidth(paper); + height = (double)PaperHeight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", *argv+2); + break; + case 'W': /* input page width */ + inwidth = singledimen(*argv+2, argerror, usage); + break; + case 'H': /* input page height */ + inheight = singledimen(*argv+2, argerror, usage); + break; + case 'P': /* input paper type */ + if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { + inwidth = (double)PaperWidth(paper); + inheight = (double)PaperHeight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", *argv+2); + break; + case 'v': /* version */ + default: + usage(); + } + } else if (infile == stdin) { + if ((infile = fopen(*argv, OPEN_READ)) == NULL) + message(FATAL, "can't open input file %s\n", *argv); + } else if (outfile == stdout) { + if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) + message(FATAL, "can't open output file %s\n", *argv); + } else usage(); + } +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + if ( infile == stdin ) { + int fd = fileno(stdin) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't open input file %s\n", argv[4]); + } + if ( outfile == stdout ) { + int fd = fileno(stdout) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdout to binary mode\n"); + } +#endif + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + if (width <= 0 || height <= 0) + message(FATAL, "output page width and height must be set\n"); + + if (inwidth <= 0 || inheight <= 0) + message(FATAL, "input page width and height must be set\n"); + + /* try normal orientation first */ + scale = MIN(width/inwidth, height/inheight); + waste = (width-scale*inwidth)*(width-scale*inwidth) + + (height-scale*inheight)*(height-scale*inheight); + hshift = (width - inwidth*scale)/2; + vshift = (height - inheight*scale)/2; + + /* try rotated orientation */ + rscale = MIN(height/inwidth, width/inheight); + rwaste = (height-scale*inwidth)*(height-scale*inwidth) + + (width-scale*inheight)*(width-scale*inheight); + if (rwaste < waste) { + double tmp = width; + scale = rscale; + hshift = (width + inheight*scale)/2; + vshift = (height - inwidth*scale)/2; + rotate = 1; + width = height; + height = tmp; + } + + width /= scale; + height /= scale; + + /* now construct specification list and run page rearrangement procedure */ + specs = newspec(); + + if (rotate) { + specs->rotate = 90; + specs->flags |= ROTATE; + } + specs->pageno = 0; + specs->scale = scale; + specs->flags |= SCALE; + specs->xoff = hshift; + specs->yoff = vshift; + specs->flags |= OFFSET; + + pstops(1, 1, 0, specs, 0.0); /* do page rearrangement */ + + exit(0); +} + diff --git a/Build/source/utils/psutils/psresize.man b/Build/source/utils/psutils/psresize.man new file mode 100644 index 00000000000..f7ba9cb3093 --- /dev/null +++ b/Build/source/utils/psutils/psresize.man @@ -0,0 +1,81 @@ +.TH PSRESIZE 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +psresize \- multiple pages per sheet +.SH SYNOPSIS +.B psresize +[ +.B \-w\fIwidth\fR +] [ +.B \-h\fIheight\fR +] [ +.B \-p\fIpaper\fR +] [ +.B \-W\fIwidth\fR +] [ +.B \-H\fIheight\fR +] [ +.B \-P\fIpaper\fR +] [ +.B \-q +] [ +.I infile +[ +.I outfile +] ] +.SH DESCRIPTION +.I Psresize +rescales and centres a document on a different size of paper. +The input PostScript file should follow the Adobe Document Structuring +Conventions. +.PP +The +.I \-w +option gives the output paper width, and the +.I \-h +option gives the output paper height, normally specified in +.B "cm" +or +.B "in" +to convert +PostScript's points (1/72 of an inch) +to centimeters or inches. +The +.I \-p +option can be used as an alternative, to set the output paper size to +.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto +or +.B 10x14. +The default output paper size is +.B @PAPER@. +.PP +The +.I \-W +option gives the input paper width, and the +.I \-H +option gives the input paper height. +The +.I \-P +option can be used as an alternative, to set the input paper size. +The default input paper size is +.B @PAPER@. +.PP +.I Psresize +normally prints the page numbers of the pages output; the +.I \-q +option suppresses this. +.SH EXAMPLES +The following command can be used to convert a document on A4 size paper to +letter size paper: +.sp +psresize -PA4 -pletter in.ps out.ps +.sp +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I Psresize +does not accept all DSC comments. diff --git a/Build/source/utils/psutils/psselect.c b/Build/source/utils/psutils/psselect.c new file mode 100644 index 00000000000..fcb3dff57ac --- /dev/null +++ b/Build/source/utils/psutils/psselect.c @@ -0,0 +1,239 @@ +/* psselect.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * rearrange pages in conforming PS file for printing in signatures + * + * Usage: + * psselect [-q] [-e] [-o] [-r] [-p<pages>] [infile [outfile]] + */ + +#include "psutil.h" +#include "pserror.h" +#include "patchlev.h" + +char *program ; +int pages ; +int verbose ; +FILE *infile ; +FILE *outfile ; +char pagelabel[BUFSIZ] ; +int pageno ; + +static void usage(void) +{ + fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); + fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); + fprintf(stderr, + "Usage: %s [-q] [-e] [-o] [-r] [-p<pages>] [infile [outfile]]\n", + program); + fflush(stderr); + exit(1); +} + +typedef struct pgrange { + int first, last; + struct pgrange *next; +} PageRange ; + +static PageRange *makerange(int beg, int end, PageRange *next) +{ + PageRange *new; + if ((new = (PageRange *)malloc(sizeof(PageRange))) == NULL) + message(FATAL, "out of memory\n"); + new->first = beg; + new->last = end; + new->next = next; + return (new); +} + + +static PageRange *addrange(char *str, PageRange *rp) +{ + int first=0; + int sign; + sign = (*str == '_' && ++str) ? -1 : 1; + if (isdigit(*str)) { + first = sign*atoi(str); + while (isdigit(*str)) str++; + } + switch (*str) { + case '\0': + if (first || sign < 0) + return (makerange(first, first, rp)); + break; + case ',': + if (first || sign < 0) + return (addrange(str+1, makerange(first, first, rp))); + break; + case '-': + case ':': + str++; + sign = (*str == '_' && ++str) ? -1 : 1; + if (!first) + first = 1; + if (isdigit(*str)) { + int last = sign*atoi(str); + while (isdigit(*str)) str++; + switch (*str) { + case '\0': + return (makerange(first, last, rp)); + case ',': + return (addrange(str+1, makerange(first, last, rp))); + } + } else if (*str == '\0') + return (makerange(first, -1, rp)); + else if (*str == ',') + return (addrange(str+1, makerange(first, -1, rp))); + } + message(FATAL, "invalid page range\n"); + return (PageRange *)0 ; +} + + +void main(int argc, char *argv[]) +{ + int currentpg, maxpage = 0; + int even = 0, odd = 0, reverse = 0; + int pass, all; + PageRange *pagerange = NULL; + + infile = stdin; + outfile = stdout; + verbose = 1; + for (program = *argv++; --argc; argv++) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case 'e': /* even pages */ + even = 1; + break; + case 'o': /* odd pages */ + odd = 1; + break; + case 'r': /* reverse */ + reverse = 1; + break; + case 'p': /* page spec */ + pagerange = addrange(*argv+2, pagerange); + break; + case 'q': /* quiet */ + verbose = 0; + break; + case 'v': /* version */ + default: + usage(); + } + } else if (pagerange == NULL && !reverse && !even && !odd) { + pagerange = addrange(*argv, NULL); + } else if (infile == stdin) { + if ((infile = fopen(*argv, OPEN_READ)) == NULL) + message(FATAL, "can't open input file %s\n", *argv); + } else if (outfile == stdout) { + if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) + message(FATAL, "can't open output file %s\n", *argv); + } else usage(); + } +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + if ( infile == stdin ) { + int fd = fileno(stdin) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't open input file %s\n", argv[4]); + } + if ( outfile == stdout ) { + int fd = fileno(stdout) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdout to binary mode\n"); + } +#endif + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + scanpages(); + + /* select all pages or all in range if odd or even not set */ + all = !(odd || even); + + /* add default page range */ + if (!pagerange) + pagerange = makerange(1, -1, NULL); + + /* reverse page list if not reversing pages (list constructed bottom up) */ + if (!reverse) { + PageRange *revlist = NULL; + PageRange *next = NULL; + while (pagerange) { + next = pagerange->next; + pagerange->next = revlist; + revlist = pagerange; + pagerange = next; + } + pagerange = revlist; + } else { /* swap start & end if reversing */ + PageRange *r; + for (r = pagerange; r; r = r->next) { + int temp = r->last; + r->last = r->first; + r->first = temp; + } + } + + { /* adjust for end-relative pageranges */ + PageRange *r; + for (r = pagerange; r; r = r->next) { + if (r->first < 0) { + r->first += pages + 1; + if (r->first < 1) + r->first = 1; + } + if (r->last < 0) { + r->last += pages + 1; + if (r->last < 1) + r->last = 1; + } + } + } + + /* count pages on first pass, select pages on second pass */ + for (pass = 0; pass < 2; pass++) { + PageRange *r; + if (pass) { /* write header on second pass */ + writeheader(maxpage); + writeprolog(); + writesetup(); + } + for (r = pagerange; r; r = r->next) { + if (r->last < r->first) { + for (currentpg = r->first; currentpg >= r->last; currentpg--) { + if (currentpg == 0 || + (currentpg <= pages && + ((currentpg&1) ? (odd || all) : (even || all)))) { + if (pass) { + if (currentpg) + writepage(currentpg-1); + else + writeemptypage() ; + } else + maxpage++; + } + } + } else { + for (currentpg = r->first; currentpg <= r->last; currentpg++) { + if (currentpg == 0 || + (currentpg <= pages && + ((currentpg&1) ? (odd || all) : (even || all)))) { + if (pass) { + if (currentpg) + writepage(currentpg-1); + else + writeemptypage() ; + } else + maxpage++; + } + } + } + } + } + writetrailer(); + + exit(0); +} diff --git a/Build/source/utils/psutils/psselect.man b/Build/source/utils/psutils/psselect.man new file mode 100644 index 00000000000..5311db233e3 --- /dev/null +++ b/Build/source/utils/psutils/psselect.man @@ -0,0 +1,84 @@ +.TH PSSELECT 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +psselect \- select pages from a PostScript file +.SH SYNOPSIS +.B psselect +[ +.B \-q +] [ +.B \-e +] [ +.B \-o +] [ +.B \-r +] [ +.B \-p\fIpages\fR +] [ +.I pages +] [ +.I infile +[ +.I outfile +] ] +.SH DESCRIPTION +.I Psselect +selects pages from a PostScript document, creating a new PostScript file. The +input PostScript file should follow the Adobe Document Structuring +Conventions. +.PP +The +.I \-e +option selects all of the even pages; it may be used in conjunction with the +other page selection options to select the even pages from a range of pages. +.PP +The +.I \-o +option selects all of the odd pages; it may be used in conjunction with the +other page selection options. +.PP +The +.I \-p\fIpages\fR +option specifies the pages which are to be selected. +.I Pages +is a comma separated list of page ranges, each of which may be a page number, +or a page range of the form \fIfirst\fR-\fIlast\fR. If \fIfirst\fR is omitted, +the +first page is assumed, and if \fIlast\fR is omitted, the last page is assumed. + +The prefix character `_' indicates that the page number is relative to the end +of the document, counting backwards. If just this character with no page +number is used, a blank page will be inserted. +.PP +The +.I \-r +option causes +.I psselect +to output the selected pages in reverse order. +.PP +Psselect normally prints the page numbers of the pages rearranged; the +.I \-q +option suppresses this. +.PP +If any of the +.I \-r, \-e, +or +.I \-o +options are specified, the page range must be given with the +.I \-p +option. This is for backwards compatibility with previous versions. + +.SH NOTES +The page number given to +.I psselect +is the number of the page counting from the start or end of the file, starting +at one. The actual page number in the document may be different. +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I Psselect +does not accept all DSC comments. diff --git a/Build/source/utils/psutils/psspec.c b/Build/source/utils/psutils/psspec.c new file mode 100644 index 00000000000..88d46f07a43 --- /dev/null +++ b/Build/source/utils/psutils/psspec.c @@ -0,0 +1,249 @@ +/* psspec.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * page spec routines for page rearrangement + */ + +#include "psutil.h" +#include "psspec.h" +#include "pserror.h" +#include "patchlev.h" + +#include <string.h> + +double width = -1; +double height = -1; + +/* create a new page spec */ +PageSpec *newspec(void) +{ + PageSpec *temp = (PageSpec *)malloc(sizeof(PageSpec)); + if (temp == NULL) + message(FATAL, "out of memory\n"); + temp->reversed = temp->pageno = temp->flags = temp->rotate = 0; + temp->scale = 1; + temp->xoff = temp->yoff = 0; + temp->next = NULL; + return (temp); +} + +/* dimension parsing routines */ +int parseint(char **sp, void (*errorfn)(void)) +{ + char *s = *sp; + int num = atoi(s); + + while (isdigit(*s)) + s++; + if (*sp == s) (*errorfn)() ; + *sp = s; + return (num); +} + +double parsedouble(char **sp, void (*errorfn)(void)) +{ + char *s = *sp; + double num = atof(s); + + while (isdigit(*s) || *s == '-' || *s == '.') + s++; + if (*sp == s) (*errorfn)() ; + *sp = s; + return (num); +} + +double parsedimen(char **sp, void (*errorfn)(void)) +{ + double num = parsedouble(sp, errorfn); + char *s = *sp; + + if (strncmp(s, "pt", 2) == 0) { + s += 2; + } else if (strncmp(s, "in", 2) == 0) { + num *= 72; + s += 2; + } else if (strncmp(s, "cm", 2) == 0) { + num *= 28.346456692913385211; + s += 2; + } else if (strncmp(s, "mm", 2) == 0) { + num *= 2.8346456692913385211; + s += 2; + } else if (*s == 'w') { + if (width < 0) + message(FATAL, "width not initialised\n"); + num *= width; + s++; + } else if (*s == 'h') { + if (height < 0) + message(FATAL, "height not initialised\n"); + num *= height; + s++; + } + *sp = s; + return (num); +} + +double singledimen(char *str, void (*errorfn)(void), void (*usagefn)(void)) +{ + double num = parsedimen(&str, errorfn); + if (*str) (*usagefn)(); + return (num); +} + +static char *prologue[] = { /* PStoPS procset */ +#ifndef SHOWPAGE_LOAD + "userdict begin", + "[/showpage/erasepage/copypage]{dup where{pop dup load", /* prevent */ + " type/operatortype eq{1 array cvx dup 0 3 index cvx put", /* binding */ + " bind def}{pop}ifelse}{pop}ifelse}forall", /* in prolog */ +#else + "userdict begin", + "[/showpage/copypage/erasepage]{dup 10 string cvs dup", + " length 6 add string dup 0 (PStoPS) putinterval dup", + " 6 4 -1 roll putinterval 2 copy cvn dup where", + " {pop pop pop}{exch load def}ifelse cvx cvn 1 array cvx", + " dup 0 4 -1 roll put def}forall", +#endif + "[/letter/legal/executivepage/a4/a4small/b5/com10envelope", /* nullify */ + " /monarchenvelope/c5envelope/dlenvelope/lettersmall/note", /* paper */ + " /folio/quarto/a5]{dup where{dup wcheck{exch{}put}", /* operators */ + " {pop{}def}ifelse}{pop}ifelse}forall", + "/setpagedevice {pop}bind 1 index where{dup wcheck{3 1 roll put}", + " {pop def}ifelse}{def}ifelse", + "/PStoPSmatrix matrix currentmatrix def", + "/PStoPSxform matrix def/PStoPSclip{clippath}def", + "/defaultmatrix{PStoPSmatrix exch PStoPSxform exch concatmatrix}bind def", + "/initmatrix{matrix defaultmatrix setmatrix}bind def", + "/initclip[{matrix currentmatrix PStoPSmatrix setmatrix", + " [{currentpoint}stopped{$error/newerror false put{newpath}}", + " {/newpath cvx 3 1 roll/moveto cvx 4 array astore cvx}ifelse]", + " {[/newpath cvx{/moveto cvx}{/lineto cvx}", + " {/curveto cvx}{/closepath cvx}pathforall]cvx exch pop}", + " stopped{$error/errorname get/invalidaccess eq{cleartomark", + " $error/newerror false put cvx exec}{stop}ifelse}if}bind aload pop", + " /initclip dup load dup type dup/operatortype eq{pop exch pop}", + " {dup/arraytype eq exch/packedarraytype eq or", + " {dup xcheck{exch pop aload pop}{pop cvx}ifelse}", + " {pop cvx}ifelse}ifelse", + " {newpath PStoPSclip clip newpath exec setmatrix} bind aload pop]cvx def", + "/initgraphics{initmatrix newpath initclip 1 setlinewidth", + " 0 setlinecap 0 setlinejoin []0 setdash 0 setgray", + " 10 setmiterlimit}bind def", + "end", + NULL + }; + +void pstops(int modulo, int pps, int nobind, PageSpec *specs, double draw) +{ + int thispg, maxpage; + int pageindex = 0; + char **pro; + + scanpages(); + + maxpage = ((pages+modulo-1)/modulo)*modulo; + + /* rearrange pages: doesn't cope properly with loaded definitions */ + writeheader((maxpage/modulo)*pps); +#ifndef SHOWPAGE_LOAD + writestring("%%BeginProcSet: PStoPS"); +#else + writestring("%%BeginProcSet: PStoPS-spload"); +#endif + if (nobind) + writestring("-nobind"); + writestring(" 1 15\n"); + for (pro = prologue; *pro; pro++) { + writestring(*pro); + writestring("\n"); + } + if (nobind) /* desperation measures */ + writestring("/bind{}def\n"); + writestring("%%EndProcSet\n"); + /* save transformation from original to current matrix */ + if (writepartprolog()) { + writestring("userdict/PStoPSxform PStoPSmatrix matrix currentmatrix\n"); + writestring(" matrix invertmatrix matrix concatmatrix\n"); + writestring(" matrix invertmatrix put\n"); + } + writesetup(); + for (thispg = 0; thispg < maxpage; thispg += modulo) { + int add_last = 0; + PageSpec *ps; + for (ps = specs; ps != NULL; ps = ps->next) { + int actualpg; + int add_next = ((ps->flags & ADD_NEXT) != 0); + if (ps->reversed) + actualpg = maxpage-thispg-modulo+ps->pageno; + else + actualpg = thispg+ps->pageno; + if (actualpg < pages) + seekpage(actualpg); + if (!add_last) { /* page label contains original pages */ + PageSpec *np = ps; + char *eob = pagelabel; + char sep = '('; + do { + *eob++ = sep; + if (np->reversed) + sprintf(eob, "%d", maxpage-thispg-modulo+np->pageno); + else + sprintf(eob, "%d", thispg+np->pageno); + eob = eob + strlen(eob); + sep = ','; + } while ((np->flags & ADD_NEXT) && (np = np->next)); + strcpy(eob, ")"); + writepageheader(pagelabel, ++pageindex); + } + writestring("userdict/PStoPSsaved save put\n"); + if (ps->flags & GSAVE) { + char buffer[BUFSIZ]; + writestring("PStoPSmatrix setmatrix\n"); + if (ps->flags & OFFSET) { + sprintf(buffer, "%f %f translate\n", ps->xoff, ps->yoff); + writestring(buffer); + } + if (ps->flags & ROTATE) { + sprintf(buffer, "%d rotate\n", ps->rotate); + writestring(buffer); + } + if (ps->flags & SCALE) { + sprintf(buffer, "%f dup scale\n", ps->scale); + writestring(buffer); + } + writestring("userdict/PStoPSmatrix matrix currentmatrix put\n"); + if (width > 0 && height > 0) { + char buffer[BUFSIZ]; + writestring("userdict/PStoPSclip{0 0 moveto\n"); + sprintf(buffer, " %f 0 rlineto 0 %f rlineto -%f 0 rlineto\n", + width, height, width); + writestring(buffer); + writestring(" closepath}put initclip\n"); + if (draw > 0) { + sprintf(buffer, "gsave clippath 0 setgray %f setlinewidth stroke grestore\n", draw); + writestring(buffer); + } + } + } + if (add_next) { +#ifndef SHOWPAGE_LOAD + writestring("/showpage{}def/copypage{}def/erasepage{}def\n"); +#else + writestring("/PStoPSshowpage{}store/PStoPScopypage{}store/PStoPSerasepage{}store\n"); +#endif + } + if (actualpg < pages) { + writepagesetup(); + writestring("PStoPSxform concat\n"); + writepagebody(actualpg); + } else { + writestring("PStoPSxform concat\n"); + writestring("showpage\n"); + } + writestring("PStoPSsaved restore\n"); + add_last = add_next; + } + } + writetrailer(); +} diff --git a/Build/source/utils/psutils/psspec.h b/Build/source/utils/psutils/psspec.h new file mode 100644 index 00000000000..ce796f5407a --- /dev/null +++ b/Build/source/utils/psutils/psspec.h @@ -0,0 +1,30 @@ +/* psspec.h + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * routines for page rearrangement specs + */ + +/* pagespec flags */ +#define ADD_NEXT (0x01) +#define ROTATE (0x02) +#define SCALE (0x04) +#define OFFSET (0x08) +#define GSAVE (ROTATE|SCALE|OFFSET) + +typedef struct pagespec { + int reversed, pageno, flags, rotate; + double xoff, yoff, scale; + struct pagespec *next; +} PageSpec ; + +extern double width, height; + +extern PageSpec *newspec(void); +extern int parseint(char **sp, void (*errorfn)(void)); +extern double parsedouble(char **sp, void (*errorfn)(void)); +extern double parsedimen(char **sp, void (*errorfn)(void)); +extern double singledimen(char *str, void (*errorfn)(void), + void (*usagefn)(void)); +extern void pstops(int modulo, int pps, int nobind, PageSpec *specs, + double draw); diff --git a/Build/source/utils/psutils/pstops.c b/Build/source/utils/psutils/pstops.c new file mode 100644 index 00000000000..3f8c59be419 --- /dev/null +++ b/Build/source/utils/psutils/pstops.c @@ -0,0 +1,198 @@ +/* pstops.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * rearrange pages in conforming PS file for printing in signatures + * + * Usage: + * pstops [-q] [-b] [-d] [-w<dim>] [-h<dim>] [-ppaper] <pagespecs> [infile [outfile]] + */ + +#include "psutil.h" +#include "psspec.h" +#include "pserror.h" +#include "patchlev.h" + +char *program ; +int pages ; +int verbose ; +FILE *infile ; +FILE *outfile ; +char pagelabel[BUFSIZ] ; +int pageno ; + +void usage(void) +{ + fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); + fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); + fprintf(stderr, "Usage: %s [-q] [-b] [-wwidth] [-hheight] [-dlwidth] [-ppaper] <pagespecs> [infile [outfile]]\n", + program); + fflush(stderr); + exit(1); +} + +static void argerror(void) +{ + fprintf(stderr, "%s: page specification error:\n", program); + fprintf(stderr, " <pagespecs> = [modulo:]<spec>\n"); + fprintf(stderr, " <spec> = [-]pageno[@scale][L|R|U][(xoff,yoff)][,spec|+spec]\n"); + fprintf(stderr, " modulo>=1, 0<=pageno<modulo\n"); + fflush(stderr); + exit(1); +} + +static int modulo = 1; +static int pagesperspec = 1; + +static PageSpec *parsespecs(char *str) +{ + PageSpec *head, *tail; + int other = 0; + int num = -1; + + head = tail = newspec(); + while (*str) { + if (isdigit(*str)) { + num = parseint(&str, argerror); + } else { + switch (*str++) { + case ':': + if (other || head != tail || num < 1) argerror(); + modulo = num; + num = -1; + break; + case '-': + tail->reversed = !tail->reversed; + break; + case '@': + if (num < 0) argerror(); + tail->scale *= parsedouble(&str, argerror); + tail->flags |= SCALE; + break; + case 'l': case 'L': + tail->rotate += 90; + tail->flags |= ROTATE; + break; + case 'r': case 'R': + tail->rotate -= 90; + tail->flags |= ROTATE; + break; + case 'u': case 'U': + tail->rotate += 180; + tail->flags |= ROTATE; + break; + case '(': + tail->xoff += parsedimen(&str, argerror); + if (*str++ != ',') argerror(); + tail->yoff += parsedimen(&str, argerror); + if (*str++ != ')') argerror(); + tail->flags |= OFFSET; + break; + case '+': + tail->flags |= ADD_NEXT; + case ',': + if (num < 0 || num >= modulo) argerror(); + if ((tail->flags & ADD_NEXT) == 0) + pagesperspec++; + tail->pageno = num; + tail->next = newspec(); + tail = tail->next; + num = -1; + break; + default: + argerror(); + } + other = 1; + } + } + if (num >= modulo) + argerror(); + else if (num >= 0) + tail->pageno = num; + return (head); +} + +void main(int argc, char *argv[]) +{ + PageSpec *specs = NULL; + int nobinding = 0; + double draw = 0; + Paper *paper; + +#ifdef PAPER + if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { + width = (double)PaperWidth(paper); + height = (double)PaperHeight(paper); + } +#endif + + infile = stdin; + outfile = stdout; + verbose = 1; + for (program = *argv++; --argc; argv++) { + if (argv[0][0] == '-') { + switch (argv[0][1]) { + case 'q': /* quiet */ + verbose = 0; + break; + case 'd': /* draw borders */ + if (argv[0][2]) + draw = singledimen(*argv+2, argerror, usage); + else + draw = 1; + break; + case 'b': /* no bind operator */ + nobinding = 1; + break; + case 'w': /* page width */ + width = singledimen(*argv+2, argerror, usage); + break; + case 'h': /* page height */ + height = singledimen(*argv+2, argerror, usage); + break; + case 'p': /* paper type */ + if ( (paper = findpaper(*argv+2)) != (Paper *)0 ) { + width = (double)PaperWidth(paper); + height = (double)PaperHeight(paper); + } else + message(FATAL, "paper size '%s' not recognised\n", *argv+2); + break; + case 'v': /* version */ + usage(); + default: + if (specs == NULL) + specs = parsespecs(*argv); + else + usage(); + } + } else if (specs == NULL) + specs = parsespecs(*argv); + else if (infile == stdin) { + if ((infile = fopen(*argv, OPEN_READ)) == NULL) + message(FATAL, "can't open input file %s\n", *argv); + } else if (outfile == stdout) { + if ((outfile = fopen(*argv, OPEN_WRITE)) == NULL) + message(FATAL, "can't open output file %s\n", *argv); + } else usage(); + } + if (specs == NULL) + usage(); +#if defined(MSDOS) || defined(WINNT) || defined(WIN32) + if ( infile == stdin ) { + int fd = fileno(stdin) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't open input file %s\n", argv[4]); + } + if ( outfile == stdout ) { + int fd = fileno(stdout) ; + if ( setmode(fd, O_BINARY) < 0 ) + message(FATAL, "can't reset stdout to binary mode\n"); + } +#endif + if ((infile=seekable(infile))==NULL) + message(FATAL, "can't seek input\n"); + + pstops(modulo, pagesperspec, nobinding, specs, draw); + + exit(0); +} diff --git a/Build/source/utils/psutils/pstops.man b/Build/source/utils/psutils/pstops.man new file mode 100644 index 00000000000..350af6c2990 --- /dev/null +++ b/Build/source/utils/psutils/pstops.man @@ -0,0 +1,166 @@ +.TH PSTOPS 1 "PSUtils Release @RELEASE@ Patchlevel @PATCHLEVEL@" +.SH NAME +pstops \- shuffle pages in a PostScript file +.SH SYNOPSIS +.B pstops +[ +.B \-q +] [ +.B \-b +] [ +.B \-w\fIwidth\fR +] [ +.B \-h\fIheight\fR +] [ +.B \-p\fIpaper\fR +] [ +.B \-d\fIlwidth\fR +] +.I pagespecs +[ +.I infile +[ +.I outfile +] ] +.SH DESCRIPTION +.I Pstops +rearranges pages from a PostScript document, creating a new PostScript file. +The input PostScript file should follow the Adobe Document Structuring +Conventions. +.I Pstops +can be used to perform a large number of arbitrary re-arrangements of +Documents, including arranging for printing 2-up, 4-up, booklets, reversing, +selecting front or back sides of documents, scaling, etc. +.PP +.I pagespecs +follow the syntax: +.RS +.TP 12 +.I pagespecs +.I = [modulo:]specs +.TP +.I specs +.I = spec[+specs][,specs] +.TP +.I spec +.I = [-]pageno[L][R][U][@scale][(xoff,yoff)] +.RE +.sp +.I modulo +is the number of pages in each block. The value of +.I modulo +should be greater than 0; the default value is 1. +.I specs +are the page specifications for the pages in each block. The value of the +.I pageno +in each +.I spec +should be between 0 (for the first page in the block) and \fImodulo\fR-1 +(for the last page in each block) inclusive. +The optional dimensions +.I xoff +and +.I yoff +shift the page by the specified amount. +.I xoff +and +.I yoff +are in PostScript's points, but may be followed by the units +.B "cm" +or +.B "in" +to convert to centimetres or inches, or the flag +.B "w" +or +.B "h" +to specify as a multiple of the width or height. +The optional parameters \fIL\fR, \fIR\fR, and \fIU\fR rotate the page left, +right, or upside-down. +The optional +.I scale +parameter scales the page by the fraction specified. +If the optional minus sign is specified, the page is relative to the end of +the document, instead of the start. + +If page \fIspec\fRs are separated by +.B \+ +the pages will be merged into one page; if they are separated by +.B \, +they will be on separate pages. +If there is only one page specification, with +.I pageno +zero, the \fIpageno\fR may be omitted. + +The shift, rotation, and scaling are performed +in that order regardless of which order +they appear on the command line. +.PP +The +.I \-w +option gives the width which is used by the +.B "w" +dimension specifier, and the +.I \-h +option gives the height which is used by the +.B "h" +dimension specifier. These dimensions are also used (after scaling) to set the +clipping path for each page. +The +.I \-p +option can be used as an alternative, to set the paper size to +.B a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto +or +.B 10x14. +The default paper size is +.B @PAPER@. +.PP +The +.I \-b +option prevents any +.B bind +operators in the PostScript prolog from binding. This may be needed in cases +where complex multi-page re-arrangements are being done. +.PP +The +.I \-d +option draws a line around the border of each page, of the specified width. +If the \fIlwidth\fR parameter is omitted, a default linewidth of 1 point is +assumed. The linewidth is relative to the original page dimensions, +\fIi.e.\fR it is scaled up or down with the rest of the page. +.PP +Pstops normally prints the page numbers of the pages re-arranged; the +.I \-q +option suppresses this. +.SH EXAMPLES +This section contains some sample re-arrangements. To put two pages on one +sheet (of A4 paper), the pagespec to use is: +.sp +.ce +2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm) +.sp +To select all of the odd pages in reverse order, use: +.sp +.ce +2:-0 +.sp +To re-arrange pages for printing 2-up booklets, use +.sp +.ce +4:-3L@.7(21cm,0)+0L@.7(21cm,14.85cm) +.sp +for the front sides, and +.sp +.ce +4:1L@.7(21cm,0)+-2L@.7(21cm,14.85cm) +.sp +for the reverse sides (or join them with a comma for duplex printing). +.SH AUTHOR +Copyright (C) Angus J. C. Duggan 1991-1995 +.SH "SEE ALSO" +@MAN@ +.SH TRADEMARKS +.B PostScript +is a trademark of Adobe Systems Incorporated. +.SH BUGS +.I Pstops +does not accept all DSC comments. diff --git a/Build/source/utils/psutils/psutil.c b/Build/source/utils/psutils/psutil.c new file mode 100644 index 00000000000..aa954177d15 --- /dev/null +++ b/Build/source/utils/psutils/psutil.c @@ -0,0 +1,344 @@ +/* psutil.c + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * utilities for PS programs + */ + +/* + * AJCD 6/4/93 + * Changed to using ftell() and fseek() only (no length calculations) + * Hunter Goatley 31-MAY-1993 23:33 + * Fixed VMS support. + * Hunter Goatley 2-MAR-1993 14:41 + * Added VMS support. + */ +#include "psutil.h" +#include "pserror.h" +#include "patchlev.h" + +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> + +#define iscomment(x,y) (strncmp(x,y,strlen(y)) == 0) + +extern char *program ; +extern int pages; +extern int verbose; +extern FILE *infile; +extern FILE *outfile; +extern char pagelabel[BUFSIZ]; +extern int pageno; + +static char buffer[BUFSIZ]; +static long bytes = 0; +static long pagescmt = 0; +static long headerpos = 0; +static long endsetup = 0; +static long beginprocset = 0; /* start of pstops procset */ +static long endprocset = 0; +static int outputpage = 0; +static int maxpages = 100; +static long *pageptr; + +/* list of paper sizes supported */ +static Paper papersizes[] = { + { "a3", 842, 1191 }, /* 29.7cm * 42cm */ + { "a4", 595, 842 }, /* 21cm * 29.7cm */ + { "a5", 421, 595 }, /* 14.85cm * 21cm */ + { "b5", 516, 729 }, /* 18.2cm * 25.72cm */ + { "A3", 842, 1191 }, /* 29.7cm * 42cm */ + { "A4", 595, 842 }, /* 21cm * 29.7cm */ + { "A5", 421, 595 }, /* 14.85cm * 21cm */ + { "B5", 516, 729 }, /* 18.2cm * 25.72cm */ + { "letter", 612, 792 }, /* 8.5in * 11in */ + { "legal", 612, 1008 }, /* 8.5in * 14in */ + { "ledger", 1224, 792 }, /* 17in * 11in */ + { "tabloid", 792, 1224 }, /* 11in * 17in */ + { "statement", 396, 612 }, /* 5.5in * 8.5in */ + { "executive", 540, 720 }, /* 7.6in * 10in */ + { "folio", 612, 936 }, /* 8.5in * 13in */ + { "quarto", 610, 780 }, /* 8.5in * 10.83in */ + { "10x14", 720, 1008 }, /* 10in * 14in */ + { NULL, 0, 0 } +}; + +/* return pointer to paper size struct or NULL */ +Paper* findpaper(char *name) +{ + Paper *pp; + for (pp = papersizes; PaperName(pp); pp++) { + if (strcmp(PaperName(pp), name) == 0) { + return pp; + } + } + return (Paper *)NULL; +} + +/* Make a file seekable, using temporary files if necessary */ +FILE *seekable(FILE *fp) +{ +#ifndef MSDOS + FILE *ft; + long r, w ; +#endif + char *p; + char buffer[BUFSIZ] ; +#if defined(WINNT) || defined(WIN32) + struct _stat fs ; +#else + long fpos; +#endif + +#if defined(WINNT) || defined(WIN32) + if (_fstat(fileno(fp), &fs) == 0 && (fs.st_mode&_S_IFREG) != 0) + return (fp); +#else + if ((fpos = ftell(fp)) >= 0) + if (!fseek(fp, 0L, SEEK_END) && !fseek(fp, fpos, SEEK_SET)) + return (fp); +#endif + +#if defined(MSDOS) + message(FATAL, "input is not seekable\n"); + return (NULL) ; +#else + if ((ft = tmpfile()) == NULL) + return (NULL); + + while ((r = fread(p = buffer, sizeof(char), BUFSIZ, fp)) > 0) { + do { + if ((w = fwrite(p, sizeof(char), r, ft)) == 0) + return (NULL) ; + p += w ; + r -= w ; + } while (r > 0) ; + } + + if (!feof(fp)) + return (NULL) ; + + /* discard the input file, and rewind the temporary */ + (void) fclose(fp); + if (fseek(ft, 0L, SEEK_SET) != 0) + return (NULL) ; + + return (ft); +#endif +} + + +/* copy input file from current position upto new position to output file */ +static int fcopy(long upto) +{ + long here = ftell(infile); + while (here < upto) { + if ((fgets(buffer, BUFSIZ, infile) == NULL) || + (fputs(buffer, outfile) == EOF)) + return(0); + here = ftell(infile); + bytes += strlen(buffer); + } + return (1); +} + +/* build array of pointers to start/end of pages */ +void scanpages(void) +{ + register char *comment = buffer+2; + register int nesting = 0; + register long int record; + + if ((pageptr = (long *)malloc(sizeof(long)*maxpages)) == NULL) + message(FATAL, "out of memory\n"); + pages = 0; + fseek(infile, 0L, SEEK_SET); + while (record = ftell(infile), fgets(buffer, BUFSIZ, infile) != NULL) + if (*buffer == '%') { + if (buffer[1] == '%') { + if (nesting == 0 && iscomment(comment, "Page:")) { + if (pages >= maxpages-1) { + maxpages *= 2; + if ((pageptr = (long *)realloc((char *)pageptr, + sizeof(long)*maxpages)) == NULL) + message(FATAL, "out of memory\n"); + } + pageptr[pages++] = record; + } else if (headerpos == 0 && iscomment(comment, "Pages:")) + pagescmt = record; + else if (headerpos == 0 && iscomment(comment, "EndComments")) + headerpos = ftell(infile); + else if (iscomment(comment, "BeginDocument") || + iscomment(comment, "BeginBinary") || + iscomment(comment, "BeginFile")) + nesting++; + else if (iscomment(comment, "EndDocument") || + iscomment(comment, "EndBinary") || + iscomment(comment, "EndFile")) + nesting--; + else if (nesting == 0 && iscomment(comment, "EndSetup")) + endsetup = record; + else if (nesting == 0 && iscomment(comment, "BeginProlog")) + headerpos = ftell(infile); + else if (nesting == 0 && + iscomment(comment, "BeginProcSet: PStoPS")) + beginprocset = record; + else if (beginprocset && !endprocset && + iscomment(comment, "EndProcSet")) + endprocset = ftell(infile); + else if (nesting == 0 && (iscomment(comment, "Trailer") || + iscomment(comment, "EOF"))) { + fseek(infile, record, SEEK_SET); + break; + } + } else if (headerpos == 0 && buffer[1] != '!') + headerpos = record; + } else if (headerpos == 0) + headerpos = record; + pageptr[pages] = ftell(infile); + if (endsetup == 0 || endsetup > pageptr[0]) + endsetup = pageptr[0]; +} + +/* seek a particular page */ +void seekpage(int p) +{ + fseek(infile, pageptr[p], SEEK_SET); + if (fgets(buffer, BUFSIZ, infile) != NULL && + iscomment(buffer, "%%Page:")) { + char *start, *end; + for (start = buffer+7; isspace(*start); start++); + if (*start == '(') { + int paren = 1; + for (end = start+1; paren > 0; end++) + switch (*end) { + case '\0': + message(FATAL, "Bad page label while seeking page %d\n", p); + case '(': + paren++; + break; + case ')': + paren--; + break; + } + } else + for (end = start; !isspace(*end); end++); + strncpy(pagelabel, start, end-start); + pagelabel[end-start] = '\0'; + pageno = atoi(end); + } else + message(FATAL, "I/O error seeking page %d\n", p); +} + +/* Output routines. These all update the global variable bytes with the number + * of bytes written */ +void writestring(char *s) +{ + fputs(s, outfile); + bytes += strlen(s); +} + +/* write page comment */ +void writepageheader(char *label, int page) +{ + if (verbose) + message(LOG, "[%d] ", page); + sprintf(buffer, "%%%%Page: %s %d\n", label, ++outputpage); + writestring(buffer); +} + +/* search for page setup */ +void writepagesetup(void) +{ + char buffer[BUFSIZ]; + if (beginprocset) { + for (;;) { + if (fgets(buffer, BUFSIZ, infile) == NULL) + message(FATAL, "I/O error reading page setup %d\n", outputpage); + if (!strncmp(buffer, "PStoPSxform", 11)) + break; + if (fputs(buffer, outfile) == EOF) + message(FATAL, "I/O error writing page setup %d\n", outputpage); + bytes += strlen(buffer); + } + } +} + +/* write the body of a page */ +void writepagebody(int p) +{ + if (!fcopy(pageptr[p+1])) + message(FATAL, "I/O error writing page %d\n", outputpage); +} + +/* write a whole page */ +void writepage(int p) +{ + seekpage(p); + writepageheader(pagelabel, p+1); + writepagebody(p); +} + +/* write from start of file to end of header comments */ +void writeheader(int p) +{ + fseek(infile, 0L, SEEK_SET); + if (pagescmt) { + if (!fcopy(pagescmt) || fgets(buffer, BUFSIZ, infile) == NULL) + message(FATAL, "I/O error in header\n"); + sprintf(buffer, "%%%%Pages: %d 0\n", p); + writestring(buffer); + } + if (!fcopy(headerpos)) + message(FATAL, "I/O error in header\n"); +} + +/* write prologue to end of setup section excluding PStoPS procset */ +int writepartprolog(void) +{ + if (beginprocset && !fcopy(beginprocset)) + message(FATAL, "I/O error in prologue\n"); + if (endprocset) + fseek(infile, endprocset, SEEK_SET); + writeprolog(); + return !beginprocset; +} + +/* write prologue up to end of setup section */ +void writeprolog(void) +{ + if (!fcopy(endsetup)) + message(FATAL, "I/O error in prologue\n"); +} + +/* write from end of setup to start of pages */ +void writesetup(void) +{ + if (!fcopy(pageptr[0])) + message(FATAL, "I/O error in prologue\n"); +} + +/* write trailer */ +void writetrailer(void) +{ + fseek(infile, pageptr[pages], SEEK_SET); + while (fgets(buffer, BUFSIZ, infile) != NULL) { + writestring(buffer); + } + if (verbose) + message(LOG, "Wrote %d pages, %ld bytes\n", outputpage, bytes); +} + +/* write a page with nothing on it */ +void writeemptypage(void) +{ + if (verbose) + message(LOG, "[*] "); + sprintf(buffer, "%%%%Page: * %d\n", ++outputpage); + writestring(buffer); + if (beginprocset) + writestring("PStoPSxform concat\n"); + writestring("showpage\n"); +} + diff --git a/Build/source/utils/psutils/psutil.h b/Build/source/utils/psutils/psutil.h new file mode 100644 index 00000000000..deed93ac811 --- /dev/null +++ b/Build/source/utils/psutils/psutil.h @@ -0,0 +1,52 @@ +/* psutil.h + * Copyright (C) Angus J. C. Duggan 1991-1995 + * See file LICENSE for details. + * + * utilities for PS programs + */ + +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> + +#include "config.h" + +/* types for describing document; this is a step towards version 2 */ +typedef long Fileptr ; + +/* paper size structure; configurability and proper paper resources will have + to wait until version 2 */ +typedef struct papersize { + char *name; /* name of paper size */ + int width, height; /* width, height in points */ +} Paper ; +#define PaperName(p) ((p)->name) +#define PaperWidth(p) ((p)->width) +#define PaperHeight(p) ((p)->height) + +/* Definitions for functions found in psutil.c */ +extern Paper *findpaper(char *name); +extern FILE *seekable(FILE *fp); +extern void writepage(int p); +extern void seekpage(int p); +extern void writepageheader(char *label, int p); +extern void writepagesetup(void); +extern void writepagebody(int p); +extern void writeheader(int p); +extern int writepartprolog(void); +extern void writeprolog(void); +extern void writesetup(void); +extern void writetrailer(void); +extern void writeemptypage(void); +extern void scanpages(void); +extern void writestring(char *s); + +/* These variables are imported from the client program (e.g. psbook, psnup, + etc.) */ +extern char *program ; +extern int pages; +extern int verbose; +extern FILE *infile; +extern FILE *outfile; +extern char pagelabel[BUFSIZ]; +extern int pageno; diff --git a/Build/source/utils/psutils/showchar.sh b/Build/source/utils/psutils/showchar.sh new file mode 100644 index 00000000000..e685e99ae8c --- /dev/null +++ b/Build/source/utils/psutils/showchar.sh @@ -0,0 +1,118 @@ +#!/bin/sh +# showchar: show character with information +# usage: +# showchar Font-Name Char-Name | lpr -Pprinter + +if [ $# != 2 ]; then + echo "Usage: `basename $0` Font-Name Char-Name" >&2 + exit 1 +fi + +cat <<EOF +%! +% Get character metrics and bounding box for $1 +/ns 30 string def +/fname /$1 def +/cname /$2 def +/fn fname findfont 1000 scalefont def +/thin 0.7 def +/reduction 2.0 def + +/sn { ns cvs show } def +/sc { (\()show exch sn (,)show sn (\))show } def + +/Times-Roman findfont 10 scalefont setfont + +72 242 translate % one inch in, 3 1/2 inch up +newpath 0 0 moveto +gsave % print character name + 0 468 rmoveto + ($2 from font $1 displayed on `date` by `basename $0` 1.00 (C) AJCD 1991) + show +grestore + +gsave + thin setlinewidth % cross hairs + -9 0 rmoveto 18 0 rlineto + -9 -9 rmoveto 0 18 rlineto + stroke % position info + -9 -9 moveto ((0,0)) stringwidth pop neg 0 rmoveto + ((0,0)) show +grestore + +% create encoding with a single character at all positions +/MyEncoding 256 array def + +0 1 255 { % fill out with notdefs + MyEncoding exch cname put +} for + +fn dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding MyEncoding def + currentdict +end /newfont exch definefont +/fn exch def +/en MyEncoding def + +gsave % draw character (enlarged) + .75 setgray + fn 1 reduction div scalefont setfont + (\000) show +grestore + +% show character info +fn /Metrics known { + dup fn /Metrics get exch get + dup type /arraytype eq { + dup length 2 eq + {1 get 0} {dup 2 get exch 3 get} ifelse + } { + round 0 + } ifelse +} { + gsave + fn setfont (\000) stringwidth round exch round exch + grestore +} ifelse +gsave % show width + thin setlinewidth + 2 copy + reduction div exch reduction div exch rlineto + gsave + 1 1 rmoveto sc + grestore + -4 -3 rlineto 0 6 rmoveto 4 -3 rlineto + stroke +grestore + +gsave + gsave % get bounding box + fn setfont + (\000) true charpath flattenpath pathbbox + grestore + thin setlinewidth + 3 index reduction div % put coords on top of stack + 3 index reduction div + 3 index reduction div + 3 index reduction div + 3 index 3 index moveto + gsave % llx lly + 0 -9 rmoveto 7 index 7 index sc + grestore + 1 index 3 index lineto + gsave % urx lly + 0 -9 rmoveto 5 index 7 index sc + grestore + 1 index 1 index lineto + gsave % urx ury + 0 9 rmoveto 5 index 5 index sc + grestore + 3 index 1 index lineto + gsave % llx ury + 0 9 rmoveto 7 index 5 index sc + grestore + closepath stroke +grestore +showpage +EOF diff --git a/Build/source/utils/psutils/win32.mak b/Build/source/utils/psutils/win32.mak new file mode 100644 index 00000000000..4ab3ad31be9 --- /dev/null +++ b/Build/source/utils/psutils/win32.mak @@ -0,0 +1,195 @@ +################################################################################ +# +# Makefile : Psutils +# Author : Fabrice Popineau <Fabrice.Popineau@supelec.fr> +# Platform : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources +# Time-stamp: <02/12/25 22:26:52 popineau> +# +################################################################################ +root_srcdir = ..\.. +!ifdef DEVELOPMENT +INCLUDE=$(INCLUDE);$(root_srcdir)\texk.development +!else +INCLUDE=$(INCLUDE);$(root_srcdir)\texk +!endif + +USE_GNUW32 = 1 + +!include <msvc/common.mak> + +PAPER=a4 +OS = Win32 + +DEFS = -I. $(DEFS) -DPAPER=\"$(PAPER)\" -D$(OS) + +programs = $(objdir)\psbook.exe $(objdir)\psselect.exe $(objdir)\pstops.exe \ + $(objdir)\epsffit.exe $(objdir)\psnup.exe \ + $(objdir)\psresize.exe +shellscripts = +perlscripts = fixfmps.bat fixmacps.bat fixpsditps.bat fixpspps.bat \ + fixtpps.bat fixwfwps.bat fixwpps.bat fixscribeps.bat fixwwps.bat \ + fixdlsrps.bat extractres.bat includeres.bat psmerge.bat +scripts = $(shellscripts) $(perlscripts) +etcfiles = md68_0.ps md71_0.ps +etcdir = $(psheaderdir)\psutils +perlcmd=perl + +manpages = psbook.man psselect.man pstops.man epsffit.man psnup.man psresize.man \ + $(perlscripts:.bat=.man) + +mansedscript = mansedscript.sed +manfiles = $(manpages:.man=.1) + +default: all + +all: $(objdir) $(programs) $(perlscripts) + +$(objdir)\epsffit.exe: $(objdir)\epsffit.obj $(objdir)\pserror.obj + $(link) $(**) $(conlibs) + +$(objdir)\psnup.exe: $(objdir)\psnup.obj $(objdir)\psutil.obj $(objdir)\psspec.obj $(objdir)\pserror.obj + $(link) $(**) $(conlibs) + +$(objdir)\psresize.exe: $(objdir)\psresize.obj $(objdir)\psutil.obj $(objdir)\pserror.obj $(objdir)\psspec.obj + $(link) $(**) $(conlibs) + +$(objdir)\psbook.exe: $(objdir)\psbook.obj $(objdir)\psutil.obj $(objdir)\pserror.obj + $(link) $(**) $(conlibs) + +$(objdir)\psselect.exe: $(objdir)\psselect.obj $(objdir)\psutil.obj $(objdir)\pserror.obj + $(link) $(**) $(conlibs) + +$(objdir)\pstops.exe: $(objdir)\pstops.obj $(objdir)\psutil.obj $(objdir)\psspec.obj $(objdir)\pserror.obj + $(link) $(**) $(conlibs) + +psmerge.bat: psmerge.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixfmps.bat: fixfmps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixmacps.bat: fixmacps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) INCLUDE=$(INCLUDEDIR) $? > $@ + +fixpsditps.bat: fixpsditps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixpspps.bat: fixpspps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixscribeps.bat: fixscribeps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixtpps.bat: fixtpps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixwfwps.bat: fixwfwps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixwpps.bat: fixwpps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixwwps.bat: fixwwps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +fixdlsrps.bat: fixdlsrps.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +extractres.bat: extractres.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) $? > $@ + +includeres.bat: includeres.pl + $(perl) maketext OS=$(OS) perl=$(perlcmd) INCLUDE=$(INCLUDEDIR) $? > $@ + +epsffit.$(manext): epsffit.man + $(perl) maketext MAN="$(manpages:.man=.1)" $*.man > $@ + +psnup.$(manext): psnup.man + $(perl) maketext MAN="$(manpages:.man=.1)" PAPER=$(PAPER) $*.man > $@ + +psresize.$(manext): psresize.man + $(perl) maketext MAN="$(manpages:.man=.1)" PAPER=$(PAPER) $*.man > $@ + +psbook.$(manext): psbook.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +psselect.$(manext): psselect.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +pstops.$(manext): pstops.man + $(perl) maketext "MAN=$(manpages:.man=.1)" PAPER=$(PAPER) $*.man > $@ + +psmerge.$(manext): psmerge.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixfmps.$(manext): fixfmps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixmacps.$(manext): fixmacps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" INCLUDE=$(INCLUDEDIR) $*.man > $@ + +fixpsditps.$(manext): fixpsditps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixpspps.$(manext): fixpspps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixscribeps.$(manext): fixscribeps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixtpps.$(manext): fixtpps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixwfwps.$(manext): fixwfwps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixwpps.$(manext): fixwpps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixwwps.$(manext): fixwwps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +fixdlsrps.$(manext): fixdlsrps.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +extractres.$(manext): extractres.man + $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +includeres.$(manext): includeres.man + $(perl) maketext "MAN=$(manpages:.man=.1)" INCLUDE=$(INCLUDEDIR) $*.man > $@ + +#getafm.$(manext): getafm.man +# $(perl) maketext "MAN=$(manpages:.man=.1)" $*.man > $@ + +patchlev.h: patchlev.h.in + $(perl) $(win32perldir)/conf-cauto.pl $(**) $@ + +!include <msvc/config.mak> + +installdirs = $(bindir) $(includes) $(psheaderdir)\psutils + +!include <msvc/install.mak> + +install:: install-exec install-data install-man + +mansedscript.sed: + @echo <<mansedscript.sed +1,$$s/@PAPER@/A4/g +1,$$s/@RELEASE@/1/g +1,$$s/@PATCHLEVEL@/17/g +1,$$s!@INCLUDE@!$(psheaderdir:\=/)/psutils!g +<<KEEP + +!include <msvc/clean.mak> + +distclean:: + -@$(del) $(perlscripts) $(perlscripts:.bat=.cmd) patchlev.h + -@$(del) $(manfiles) mansedscript.sed + +!include <msvc/rdepend.mak> +!include "./depend.mak" + +# +# Local Variables: +# mode: makefile +# End:
\ No newline at end of file |