trueprint-5.3/0000777000076400007640000000000007322207150007170 5trueprint-5.3/Makefile.in0000664000076400007640000002660007322207145011163 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ GOT_DIFF_CMD = @GOT_DIFF_CMD@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PRINT_CMD = @PRINT_CMD@ RANLIB = @RANLIB@ VERSION = @VERSION@ SUBDIRS = replace src doc tests EXTRA_DIST = config/install-sh config/mdate-sh config/missing config/mkinstalldirs config/sys_errlist.m4 doc/trueprint.1 doc/trueprint.spec bootstrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h config.h CONFIG_CLEAN_FILES = DIST_COMMON = README ./stamp-h1.in ./stamp-h2.in AUTHORS COPYING \ ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 \ config.h.in configure configure.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status $(ACLOCAL_M4): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h1 2> /dev/null $(srcdir)/config.h.in: $(srcdir)/stamp-h1.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h1.in; \ $(MAKE) $(srcdir)/stamp-h1.in; \ else :; fi $(srcdir)/stamp-h1.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h1.in 2> /dev/null config.h: stamp-h2 @if test ! -f $@; then \ rm -f stamp-h2; \ $(MAKE) stamp-h2; \ else :; fi stamp-h2: $(srcdir)/config.h.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES= CONFIG_HEADERS=config.h \ $(SHELL) ./config.status @echo timestamp > stamp-h2 2> /dev/null $(srcdir)/config.h.in: $(srcdir)/stamp-h2.in @if test ! -f $@; then \ rm -f $(srcdir)/stamp-h2.in; \ $(MAKE) $(srcdir)/stamp-h2.in; \ else :; fi $(srcdir)/stamp-h2.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h cd $(top_srcdir) && $(AUTOHEADER) @echo timestamp > $(srcdir)/stamp-h2.in 2> /dev/null mostlyclean-hdr: clean-hdr: distclean-hdr: -rm -f config.h config.h maintainer-clean-hdr: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. @SET_MAKE@ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ test "$$subdir" = "." && dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in config.h.in $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)config.h.in config.h.in$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in config.h.in $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist -rm -rf $(distdir) GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz mkdir $(distdir)/=build mkdir $(distdir)/=inst dc_install_base=`cd $(distdir)/=inst && pwd`; \ cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) dist -rm -rf $(distdir) @banner="$(distdir).tar.gz is ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes" dist: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) dist-all: distdir -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) $(mkinstalldirs) $(distdir)/config $(distdir)/doc @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive all-recursive-am: config.h config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile config.h config.h all-redirect: all-recursive-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-hdr clean-tags clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-hdr distclean-tags distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-recursive -rm -f config.status .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ install-data-recursive uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ install-exec-am install-exec install-data-am install-data install-am \ install uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: trueprint-5.3/config/0000775000076400007640000000000007322207145010437 5trueprint-5.3/config/install-sh0000755000076400007640000001273607216037013012367 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 trueprint-5.3/config/mdate-sh0000755000076400007640000000516707217536630012025 #!/bin/sh # Get modification time of a file or directory and pretty-print it. # Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # Get the extended ls output of the file or directory. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. if ls -L /dev/null 1>/dev/null 2>&1; then set - x`ls -L -l -d $1` else set - x`ls -l -d $1` fi # The month is at least the fourth argument # (3 shifts here, the next inside the loop). shift shift shift # Find the month. Next argument is day, followed by the year or time. month= until test $month do shift case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done day=$2 # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year trueprint-5.3/config/missing0000755000076400007640000001421307216037013011752 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 trueprint-5.3/config/mkinstalldirs0000755000076400007640000000132207216037013013156 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here trueprint-5.3/config/sys_errlist.m40000664000076400007640000000061707216034130013201 AC_DEFUN(TRUEPRINT_VAR_SYS_ERRLIST, [AC_CACHE_CHECK([for sys_errlist], trueprint_cv_var_sys_errlist, [AC_TRY_LINK([int *p;], [extern in sys_errlist; p = &sys_errlist;], trueprint_cv_var_sys_errlist=yes, trueprint_cv_var_sys_errlist=no)]) if test x"$trueprint_cv_var_sys_errlist" = xyes; then AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if your system libraries have a sys_errlist variable.]) fi]) trueprint-5.3/doc/0000777000076400007640000000000007322207150007735 5trueprint-5.3/doc/trueprint.10000644000076400007640000004121407052654426012005 .\" Diese Anleitung ist unter der GPL veröffentlicht. .\" Alle Richtlinien der GPL sind in diesem Dokument zu beachten. .\" Um ein ASCII-Textfile zu bekommen, folgenden Befehl ausführen. .\" groff -man -Tascii pon.1 > pon.txt .\" .TH TRUEPRINT 1 "7. 1. 2000" GNU "User Manual" .SH NAME trueprint \- print program listings on postscript printer. .SH SYNOPSIS .B trueprint [ .B options ] [ .B files ] .SH DESCRIPTION .B trueprint is a general purpose program printing program. It tries to produce everything that anybody could need in a program printout without the need for large numbers of switches or pipelines. .B trueprint can currently handle C, C++, Java, Perl, Verilog, shell (including ksh), Pascal, pseudo C, report files (trueprint report file, see NOTES), listing files, text files. .PP Each page in the output has a default header consisting of the date or a user-defined string, the current function name, and the overall page number (which is used in the indexes); and a footer consisting of the date, the current file name and page number within file, and the overall page number. If the language contains the concept of braces then .B trueprint will include a braces depth count in the left-hand margin. .PP The printout has two function indexes at the front - one is an alphabetical list of all functions and the other is a list of files with functions in each file in alphabetical order. The first is suppressed if there are no functions and the second is suppressed if there is only one file. .PP If no language is specified on the command line then options are defaulted to be appropriate for the first file specified on the command line. The filetype is taken from the suffix - valid suffixes are .TP .B "Language Suffix language option" .TP C .c .h -language=c .TP C++ .cxx .cpp .cc -langauge=cxx .br .C .hpp .H .TP Java .java -language=java .TP Shell .sh -language=sh .TP Perl .pl -language=perl .TP Pascal .pas -language=pascal .TP Verilog .v -language=v .TP Pseudo C .pc .ph -language=pseudoc .TP Report format .rep -language=report .TP Listing .lst -language=list .TP Plain Text default -language=text .PP When Trueprint starts it uses four sets of options: .PP \(em Hard-coded defaults .br \(em Language-specific defaults .br \(em Options taken from the environment variable `$TP_OPTS' .br \(em Command-line options .PP Each set of options overrides the earlier sets, so command-line options override all other sets. .br If you want to set some personal default options, then simply set the environment variable `$TP_OPTS'. .SH OPTIONS .SS Miscellaneous Options .TP .B \-D , \-\-debug= set debug options to (see USAGE whatfor is). .TP .B \-O , \-\-diff= if is a file then print diffs between and input file otherwise use as a prefix and print diffs. See USAGE for more information on usage. .TP .B \-t , \-\-language= treat input as language. Use --help=language for list. .TP .B \-U , \-\-username= set username for coversheet .TP .B \-H, \-\-help[=] Type help information and given the option it lists options for the following topics: .IP .B all-options \- all options .br .B misc-options \- miscellaneous options .br .B page-furniture-options \- page furniture options .br .B text-format-options \- text formatting options .br .B print-options \- options that select what to print .br .B page-format-options \- page format options .br .B output-options \- options affecting output .br .B language \- languages .br .B prompt \- format for --print-pages string .br .B debug \- format for --debug string .br .B header \- format for header & footer strings .br .B report \- file format for --language=report input .br .B environment \- environment vars used .TP .B \-V, \-\-version Type version information .TP .B \-N, \-\-use\-environment use environment variables .TP .B \-\-N, \-\-ignore\-environment don't use values from environment, such as time, $USER, etc. This is for test purposes, to make test results more reproducible .TP .B \-R 1, \-\-ps\-level\-one Use level one postscript. .TP .B \-R 2, \-\-ps\-level\-two Use level two postscript. .SS Text Formatting .TP .B \-b, \-\-no\-page\-break\-after\-function don't print page breaks at the end of functions .TP .B \-\-b, \-\-page\-break\-after\-function print page breaks at the end of functions .TP .B \-W, \-\-no\-intelligent\-line\-wrap Wrap lines at exactly the line-wrap column .TP .B \-\-W, \-\-intelligent\-line\-wrap Wrap lines intelligently at significant characters, such as a space .TP .B \-L , \-\-minimum\-line\-length= minimum line length permitted by intelligent line wrap (default 10) .TP .B \-T , \-\-tabsize= set tabsize (default 8) .TP .B \-E, \-\-ignore\-form\-feeds don't expand form feed characters to new page .TP .B \-\-E, \-\-form\-feeds expand form feed characters to new page .TP .B \-p , \-\-point\-size= specify point size (default 10) .TP .B \-g , \-\-leading= specify interline gap in points (default 1) .TP .B \-w , \-\-line\-wrap= specify the line-wrap column. .TP .B \-\-no\-line\-wrap turn off line-wrap .TP .B \-l , \-\-page\-length= specify number of lines on a page, point size is calculated appropriately .SS Page Formatting .TP .B \-I, \-\-no\-holepunch don't leave space for holepunch at the side of each page .TP .B \-\-I, \-\-holepunch leave space for holepunch at the side of each page .TP .B \-J, \-\-no\-top\-holepunch don't leave space for holepunch at the top of each page .TP .B \-\-J, \-\-top\-holepunch leave space for holepunch at the top of each page .TP .B \-o p, \-\-portrait print using portrait orientation .TP .B \-o l, \-\-landscape print using landscape orientation .TP .B \-S 1, \-\-single-sided print single-sided .TP .B \-S 2, \-\-double\-sided print double-sided .TP .B \-1, \-\-one\-up print 1-on-1 (default) .TP .B \-2, \-\-two\-up print 2-on-1 .TP .B \-3, \-\-two\-tall\-up print 2-on-1 at 4-on-1 pointsize .TP .B \-4, \-\-four\-up print 4-on-1 .SS Page Furniture .TP .B \-X , \-\-left\-header= specify string for left side of header .TP .B \-x , \-\-left\-footer= specify string for left side of footer .TP .B \-Y , \-\-center\-header= specify string for center of header .TP .B \-y , \-\-center\-footer= specify string for center of footer .TP .B \-Z , \-\-right\-header= specify string for right side of header .TP .B \-z , \-\-right\-footer= specify string for right side of footer .TP .B \-m , \-\-message= message to be printed over page. Will be printed in a very large, light gray font. There are a few escapes as a replacement for ; see USAGE for more information. .TP .B \-G , \-\-gray\-bands= Emulate the old lineprinter paper with gray bands across each page. The value of gives the width of the bands and the gaps between them .TP .B \-K, \-\-headers include the header on each page .TP .B \-\-K, \-\-no\-headers suppress the header on each page .TP .B \-k, \-\-footers include the footer on each page .TP .B \-\-k, \-\-no\-footers suppress the footer on each page .TP .B \-u, \-\-page\-furniture\-lines Draw lines around header & footer boxes and down left side of page. .TP .B \-\-u, \-\-no\-page\-furniture\-lines Don't draw lines around header & footer boxes or down left side of page. .TP .B \-i, \-\-no\-braces-depth exclude the braces depth count .TP .B \-\-i, \-\-braces\-depth include the braces depth count .TP .B \-n, \-\-no\-line\-numbers exclude the line number count .TP .B \-\-n, \-\-line\-numbers include the line number count .SS Output Options Per .RB default " trueprint " will send the postscript output to `lp' or `lpr' and it will explicitly set the destination to the value of the environment variable `$PRINTER'. .TP .B \-d , \-\-printer= use printer .TP .B \-P , \-\-printer= use printer .TP .B \-s , \-\-output= send output to filename ; use - for stdout .TP .B \-r, \-\-redirect\-output redirect output to .ps file named after first filename .TP .B \-\-r, \-\-no\-redirect\-output don't redirect output .TP .B \-c , \-\-copies= specify number of copies to be printed .SS Print Selection .TP .B \-C, \-\-no\-cover\-sheet don't print cover sheet .TP .B \-\-C, \-\-cover\-sheet print cover sheet .TP .B \-A , \-\-print\-pages= specify list of pages to be printed (see USAGE whatfor is). .TP .B \-a, \-\-no\-prompt don't prompt for each page, whether it should be printed or not .TP .B \-\-a, \-\-prompt prompt for each page, whether it should be printed or not .TP .B \-F, \-\-no\-file\-index don't print file index .TP .B \-\-F, \-\-file\-index print file index .TP .B \-f, \-\-no\-function\-index don't print function index .TP .B \-\-f, \-\-function\-index print function index .TP .B \-B, \-\-no\-print\-body don't print body of text .TP .B \-\-B, \-\-print\-body print body of text .SH USAGE The usage of the .RB ` "\-D " ', .RB ` "\-\-debug=" ' is as follows: .br Each letter turns on a set of debugging messages, and the corresponding digit indicates the level of messages, with 1 indicating the least number of messags and 9 turning on all messages. The letter `@' can be used to turn on all areas, so `--debug=@9' will turn on all messages. Use `--help=debug' for details of what letters turn on what areas. .br Note that this feature is not uniformly implemented - messages were only typically added where they were needed. Also note that messages will not be generated in code prior to the code that sets the debug string! .PP The usage of the .RB ` "\-O " ', .RB ` "\-\-diff=" ' option looks as follows: .br You specify the old version of the file or files with `--diff='. If suffixed with the current filename is a valid file then the differences between / are displayed. Alternatively, if is a file and you're printing one file, then the differences between and the current file are displayed. Examples how to make it are shown below: .IP trueprint --diff=../old- this.c that.c .PP will print the differences between ../old-this.c and this.c, and ../old-that.c and that.c. .IP trueprint --diff=../old/ this.c that.c .PP will print the differences between ../old/this.c and this.c, and ../old/that.c and that.c. Note that the trailing / is important. .IP trueprint --diff=this.c that.c .PP will print the differences between this.c and that.c. .PP The usage of the .RB ` "\-A " ', .RB ` "\-\-print\-pages=" ' option looks as follows: .br consists of a comma-seperated list of page selections: .IP .B `' -- print the specific page .br .B `-' -- Print all pages between, and including, the specified pages .br .B `' -- Print all pages that include function-name. .br .B `d' -- Print all pages that have changed (this is only useful with the `--diff' (see above) option. .br .B `D' -- Print all pages containing functions that have changed (this is only useful with the `--diff' (see above) option. .br .B `f' -- Print the function index .br .B `F' -- Print the file index. .PP For example, .IP --print-pages=1-5,main,f .PP will print the function index, pages 1 to 5, and all the pages for the function `main'. .PP If you specify .RB ` "--prompt" ' then .B trueprint will prompt you for each page, whether or not it should print that page. It will give you information such as the current filename, current functionname, page number, and so on. The possible responses are: .IP .B `y' -- Print this page. .br .B `y' -- Print pages. .br .B `y*' -- Print all the remaining pages. .br .B `n' -- Skip this page .br .B `n' -- Skip pages. .br .B `n*' -- Skip all the remaining pages. .br .B `p' -- Print all remaining pages that match , where is in the format defined above. .br .B `?' -- Print a help message. .PP The .RB ` "--message=" ' option takes a few % escapes for which are listed below: .IP .B `%%' -- Print a simple %. .br .B `%m' -- Print the current month of the year as a number, e.g. 05. .br .B `%d' -- Print the current day of the month, e.g. 01. .br .B `%y' -- Print the current year, e.g. 1999 .br .B `%D' -- Print the date in the format mm/dd/yy. .br .B `%L' -- Print the date and time in long format, e.g. Fri Oct 8 11:49:51 1999 .br .B `%c' -- Print the last modified date of the current file in the format mm/dd/yy. .br .B `%C' -- Print the last modified date and time of the current file in long format, e.g. Fri Oct 8 11:49:51 1999 .br .B `%H' -- Print the current hour. .br .B `%M' -- Print the current minute. .br .B `%S' -- Print the current second. .br .B `%T' -- Print the time in the format HH:MM:SS. .br .B `%j' -- Print the day of the year, e.g. 095. .br .B `%w' -- Print the day of the week, e.g. Sunday. .br .B `%a' -- Print the abbreviated day of the week, e.g. Sun. .br .B `%h' -- Print the abbreviated month name, e.g. Mar. .br .B `%r' -- Print the time in am/pm notation, e.g. 10:45pm. .br .B `%p' -- Print the page number in the current file. .br .B `%P' -- Print the overall page number. .br .B `%f' -- Print the total number of pages of the current file. .br .B `%F' -- Print the total number of pages. .br .B `%n' -- Print the current filename. .br .B `%N' -- Print the current function name. .br .B `%l' -- Print the username of the current user. .PP Default Values are: .IP `left-header' `%L' .br `center-header' `%N' .br `right-header' `Page %P of %F' .br `left-footer' `%L' .br `center-footer' `%n %p' .br `right-footer' `Page %P of %F' .SH NOTES For most of the languages, .B trueprint uses the language to work out where comments are (so it can print them in italics) and where the function names are (so it can print them in bold and include them in the function index). However there are some special features for some of the languages: .PP Pseudo C is like C, except it has a more forgiving syntax. In particular it ignores strings, so if you leave off a closing quote then pseudo C will print out using a vaguely sensible format. Pseudo C is intended for printing code that doesn't yet compile. .PP Listing format assumes very wide lines and a fixed page length of sixty-six characters, so it turns off line-wrap and sets the page length appropriately. .PP Report format uses a few special characters: anything between ^A and ^E is printed in bold and included in the function index, and anything between a pair of ^Cs is printed in italics. .SH ENVIRONMENT By default Trueprint uses environment variables and the current username. .TP .B PRINTER Specify the printer to use when sending postscript output to the printer. .TP .B TP_OPTS Specify options. These options override any default options including language defaults, but are overridden by command line options. .TP .B TP_DIFF_CMD Specify the diff command to be used. The command must produce output in the same format as the classic Unix diff. This variable can be used to add flags to the diff command used, for example to make diff ignore whitespace. .TP .B TP_PRINT_CMD Specify the print command. The default is lpr. If this is set then it should be set to a command that takes standard input. If this is set then the destination and number of copies have no effect, i.e. there is no mechanism to pass these values to your print command. If you set this to /bin/cat then the postscript output will appear on stdout. .TP .B TP_PRINTERS_FILE Specify the printers file. The default is the printers file that was initially configured when trueprint was installed. This can be used to test out a new printers file. .SH AUTHOR The program was written by Lezz Giles. Please send bug reports to and ideas for enhancement or similar things to . The manpage was written by Othmar Pasteka . trueprint-5.3/doc/trueprint.spec0000644000076400007640000000360707256014122012570 Summary: Prints the source files in PostScript Name: trueprint Version: 5.3 Release: 1 Source: ftp://ftp.gnu.org/pub/gnu/trueprint/trueprint-%{PACKAGE_VERSION}.tar.gz Copyright: GPL Group: Applications/Text Vendor: Jan "Yenya" Kasprzak Packager: Jan "Yenya" Kasprzak BuildRoot: /var/tmp/trueprint-root Prereq: info Obsoletes: Trueprint %description Trueprint is a general purpose program printing program. It tries to produce everything that anybody could need in a program printout without the need for large numbers of switches or pipelines. Trueprint can currently handle C, C++, Verilog, shell (including ksh), perl, pascal, listing files and plain text files. %changelog * Tue Mar 20 2001 Lezz Giles - Updated to the 5.3 release. * Wed Feb 16 2000 Lezz Giles - Updated to the 5.2.1 release. * Wed Nov 3 1999 Lezz Giles - Updated to the 5.2 release. * Sat Oct 30 1999 Jan "Yenya" Kasprzak - Updated to the 5.1 release. - Strip trueprint (-s added to CFLAGS). * Tue Jul 27 1999 Jan "Yenya" Kasprzak - Initial release %prep %setup -n trueprint-%{PACKAGE_VERSION} %build CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr make %install rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}/usr/{bin,lib,info,man/man1} make prefix=${RPM_BUILD_ROOT}/usr install strip ${RPM_BUILD_ROOT}/usr/bin/trueprint %post if [ $1 = 1 ] then /sbin/install-info --dir-file=/usr/info/dir /usr/info/trueprint.info fi %postun if [ $1 = 0 ] then /sbin/install-info --dir-file=/usr/info/dir --remove /usr/info/trueprint.info fi %files %attr(0755,root,root) /usr/bin/trueprint %attr(0644,root,root) %doc /usr/man/man1/trueprint.1 %attr(0644,root,root) %config(noreplace) /usr/lib/printers %attr(0644,root,root) %doc /usr/info/trueprint.info %attr(0644,root,root) %doc BUGS NEWS README trueprint-5.3/doc/Makefile.in0000664000076400007640000002473207322207150011730 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ GOT_DIFF_CMD = @GOT_DIFF_CMD@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PRINT_CMD = @PRINT_CMD@ RANLIB = @RANLIB@ VERSION = @VERSION@ man_MANS = trueprint.1 MAINTAINERCLEANFILES = Makefile.in info_TEXINFOS = trueprint.texi # We can make a trueprint.html, but this isn't done as part of a # normal distribution SUFFIXES = .html html_docs = trueprint.html mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = ../config.h ../config.h CONFIG_CLEAN_FILES = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ TEXI2DVI = texi2dvi TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex INFO_DEPS = trueprint.info DVIS = trueprint.dvi TEXINFOS = trueprint.texi man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff DIST_COMMON = Makefile.am Makefile.in stamp-vti version.texi DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: .SUFFIXES: .dvi .html .info .ps .texi .texinfo .txi $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status $(srcdir)/version.texi: stamp-vti @: $(srcdir)/stamp-vti: trueprint.texi $(top_srcdir)/configure.in @echo "@set UPDATED `$(SHELL) $(top_srcdir)/config/mdate-sh $(srcdir)/trueprint.texi`" > vti.tmp @echo "@set EDITION $(VERSION)" >> vti.tmp @echo "@set VERSION $(VERSION)" >> vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp clean-vti: distclean-vti: maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi trueprint.info: trueprint.texi version.texi trueprint.dvi: trueprint.texi version.texi DVIPS = dvips .texi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texi.dvi: TEXINPUTS=$(top_srcdir)/config/texinfo.tex:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .texi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .texinfo.dvi: TEXINPUTS=$(top_srcdir)/config/texinfo.tex:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .txi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .txi.dvi: TEXINPUTS=$(top_srcdir)/config/texinfo.tex:$$TEXINPUTS \ MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< .txi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) `echo $< | sed 's,.*/,,'` .dvi.ps: $(DVIPS) $< -o $@ install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) @list='$(INFO_DEPS)'; \ for file in $$list; do \ d=$(srcdir); \ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ if test -f $$d/$$ifile; then \ echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ done; \ else : ; fi uninstall-info: $(PRE_UNINSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ ii=yes; \ else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ test -z "$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) list='$(INFO_DEPS)'; \ for file in $$list; do \ (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done dist-info: $(INFO_DEPS) list='$(INFO_DEPS)'; \ for base in $$list; do \ d=$(srcdir); \ for file in `cd $$d && eval echo $$base*`; do \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file; \ done; \ done mostlyclean-aminfo: -rm -f trueprint.aux trueprint.cp trueprint.cps trueprint.dvi \ trueprint.fn trueprint.fns trueprint.ky trueprint.kys \ trueprint.ps trueprint.log trueprint.pg trueprint.toc \ trueprint.tp trueprint.tps trueprint.vr trueprint.vrs \ trueprint.op trueprint.tr trueprint.cv trueprint.cn clean-aminfo: distclean-aminfo: maintainer-clean-aminfo: cd $(srcdir) && for i in $(INFO_DEPS); do \ rm -f $$i; \ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ rm -f $$i-[0-9]*; \ fi; \ done install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = doc distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info info-am: $(INFO_DEPS) info: info-am dvi-am: $(DVIS) dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-info-am install-man install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-info uninstall-man uninstall: uninstall-am all-am: Makefile $(INFO_DEPS) $(MANS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(mandir)/man1 mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-vti mostlyclean-aminfo mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-vti clean-aminfo clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-vti distclean-aminfo distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-vti maintainer-clean-aminfo \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-vti distclean-vti clean-vti maintainer-clean-vti \ install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \ clean-aminfo maintainer-clean-aminfo install-man1 uninstall-man1 \ install-man uninstall-man tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean .texi.html: $(MAKEINFO) --html $< # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: trueprint-5.3/doc/Makefile.am0000664000076400007640000000052207217536224011720 ## Makefile.am -- Process this file with automake to produce Makefile.in man_MANS = trueprint.1 MAINTAINERCLEANFILES = Makefile.in info_TEXINFOS = trueprint.texi # We can make a trueprint.html, but this isn't done as part of a # normal distribution SUFFIXES = .html html_docs = trueprint.html .texi.html: $(MAKEINFO) --html $< trueprint-5.3/doc/stamp-vti0000664000076400007640000000007307322205515011525 @set UPDATED 8 July 2001 @set EDITION 5.3 @set VERSION 5.3 trueprint-5.3/doc/version.texi0000664000076400007640000000007307322205515012236 @set UPDATED 8 July 2001 @set EDITION 5.3 @set VERSION 5.3 trueprint-5.3/doc/trueprint.texi0000644000076400007640000011030207322205051012573 \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename trueprint.info @settitle Trueprint @c %**end of header @headings double @include version.texi @dircategory Miscellaneous @direntry * Trueprint: (trueprint). Format & print text files on a printer @end direntry @setchapternewpage odd @ifinfo This is the documentation for GNU Trueprint Copyright @copyright{} 1999 Free Software Foundation Inc. @end ifinfo @titlepage @sp 10 @title Trueprint @subtitle Edition @value{EDITION}, @value{UPDATED} @author Lezz Giles @author @email{giles@@world.std.com} @page @vskip 0pt plus 1filll Copyright @copyright{} 1999 Free Software Foundation Inc. @end titlepage @node Top, Overview, , (dir) @top Trueprint Trueprint is a program for printing source code and other text files. @menu * Overview:: Trueprint in brief. * Installing Trueprint:: How to install Trueprint. * Languages:: How Trueprint handles source files for different computer languages. * Page Formatting:: Getting the right number of pages on a sheet. * Page Furniture:: Headers, footers and other page decorations. * Text Formatting:: Font size, line breaks, and other text formatting tweaks. * Output Options:: Sending the output to the right place. * Print Selection:: Printing just the stuff you want. * Miscellaneous Features:: All the stuff that doesn't belong anywhere else. * Options and Environment Variables List:: A reference list of all options. * Option Index:: Index to options * Concept Index:: Index to concepts throughout this manual @end menu @node Overview, Installing Trueprint, Top, Top @chapter Overview @cindex flower @cindex smell @cindex overview What is Trueprint? Trueprint is an ugly flower that smells beautiful. Trueprint is intended to be the only printing program you will ever need to print your program source code and other text files. It tries to achieve this by being simple to use, providing powerful features, and being intelligent enough to provide those features when you need them. Trueprint knows about common computer languages and will select features appropriate to each language. For example if the language contains functions then Trueprint will generate a function index. And if the language contains the concept of braces then Trueprint will include a braces depth count in the left-hand margin. If you need to customize the appearance of the printed output then you can use options to turn any of Trueprint's features on or off. For example you can specify that the output be printed landscape, two-up, using an eight-point font with line numbers. By setting an environment variable you can create personal defaults for Trueprint which will override the language defaults and which will in turn be overridden by the command line options. Trueprint knows about the printers available on your system via a special @code{printers} file. This file tells it how large a page is and whether the printer is double or single sided. Using this information, Trueprint can format your output appropriately. If there's anything that Trueprint doesn't do, you are welcome to change the tool itself - just remember that it's covered by the GPL and be sure to send a copy of the changes to @email{enhance-trueprint@@gnu.org}! The original author and current maintainer of trueprint is Lezz Giles. His email addresses at the time of writing are @email{gilesfamily@@mediaone.net}, @email{lgiles@@avici.com}, and @email{giles@@world.std.com}. @node Installing Trueprint, Languages, Overview, Top @chapter Installing Trueprint Installing Trueprint is almost as simple as installing any well-behaved GNU program. For details, read the README file that comes with the package. This section provides an overview of the process, plus details of the @code{printers} file. @section Installation Overview @cindex installing @cindex invoking make @cindex testing the installation @cindex make install @cindex make test In the simplest case, assuming you want to install trueprint into /usr/local/bin, installing trueprint is just a matter of five short steps: @itemize @bullet @item @code{./configure} @item @code{make} @item @code{make test} @item Update the printers file with your printer information. @item @code{make install} @end itemize If you want to change the installation root directory from @code{/usr/local} to, for example, @code{/usr} (so that the executable would be put into @code{/usr/bin/trueprint}) then just pass the new root directory to @code{./configure} using @code{--prefix}, e.g. @code{./configure --prefix=/usr}. If the tests fail then cd to the tests subdirectory and look at the appropriate @code{.dif} file. If you can't work out what's gone wrong then report the problem to @email{bug-trueprint@@gnu.org}. @section The @code{printers} file @cindex printers file @cindex printer specification @cindex printer queues The printers file is the most complicated part of Trueprint. Put simply, it contains two lists: a list of printer types, and a list of the printers at your site. The list of printer types is long (well, actually it's fairly short) and it should contain the most common office printers. The list of printers in the distribution printers file is just a set of example entries - you should delete these examples and replace them with your own printer information. An example type entry is: @example type:Apple Laswerwriter II:1: 15:597:784:8 @end example The first field just specifies this as a @code{type} entry. The second field contains the printer type name. Whitespace is significant, so there shouldn't be any spaces between the start and end of the name, and the colons. The third field is 1 for a single-sided printer and 2 for a double-sided printer. The final four fields give the left, right, top and bottom margins respectively in points from the bottom left corner of the paper; more specifically they are the coordinates of the bounding box that the postscript engine on the printer can print in. The first three fields are typically easy to fill in; however the final four fields need to be calculated for each printer type. Fortunately the postscript interpreter knows what the coordinates are - it's just a matter of asking it nicely, and the file @code{testprint} contains a little postscript program that will do just that. If you print @code{testprint} using either @code{lpr} or @code{lp} then it will print out the four numbers needed in the @code{printers} file (on the other hand, if it simply prints the contents of the file then either your printer is not configured properly or it isn't a postscript printer - you'll need to rectify the situation before you can use Trueprint on that printer). The second half of the file contains printer entries, for example: @example printer:pr2-simp:HP Laserjet 8000 simplex @end example Once again, the first entry simply specifies that this is a @code{printer} entry. The second entry contains the printer queue name as known to your operating system (i.e. the value you would pass to @code{lp} or @code{lpr}). The third field contains the appropriate printer type name; once again whitespace is important so make sure there are no trailing space or tab characters at the end of the line. If you have two queues set up to one printer, one for single-sided output and one for double-sided output, simply set up two printer types. Similarly if you have multiple queues for the same printer for different paper sizes. @node Languages, Page Formatting, Installing Trueprint, Top @chapter Languages @cindex languages @cindex language defaults @cindex c language @cindex verilog @cindex c++ @cindex shell @cindex pascal @cindex perl @cindex java @cindex plain text @cindex pseudo C @cindex listing files @cindex report format @cindex filename extensions Different programming languages have different features and look their best with different formats. Since Trueprint tries to be all things to all people, it understands a number of different languages and tries to accomodate all of them. In this version Trueprint understands: @itemize @bullet @item C @item Verilog @item C++ @item Shell @item Pascal @item Perl @item Java @end itemize It also understands some other formats: @itemize @bullet @item Plain text @item Pseudo C @item Listing files @item A special format called "report format" @end itemize Not all of the languages are fully supported. C is well supported, but Java is only minimally supported. The language support is implemented in the @code{lang_*.c} files - if you're not happy with the level of support for your favorite language just improve - or add - it! @findex language There are a couple of ways that Trueprint can find out what type of language a file contains. It can look at the filename suffix, or it can be told using the @code{--language} option. The details are: @multitable @columnfractions .2 .2 .6 @item @emph{Language} @tab @emph{suffix} @tab @emph{--language option} @item C @tab .c .h @tab --language=c @item Verilog @tab .v @tab --language=v @item C++ @tab .cxx .cpp .cc .C .hpp .H @tab --language=cxx @item Shell @tab .sh @tab --language=sh @item Pascal @tab .pas @tab --language=pascal @item Perl @tab .pl @tab --language=perl @item Java @tab .java @tab --language=java @item Plain text @tab default @tab --language=text @item Pseudo C @tab .pc .ph @tab --language=pseudoc @item Listing @tab .lst @tab --language=list @item Report format @tab .rep @tab --language=report @end multitable For most of the languages, Trueprint uses the language to work out where comments are (so it can print them in italics) and where the function names are (so it can print them in bold and include them in the function index). However there are some special features for some of the languages: Pseudo C is like C, except it has a more forgiving syntax. In particular it ignores strings, so if you leave off a closing quote then pseudo C will print out using a vaguely sensible format. Pseudo C is intended for printing code that doesn't yet compile. Listing format assumes very wide lines and a fixed page length of sixty-six characters, so it turns off line-wrap and sets the page length appropriately. Report format uses a few special characters: anything between ^A and ^E is printed in bold and included in the function index, and anything between a pair of ^Cs is printed in italics. @node Page Formatting, Page Furniture, Languages, Top @chapter Page Formatting @cindex page formatting @cindex portrait @cindex landscape @cindex single-sided @cindex double-sided @cindex one-up @cindex two-up @cindex two-up with small font @cindex four-up @cindex holepunch @cindex holepunch at top of page @cindex top holepunch There are a few options that you can use to adjust the overall page formatting. Most of these options are pretty self-explanatory. @findex portrait @findex landscape For portrait printing use @code{--portrait}, and for landscape printing use @code{--landscape}. @findex single-sided @findex double-sided To force the printer to print single-sided use @code{--single-sided}, and to try to force double-sided printing use @code{--double-sided}. These options also affect headers and footers, so forcing @code{--double-sided} on a single-sided printer will result in odd-looking headers and footers. Also since Trueprint tries to start each file on a new sheet of paper, specifying @code{--double-sided} forces occasional pages with no content. @findex one-up @findex two-up @findex two-tall-up @findex four-up To print one page of output on one physical sheet, the default, use @code{--one-up}. To print two-up, i.e. two logical pages on one sheet (side-by-side for portrait or one over the other for landscape) use @code{--two-up}. And to print four logical pages on each sheet (and to help ruin your eyesight!) use @code{--four-up}. There is another mode called @code{two-tall-up} which prints two logical pages on each sheet at four-up pointsize - for portrait format each logical page is very tall and narrow, and for landscape format each logical page is very wide. @findex holepunch @findex no-holepunch @findex top-holepunch @findex no-top-holepunch To leave a gap down the left-hand-side of each physical page so that you can punch holes in the page without punching out any information, use @code{--holepunch}, and to leave a gap at the top of the page (if you want to punch holes at the top) use @code{--top-holepunch}. Options @code{--no-holepunch} and @code{no-top-holepunch} exist to override these if they've been set up as defaults. @node Page Furniture, Text Formatting, Page Formatting, Top @chapter Page Furniture @cindex page furniture @cindex line numbers @cindex braces depth @cindex indentation @cindex nostalgia @cindex gray bands Page furniture refers to the bits and pieces scattered around the edge of each page. It includes things like headers and footers, line numbers, and so on. @findex line-numbers @findex no-line-numbers @findex braces-depth @findex no-braces-depth The left-hand side of each page can include two columns of information: line numbers and a count of the current braces depth. Line numbers are normally included, but they can be forced on with @code{--line-numbers} and forced off with @code{--no-line-numbers}. The braces depth count is normally only turned on for languages that have the concept of braces (e.g. C or Java); it can be explicitly turned on with @code{--braces-depth} or it can be turned off with @code{--no-braces-depth}. @findex gray-bands @findex no-gray-bands If you are nostalgic for the old line-printer paper with gray or green bands running across each page you can turn this on with @code{--gray-bands @var{number}} where @var{number} is the width of the bands. For example @code{--gray-bands 3} would print light gray bands three lines deep all the way down the page. Naturally you can force this off with @code{--no-gray-bands}. @section Headers and Footers @cindex headers @cindex footers @cindex message string @cindex string format characters @cindex header string format @cindex footer string format @cindex message string format @findex left-header @findex center-header @findex right-header @findex left-footer @findex center-footer @findex right-footer @findex headers @findex footers @findex no-headers @findex no-footers Headers and footers are printed in boxes at the top and bottom of each page. There are three header strings and three footer strings, and each can be a mixture of constant strings or % escapes. The strings are set with @code{--left-header=@var{string}}, @code{--center-header=@var{string}}, @code{--right-header=@var{string}}, @code{--left-footer=@var{string}}, @code{--center-footer=@var{string}}, and @code{--right-footer=@var{string}}. If you want to turn off either headers or footers you can use @code{--no-headers} or @code{--no-footers}, and of course you can force them on with @code{--headers} and @code{--footers}. If you're printing double-sided then the left and right headers and footers are swapped on every second page. @findex page-furniture-lines @findex no-page-furniture-lines Normally headers and footers have a line drawn around them and a line is also drawn down the left side of each page. By specifying @code{--no-page-furniture-lines} these lines are not drawn. In fact if you turn off headers, footers, line count and braces depth then no page furniture will be drawn at all, i.e. @code{--no-page-furniture-lines --no-headers --no-footers --no-braces-depth --no-line-numbers}. @findex message There is also an optional message string that is printed across the middle of each page in a very large, light gray font. You can use this message to say things like @samp{draft} or @samp{top secret}. Use @code{--message=@var{string}} to set the message. There are quite a few % escapes that you can use inside the header, footer and message strings: @table @code @item %% Print a simple %. @item %m Print the current month of the year as a number, e.g. 05. @item %d Print the current day of the month, e.g. 01. @item %y Print the current year, e.g. 1999 @item %D Print the date in the format mm/dd/yy. @item %L Print the date and time in long format, e.g. Fri Oct 8 11:49:51 1999 @item %c Print the last modified date of the current file in the format mm/dd/yy. @item %C Print the last modified date and time of the current file in long format, e.g. Fri Oct 8 11:49:51 1999 @item %H Print the current hour. @item %M Print the current minute. @item %S Print the current second. @item %T Print the time in the format HH:MM:SS. @item %j Print the day of the year, e.g. 095. @item %w Print the day of the week, e.g. Sunday. @item %a Print the abbreviated day of the week, e.g. Sun. @item %h Print the abbreviated month name, e.g. Mar. @item %r Print the time in am/pm notation, e.g. 10:45pm. @item %p Print the page number in the current file. @item %P Print the overall page number. @item %f Print the total number of pages of the current file. @item %F Print the total number of pages. @item %n Print the current filename. @item %N Print the current function name. @item %l Print the username of the current user. @end table The default strings are: @multitable {@code{center-header}} {@code{Page %P of %Flskdfj}} @item @code{left-header} @tab @code{%L} @item @code{center-header} @tab @code{%N} @item @code{right-header} @tab @code{Page %P of %F} @item @code{left-footer} @tab @code{%L} @item @code{center-footer} @tab @code{%n %p} @item @code{right-footer} @tab @code{Page %P of %F} @end multitable @node Text Formatting, Output Options, Page Furniture, Top @chapter Text Formatting @cindex text formatting @cindex format @section Page breaks @cindex page breaks @cindex formfeed character @cindex function page breaks @cindex page breaks after functions @cindex control-L There are three places that Trueprint can include page breaks: at the end of a function (assuming the current language has functions), when it finds a form-feed character (control-L), and at the end of each file. @findex page-break-after-function @findex no-page-break-after-function To force on page breaks at the end of functions use @code{--page-break-after-function}. The default behaviour, to not break the page at the end of a function, can be forced with @code{--no-page-break-after-function}. @findex new-sheet-after-file Normally Trueprint will print each file on a seperate sheet of paper; however if you're printing a lot of small files four-up on a duplex printer then this can waste a lot of paper. Use @code{--no-new-sheet-after-file} to tell Trueprint to just start a new page at the end of a file. This option has no effect for one-up output. @findex form-feeds @findex ignore-form-feeds You can force Trueprint to expand form-feeds to a new page with @code{--form-feeds} and, of course, you can turn it off with @code{--ignore-form-feeds}. @section Line wrap @cindex line wrap @cindex intelligent line wrap @cindex line breaks @findex line-wrap @findex no-line-wrap @findex intelligent-line-wrap @findex no-intelligent-line-wrap @findex minimum-line-length By default Trueprint will wrap lines that are too long for the page. It will try to break the lines at intelligent locations, for example at a space character, and it will print the remainder of the line right-justified. If you don't like this then you can turn off line-wrap with @code{--no-line-wrap}, or you can set the line-wrap column explicitly with @code{--line-wrap=@var{column}}. You can also tell Trueprint to wrap lines at exactly a specific column, i.e. to stop trying to be clever, with @code{--no-intelligent-line-wrap}. Of course you can force the feature on with @code{--intelligent-line-wrap}. And if you want to use intelligent line-wrap but you want to ensure that you don't end up with incredibly short lines then you can set the minimum line length with @code{--minimum-line-length=@var{number}}. @section Page length and pointsize @cindex page length @cindex pointsize @cindex text size @cindex leading @cindex line gap @cindex page length @findex pointsize The default pointsize used by Trueprint is 10. Of course, this is reduced appropriately if you're printing two-up or four-up. You can set the pointsize explicitly with @code{--pointsize=@var{number}}, although bear in mind that the pointsize will still be scaled down for two-up or four-up. @findex leading In the old days of printing, strips of lead were used to seperate the lines of text. If you wanted more seperation you included more strips of lead. Trueprint is nothing if not traditional. The default leading (pronounced @samp{ledding}) is one point, but you can increase (or decrease) it with @code{--leading=@var{number}}. Not suprisingly you can't specify a negative number. @findex page-length You can set the overall page length with @code{--page-length=@var{length}}. Trueprint will set the point size appropriately. Unfortunately, since there are a limited number of pointsizes that Trueprint can chose from (e.g. it can't select 8.35), using this option may result in a blank space at the bottom of each page. This option is best used if your file naturally breaks into pages of a specific length. You may also want to turn off line-wrap so that long lines don't mess up your carefully formatted output. @section Tab size @cindex tab size @findex tabsize The default tab size is eight characters. If this eats up too many columns for you, then you can set it with @code{--tabsize=@var{number}}. @node Output Options, Print Selection, Text Formatting, Top @chapter Output Options @cindex output @cindex printer destination @cindex $PRINTER @cindex lp @cindex lpr @cindex printing multiple copies @cindex copies @cindex postscript @cindex saving postscript @cindex file output @cindex output file @findex printer By default Trueprint will simply send the postscript output to @code{lp} or @code{lpr} (depending on the ancestry of your version of Unix), and it will explicitly set the destination to the value of the environment variable @code{$PRINTER}. You can use @code{--printer=@var{printer}} to send the print job to another printer. If you like @code{lp} options then you can also say @code{-P @var{printer}}, or if you are a fan of System V then you can say @code{-d @var{printer}} (almost every Trueprint option has a single-character equivalent - I only mention these two explicitly because they are used exactly the same way as the options to @code{lpr} and @code{lp}). @findex copies If you want to print multiple copies then just use @code{--copies=@var{number}}. @findex output @findex redirect If you want to save the postscript output then you can redirect it to a file using @code{--output=@var{filename}}. If you use @code{-} for the filename then the postscript will be sent to stdout. If you use @code{--redirect-output} then the output will be sent to a file named after the first parameter with the suffix @code{.ps}. The @code{--redirect-output} option overrides the @code{--output=@var{filename}} option, and of course there is a @code{--no-redirect-output} option to turn it off. @node Print Selection, Miscellaneous Features, Output Options, Top @chapter Print Selection @cindex cover sheet @cindex file index @cindex function index @cindex body @cindex selecting pages to print A Trueprint print job can contain a reasonably long list of pages: @itemize @bullet @item A cover sheet, @item a file index, @item a function index, @item and the files. @end itemize Each of these can be explicitly disabled or enabled: @findex function-index @findex no-function-index @findex file-index @findex no-file-index @findex cover-sheet @findex no-cover-sheet @findex print-body @findex no-print-body @multitable @columnfractions .5 .5 @item @code{--no-cover-sheet} @tab @code{--cover-sheet} @item @code{--no-file-index} @tab @code{--file-index} @item @code{--no-function-index} @tab @code{--function-index} @item @code{--no-print-body} @tab @code{--print-body} @end multitable @findex print-pages In addition there is a mechanism for printing only a subset of the pages, by using @code{--print-pages=@var{selection}}, where selection consists of a comma-seperated list of page selections: @table @code @item @var{number} Print the specific page. @item @var{number}-@var{number} Print all pages between, and including, the specified pages. @item @var{function-name} Print all pages that include @var{function-name}. @item d Print all pages that have changed (this is only useful with the @code{--diff} (@pxref{Miscellaneous Features}) option. @item D Print all pages containing functions that have changed (this is only useful with the @code{--diff} (@pxref{Miscellaneous Features}) option. @item f Print the function index. @item F Print the file index. @end table For example, @code{--print-pages=1-5,main,f} will print the function index, pages 1 to 5, and all the pages for the function @code{main}. @findex prompt If you specify @code{--prompt} then Trueprint will prompt you for each page, whether or not it should print that page. It will give you information such as the current filename, current functionname, page number, and so on. The possible responses are: @table @code @item y Print this page. @item y@var{number} Print @var{number} pages. @item y* Print all the remaining pages. @item n Skip this page @item n@var{number} Skip @var{number} pages. @item n* Skip all the remaining pages. @item p@var{selection} Print all remaining pages that match @var{selection}, where @var{selection} is in the format defined above. @item ? Print a help message. @end table @findex no-prompt Of course, you can force the prompting feature off with @code{--no-prompt}. @node Miscellaneous Features, Options and Environment Variables List, Print Selection, Top @chapter Miscellaneous Features @section Diff-marking @cindex diff @cindex comparing with old version @cindex marking differences One of the more obscure but more useful features of Trueprint is the ability to highlight differences between two versions of sets of files. Added lines are shown in bold, while deleted lines are shown struck-out. @findex diff You specify the old version of the file or files with @code{--diff=@var{pathname}}. If @var{pathname} suffixed with the current filename is a valid file then the differences between @var{pathname}/@var{filename} are displayed. Alternatively, if @var{pathname} is a file and you're printing one file, then the differences between @var{pathname} and the current file are displayed. Some examples: @example trueprint --diff=../old- this.c that.c @end example will print the differences between ../old-this.c and this.c, and ../old-that.c and that.c. @example trueprint --diff=../old/ this.c that.c @end example will print the differences between ../old/this.c and this.c, and ../old/that.c and that.c. Note that the trailing / is important. @example trueprint --diff=this.c that.c @end example will print the differences between this.c and that.c. @section Help and Version Information @cindex help messages @cindex version information @findex help Use @code{--help} for general on-line help information. If you give the @code{--help} option a parameter it will give you more detailed information about a specific area - use @code{--help} for a list of the areas. @findex version Use @code{--version} to see the current version of Trueprint. @section Setting personal defaults @cindex default options @cindex personal defaults @cindex setting defaults When Trueprint starts it uses four sets of options: @itemize @bullet @item Hard-coded defaults. @item Language-specific defaults. @item Options taken from the environment variable @code{$TP_OPTS}. @item Command-line options. @end itemize Each set of options overrides the earlier sets, so command-line options override all other sets. If you want to set some personal default options, then simply set the environment variable @code{$TP_OPTS}. @section Postscript level @cindex postscript level It is possible to request that trueprint generate level 1 or level 2 postscript. Level 2 is the default. If level 2 is set then trueprint will send the appropriate instructions to select the proper paper size. You shouldn't normally need to use this option. To select postscript level 1 use @code{--ps-level-one} and to select postscript level 2 use @code{--ps-level-two}. In the future this option may be used to turn on more features. @section Environment Information @cindex environment variables @findex ignore-environment @findex use-environment By default Trueprint uses environment variables and the current username. You can force it to ignore these by using @code{--ignore-environment}. In practice this is only used when running the tests during installation. For the sake of completeness there is an option @code{--use-environment}. @section Debugging @cindex debugging @findex debug Trueprint has built-in debugging messages that can be useful for tracking down problems. The debugging messages are turned on with @code{--debug=@var{string}}, where @var{string} is a series of letter/digit pairs. Each letter turns on a set of debugging messages, and the corresponding digit indicates the level of messages, with 1 indicating the least number of messags and 9 turning on all messages. The letter @code{@@} can be used to turn on all areas, so @code{--debug=@@9} will turn on all messages. Use @code{--help=debug} for details of what letters turn on what areas. Note that this feature is not uniformly implemented - messages were only typically added where they were needed. Also note that messages will not be generated in code prior to the code that sets the debug string! @node Options and Environment Variables List, Option Index, Miscellaneous Features, Top @chapter Options and Environment Variables @section Miscellaneous options @table @code @item -D @itemx --debug=@var{string} set debug options to @var{string} @item -O @var{string} @itemx --diff=@var{string} if @var{string} is a file then print diffs between @var{string} and input file otherwise use as a prefix and print diffs @item -t @var{string} @itemx --language=@var{string} treat input as language. Use --help languages for list. @item -U @var{string} @itemx --username=@var{string} set username for coversheet @item -H @itemx --help Type help information @item --help=@var{string} Type specific help information. Use @code{--help} for a list of possible @var{string}s. @item -V @itemx --version Type version information @item -N @itemx --use-environment use environment variables @item --N @itemx --ignore-environment don't use values from environment, such as time, @code{$USER}, etc. This is for test purposes, to make test results more reproducible. @end table @section Page furniture options @table @code @item -X @var{string} @itemx --left-header=@var{string} Specify string for left side of header. @item -x @var{string} @itemx --left-footer=@var{string} Specify string for left side of footer. @item -Y @var{string} @itemx --center-header=@var{string} Specify string for center of header. @item -y @var{string} @itemx --center-footer=@var{string} Specify string for center of footer. @item -Z @var{string} @itemx --right-header=@var{string} Specify string for right side of header. @item -z @var{string} @itemx --right-footer=@var{string} Specify string for right side of footer. @item -m @var{string} @itemx --message=@var{string} Message to be printed over page. @item -G @var{number} @itemx --gray-bands=@var{number} Emulate the old lineprinter paper with gray bands across each page. The value of @var{number} gives the width of the bands and the gaps between them. @item -K @itemx --headers Include the header on each page. @item --K @itemx --no-headers Suppress the header on each page. @item -k @itemx --footers Include the footer on each page. @item --k @itemx --no-footers Suppress the footer on each page. @item -i @itemx --no-braces-depth Exclude the braces depth count. @item --i @itemx --braces-depth Include the braces depth count. @item -n @itemx --no-line-numbers Exclude the line number count. @item --n @itemx --line-numbers Include the line number count. @end table @section Text formatting options @table @code @item -b @itemx --no-page-break-after-function Don't print page breaks at the end of functions. @item --b @itemx --page-break-after-function Print page breaks at the end of functions. @item --new-sheet-after-file Print each file on a new sheet of paper. @item --no-new-sheet-after-file Don't print each file on a new sheet of paper. This option will still insert a page break at the end of a file, but it won't force the new file on to a new sheet of paper. @item -W @itemx --no-intelligent-line-wrap Wrap lines at exactly the line-wrap column. @item --W @itemx --intelligent-line-wrap Wrap lines intelligently at significant characters, such as a space @item -T @var{number} @itemx --tabsize=@var{number} Set tabsize (default 8). @item -E @itemx --ignore-form-feeds Don't expand form feed characters to new page. @item --E @itemx --form-feeds Expand form feed characters to new page. @item -p @var{number} @itemx --point-size=@var{number} Specify point size (default 10). @item -g @var{number} @itemx --leading=@var{number} Specify interline gap in points (default 1). @item -w @var{number} @itemx --line-wrap=@var{number} Specify the line-wrap column. @item --no-line-wrap Turn off line-wrap. @item -l @var{number} @itemx --page-length=@var{number} Specify number of lines on a page, point size is calculated appropriately. @end table @section Print selection options @table @code @item -C @itemx --no-cover-sheet Don't print cover sheet. @item --C @itemx --cover-sheet Print cover sheet. @item -A @var{string} @itemx --print-pages=@var{string} Specify list of pages to be printed. @item -a @itemx --no-prompt Don't prompt for each page, whether it should be printed or not. @item --a @itemx --prompt Prompt for each page, whether it should be printed or not. @item -F @itemx --no-file-index Don't print file index. @item --F @itemx --file-index Print file index. @item -f @itemx --no-function-index Don't print function index. @item --f @itemx --function-index Print function index. @item -B @itemx --no-print-body Don't print body of text. @item --B @itemx --print-body Print body of text. @end table @section Page format options @table @code @item -I @itemx --no-holepunch Don't leave space for holepunch at the side of each page. @item --I @itemx --holepunch Leave space for holepunch at the side of each page. @item -J @itemx --no-top-holepunch Don't leave space for holepunch at the top of each page. @item --J @itemx --top-holepunch Leave space for holepunch at the top of each page. @item -o p @itemx --portrait Print using portrait orientation. @item -o l @itemx --landscape Print using landscape orientation. @item -S 1 @itemx --single-sided Print single-sided. @item -S 2 @itemx --double-sided Print double-sided. @item -1 @itemx --one-up Print 1-on-1 (default). @item -2 @itemx --two-up Print 2-on-1. @item -3 @itemx --two-tall-up Print 2-on-1 at 4-on-1 pointsize. @item -4 @itemx --four-up Print 4-on-1. @end table @section Output options @table @code @item -d @var{string} @itemx --printer=@var{string} Use printer @var{string}. @item -P @var{string} @itemx --printer=@var{string} Use printer @var{string}. @item -s @var{string} @itemx --output=@var{string} Send output to filename @var{string}; use - for stdout. @item -c @var{number} @itemx --copies=@var{number} Specify number of copies to be printed. @end table @section Environment Variables @subsection TP_OPTS Specify options. These options override any default options including language defaults, but are overridden by command line options. @subsection TP_DIFF_CMD Specify the diff command to be used. The command must produce output in the same format as the classic Unix diff. This variable can be used to add flags to the diff command used, for example to make diff ignore whitespace. @subsection TP_PRINT_CMD Specify the print command. The default is lpr. If this is set then it should be set to a command that takes standard input. If this is set then the destination and number of copies have no effect, i.e. there is no mechanism to pass these values to your print command. If you set this to /bin/cat then the postscript output will appear on stdout. @subsection TP_PRINTERS_FILE Specify the printers file. The default is the printers file that was initially configured when trueprint was installed. This can be used to test out a new printers file. @node Option Index, Concept Index, Options and Environment Variables List, Top @unnumbered Option Index @printindex fn @node Concept Index, , Option Index, Top @unnumbered Concept Index @printindex cp @summarycontents @contents @bye trueprint-5.3/doc/trueprint.info0000664000076400007640000012172607322205515012600 This is trueprint.info, produced by makeinfo version 4.0 from trueprint.texi. INFO-DIR-SECTION Miscellaneous START-INFO-DIR-ENTRY * Trueprint: (trueprint). Format & print text files on a printer END-INFO-DIR-ENTRY This is the documentation for GNU Trueprint Copyright (C) 1999 Free Software Foundation Inc.  File: trueprint.info, Node: Top, Next: Overview, Up: (dir) Trueprint ********* Trueprint is a program for printing source code and other text files. * Menu: * Overview:: Trueprint in brief. * Installing Trueprint:: How to install Trueprint. * Languages:: How Trueprint handles source files for different computer languages. * Page Formatting:: Getting the right number of pages on a sheet. * Page Furniture:: Headers, footers and other page decorations. * Text Formatting:: Font size, line breaks, and other text formatting tweaks. * Output Options:: Sending the output to the right place. * Print Selection:: Printing just the stuff you want. * Miscellaneous Features:: All the stuff that doesn't belong anywhere else. * Options and Environment Variables List:: A reference list of all options. * Option Index:: Index to options * Concept Index:: Index to concepts throughout this manual  File: trueprint.info, Node: Overview, Next: Installing Trueprint, Prev: Top, Up: Top Overview ******** What is Trueprint? Trueprint is an ugly flower that smells beautiful. Trueprint is intended to be the only printing program you will ever need to print your program source code and other text files. It tries to achieve this by being simple to use, providing powerful features, and being intelligent enough to provide those features when you need them. Trueprint knows about common computer languages and will select features appropriate to each language. For example if the language contains functions then Trueprint will generate a function index. And if the language contains the concept of braces then Trueprint will include a braces depth count in the left-hand margin. If you need to customize the appearance of the printed output then you can use options to turn any of Trueprint's features on or off. For example you can specify that the output be printed landscape, two-up, using an eight-point font with line numbers. By setting an environment variable you can create personal defaults for Trueprint which will override the language defaults and which will in turn be overridden by the command line options. Trueprint knows about the printers available on your system via a special `printers' file. This file tells it how large a page is and whether the printer is double or single sided. Using this information, Trueprint can format your output appropriately. If there's anything that Trueprint doesn't do, you are welcome to change the tool itself - just remember that it's covered by the GPL and be sure to send a copy of the changes to ! The original author and current maintainer of trueprint is Lezz Giles. His email addresses at the time of writing are , , and .  File: trueprint.info, Node: Installing Trueprint, Next: Languages, Prev: Overview, Up: Top Installing Trueprint ******************** Installing Trueprint is almost as simple as installing any well-behaved GNU program. For details, read the README file that comes with the package. This section provides an overview of the process, plus details of the `printers' file. Installation Overview ===================== In the simplest case, assuming you want to install trueprint into /usr/local/bin, installing trueprint is just a matter of five short steps: * `./configure' * `make' * `make test' * Update the printers file with your printer information. * `make install' If you want to change the installation root directory from `/usr/local' to, for example, `/usr' (so that the executable would be put into `/usr/bin/trueprint') then just pass the new root directory to `./configure' using `--prefix', e.g. `./configure --prefix=/usr'. If the tests fail then cd to the tests subdirectory and look at the appropriate `.dif' file. If you can't work out what's gone wrong then report the problem to . The `printers' file =================== The printers file is the most complicated part of Trueprint. Put simply, it contains two lists: a list of printer types, and a list of the printers at your site. The list of printer types is long (well, actually it's fairly short) and it should contain the most common office printers. The list of printers in the distribution printers file is just a set of example entries - you should delete these examples and replace them with your own printer information. An example type entry is: type:Apple Laswerwriter II:1: 15:597:784:8 The first field just specifies this as a `type' entry. The second field contains the printer type name. Whitespace is significant, so there shouldn't be any spaces between the start and end of the name, and the colons. The third field is 1 for a single-sided printer and 2 for a double-sided printer. The final four fields give the left, right, top and bottom margins respectively in points from the bottom left corner of the paper; more specifically they are the coordinates of the bounding box that the postscript engine on the printer can print in. The first three fields are typically easy to fill in; however the final four fields need to be calculated for each printer type. Fortunately the postscript interpreter knows what the coordinates are - it's just a matter of asking it nicely, and the file `testprint' contains a little postscript program that will do just that. If you print `testprint' using either `lpr' or `lp' then it will print out the four numbers needed in the `printers' file (on the other hand, if it simply prints the contents of the file then either your printer is not configured properly or it isn't a postscript printer - you'll need to rectify the situation before you can use Trueprint on that printer). The second half of the file contains printer entries, for example: printer:pr2-simp:HP Laserjet 8000 simplex Once again, the first entry simply specifies that this is a `printer' entry. The second entry contains the printer queue name as known to your operating system (i.e. the value you would pass to `lp' or `lpr'). The third field contains the appropriate printer type name; once again whitespace is important so make sure there are no trailing space or tab characters at the end of the line. If you have two queues set up to one printer, one for single-sided output and one for double-sided output, simply set up two printer types. Similarly if you have multiple queues for the same printer for different paper sizes.  File: trueprint.info, Node: Languages, Next: Page Formatting, Prev: Installing Trueprint, Up: Top Languages ********* Different programming languages have different features and look their best with different formats. Since Trueprint tries to be all things to all people, it understands a number of different languages and tries to accomodate all of them. In this version Trueprint understands: * C * Verilog * C++ * Shell * Pascal * Perl * Java It also understands some other formats: * Plain text * Pseudo C * Listing files * A special format called "report format" Not all of the languages are fully supported. C is well supported, but Java is only minimally supported. The language support is implemented in the `lang_*.c' files - if you're not happy with the level of support for your favorite language just improve - or add - it! There are a couple of ways that Trueprint can find out what type of language a file contains. It can look at the filename suffix, or it can be told using the `--language' option. The details are: _Language_ _suffix_ _-language option_ C .c .h -language=c Verilog .v -language=v C++ .cxx .cpp .cc -language=cxx .C .hpp .H Shell .sh -language=sh Pascal .pas -language=pascal Perl .pl -language=perl Java .java -language=java Plain text default -language=text Pseudo C .pc .ph -language=pseudoc Listing .lst -language=list Report format .rep -language=report For most of the languages, Trueprint uses the language to work out where comments are (so it can print them in italics) and where the function names are (so it can print them in bold and include them in the function index). However there are some special features for some of the languages: Pseudo C is like C, except it has a more forgiving syntax. In particular it ignores strings, so if you leave off a closing quote then pseudo C will print out using a vaguely sensible format. Pseudo C is intended for printing code that doesn't yet compile. Listing format assumes very wide lines and a fixed page length of sixty-six characters, so it turns off line-wrap and sets the page length appropriately. Report format uses a few special characters: anything between ^A and ^E is printed in bold and included in the function index, and anything between a pair of ^Cs is printed in italics.  File: trueprint.info, Node: Page Formatting, Next: Page Furniture, Prev: Languages, Up: Top Page Formatting *************** There are a few options that you can use to adjust the overall page formatting. Most of these options are pretty self-explanatory. For portrait printing use `--portrait', and for landscape printing use `--landscape'. To force the printer to print single-sided use `--single-sided', and to try to force double-sided printing use `--double-sided'. These options also affect headers and footers, so forcing `--double-sided' on a single-sided printer will result in odd-looking headers and footers. Also since Trueprint tries to start each file on a new sheet of paper, specifying `--double-sided' forces occasional pages with no content. To print one page of output on one physical sheet, the default, use `--one-up'. To print two-up, i.e. two logical pages on one sheet (side-by-side for portrait or one over the other for landscape) use `--two-up'. And to print four logical pages on each sheet (and to help ruin your eyesight!) use `--four-up'. There is another mode called `two-tall-up' which prints two logical pages on each sheet at four-up pointsize - for portrait format each logical page is very tall and narrow, and for landscape format each logical page is very wide. To leave a gap down the left-hand-side of each physical page so that you can punch holes in the page without punching out any information, use `--holepunch', and to leave a gap at the top of the page (if you want to punch holes at the top) use `--top-holepunch'. Options `--no-holepunch' and `no-top-holepunch' exist to override these if they've been set up as defaults.  File: trueprint.info, Node: Page Furniture, Next: Text Formatting, Prev: Page Formatting, Up: Top Page Furniture ************** Page furniture refers to the bits and pieces scattered around the edge of each page. It includes things like headers and footers, line numbers, and so on. The left-hand side of each page can include two columns of information: line numbers and a count of the current braces depth. Line numbers are normally included, but they can be forced on with `--line-numbers' and forced off with `--no-line-numbers'. The braces depth count is normally only turned on for languages that have the concept of braces (e.g. C or Java); it can be explicitly turned on with `--braces-depth' or it can be turned off with `--no-braces-depth'. If you are nostalgic for the old line-printer paper with gray or green bands running across each page you can turn this on with `--gray-bands NUMBER' where NUMBER is the width of the bands. For example `--gray-bands 3' would print light gray bands three lines deep all the way down the page. Naturally you can force this off with `--no-gray-bands'. Headers and Footers =================== Headers and footers are printed in boxes at the top and bottom of each page. There are three header strings and three footer strings, and each can be a mixture of constant strings or % escapes. The strings are set with `--left-header=STRING', `--center-header=STRING', `--right-header=STRING', `--left-footer=STRING', `--center-footer=STRING', and `--right-footer=STRING'. If you want to turn off either headers or footers you can use `--no-headers' or `--no-footers', and of course you can force them on with `--headers' and `--footers'. If you're printing double-sided then the left and right headers and footers are swapped on every second page. Normally headers and footers have a line drawn around them and a line is also drawn down the left side of each page. By specifying `--no-page-furniture-lines' these lines are not drawn. In fact if you turn off headers, footers, line count and braces depth then no page furniture will be drawn at all, i.e. `--no-page-furniture-lines --no-headers --no-footers --no-braces-depth --no-line-numbers'. There is also an optional message string that is printed across the middle of each page in a very large, light gray font. You can use this message to say things like `draft' or `top secret'. Use `--message=STRING' to set the message. There are quite a few % escapes that you can use inside the header, footer and message strings: `%%' Print a simple %. `%m' Print the current month of the year as a number, e.g. 05. `%d' Print the current day of the month, e.g. 01. `%y' Print the current year, e.g. 1999 `%D' Print the date in the format mm/dd/yy. `%L' Print the date and time in long format, e.g. Fri Oct 8 11:49:51 1999 `%c' Print the last modified date of the current file in the format mm/dd/yy. `%C' Print the last modified date and time of the current file in long format, e.g. Fri Oct 8 11:49:51 1999 `%H' Print the current hour. `%M' Print the current minute. `%S' Print the current second. `%T' Print the time in the format HH:MM:SS. `%j' Print the day of the year, e.g. 095. `%w' Print the day of the week, e.g. Sunday. `%a' Print the abbreviated day of the week, e.g. Sun. `%h' Print the abbreviated month name, e.g. Mar. `%r' Print the time in am/pm notation, e.g. 10:45pm. `%p' Print the page number in the current file. `%P' Print the overall page number. `%f' Print the total number of pages of the current file. `%F' Print the total number of pages. `%n' Print the current filename. `%N' Print the current function name. `%l' Print the username of the current user. The default strings are: `left-header' `%L' `center-header' `%N' `right-header' `Page %P of %F' `left-footer' `%L' `center-footer' `%n %p' `right-footer' `Page %P of %F'  File: trueprint.info, Node: Text Formatting, Next: Output Options, Prev: Page Furniture, Up: Top Text Formatting *************** Page breaks =========== There are three places that Trueprint can include page breaks: at the end of a function (assuming the current language has functions), when it finds a form-feed character (control-L), and at the end of each file. To force on page breaks at the end of functions use `--page-break-after-function'. The default behaviour, to not break the page at the end of a function, can be forced with `--no-page-break-after-function'. Normally Trueprint will print each file on a seperate sheet of paper; however if you're printing a lot of small files four-up on a duplex printer then this can waste a lot of paper. Use `--no-new-sheet-after-file' to tell Trueprint to just start a new page at the end of a file. This option has no effect for one-up output. You can force Trueprint to expand form-feeds to a new page with `--form-feeds' and, of course, you can turn it off with `--ignore-form-feeds'. Line wrap ========= By default Trueprint will wrap lines that are too long for the page. It will try to break the lines at intelligent locations, for example at a space character, and it will print the remainder of the line right-justified. If you don't like this then you can turn off line-wrap with `--no-line-wrap', or you can set the line-wrap column explicitly with `--line-wrap=COLUMN'. You can also tell Trueprint to wrap lines at exactly a specific column, i.e. to stop trying to be clever, with `--no-intelligent-line-wrap'. Of course you can force the feature on with `--intelligent-line-wrap'. And if you want to use intelligent line-wrap but you want to ensure that you don't end up with incredibly short lines then you can set the minimum line length with `--minimum-line-length=NUMBER'. Page length and pointsize ========================= The default pointsize used by Trueprint is 10. Of course, this is reduced appropriately if you're printing two-up or four-up. You can set the pointsize explicitly with `--pointsize=NUMBER', although bear in mind that the pointsize will still be scaled down for two-up or four-up. In the old days of printing, strips of lead were used to seperate the lines of text. If you wanted more seperation you included more strips of lead. Trueprint is nothing if not traditional. The default leading (pronounced `ledding') is one point, but you can increase (or decrease) it with `--leading=NUMBER'. Not suprisingly you can't specify a negative number. You can set the overall page length with `--page-length=LENGTH'. Trueprint will set the point size appropriately. Unfortunately, since there are a limited number of pointsizes that Trueprint can chose from (e.g. it can't select 8.35), using this option may result in a blank space at the bottom of each page. This option is best used if your file naturally breaks into pages of a specific length. You may also want to turn off line-wrap so that long lines don't mess up your carefully formatted output. Tab size ======== The default tab size is eight characters. If this eats up too many columns for you, then you can set it with `--tabsize=NUMBER'.  File: trueprint.info, Node: Output Options, Next: Print Selection, Prev: Text Formatting, Up: Top Output Options ************** By default Trueprint will simply send the postscript output to `lp' or `lpr' (depending on the ancestry of your version of Unix), and it will explicitly set the destination to the value of the environment variable `$PRINTER'. You can use `--printer=PRINTER' to send the print job to another printer. If you like `lp' options then you can also say `-P PRINTER', or if you are a fan of System V then you can say `-d PRINTER' (almost every Trueprint option has a single-character equivalent - I only mention these two explicitly because they are used exactly the same way as the options to `lpr' and `lp'). If you want to print multiple copies then just use `--copies=NUMBER'. If you want to save the postscript output then you can redirect it to a file using `--output=FILENAME'. If you use `-' for the filename then the postscript will be sent to stdout. If you use `--redirect-output' then the output will be sent to a file named after the first parameter with the suffix `.ps'. The `--redirect-output' option overrides the `--output=FILENAME' option, and of course there is a `--no-redirect-output' option to turn it off.  File: trueprint.info, Node: Print Selection, Next: Miscellaneous Features, Prev: Output Options, Up: Top Print Selection *************** A Trueprint print job can contain a reasonably long list of pages: * A cover sheet, * a file index, * a function index, * and the files. Each of these can be explicitly disabled or enabled: `--no-cover-sheet' `--cover-sheet' `--no-file-index' `--file-index' `--no-function-index' `--function-index' `--no-print-body' `--print-body' In addition there is a mechanism for printing only a subset of the pages, by using `--print-pages=SELECTION', where selection consists of a comma-seperated list of page selections: `NUMBER' Print the specific page. `NUMBER-NUMBER' Print all pages between, and including, the specified pages. `FUNCTION-NAME' Print all pages that include FUNCTION-NAME. `d' Print all pages that have changed (this is only useful with the `--diff' (*note Miscellaneous Features::) option. `D' Print all pages containing functions that have changed (this is only useful with the `--diff' (*note Miscellaneous Features::) option. `f' Print the function index. `F' Print the file index. For example, `--print-pages=1-5,main,f' will print the function index, pages 1 to 5, and all the pages for the function `main'. If you specify `--prompt' then Trueprint will prompt you for each page, whether or not it should print that page. It will give you information such as the current filename, current functionname, page number, and so on. The possible responses are: `y' Print this page. `yNUMBER' Print NUMBER pages. `y*' Print all the remaining pages. `n' Skip this page `nNUMBER' Skip NUMBER pages. `n*' Skip all the remaining pages. `pSELECTION' Print all remaining pages that match SELECTION, where SELECTION is in the format defined above. `?' Print a help message. Of course, you can force the prompting feature off with `--no-prompt'.  File: trueprint.info, Node: Miscellaneous Features, Next: Options and Environment Variables List, Prev: Print Selection, Up: Top Miscellaneous Features ********************** Diff-marking ============ One of the more obscure but more useful features of Trueprint is the ability to highlight differences between two versions of sets of files. Added lines are shown in bold, while deleted lines are shown struck-out. You specify the old version of the file or files with `--diff=PATHNAME'. If PATHNAME suffixed with the current filename is a valid file then the differences between PATHNAME/FILENAME are displayed. Alternatively, if PATHNAME is a file and you're printing one file, then the differences between PATHNAME and the current file are displayed. Some examples: trueprint --diff=../old- this.c that.c will print the differences between ../old-this.c and this.c, and ../old-that.c and that.c. trueprint --diff=../old/ this.c that.c will print the differences between ../old/this.c and this.c, and ../old/that.c and that.c. Note that the trailing / is important. trueprint --diff=this.c that.c will print the differences between this.c and that.c. Help and Version Information ============================ Use `--help' for general on-line help information. If you give the `--help' option a parameter it will give you more detailed information about a specific area - use `--help' for a list of the areas. Use `--version' to see the current version of Trueprint. Setting personal defaults ========================= When Trueprint starts it uses four sets of options: * Hard-coded defaults. * Language-specific defaults. * Options taken from the environment variable `$TP_OPTS'. * Command-line options. Each set of options overrides the earlier sets, so command-line options override all other sets. If you want to set some personal default options, then simply set the environment variable `$TP_OPTS'. Postscript level ================ It is possible to request that trueprint generate level 1 or level 2 postscript. Level 2 is the default. If level 2 is set then trueprint will send the appropriate instructions to select the proper paper size. You shouldn't normally need to use this option. To select postscript level 1 use `--ps-level-one' and to select postscript level 2 use `--ps-level-two'. In the future this option may be used to turn on more features. Environment Information ======================= By default Trueprint uses environment variables and the current username. You can force it to ignore these by using `--ignore-environment'. In practice this is only used when running the tests during installation. For the sake of completeness there is an option `--use-environment'. Debugging ========= Trueprint has built-in debugging messages that can be useful for tracking down problems. The debugging messages are turned on with `--debug=STRING', where STRING is a series of letter/digit pairs. Each letter turns on a set of debugging messages, and the corresponding digit indicates the level of messages, with 1 indicating the least number of messags and 9 turning on all messages. The letter `@' can be used to turn on all areas, so `--debug=@9' will turn on all messages. Use `--help=debug' for details of what letters turn on what areas. Note that this feature is not uniformly implemented - messages were only typically added where they were needed. Also note that messages will not be generated in code prior to the code that sets the debug string!  File: trueprint.info, Node: Options and Environment Variables List, Next: Option Index, Prev: Miscellaneous Features, Up: Top Options and Environment Variables ********************************* Miscellaneous options ===================== `-D' `--debug=STRING' set debug options to STRING `-O STRING' `--diff=STRING' if STRING is a file then print diffs between STRING and input file otherwise use as a prefix and print diffs `-t STRING' `--language=STRING' treat input as language. Use -help languages for list. `-U STRING' `--username=STRING' set username for coversheet `-H' `--help' Type help information `--help=STRING' Type specific help information. Use `--help' for a list of possible STRINGs. `-V' `--version' Type version information `-N' `--use-environment' use environment variables `--N' `--ignore-environment' don't use values from environment, such as time, `$USER', etc. This is for test purposes, to make test results more reproducible. Page furniture options ====================== `-X STRING' `--left-header=STRING' Specify string for left side of header. `-x STRING' `--left-footer=STRING' Specify string for left side of footer. `-Y STRING' `--center-header=STRING' Specify string for center of header. `-y STRING' `--center-footer=STRING' Specify string for center of footer. `-Z STRING' `--right-header=STRING' Specify string for right side of header. `-z STRING' `--right-footer=STRING' Specify string for right side of footer. `-m STRING' `--message=STRING' Message to be printed over page. `-G NUMBER' `--gray-bands=NUMBER' Emulate the old lineprinter paper with gray bands across each page. The value of NUMBER gives the width of the bands and the gaps between them. `-K' `--headers' Include the header on each page. `--K' `--no-headers' Suppress the header on each page. `-k' `--footers' Include the footer on each page. `--k' `--no-footers' Suppress the footer on each page. `-i' `--no-braces-depth' Exclude the braces depth count. `--i' `--braces-depth' Include the braces depth count. `-n' `--no-line-numbers' Exclude the line number count. `--n' `--line-numbers' Include the line number count. Text formatting options ======================= `-b' `--no-page-break-after-function' Don't print page breaks at the end of functions. `--b' `--page-break-after-function' Print page breaks at the end of functions. `--new-sheet-after-file' Print each file on a new sheet of paper. `--no-new-sheet-after-file' Don't print each file on a new sheet of paper. This option will still insert a page break at the end of a file, but it won't force the new file on to a new sheet of paper. `-W' `--no-intelligent-line-wrap' Wrap lines at exactly the line-wrap column. `--W' `--intelligent-line-wrap' Wrap lines intelligently at significant characters, such as a space `-T NUMBER' `--tabsize=NUMBER' Set tabsize (default 8). `-E' `--ignore-form-feeds' Don't expand form feed characters to new page. `--E' `--form-feeds' Expand form feed characters to new page. `-p NUMBER' `--point-size=NUMBER' Specify point size (default 10). `-g NUMBER' `--leading=NUMBER' Specify interline gap in points (default 1). `-w NUMBER' `--line-wrap=NUMBER' Specify the line-wrap column. `--no-line-wrap' Turn off line-wrap. `-l NUMBER' `--page-length=NUMBER' Specify number of lines on a page, point size is calculated appropriately. Print selection options ======================= `-C' `--no-cover-sheet' Don't print cover sheet. `--C' `--cover-sheet' Print cover sheet. `-A STRING' `--print-pages=STRING' Specify list of pages to be printed. `-a' `--no-prompt' Don't prompt for each page, whether it should be printed or not. `--a' `--prompt' Prompt for each page, whether it should be printed or not. `-F' `--no-file-index' Don't print file index. `--F' `--file-index' Print file index. `-f' `--no-function-index' Don't print function index. `--f' `--function-index' Print function index. `-B' `--no-print-body' Don't print body of text. `--B' `--print-body' Print body of text. Page format options =================== `-I' `--no-holepunch' Don't leave space for holepunch at the side of each page. `--I' `--holepunch' Leave space for holepunch at the side of each page. `-J' `--no-top-holepunch' Don't leave space for holepunch at the top of each page. `--J' `--top-holepunch' Leave space for holepunch at the top of each page. `-o p' `--portrait' Print using portrait orientation. `-o l' `--landscape' Print using landscape orientation. `-S 1' `--single-sided' Print single-sided. `-S 2' `--double-sided' Print double-sided. `-1' `--one-up' Print 1-on-1 (default). `-2' `--two-up' Print 2-on-1. `-3' `--two-tall-up' Print 2-on-1 at 4-on-1 pointsize. `-4' `--four-up' Print 4-on-1. Output options ============== `-d STRING' `--printer=STRING' Use printer STRING. `-P STRING' `--printer=STRING' Use printer STRING. `-s STRING' `--output=STRING' Send output to filename STRING; use - for stdout. `-c NUMBER' `--copies=NUMBER' Specify number of copies to be printed. Environment Variables ===================== TP_OPTS ------- Specify options. These options override any default options including language defaults, but are overridden by command line options. TP_DIFF_CMD ----------- Specify the diff command to be used. The command must produce output in the same format as the classic Unix diff. This variable can be used to add flags to the diff command used, for example to make diff ignore whitespace. TP_PRINT_CMD ------------ Specify the print command. The default is lpr. If this is set then it should be set to a command that takes standard input. If this is set then the destination and number of copies have no effect, i.e. there is no mechanism to pass these values to your print command. If you set this to /bin/cat then the postscript output will appear on stdout. TP_PRINTERS_FILE ---------------- Specify the printers file. The default is the printers file that was initially configured when trueprint was installed. This can be used to test out a new printers file.  File: trueprint.info, Node: Option Index, Next: Concept Index, Prev: Options and Environment Variables List, Up: Top Option Index ************ * Menu: * braces-depth: Page Furniture. * center-footer: Page Furniture. * center-header: Page Furniture. * copies: Output Options. * cover-sheet: Print Selection. * debug: Miscellaneous Features. * diff: Miscellaneous Features. * double-sided: Page Formatting. * file-index: Print Selection. * footers: Page Furniture. * form-feeds: Text Formatting. * four-up: Page Formatting. * function-index: Print Selection. * gray-bands: Page Furniture. * headers: Page Furniture. * help: Miscellaneous Features. * holepunch: Page Formatting. * ignore-environment: Miscellaneous Features. * ignore-form-feeds: Text Formatting. * intelligent-line-wrap: Text Formatting. * landscape: Page Formatting. * language: Languages. * leading: Text Formatting. * left-footer: Page Furniture. * left-header: Page Furniture. * line-numbers: Page Furniture. * line-wrap: Text Formatting. * message: Page Furniture. * minimum-line-length: Text Formatting. * new-sheet-after-file: Text Formatting. * no-braces-depth: Page Furniture. * no-cover-sheet: Print Selection. * no-file-index: Print Selection. * no-footers: Page Furniture. * no-function-index: Print Selection. * no-gray-bands: Page Furniture. * no-headers: Page Furniture. * no-holepunch: Page Formatting. * no-intelligent-line-wrap: Text Formatting. * no-line-numbers: Page Furniture. * no-line-wrap: Text Formatting. * no-page-break-after-function: Text Formatting. * no-page-furniture-lines: Page Furniture. * no-print-body: Print Selection. * no-prompt: Print Selection. * no-top-holepunch: Page Formatting. * one-up: Page Formatting. * output: Output Options. * page-break-after-function: Text Formatting. * page-furniture-lines: Page Furniture. * page-length: Text Formatting. * pointsize: Text Formatting. * portrait: Page Formatting. * print-body: Print Selection. * print-pages: Print Selection. * printer: Output Options. * prompt: Print Selection. * redirect: Output Options. * right-footer: Page Furniture. * right-header: Page Furniture. * single-sided: Page Formatting. * tabsize: Text Formatting. * top-holepunch: Page Formatting. * two-tall-up: Page Formatting. * two-up: Page Formatting. * use-environment: Miscellaneous Features. * version: Miscellaneous Features.  File: trueprint.info, Node: Concept Index, Prev: Option Index, Up: Top Concept Index ************* * Menu: * $PRINTER: Output Options. * body: Print Selection. * braces depth: Page Furniture. * c language: Languages. * c++: Languages. * comparing with old version: Miscellaneous Features. * control-L: Text Formatting. * copies: Output Options. * cover sheet: Print Selection. * debugging: Miscellaneous Features. * default options: Miscellaneous Features. * diff: Miscellaneous Features. * double-sided: Page Formatting. * environment variables: Miscellaneous Features. * file index: Print Selection. * file output: Output Options. * filename extensions: Languages. * flower: Overview. * footer string format: Page Furniture. * footers: Page Furniture. * format: Text Formatting. * formfeed character: Text Formatting. * four-up: Page Formatting. * function index: Print Selection. * function page breaks: Text Formatting. * gray bands: Page Furniture. * header string format: Page Furniture. * headers: Page Furniture. * help messages: Miscellaneous Features. * holepunch: Page Formatting. * holepunch at top of page: Page Formatting. * indentation: Page Furniture. * installing: Installing Trueprint. * intelligent line wrap: Text Formatting. * invoking make: Installing Trueprint. * java: Languages. * landscape: Page Formatting. * language defaults: Languages. * languages: Languages. * leading: Text Formatting. * line breaks: Text Formatting. * line gap: Text Formatting. * line numbers: Page Furniture. * line wrap: Text Formatting. * listing files: Languages. * lp: Output Options. * lpr: Output Options. * make install: Installing Trueprint. * make test: Installing Trueprint. * marking differences: Miscellaneous Features. * message string: Page Furniture. * message string format: Page Furniture. * nostalgia: Page Furniture. * one-up: Page Formatting. * output: Output Options. * output file: Output Options. * overview: Overview. * page breaks: Text Formatting. * page breaks after functions: Text Formatting. * page formatting: Page Formatting. * page furniture: Page Furniture. * page length: Text Formatting. * pascal: Languages. * perl: Languages. * personal defaults: Miscellaneous Features. * plain text: Languages. * pointsize: Text Formatting. * portrait: Page Formatting. * postscript: Output Options. * postscript level: Miscellaneous Features. * printer destination: Output Options. * printer queues: Installing Trueprint. * printer specification: Installing Trueprint. * printers file: Installing Trueprint. * printing multiple copies: Output Options. * pseudo C: Languages. * report format: Languages. * saving postscript: Output Options. * selecting pages to print: Print Selection. * setting defaults: Miscellaneous Features. * shell: Languages. * single-sided: Page Formatting. * smell: Overview. * string format characters: Page Furniture. * tab size: Text Formatting. * testing the installation: Installing Trueprint. * text formatting: Text Formatting. * text size: Text Formatting. * top holepunch: Page Formatting. * two-up: Page Formatting. * two-up with small font: Page Formatting. * verilog: Languages. * version information: Miscellaneous Features.  Tag Table: Node: Top318 Node: Overview1263 Node: Installing Trueprint3182 Node: Languages6932 Node: Page Formatting9516 Node: Page Furniture11221 Node: Text Formatting15295 Node: Output Options18546 Node: Print Selection19822 Node: Miscellaneous Features21938 Node: Options and Environment Variables List25531 Node: Option Index31993 Node: Concept Index36053  End Tag Table trueprint-5.3/README0000664000076400007640000000053307255551333010001 This is GNU Trueprint version 5.3. I'm using automake and autoconf for the first time with this version, so if you encounter any installation problems let me know. Also note that the ChangeLog is empty - due to the change to automake in this release, there were too many changes to put into the ChangeLog. Next release should have a ChangeLog. trueprint-5.3/stamp-h1.in0000664000076400007640000000000007256014171011063 trueprint-5.3/stamp-h2.in0000664000076400007640000000000007256014171011064 trueprint-5.3/AUTHORS0000664000076400007640000000031007217540235010157 --------------------------------------- GNU Trueprint development by: Lezz Giles --------------------------------------- Other contributors: a cast of hundreds.... trueprint-5.3/COPYING0000644000076400007640000004311007216036741010146 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. trueprint-5.3/ChangeLog0000664000076400007640000000000007216037121010647 trueprint-5.3/INSTALL0000644000076400007640000001722707216036741010156 Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. trueprint-5.3/Makefile.am0000664000076400007640000000042607256014135011151 ## Makefile.am -- Process this file with automake to produce Makefile.in SUBDIRS = replace src doc tests EXTRA_DIST = config/install-sh \ config/mdate-sh \ config/missing \ config/mkinstalldirs \ config/sys_errlist.m4 \ doc/trueprint.1 \ doc/trueprint.spec \ bootstrap trueprint-5.3/NEWS0000664000076400007640000002603107322202453007610 Reverse history of Trueprint: Version 5.3: Trueprint now uses autoconf and automake (Paul Smith, and the book GNU Autoconf, Automake and Libtool by Gary V. Vaughan et al, published by New Riders). Mention of trueprint.uu removed from README (Othmar Pasteka). Suffix .pike added for pike programs (Othmar Pasteka). Added include of sys/types.h before sys/stat.h to support FreeBSD (Dmitry Sivachenko). README.mswin removed (John Morey). If there isn't an lp or lpr command on your system when you run configure, trueprint will now be built to send postscript output to stdout by default (Othmar Pasteka). Choice options like --landscape and --option were broken due to a serious bug in options.c (Paul Smith). Added Canon LBP 3260 (Bjorn Wingman). Added HP Laserjet 1100 (Peter Green). Fix for handling arithmetic << in Perl (Peter Green). Added --new-sheet-after-file and --no-new-sheet-after-file, from a suggestion by David Karr. Version 5.2.1: Fixed bug that ignored the double-sided/single-sided setting for printers in the printers file. Version 5.2: As of this release I'm going to include the contributors name in every change description. Sorry I didn't do that for version 5.1. + Added NEC SuperScript 870 printer details (Craig Pinfold). + Added A4 settings for HP Laserjet 4 Si MX (Ian Brown). + Use configure to find the proper install tool (George Lindholm). + Use mandir and man1dir vars in Makefile properly (Michael Somos). + Added missing colon to printers file (Michael Somos). + Handle unknown language with a message instead of a core dump (Craig Pinfold). + Added -R to specify postscript level (Ian Brown). + Initialize use_environment in main() (Ian Brown and others). + Added to lang_java.c to get abort() (Ian Brown). + C++ comments are now recognized in C code. OK, this isn't ANSI but GCC is a better standard than ANSI any day... :-) This solves a problem reported by Bruce Tenison. + Changes made to support compiling for Microsoft Windows platforms are added (Ian Brown). + Option -u added: --u will suppress even minimal headers, footers and left margin line (suggested by... ) + When using the perl5 "use subs" pragma, trueprint incorrectly identifies "s" as a subroutine. This is fixed in lang_perl.c with a fix submitted by Jim Eshleman. + Added printer HP Laserjet 8100N (Kris Berbeeck). + Added printer CalComp (sorry, I lost the name of the contributor - send me a mail and I'll add it in the next release) + Added support for language pike (see pike.idonex.se) (Martin Bahr). + Rewritten man page (see author in the man page itself). Version 5.1: Many thanks to everyxbody who gave me feedback and reported problems in version 5.0! I've found the best advantage of making Trueprint a GNU program is the users! The changes in 5.1 are all relatively minor - there are no major rewrites. + make check now uses gmtime instead of localtime, so you don't need to live in Boston to have the tests succeed. + make check now ignores any DEFAULT_OPTS that might be set in trueprint.h. + If the output is sent to a postscript file then it is no longer created with the execute bits set. + In version 5.0 the documentation stated that the default behaviour was to NOT have page breaks after functions; however the code disagreed with the documentation. The code has been changed to fit. If you want to change this back, set DEFAULT_OPTS in trueprint.h to "--page-break-after-function" + .pm is now recognized as a suffix for a perl file. + Minor tweaks were made to the Makefile to make it easier to generate a RPM package. + Postscript comments generated correctly with page information. + With no line numbers or braces depth, a thin line is still printed on the lhs of each page. + In headers, footers and other strings, %c and %C can be used to get the modification time of the file in short or long format. + When using stdin, the "filename" in headers and footers appears as "-" instead of "stdin" as it did in earlier versions. + -r/--redirect-output sends output to .ps file named after 1st arg + -L/--minimum-line-length sets the minimum line length for lines produced using intelligent line wrap. + A dummy gettext() is now included in case gettext() doesn't exist on the system. + The standard GNU files getopt.c, getopt1.c and getopt.h are included in case the system doesn't have getopt_long. + A bug in shell language handling which caused a coredump is fixed. + Perl should print POD documentation as comments. + I had many people suggest that the printers file should move; I'm not moving it yet though. My plan is to change the format of the printers file to include (among other things) options to be used for each queue, the possibility of multiple virtual printers for one queue, passing options through to lp or lpr (so you can e.g. select paper from different trays), and (most important) a version id so that all future versions of trueprint will be able to read older printer files. When I make this change I'll move the printers file so that older versions of trueprint will still be able to find a printers file they understand in /etc. + Various other minor changes were also made. Version 5.0: Trueprint GNU Changed code to adhere to GNU coding standards. Added long options. Short options that used to start with '+' now start with '--', e.g. +I is now --I. Default is "off" for page breaks after function calls. Added texinfo documentation. 020299 4.1.2 Fixed waiting for child pid so lpr message appears before trueprint returns. Fixed bad interaction between turning off linewrap and turning off linecount. Fixed get_function_name() so it can be called many times for the same page (by removing static qualifier to current_function). Included changes from James Card: added .H & .C as valid C++. Fixed tab expansion (tab character was included in output). 072298 4.1.1 Added C++ & Verilog support and updated the man page. Fixed crash when $USER not set. Map lf/cr (MS-DOS line end) to cr, and cr/ff to ff. Added -J for holepunch gap at top of page. Improved message for an unknown option. Empty input -> no print job. Added file COPYING, which contains the GPL. ------ 4.1 Fixed header problem in utils.h, removed trueprint.ps from makefile 082095 4.0 Added stdin handling, fixed one-char fn name bug, fixed filename on blank page bug, added backspace handling for underline & bold, added bold-italic for added comments, can suppress headers & footers, totally new option handling, totally new file printing. 021795 3.6.5 Fixed -G bug 021795 3.6.4 Added -G, fixed some small bugs in manpage. 021794 3.6.3 Fixed 'showpage' printing 122893 3.6.2 Fixed logging 120793 3.6.1 Added -3, significantly improved page size handling, added -I. 101393 3.6 General header, footer & message string processing; Better -D options 091493 3.5.4 Various minor bugs, and added strike-out for deleted text in diff-ed output. 090993 3.5.3 Removed limits on various string options; added closepipe and fclosepipe to avoid zombies! 081993 3.5.2 Removed MAX_FUNCTIONS and MAX_FILES from index.c - should be able to cope with unlimited number of functions/files 080593 3.5.1 added -A 080493 3.5 added -a and -treport 080393 3.4.2 made it POSIX - now compiles on Sun & Ultrix 063093 3.4.1 made it ANSI 020393 3.4 added printers file, config.h 180392 3.3 added perl 012292 3.2 added -W option, -E option 120391 3.1.1 fixed clash between -nn -xn -w0. 112091 3.1 added -B option 111091 3.0 added -n option, integrated with scm_help. 060591 2.9.8 fixed minor bug with -c; added -L and -M options. 280391 2.9.7.3 Added call to lezzlog 250391 2.9.7.2 Blanked out function name from headers when no function present, altered headers for -S2. 220391 2.9.7.1 Changed option handling to functions 210391 2.9.7 Add -T 140391 2.9.6 Initialize braces_depth at end of first pass (finally!) 110391 2.9.5 Added cflow pages 060391 2.9.4 Added language type pseudoc 010391 2.9.3 Added -C and -U 250291 2.9.2 Fixed C parsing to cope with function ptr argument. 220291 2.9.1 Changed definition of line indent in postscript.c to get line at right position. 070291 2.9 Changed meanings of -F, -f, -b and -x to align with users' manual 110191 2.8.1 Added -F -f to suppress File and function indices and added -b to suppress page breaks at function end 030191 2.8 Got -l and -w options working properly, added -c, altered language dynamically according to filename extension. 311290 2.7 Merged 2-on-1 and 4-on-1 with landscape and portrait modes, added $TP_OPTS, made defaults neater. 261290 2.6.1 Stripped out the last remnants of APT and Xerox printers 131290 2.6 Added 2-on-1 and 4-on-1 modes 151190 2.5.1 Fixed minor bug with comment immediately after function name. added variable old_state to lang_c.c. 310790 2.5 Tested diffs, fixed minor bug with fontsize of + in added blank lines, released. Next step version 3.... 300790 2.4.3 Removed -i (standard input) option. stdin doesn't work! 260790 2.4.2 Split print.list.c into main.c input.c output.c, tidied up printing lines for postscript. Line and brace depth numbers in smaller font. Blank lines have no line or brace depth numbers. Landscape working. -m, -p and -g working. Added plain text "language". 180790 2.4.1 Fixed up postscript headers and footers properly. 170790 2.4 Added -P x|p option for postscript printers. Very little tested, but it works. 110790 2.3 Added -S option, suppressed function index if no functions, suppressed file index if only one file. 100790 2.2.5a Ported to DECstations, without aptmac.h or lezzlog.c Fixed uninitialised pointer bug in index.c Changed opr to lpr and changed escape strings via #ifdef APT... 140390 2.2.5 changed coding standards - { put on same line as while, if, etc. to reduce number of lines. 280290 2.2.4 static char_usage retval in printnextline() was set to INPUT_END at beginning of second pass (value inherited from first pass). This had the effect that if deleted lines were printed before source then the INPUT_END was taken to be the true retval and only the deleted lines were printed. So a line initialising retval at beginning of second pass was added. 270290 2.2.3 a few pascal bugs in lang_pascal.c fixed after trying it out on a decent pascal program for the first time. Also no_of_functions in index.c initialised explicitly. 130290 2.2.2 init_diffs() was called too early in getnextchar, and getnextline() was getting confused right at the end of a file about which file the diffs were for. So init_diffs call was moved to getnextline(). 060290 2.2.1 Newpage was treated like newline - so line were wrong. This showed up with -O and -P options in files with newpage characters. Fixed by not treating newpage like newline in getnextline(). 240190 2.2 goes through lint (more or less), index functions expected short, got long as param - potential bug. 230190 2.1 with -P option (multiple files diffs) released. bug with param ending ...[]; fixed. function names in headers starting too early fixed. 220190 2.0 with -O option (single file differences) released 261089 First public version released! trueprint-5.3/acconfig.h0000644000076400007640000000216607216045216011040 /* acconfig.h This file is copied from the standard autoconf distribution for trueprint Descriptive text for the C preprocessor macros that the distributed Autoconf macros can define. No software package will use all of them; autoheader copies the ones your configure.in uses into your configuration header file templates. The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). Although this order can split up related entries, it makes it easier to check whether a given entry is in the file. Leave the following blank line there!! Autoheader needs it. */ /* diff command */ #undef DIFF_CMD /* print command - normally either lp or lpr */ #undef PRINT_CMD /* printer flag for specifying how many copies to print */ #undef PRINT_CMD_COUNT_FLAG /* printer flag for specifying destination */ #undef PRINT_CMD_DEST_FLAG /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). */ trueprint-5.3/aclocal.m40000664000076400007640000001127407256013143010756 dnl aclocal.m4 generated automatically by aclocal 1.4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, [AC_PREREQ([2.12]) AC_CONFIG_HEADER([$1]) dnl When config.status generates a header, we must update the stamp-h file. dnl This file resides in the same directory as the config header dnl that is generated. We must strip everything past the first ":", dnl and everything past the last "/". AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, <>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, <>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1` done<<>>dnl>>) changequote([,]))]) # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. # serial 1 dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN(AM_INIT_AUTOMAKE, [AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] AC_SUBST(VERSION) dnl test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi ifelse([$3],, AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) # # Check to make sure that the build environment is sane. # AC_DEFUN(AM_SANITY_CHECK, [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "[$]2" = conftestfile ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi rm -f conftest* AC_MSG_RESULT(yes)]) dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) dnl The program must properly implement --version. AC_DEFUN(AM_MISSING_PROG, [AC_MSG_CHECKING(for working $2) # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found) else $1="$3/missing $2" AC_MSG_RESULT(missing) fi AC_SUBST($1)]) AC_DEFUN(TRUEPRINT_VAR_SYS_ERRLIST, [AC_CACHE_CHECK([for sys_errlist], trueprint_cv_var_sys_errlist, [AC_TRY_LINK([int *p;], [extern in sys_errlist; p = &sys_errlist;], trueprint_cv_var_sys_errlist=yes, trueprint_cv_var_sys_errlist=no)]) if test x"$trueprint_cv_var_sys_errlist" = xyes; then AC_DEFINE(HAVE_SYS_ERRLIST, 1, [Define if your system libraries have a sys_errlist variable.]) fi]) trueprint-5.3/config.h.in0000664000076400007640000000336207216045231011137 /* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define to empty if the keyword does not work. */ #undef const /* Define if you don't have vprintf but do have _doprnt. */ #undef HAVE_DOPRNT /* Define if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF /* Define to `long' if doesn't define. */ #undef off_t /* Define to `int' if doesn't define. */ #undef pid_t /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define if your declares struct tm. */ #undef TM_IN_SYS_TIME /* diff command */ #undef DIFF_CMD /* print command - normally either lp or lpr */ #undef PRINT_CMD /* printer flag for specifying how many copies to print */ #undef PRINT_CMD_COUNT_FLAG /* printer flag for specifying destination */ #undef PRINT_CMD_DEST_FLAG /* Define if you have the gettext function. */ #undef HAVE_GETTEXT /* Define if you have the strdup function. */ #undef HAVE_STRDUP /* Define if you have the strerror function. */ #undef HAVE_STRERROR /* Define if you have the strtol function. */ #undef HAVE_STRTOL /* Define if you have the header file. */ #undef HAVE_FCNTL_H /* Define if you have the header file. */ #undef HAVE_LIBINTL_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Version number of package */ #undef VERSION /* Define if your system libraries have a sys_errlist variable. */ #undef HAVE_SYS_ERRLIST trueprint-5.3/configure0000775000076400007640000020251607256013146011031 #! /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: # 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=src/debug.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 ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir 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. # 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:563: 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=":" 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 -f $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 build environment is sane""... $ac_c" 1>&6 echo "configure:616: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "$*" != "X $srcdir/configure conftestfile" \ && test "$*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { echo "configure: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" 1>&2; exit 1; } fi test "$2" = conftestfile ) then # Ok. : else { echo "configure: error: newly created file is older than distributed files! Check your system clock" 1>&2; exit 1; } fi rm -f conftest* echo "$ac_t""yes" 1>&6 if test "$program_transform_name" = s,x,x,; then program_transform_name= else # Double any \ or $. echo might interpret backslashes. cat <<\EOF_SED > conftestsed s,\\,\\\\,g; s,\$,$$,g EOF_SED program_transform_name="`echo $program_transform_name|sed -f conftestsed`" rm -f conftestsed fi test "$program_prefix" != NONE && program_transform_name="s,^,${program_prefix},; $program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" # sed with no file args requires a program. test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 echo "configure:673: 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 PACKAGE=trueprint VERSION=5.3 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } fi cat >> confdefs.h <> confdefs.h <&6 echo "configure:719: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (aclocal --version) < /dev/null > /dev/null 2>&1; then ACLOCAL=aclocal echo "$ac_t""found" 1>&6 else ACLOCAL="$missing_dir/missing aclocal" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 echo "configure:732: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoconf --version) < /dev/null > /dev/null 2>&1; then AUTOCONF=autoconf echo "$ac_t""found" 1>&6 else AUTOCONF="$missing_dir/missing autoconf" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 echo "configure:745: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (automake --version) < /dev/null > /dev/null 2>&1; then AUTOMAKE=automake echo "$ac_t""found" 1>&6 else AUTOMAKE="$missing_dir/missing automake" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 echo "configure:758: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (autoheader --version) < /dev/null > /dev/null 2>&1; then AUTOHEADER=autoheader echo "$ac_t""found" 1>&6 else AUTOHEADER="$missing_dir/missing autoheader" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 echo "configure:771: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. if (makeinfo --version) < /dev/null > /dev/null 2>&1; then MAKEINFO=makeinfo echo "$ac_t""found" 1>&6 else MAKEINFO="$missing_dir/missing makeinfo" echo "$ac_t""missing" 1>&6 fi # 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:788: 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_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $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:818: 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 ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $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:869: 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_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $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:901: 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 912 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:917: \"$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:943: 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:948: 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 <&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:976: 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 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1010: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi RANLIB="$ac_cv_prog_RANLIB" if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6 else echo "$ac_t""no" 1>&6 fi # Extract the first word of "diff", so it can be a program name with args. set dummy diff; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1042: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GOT_DIFF_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GOT_DIFF_CMD" in /*) ac_cv_path_GOT_DIFF_CMD="$GOT_DIFF_CMD" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GOT_DIFF_CMD="$GOT_DIFF_CMD" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_GOT_DIFF_CMD="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi GOT_DIFF_CMD="$ac_cv_path_GOT_DIFF_CMD" if test -n "$GOT_DIFF_CMD"; then echo "$ac_t""$GOT_DIFF_CMD" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -n "$GOT_DIFF_CMD" ; then cat >> confdefs.h <&2 fi for ac_prog in lpr lp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1088: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PRINT_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PRINT_CMD" in /*) ac_cv_path_PRINT_CMD="$PRINT_CMD" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PRINT_CMD="$PRINT_CMD" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_PRINT_CMD="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi PRINT_CMD="$ac_cv_path_PRINT_CMD" if test -n "$PRINT_CMD"; then echo "$ac_t""$PRINT_CMD" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$PRINT_CMD" && break done cat >> confdefs.h <> confdefs.h <<\EOF #define PRINT_CMD_DEST_FLAG "-d" EOF cat >> confdefs.h <<\EOF #define PRINT_CMD_COUNT_FLAG "-n" EOF ;; */lpr) cat >> confdefs.h <<\EOF #define PRINT_CMD_DEST_FLAG "-P" EOF # Need to disable the m4 commenting stuff, otherwise it thinks the '#' # is the start of a comment... cat >> confdefs.h <<\EOF #define PRINT_CMD_COUNT_FLAG "-#" EOF ;; *) { echo "configure: error: Cannot find either an lpr command or an lp command" 1>&2; exit 1; } ;; esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1161: 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 < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1182: \"$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 < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1199: \"$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 < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1216: \"$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 ANSI C header files""... $ac_c" 1>&6 echo "configure:1241: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1254: \"$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 rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -fr conftest* ac_cv_header_stdc=no fi rm -fr conftest* fi fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 echo "configure:1345: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #ifndef WEXITSTATUS #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF if { (eval echo configure:1366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_WAIT_H 1 EOF fi for ac_hdr in fcntl.h sys/time.h unistd.h libintl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:1390: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1400: \"$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 rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 fi done echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:1428: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:1482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 echo "configure:1503: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_off_t=yes else rm -rf conftest* ac_cv_type_off_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_off_t" 1>&6 if test $ac_cv_type_off_t = no; then cat >> confdefs.h <<\EOF #define off_t long EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 echo "configure:1536: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_pid_t=yes else rm -rf conftest* ac_cv_type_pid_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 if test $ac_cv_type_pid_t = no; then cat >> confdefs.h <<\EOF #define pid_t int EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 echo "configure:1569: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS #include #include #endif EOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then rm -rf conftest* ac_cv_type_size_t=yes else rm -rf conftest* ac_cv_type_size_t=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 if test $ac_cv_type_size_t = no; then cat >> confdefs.h <<\EOF #define size_t unsigned EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 echo "configure:1602: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF if { (eval echo configure:1615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_tm=sys/time.h fi rm -f conftest* fi echo "$ac_t""$ac_cv_struct_tm" 1>&6 if test $ac_cv_struct_tm = sys/time.h; then cat >> confdefs.h <<\EOF #define TM_IN_SYS_TIME 1 EOF fi echo $ac_n "checking for sys_errlist""... $ac_c" 1>&6 echo "configure:1637: checking for sys_errlist" >&5 if eval "test \"`echo '$''{'trueprint_cv_var_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* trueprint_cv_var_sys_errlist=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* trueprint_cv_var_sys_errlist=no fi rm -f conftest* fi echo "$ac_t""$trueprint_cv_var_sys_errlist" 1>&6 if test x"$trueprint_cv_var_sys_errlist" = xyes; then cat >> confdefs.h <<\EOF #define HAVE_SYS_ERRLIST 1 EOF fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 echo "configure:1670: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char vprintf(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_vprintf) || defined (__stub___vprintf) choke me #else vprintf(); #endif ; return 0; } EOF if { (eval echo configure:1698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_vprintf=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_VPRINTF 1 EOF else echo "$ac_t""no" 1>&6 fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 echo "configure:1722: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub__doprnt) || defined (__stub____doprnt) choke me #else _doprnt(); #endif ; return 0; } EOF if { (eval echo configure:1750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func__doprnt=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF #define HAVE_DOPRNT 1 EOF else echo "$ac_t""no" 1>&6 fi fi for ac_func in strerror strdup strtol gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:1777: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func(); int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else $ac_func(); #endif ; return 0; } EOF if { (eval echo configure:1805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" fi done 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 DEFS=-DHAVE_CONFIG_H # 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 </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 replace/Makefile src/Makefile doc/Makefile tests/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < 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%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@CC@%$CC%g s%@RANLIB@%$RANLIB%g s%@GOT_DIFF_CMD@%$GOT_DIFF_CMD%g s%@PRINT_CMD@%$PRINT_CMD%g s%@CPP@%$CPP%g s%@LIBOBJS@%$LIBOBJS%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 <> $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 ;; /*) 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 [/$]*) 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/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ac_dC='\3' ac_dD='%g' # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='\([ ]\)%\1#\2define\3' ac_uC=' ' ac_uD='\4%g' # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi for ac_file in .. $CONFIG_HEADERS; 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 echo creating $ac_file rm -f conftest.frag conftest.in conftest.out ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` cat $ac_file_inputs > conftest.in EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: # Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF s/[\\&%]/\\&/g s%[\\$`]%\\&%g s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp s%ac_d%ac_u%gp s%ac_u%ac_e%gp EOF sed -n -f conftest.hdr confdefs.h > conftest.vals rm -f conftest.hdr # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >> conftest.vals <<\EOF s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. rm -f conftest.tail while : do ac_lines=`grep -c . conftest.vals` # grep -c gives empty output for an empty file on some AIX systems. if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi # Write a limited-size here document to conftest.frag. echo ' cat > conftest.frag <> $CONFIG_STATUS sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS echo 'CEOF sed -f conftest.frag conftest.in > conftest.out rm -f conftest.in mv conftest.out conftest.in ' >> $CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail rm -f conftest.vals mv conftest.tail conftest.vals done rm -f conftest.vals cat >> $CONFIG_STATUS <<\EOF rm -f conftest.frag conftest.h echo "/* $ac_file. Generated automatically by configure. */" > conftest.h cat conftest.in >> conftest.h rm -f conftest.in if cmp -s $ac_file conftest.h 2>/dev/null; then echo "$ac_file is unchanged" rm -f conftest.h else # 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" fi rm -f $ac_file mv conftest.h $ac_file fi fi; done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h 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 trueprint-5.3/configure.in0000664000076400007640000000316707255542355011444 dnl Process this file with autoconf to produce a configure script. AC_INIT(src/debug.c) AC_CONFIG_AUX_DIR(config) AM_CONFIG_HEADER(config.h) dnl Generate config.h AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(trueprint,5.3) dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB dnl Need this two-stage search for diff so we end dnl up with either a defined variable with the value of the dnl command or an undefined variable AC_PATH_PROG(GOT_DIFF_CMD,diff) if test -n "$GOT_DIFF_CMD" ; then AC_DEFINE_UNQUOTED(DIFF_CMD,"$GOT_DIFF_CMD") else AC_MSG_WARN(Cannot find diff command - diff features will not be built) fi AC_PATH_PROGS(PRINT_CMD,lpr lp) AC_DEFINE_UNQUOTED(PRINT_CMD,"$PRINT_CMD") dnl Set the count flag depending on the variety of lp/lpr that we find case "$PRINT_CMD" in */lp) AC_DEFINE(PRINT_CMD_DEST_FLAG,"-d") AC_DEFINE(PRINT_CMD_COUNT_FLAG,"-n") ;; */lpr) AC_DEFINE(PRINT_CMD_DEST_FLAG,"-P") # Need to disable the m4 commenting stuff, otherwise it thinks the '#' # is the start of a comment... changecom AC_DEFINE(PRINT_CMD_COUNT_FLAG,"-#") changecom() ;; *) AC_MSG_ERROR(Cannot find either an lpr command or an lp command) ;; esac dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h libintl.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_TM TRUEPRINT_VAR_SYS_ERRLIST dnl Checks for library functions. AC_FUNC_VPRINTF AC_REPLACE_FUNCS(strerror strdup strtol gettext) AC_OUTPUT(Makefile replace/Makefile src/Makefile doc/Makefile tests/Makefile) trueprint-5.3/bootstrap0000775000076400007640000000012607216036702011055 #!/bin/sh set -x aclocal -I config autoheader automake --add-missing --copy autoconf trueprint-5.3/replace/0000777000076400007640000000000007322207146010610 5trueprint-5.3/replace/Makefile.in0000664000076400007640000001510107322207146012571 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ GOT_DIFF_CMD = @GOT_DIFF_CMD@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PRINT_CMD = @PRINT_CMD@ RANLIB = @RANLIB@ VERSION = @VERSION@ INCLUDES = -I$(top_builddir) -I$(top_srcdir) noinst_LIBRARIES = libreplace.a libreplace_a_SOURCES = replace.h libreplace_a_LIBADD = @LIBOBJS@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = ../config.h ../config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I.. -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ libreplace_a_DEPENDENCIES = @LIBOBJS@ libreplace_a_OBJECTS = AR = ar CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in gettext.c strdup.c strerror.c \ strtol.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(libreplace_a_SOURCES) OBJECTS = $(libreplace_a_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps replace/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstLIBRARIES: clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) distclean-noinstLIBRARIES: maintainer-clean-noinstLIBRARIES: .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: libreplace.a: $(libreplace_a_OBJECTS) $(libreplace_a_DEPENDENCIES) -rm -f libreplace.a $(AR) cru libreplace.a $(libreplace_a_OBJECTS) $(libreplace_a_LIBADD) $(RANLIB) libreplace.a tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = replace distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(LIBRARIES) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-noinstLIBRARIES distclean-compile \ distclean-tags distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: trueprint-5.3/replace/Makefile.am0000664000076400007640000000033307255527674012601 ## Makefile.am -- Process this file with automake to produce Makefile.in INCLUDES = -I$(top_builddir) -I$(top_srcdir) noinst_LIBRARIES = libreplace.a libreplace_a_SOURCES = replace.h libreplace_a_LIBADD = @LIBOBJS@ trueprint-5.3/replace/gettext.c0000664000076400007640000000005607216036033012354 char * gettext(const char *s) { return s; } trueprint-5.3/replace/strdup.c0000664000076400007640000000052207255530341012213 /*************************************************************************** * STRDUP * - uses malloc() to grab memory and fills it with a copy of a string. */ #include "src/utils.h" char *strdup(const char *from_string) { char *retval; retval = xmalloc(strlen(from_string)+1); strcpy(retval,from_string); return retval; } trueprint-5.3/replace/strerror.c0000664000076400007640000000052707255527166012574 /*********************************************************************** * strerror * Returns an informative message on system call failure. Normally * supplied by the system. */ #include "src/utils.h" char *strerror(int errnum) { static char *b = 0; if (!b) b = xmalloc(15); sprintf(b,"errno = %d",errnum); return b; } trueprint-5.3/replace/strtol.c0000664000076400007640000000053607255531530012227 /* * Stub for strtol - only works with base 10 */ long int strtol(const char *nptr, char **endptr, int base) { long int retval = 0; char *cptr; if (base != 10) abort(); *endptr = nptr; while (('0' <= **endptr) && (**endptr <= '9')) { retval = retval * 10 + (**endptr - '0'); (*endptr)++; } return retval; } trueprint-5.3/replace/replace.h0000664000076400007640000000046507255532332012322 #ifdef HAVE_LIBINTL_H #include #else char *gettext(const char *); #endif #ifndef HAVE_STRDUP extern char *strdup(const char *); #endif #ifndef HAVE_STRERROR extern char *strerror(int errnum); #endif #ifndef HAVE_STRTOL extern long int strtol(const char *nptr, char **endptr, int base); #endif trueprint-5.3/src/0000777000076400007640000000000007322207147007765 5trueprint-5.3/src/Makefile.in0000664000076400007640000002642307322207146011756 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ GOT_DIFF_CMD = @GOT_DIFF_CMD@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PRINT_CMD = @PRINT_CMD@ RANLIB = @RANLIB@ VERSION = @VERSION@ INCLUDES = -I$(top_builddir) -I$(top_srcdir) bin_PROGRAMS = trueprint trueprint_SOURCES = debug.c index.c lang_pascal.h lang_verilog.c output.h debug.h index.h lang_perl.c lang_verilog.h postscript.c diffs.c input.c lang_perl.h language.c postscript.h diffs.h input.h lang_pike.c language.h print_prompt.c expand_str.c lang_c.c lang_pike.h main.c print_prompt.h expand_str.h lang_c.h lang_report.c main.h printers_fl.c getopt.c lang_cxx.c lang_report.h openpipe.c printers_fl.h getopt.h lang_cxx.h lang_sh.c openpipe.h trueprint.h getopt1.c lang_java.c lang_sh.h options.c utils.c headers.c lang_java.h lang_text.c options.h utils.h headers.h lang_pascal.c lang_text.h output.c AM_CFLAGS = -DPRINTERS_FILE=\"$(libdir)/printers\" mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = ../config.h ../config.h CONFIG_CLEAN_FILES = PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I.. -I.. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ trueprint_OBJECTS = debug.o index.o lang_verilog.o lang_perl.o \ postscript.o diffs.o input.o language.o lang_pike.o print_prompt.o \ expand_str.o lang_c.o main.o lang_report.o printers_fl.o getopt.o \ lang_cxx.o openpipe.o lang_sh.o getopt1.o lang_java.o options.o utils.o \ headers.o lang_text.o lang_pascal.o output.o trueprint_LDADD = $(LDADD) trueprint_DEPENDENCIES = trueprint_LDFLAGS = CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(trueprint_SOURCES) OBJECTS = $(trueprint_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: trueprint: $(trueprint_OBJECTS) $(trueprint_DEPENDENCIES) @rm -f trueprint $(LINK) $(trueprint_LDFLAGS) $(trueprint_OBJECTS) $(trueprint_LDADD) $(LIBS) tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ here=`pwd` && cd $(srcdir) \ && mkid -f$$here/ID $$unique $(LISP) TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS)'; \ unique=`for i in $$list; do echo $$i; done | \ awk ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) mostlyclean-tags: clean-tags: distclean-tags: -rm -f TAGS ID maintainer-clean-tags: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = src distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done debug.o: debug.c ../config.h trueprint.h utils.h ../replace/replace.h \ options.h debug.h diffs.o: diffs.c ../config.h trueprint.h utils.h ../replace/replace.h \ main.h output.h openpipe.h options.h debug.h diffs.h expand_str.o: expand_str.c ../config.h trueprint.h main.h index.h \ debug.h output.h utils.h ../replace/replace.h expand_str.h getopt.o: getopt.c ../config.h getopt1.o: getopt1.c ../config.h getopt.h headers.o: headers.c ../config.h trueprint.h postscript.h options.h \ headers.h index.o: index.c ../config.h getopt.h trueprint.h main.h headers.h \ postscript.h debug.h utils.h ../replace/replace.h index.h input.o: input.c ../config.h getopt.h trueprint.h utils.h \ ../replace/replace.h main.h debug.h input.h lang_c.o: lang_c.c ../config.h trueprint.h main.h input.h index.h \ language.h output.h lang_c.h lang_cxx.o: lang_cxx.c ../config.h trueprint.h main.h input.h index.h \ language.h output.h lang_cxx.h lang_java.o: lang_java.c ../config.h trueprint.h main.h input.h index.h \ language.h output.h lang_java.h lang_pascal.o: lang_pascal.c ../config.h trueprint.h main.h input.h \ index.h language.h output.h lang_pascal.h lang_perl.o: lang_perl.c ../config.h trueprint.h main.h input.h index.h \ language.h output.h lang_perl.h lang_pike.o: lang_pike.c ../config.h trueprint.h main.h input.h index.h \ language.h output.h lang_pike.h lang_report.o: lang_report.c ../config.h trueprint.h main.h input.h \ index.h output.h lang_report.h lang_sh.o: lang_sh.c ../config.h trueprint.h main.h input.h index.h \ language.h output.h lang_sh.h lang_text.o: lang_text.c ../config.h trueprint.h input.h lang_text.h lang_verilog.o: lang_verilog.c ../config.h trueprint.h main.h input.h \ index.h language.h output.h lang_verilog.h language.o: language.c ../config.h trueprint.h main.h lang_c.h \ lang_cxx.h lang_report.h lang_sh.h lang_pascal.h lang_java.h \ lang_perl.h lang_pike.h lang_text.h lang_verilog.h options.h \ utils.h ../replace/replace.h language.h main.o: main.c ../config.h getopt.h trueprint.h options.h debug.h \ diffs.h index.h language.h postscript.h output.h openpipe.h \ printers_fl.h print_prompt.h input.h headers.h utils.h \ ../replace/replace.h main.h openpipe.o: openpipe.c ../config.h getopt.h trueprint.h utils.h \ ../replace/replace.h main.h debug.h openpipe.h options.o: options.c ../config.h getopt.h trueprint.h utils.h \ ../replace/replace.h debug.h options.h output.o: output.c ../config.h trueprint.h main.h diffs.h headers.h \ index.h postscript.h language.h print_prompt.h debug.h \ options.h utils.h ../replace/replace.h output.h postscript.o: postscript.c ../config.h trueprint.h main.h expand_str.h \ utils.h ../replace/replace.h debug.h options.h index.h \ printers_fl.h postscript.h print_prompt.o: print_prompt.c ../config.h trueprint.h main.h index.h \ utils.h ../replace/replace.h options.h output.h print_prompt.h printers_fl.o: printers_fl.c ../config.h trueprint.h main.h utils.h \ ../replace/replace.h debug.h printers_fl.h utils.o: utils.c ../config.h trueprint.h utils.h ../replace/replace.h info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-binPROGRAMS install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-binPROGRAMS uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-am distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile tags mostlyclean-tags distclean-tags \ clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ check-am installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: trueprint-5.3/src/Makefile.am0000664000076400007640000000177007216045600011740 ## Makefile.am -- Process this file with automake to produce Makefile.in INCLUDES = -I$(top_builddir) -I$(top_srcdir) bin_PROGRAMS = trueprint trueprint_SOURCES = \ debug.c index.c lang_pascal.h lang_verilog.c output.h \ debug.h index.h lang_perl.c lang_verilog.h postscript.c \ diffs.c input.c lang_perl.h language.c postscript.h \ diffs.h input.h lang_pike.c language.h print_prompt.c \ expand_str.c lang_c.c lang_pike.h main.c print_prompt.h \ expand_str.h lang_c.h lang_report.c main.h printers_fl.c \ getopt.c lang_cxx.c lang_report.h openpipe.c printers_fl.h \ getopt.h lang_cxx.h lang_sh.c openpipe.h trueprint.h \ getopt1.c lang_java.c lang_sh.h options.c utils.c \ headers.c lang_java.h lang_text.c options.h utils.h \ headers.h lang_pascal.c lang_text.h output.c AM_CFLAGS = -DPRINTERS_FILE=\"$(libdir)/printers\" trueprint-5.3/src/debug.c0000644000076400007640000000260107052654426011140 /* * Source file: * debug.c */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "utils.h" #include "options.h" #include "debug.h" /* * Private part */ static char *debug_string; static int match(char, int); /****************************************************************************** * Function: * setup_debug */ void setup_debug(void) { debug_string = ""; string_option("D", "debug", "", &debug_string, NULL, NULL, OPT_MISC, "set debug options to "); } /****************************************************************************** * Function: * dm (debug_message) */ void dm(char class, int level, char *message, ...) { va_list ap; if (debug_string == NULL) return; if (!match(class,level)) return; va_start(ap, message); vfprintf(stderr, message, ap); } /****************************************************************************** * Function: * match */ int match(char class, int level) { char *s_index = debug_string; char this_class; int this_level; while (*s_index) { skipspaces(&s_index); this_class = *(s_index++); skipspaces(&s_index); this_level = strtol(s_index, &s_index, 10); if ((this_class == '@') || (this_class == class)) { if (this_level >= level) return 1; return 0; } } return 0; } trueprint-5.3/src/index.c0000644000076400007640000004110507217540136011156 /* * Source file: * index.c */ #include "config.h" #if TM_IN_SYS_TIME # include #else # include #endif #include #include #include #include #include #include #include "trueprint.h" #include "main.h" #include "headers.h" #include "postscript.h" #include "debug.h" #include "utils.h" #include "index.h" /* * Public part */ /* * Private part */ #define LINE 0 #define INPUT_END 1 #define BLOCK_SIZE 1000 typedef struct { char name[SYMBOL_LEN]; long name_start_char; long name_end_char; long page_number; long end_page; boolean changed; char *filename; } function_entry; typedef struct { long starting_page; long ending_page; char *name; time_t modified; } file_entry; typedef struct { boolean changed; } page_entry; static void dot_fill(char string[]); static int compare(const void *, const void *); static short print_index_line(int print_bold); static size_t max_function_name_length = 0; static size_t max_file_name_length = 0; static unsigned short no_of_functions=0; static unsigned int function_list_size = 0; static unsigned int file_list_size = 0; static unsigned int page_list_size = 0; static function_entry *functions = NULL; static function_entry *sorted_functions = NULL; static file_entry *files = NULL; static page_entry *pages = NULL; static boolean current_function_changed = FALSE; static void grow_array(void *list_ptr_ptr, unsigned int *, size_t); /***************************************************************************** * Function: * setup_index */ void setup_index(void) { max_function_name_length = 0; max_file_name_length = 0; no_of_functions=0; function_list_size = 0; file_list_size = 0; page_list_size = 0; functions = NULL; sorted_functions = NULL; files = NULL; pages = NULL; current_function_changed = FALSE; } /***************************************************************************** * Function: * grow_array */ static void grow_array(void *list_ptr_ptr, unsigned int *list_size_ptr, size_t list_entry_size) { size_t size_needed; *list_size_ptr += BLOCK_SIZE; size_needed = *list_size_ptr * list_entry_size; dm('i',3,"index.c:grow_array() Growing array by %d bytes\n", size_needed); if (*(void **)list_ptr_ptr == NULL) *(void **)list_ptr_ptr = xmalloc(size_needed); else *(void **)list_ptr_ptr = xrealloc(*(void **)list_ptr_ptr, size_needed); } /***************************************************************************** * Function: * page_has_changed * * Flag this page and function as containing a change */ void page_has_changed(long this_page_number) { if (pass == 1) return; while (this_page_number >= page_list_size) grow_array(&pages, &page_list_size, sizeof(page_entry)); current_function_changed = TRUE; pages[this_page_number].changed = TRUE; } /***************************************************************************** * Function: * add_file * * Remembers the starting page and other info for the named file. */ void add_file(char *filename, unsigned int this_file_number, long this_file_page_number) { size_t length = strlen(filename); struct stat stat_buffer; if (this_file_number >= file_list_size) grow_array(&files, &file_list_size, sizeof(file_entry)); files[this_file_number].starting_page = this_file_page_number; files[this_file_number].name = strdup(filename); if (strcmp(filename,"-") != 0) { if (stat(filename,&stat_buffer) == -1) { perror(CMD_NAME ": cannot stat file"); exit(1); } files[this_file_number].modified = stat_buffer.st_mtime; } else { files[this_file_number].modified = 0; } if (length > max_file_name_length) max_file_name_length = length; } /***************************************************************************** * Function: * end_file * * Remembers the ending page for the named file. */ void end_file(unsigned int this_file_number, long this_file_page_number) { if (this_file_number >= file_list_size) grow_array(&files, &file_list_size, sizeof(file_entry)); files[this_file_number].ending_page = this_file_page_number; } /***************************************************************************** * Function: * get_file_last_page * * Return the last page number for a file */ long get_file_last_page(unsigned int this_file_number) { return files[this_file_number].ending_page; } /***************************************************************************** * Function: * get_file_first_page * * Return the first page number for a file */ long get_file_first_page(unsigned int this_file_number) { return files[this_file_number].starting_page; } /***************************************************************************** * Function: * get_file_modified_time * * Return the struct time_t containing the last modified time of the file */ struct tm * get_file_modified_time(unsigned int this_file_number) { if (files[this_file_number].modified == 0) return NULL; return localtime(&files[this_file_number].modified); } /***************************************************************************** * Function: * add_function. * * Remembers the start and end characters, the page number and the filename * for the named function. */ void add_function(char *name, long start, long end, long page, char *filename) { size_t length = strlen(name); if (pass == 1) return; dm('i',2,"index.c:add_function() Adding %s, page %ld filename %s\n", name,page,filename); if (no_of_functions == function_list_size) grow_array(&functions, &function_list_size, sizeof(function_entry)); strcpy(functions[no_of_functions].name, name); functions[no_of_functions].name_start_char = start; functions[no_of_functions].name_end_char = end; functions[no_of_functions].page_number = page; functions[no_of_functions].filename = filename; if (length > max_function_name_length) max_function_name_length = length; current_function_changed = FALSE; } /***************************************************************************** * Function: * end_function * * Remembers the end page for the current function, and gets ready for * information on the next function. */ void end_function(long page) { if (pass == 1) return; dm('i',2,"index.c:end_function() Ending function on page %ld\n",page); functions[no_of_functions].changed = current_function_changed; functions[no_of_functions++].end_page = page; } /***************************************************************************** * Function: * get_function_name_posn * * Looks at current_char and returns whether this character starts a * function name, ends a function name, or does neither. */ char_status get_function_name_posn(long current_char, char_status current_status) { static unsigned short current_function=0; if (pass==0) return(current_status); /* If there were no functions simply return CHAR */ if (no_of_functions == 0) return (current_status); if ((current_char >= functions[current_function].name_start_char) && (current_char <= functions[current_function].name_end_char)) { if (current_char == functions[current_function].name_end_char) current_function += 1; dm('i',5,"index.c:get_function_name_posn() Returning TRUE for char posn %ld\n", current_char); return(CHAR_BOLD); } return(current_status); } /***************************************************************************** * Function: * get_function_name * * Get the current function name for the specified page. */ char * get_function_name(long page) { unsigned short current_function=0; static char dummy_return[] = ""; dm('i',4,"Index: Searching for function name for page %ld\n",page); if ((pass==0) || (no_of_functions == 0)) return(dummy_return); for (;;) { if (page < functions[current_function].page_number) return(dummy_return); if (page <= functions[current_function].end_page) { dm('i',4,"Index: Function name for page %ld = %s\n",page,functions[current_function].name); return(functions[current_function].name); } if (current_function >= no_of_functions-1) return(dummy_return); current_function += 1; } } /***************************************************************************** * Function: * get_file_name * * Get the appropriate file name */ char * file_name(int file_number) { return files[file_number].name; } /***************************************************************************** * Function: * function_changed * * Has the current function changed? */ boolean function_changed(long page) { static unsigned short current_function=0; if (pass==0) return(FALSE); if (no_of_functions == 0) return(FALSE); for (;;) { if (page < functions[current_function].page_number) return(FALSE); if (page <= functions[current_function].end_page) return(functions[current_function].changed); if (current_function >= no_of_functions-1) return(FALSE); current_function += 1; } } /***************************************************************************** * Function: * page_changed * * Has the current page changed? */ boolean page_changed(long page) { if (pass == 0) return FALSE; if (page > page_list_size) return FALSE; return pages[page].changed; } /***************************************************************************** * Function: * dot_fill * * Take a string and fill in the middle set of spaces with dots. */ void dot_fill(char string[]) { short string_index= 0; /* Find the end of the first set of spaces */ while (string[string_index] == ' ') string_index += 1; /* Find the start of the second set of spaces */ while (string[string_index] != ' ') string_index += 1; /* Change spaces to dots */ while (string[string_index] == ' ') string[string_index++] = '.'; } /***************************************************************************** * Function: * compare * * Compares two function entries, used by qsort(). * Looks at name first, then start char. */ int compare(const void *p1, const void *p2) { int r; r = strcmp(((function_entry *)p1)->name,((function_entry *)p2)->name); if (r == 0) { if (((function_entry *)p1)->name_start_char > ((function_entry *)p2)->name_start_char) r = 1; else if (((function_entry *)p1)->name_start_char < ((function_entry *)p2)->name_start_char) r = -1; else r = 0; } return r; } /***************************************************************************** * Function: * sort_function_names * * Sort the array of function records into alphabetical order into the * array sorted_functions[]. */ void sort_function_names(void) { unsigned short every_function; size_t size_needed = function_list_size * sizeof(function_entry); if (function_list_size == 0) return; sorted_functions = xmalloc(size_needed); for (every_function=0;every_function= no_of_files) return(INPUT_END); /* * else reached end of this file - print the filename of the next file in * bold and set up for starting printing function names for this title */ printf("Lpt( %-24s %5ld) BF setfont show CF setfont Nl\n", files[current_file].name, files[current_file].starting_page); function_idx = 0; return(LINE); } /* * If "print_bold" then fill in with dots while printing out * function details. */ if (print_bold) { char string[INPUT_LINE_LEN]; sprintf(string," %-24s %4ld", sorted_functions[function_idx].name, sorted_functions[function_idx].page_number); dot_fill(string); printf("Lpt(%s) show Nl\n",string); } else { printf("Lpt( %-24s %4ld) show Nl\n", sorted_functions[function_idx].name, sorted_functions[function_idx].page_number); } function_idx += 1; return(LINE); } /***************************************************************************** * Function: * print_out_file_index * * Print out the contents of sorted_functions in order per file. */ void print_out_file_index(void) { long index_page_number=0; short output_line_number; short retval = LINE; boolean reached_end_of_sheet; /* * For every page... */ do { index_page_number += 1; /* * ...print the header... */ print_file_header(index_page_number); output_line_number = 0; /* * ...print all the lines, every second one with dots... */ while (output_line_number < page_length) { PUTS(" "); if ((retval = print_index_line(output_line_number &1)) == INPUT_END) break; output_line_number += 1; } /* * ...and print the footer... */ reached_end_of_sheet = PS_endpage(TRUE); } while (retval == LINE); /* * Print blank pages until the last page printed was the last page * on a physical sheet. */ while (!reached_end_of_sheet) { index_page_number += 1; print_file_header(index_page_number); reached_end_of_sheet = PS_endpage(TRUE); } } trueprint-5.3/src/lang_pascal.h0000644000076400007640000000021307052654426012320 /* * Include file: * lang_pascal.h */ extern stream_status get_pascal_char(char *, char_status *); extern char lang_pascal_defaults[]; trueprint-5.3/src/lang_verilog.c0000644000076400007640000000537207052654426012532 /* * Source file: * lang_verilog.c * * Contains get_verilog_char(), which parses Verilog code. */ #include "config.h" #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_verilog.h" /* * Public part */ char lang_verilog_defaults[] = "-f --F --i"; /* * Private part */ typedef enum { IP_CODE, IP_COMMENT_START, IP_COMMENT, IP_COMMENT_LINE, IP_COMMENT_END } verilog_ip_states; /* * get_verilog_char() * detects comment starts and ends; * finds function names; * detects function ends; */ stream_status get_verilog_char(char *input_char, char_status *status) { static verilog_ip_states state=IP_CODE; static verilog_ip_states saved_state; /* verilog_ip_states old_state=state; */ stream_status retval; /* static char fn_name[SYMBOL_LEN] = "UNINITIALIZED"; */ /* static short fn_name_index; */ static long start_char, end_char; static long fn_page_number; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; saved_state = IP_CODE; start_char = 0; end_char = 0; fn_page_number= 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case IP_CODE: switch (*input_char) { case '/': state = IP_COMMENT_START; { stream_status s; char c; s = getnextchar(&c); if ((c == '*') || (c == '/')) *status = CHAR_ITALIC; ungetnextchar(c,s); } break; case '{': braces_depth += 1; break; case '}': braces_depth -= 1; break; default: ; } break; case IP_COMMENT_START: switch (*input_char) { case '/': state=IP_COMMENT_LINE; *status=CHAR_ITALIC; break; case '*': state=IP_COMMENT; *status=CHAR_ITALIC; break; case '{': state=IP_CODE; braces_depth+=1; break; case '}': if ((braces_depth -= 1) == 0) retval|=STREAM_FUNCTION_END; break; default: state=IP_CODE; break; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case '*': state=IP_COMMENT_END; break; default: ; } break; case IP_COMMENT_LINE: *status = CHAR_ITALIC; switch (*input_char) { case '\n': state=IP_CODE; break; default: ; } break; case IP_COMMENT_END: *status = CHAR_ITALIC; switch (*input_char) { case '/': state=IP_CODE; break; case '*': break; default: state=IP_COMMENT; break; } break; default: abort(); } /* The whole switch on fn_state is removed - it can be copied back from lang_cxx.c if necessary. */ if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/output.h0000644000076400007640000000055707052654426011427 /* * Source file: * output.h */ extern long file_page_number; extern long page_number; extern void setup_output(void); extern void init_output(void); extern void print_file(void); extern boolean print_page(void); extern stream_status getnextline(stream_status (*get_input_char)(char *,char_status *), boolean *, char input_line[], char_status input_status[]); trueprint-5.3/src/debug.h0000644000076400007640000000015307052654426011145 /* * Include file: * debug.h */ extern void setup_debug(void); extern void dm(char, int, char *, ...); trueprint-5.3/src/index.h0000644000076400007640000000167307052654426011176 /* * Include file: * index.h */ extern void setup_index(void); extern void add_file(char *filename, unsigned int this_file_number, long this_file_page_number); extern void end_file(unsigned int this_file_number, long this_file_page_number); extern void add_function(char *name, long start, long end, long page, char *filename); extern void end_function(long page); extern char_status get_function_name_posn(long current_char, char_status status); extern char *get_function_name(long page); extern char *file_name(int file_number); extern long get_file_last_page(unsigned int this_file_number); extern long get_file_first_page(unsigned int this_file_number); extern struct tm *get_file_modified_time(unsigned int this_file_number); extern void sort_function_names(void); extern void print_index(void); extern void print_out_file_index(void); extern void page_has_changed(long); extern boolean function_changed(long); extern boolean page_changed(long); trueprint-5.3/src/lang_perl.c0000644000076400007640000001572207322173607012022 /* * Source file: * lang_perl.c * * Contains get_perl_char() which parses perl code. * * Pod functionality added by Daniel Wagenaar */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_perl.h" /* * Public part */ char lang_perl_defaults[] = "--i --F --f"; /* * Private part */ typedef enum { IP_CODE, IP_STRING, IP_QSTRING, IP_RE_OPTS, IP_COMMENT, IP_COMMAND, IP_VAR1, IP_VARBODY, IP_HD1, IP_HD2, IP_HDSTART, IP_HD, IP_HDSTARTLINE, IP_HDCHECKSTRING, IP_POD1, IP_POD2, IP_POD, IP_EPOD1, IP_EPOD2, IP_EPOD3, IP_EPOD4, IP_EPOD5, IP_EPOD6, } perl_ip_states; typedef enum { F1_CODE, F1_FUNCTION, F1_LEADING_SPACE, F1_NAME, F1_TRAILING_SPACE, F1_FNTEXT } perl_f1_states; /* * get_perl_char() * detects comment starts and ends; * finds function names; * detects function ends; */ stream_status get_perl_char(char *input_char, char_status *status) { static perl_ip_states state; stream_status retval; static perl_f1_states f1_state; static size_t f1_index; static long f1_start_char; static long f1_end_char; static char f1_name[SYMBOL_LEN]; static char here_marker[SYMBOL_LEN]; static short here_marker_index; static short here_marker_length; static long f1_page_number; static char sub[]="sub "; static boolean escaped; static int prepodstate; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; f1_state = F1_CODE; prepodstate = 0; f1_index = 0; f1_start_char = 0; f1_end_char = 0; f1_page_number= 0; escaped = FALSE; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); /* First a short switch to sort out escaped stuff... */ switch (state) { case IP_CODE: case IP_STRING: case IP_QSTRING: case IP_COMMAND: case IP_VARBODY: if (escaped) { escaped=FALSE; break; } /* otherwise drop through */ case IP_HD1: case IP_HD2: case IP_VAR1: case IP_HDSTART: if ((*input_char == '\\') && !escaped) { escaped = TRUE; break; } /* otherwise drop through */ default: switch (state) { case IP_CODE: if (*input_char=='\n') prepodstate++; else prepodstate = 0; switch (*input_char) { case '$': state=IP_VAR1; break; case '"': state=IP_STRING; break; case '\'': state=IP_QSTRING; break; case '`': state=IP_COMMAND; break; case '#': state=IP_COMMENT; *status=CHAR_ITALIC; break; case '<': state=IP_HD1; break; case '[': state=IP_RE_OPTS; break; case '{': if (braces_depth == 0) { if (f1_state == F1_TRAILING_SPACE) { add_function(f1_name,f1_start_char,f1_end_char,f1_page_number,current_filename); f1_index = 0; f1_state = F1_FNTEXT; } } braces_depth++; break; case '}': if (((braces_depth -= 1) == 0) && ((f1_state == F1_FNTEXT))) { end_function(page_number); retval |= STREAM_FUNCTION_END; f1_state = F1_CODE; } break; case '=': if (prepodstate>1) { state = IP_POD; *status=CHAR_ITALIC; } break; default: ; } break; case IP_STRING: if (*input_char == '"') state=IP_CODE; break; case IP_RE_OPTS: if (*input_char == ']') state=IP_CODE; break; case IP_QSTRING: if (*input_char == '\'') state=IP_CODE; break; case IP_COMMAND: if (*input_char == '`') state=IP_CODE; break; case IP_COMMENT: *status = CHAR_ITALIC; if (*input_char == '\n') { state=IP_CODE; prepodstate = 1; } break; case IP_VAR1: if (escaped) { state=IP_CODE; escaped=FALSE; break; } if (*input_char == '{') state=IP_VARBODY; else state=IP_CODE; break; case IP_VARBODY: if (*input_char == '}') state=IP_CODE; break; case IP_POD: *status = CHAR_ITALIC; if (*input_char == '\n') state = IP_EPOD1; break; case IP_EPOD1: *status = CHAR_ITALIC; if (*input_char == '\n') state = IP_EPOD2; else state = IP_POD; break; case IP_EPOD2: *status = CHAR_ITALIC; if (*input_char == '\n') state = IP_EPOD3; else state = IP_POD; break; case IP_EPOD3: *status = CHAR_ITALIC; if (*input_char == '\n') state = IP_EPOD4; else state = IP_POD; break; case IP_HD1: if (escaped) { state=IP_CODE; escaped=FALSE; break; } if (*input_char == '<') state=IP_HD2; else state=IP_CODE; break; case IP_HD2: if ((escaped || ((*input_char != '-') && (!isspace(*input_char)))) && (*input_char != '"') && (*input_char != '\'')) { escaped = FALSE; here_marker[here_marker_index=0] = *input_char; state = IP_HDSTART; break; } if (*input_char == '-') break; if ((*input_char == '"') || (*input_char == '\'')) break; state=IP_CODE; break; case IP_HDSTART: if ((escaped || !isspace(*input_char)) && (*input_char != '"') && (*input_char != '\'')) { escaped = FALSE; here_marker[++here_marker_index] = *input_char; break; } here_marker_length = here_marker_index+1; here_marker_index = 0; state=IP_HD; break; case IP_HD: if (*input_char == '\n') state = IP_HDSTARTLINE; break; case IP_HDSTARTLINE: if ((*input_char == '\n') || (isspace(*input_char))) break; state=IP_HDCHECKSTRING; /* else fall through */ case IP_HDCHECKSTRING: if ((*input_char == '"') || (*input_char == '\'')) break; if (*input_char != here_marker[here_marker_index++]) { if ((here_marker_index == here_marker_length+1) && (*input_char == '\n')) { state=IP_CODE; break; } state=IP_HD; here_marker_index=0; } break; default: abort(); } } if ((state == IP_CODE) && (braces_depth == 0)) { switch (f1_state) { case F1_CODE: if (*input_char == 's') { f1_index = 1; f1_state = F1_FUNCTION; f1_page_number = page_number; } break; case F1_FUNCTION: if (*input_char == sub[f1_index++]) { if (f1_index == strlen(sub)) f1_state = F1_LEADING_SPACE; } else f1_state = F1_CODE; break; case F1_LEADING_SPACE: if (isspace(*input_char)) break; if (isalpha(*input_char)) { f1_page_number = page_number; f1_name[f1_index=0] = *input_char; f1_start_char = char_number; f1_state=F1_NAME; break; } f1_state = F1_CODE; break; case F1_NAME: if (isalnum(*input_char) || (*input_char == '_')) { f1_name[++f1_index] = *input_char; } else { f1_name[++f1_index] = '\0'; f1_end_char = char_number - 1; f1_state = F1_TRAILING_SPACE; } break; default: ; } } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/lang_verilog.h0000644000076400007640000000021607052654426012527 /* * Include file: * lang_verilog.h */ extern stream_status get_verilog_char(char *, char_status *); extern char lang_verilog_defaults[]; trueprint-5.3/src/postscript.c0000644000076400007640000006050307322177271012267 /* * Source file: * postscript.c * * Implements stuff for postscript printers */ #include "config.h" #include #include #include #include "trueprint.h" #include "main.h" #include "expand_str.h" #include "utils.h" #include "debug.h" #include "options.h" #include "index.h" #include "printers_fl.h" #include "postscript.h" /* * Public part */ boolean no_show_indent_level; boolean no_show_line_number; /* * Private part */ typedef enum { NO_LAYOUT, ONE_ON_ONE, TWO_ON_ONE, THREE_ON_ONE, FOUR_ON_ONE } page_layouts; static unsigned short logical_pages_on_physical_page; static long physical_page_no; static short greenlines; static boolean no_holepunch; static boolean no_top_holepunch; static boolean page_furniture; static int interline_gap; static boolean include_headers; static boolean include_footers; static short pointsize; static char orientation; static page_layouts layout; static boolean no_cover_sheet; static char *user_name; static unsigned short printable_width; static unsigned short printable_height; static unsigned short virtual_width; static unsigned short virtual_height; static unsigned short header_box_height; static unsigned short footer_box_height; static unsigned short logical_pages_rotated; static unsigned short pos_left; static unsigned short pos_centre_left; static unsigned short pos_centre_right; static unsigned short pos_right; static unsigned short pos_bottom; static unsigned short pos_centre_bottom; static unsigned short pos_centre_top; static unsigned short pos_top; static unsigned short logical_page_no; static unsigned short left_margin; static unsigned short right_margin; static unsigned short top_margin; static unsigned short bottom_margin; static boolean left_page, right_page; static char no_of_sides; static char ps_level; /* postscript level output ... either 1 or 2 */ static void balance_strings(char *string1, char *string2, char *string3, long page_no, boolean index_page); static void set_layout_default(void); static void set_layout_1(const char *p, const char *s); static void set_layout_2(const char *p, const char *s); static void set_layout_3(const char *p, const char *s); static void set_layout_4(const char *p, const char *s); static boolean PS_side_full(void); static void set_no_of_sides(const char *p, const char *s, char value); static void set_no_of_sides_default(char value); /* * Function: * setup_postscript() * * Declares variables and performs any initializations */ void setup_postscript(void) { pointsize = -1; short_option("p", "point-size", 10, NULL, 0, MINPOINTSIZE, MAXPOINTSIZE, &pointsize, NULL, NULL, OPT_TEXT_FORMAT, "specify point size (default 10)", NULL); boolean_option("C", "no-cover-sheet", "cover-sheet", FALSE, &no_cover_sheet, NULL, NULL, OPT_PRINT, "don't print cover sheet", "print cover sheet"); boolean_option("I", "no-holepunch", "holepunch", TRUE, &no_holepunch, NULL, NULL, OPT_PAGE_FORMAT, "don't leave space for holepunch at the side of each page", "leave space for holepunch at the side of each page"); boolean_option("J", "no-top-holepunch", "top-holepunch", TRUE, &no_top_holepunch, NULL, NULL, OPT_PAGE_FORMAT, "don't leave space for holepunch at the top of each page", "leave space for holepunch at the top of each page"); boolean_option("u", "page-furniture-lines", "no-page-furniture-lines", TRUE, &page_furniture, NULL, NULL, OPT_PAGE_FURNITURE, "Draw lines around headers and footers and include left margin line", "No lines around headers or footers and no left margin line"); greenlines = -1; short_option("G", "gray-bands", 0, NULL, 0, 0, MAXGREENLINES, &greenlines, NULL, NULL, OPT_PAGE_FURNITURE, " emulate the old lineprinter paper with gray bands\n" " across each page. The value of gives the width of\n" " the bands and the gaps between them", NULL); interline_gap = -1; int_option("g", "leading", 1, NULL, 0, MININTERLINE_GAP, MAXINTERLINE_GAP, &interline_gap, NULL, NULL, OPT_TEXT_FORMAT, "specify interline gap in points (default 1)", NULL); boolean_option("K", "headers", "no-headers", TRUE, &include_headers, NULL, NULL, OPT_PAGE_FURNITURE, "include the header on each page", "suppress the header on each page"); boolean_option("k", "footers", "no-footers", TRUE, &include_footers, NULL, NULL, OPT_PAGE_FURNITURE, "include the footer on each page", "suppress the footer on each page"); user_name = NULL; string_option("U", "username", NULL, &user_name, NULL, NULL, OPT_MISC, "set username for coversheet"); boolean_option("i", "no-braces-depth", "braces-depth", FALSE, &no_show_indent_level, NULL, NULL, OPT_PAGE_FURNITURE, "exclude the braces depth count", "include the braces depth count"); boolean_option("n", "no-line-numbers", "line-numbers", FALSE, &no_show_line_number, NULL, NULL, OPT_PAGE_FURNITURE, "exclude the line number count", "include the line number count"); choice_option("o", "portrait", "landscape", 'p', 'l', &orientation, NULL, NULL, OPT_PAGE_FORMAT, "print using portrait orientation", "print using landscape orientation"); no_of_sides = '0'; choice_option("S", "single-sided", "double-sided", '1', '2', NULL, set_no_of_sides, set_no_of_sides_default, OPT_PAGE_FORMAT, "print single-sided", "print double-sided"); ps_level = '2'; choice_option("R", "ps-level-two", "ps-level-one", '2', '1', &ps_level, NULL, NULL, OPT_PAGE_FORMAT, "generate postscript level 2 code", "generate postscript level 1 code"); layout = NO_LAYOUT; noparm_option("1", "one-up", TRUE, &set_layout_1, &set_layout_default, OPT_PAGE_FORMAT, "print 1-on-1 (default)"); noparm_option("2", "two-up", FALSE, &set_layout_2, NULL, OPT_PAGE_FORMAT, "print 2-on-1"); noparm_option("3", "two-tall-up", FALSE, &set_layout_3, NULL, OPT_PAGE_FORMAT, "print 2-on-1 at 4-on-1 pointsize"); noparm_option("4", "four-up", FALSE, &set_layout_4, NULL, OPT_PAGE_FORMAT, "print 4-on-1"); } /* * Function: * init_postscript() * * Gets postscript ready for either pass 0 or pass 1 */ void init_postscript(void) { physical_page_no = 1; logical_page_no = 0; right_page = TRUE; left_page = FALSE; } void set_layout_default(void) { if (layout != NO_LAYOUT) return; layout = ONE_ON_ONE; } void set_layout_1(const char *p, const char *s) { if (layout != NO_LAYOUT) return; layout = ONE_ON_ONE; } void set_layout_2(const char *p, const char *s) { if (layout != NO_LAYOUT) return; layout = TWO_ON_ONE; } void set_layout_3(const char *p, const char *s) { if (layout != NO_LAYOUT) return; layout = THREE_ON_ONE; } void set_layout_4(const char *p, const char *s) { if (layout != NO_LAYOUT) return; layout = FOUR_ON_ONE; } /* * Function: * PS_header() * * Prints out the initial stuff for a postscript printer */ void PS_header(char *version, boolean print_body) { unsigned int file_index; printf("%%!PS-Adobe-%c.0\n", ps_level); printf("statusdict /setduplexmode known {\n"); if (no_of_sides == '2') { printf(" true "); } else { printf(" false "); } printf("statusdict /setduplexmode get exec\n} if\n"); printf("/Ps %d def\n", pointsize); printf("/SPs %d def\n", (pointsize*3)/4); printf("/Lh %d def\n", pointsize + interline_gap); printf("/Rm %d def\n", virtual_width); printf("/Tm %d def\n", virtual_height); printf("/Bh %d def\n", header_box_height); printf("/Bf %d def\n", footer_box_height); printf("/CF /Courier findfont Ps scalefont def\n"); printf("/IF /Courier-Oblique findfont Ps scalefont def\n"); printf("/BF /Courier-Bold findfont Ps scalefont def\n"); printf("/CFs /Courier findfont SPs scalefont def\n"); printf("/IFs /Courier-Oblique findfont SPs scalefont def\n"); printf("/BFs /Courier-Bold findfont SPs scalefont def\n"); printf("/HF /Helvetica findfont Ps scalefont def\n"); if ((no_show_line_number == FALSE) || (no_show_indent_level == FALSE)) printf("/Li CFs setfont (1234567890) stringwidth pop def\n"); else printf("/Li 0 def\n"); printf("/Nl { /Vpos Vpos Lh sub def } def\n"); printf("/Lpt { 0 Vpos moveto } def\n"); printf("/Gb {\n"); if (greenlines != 0) { printf(" gsave /Cv Tm Bh sub def\n"); printf(" { Li Cv moveto Rm Li sub 0 rlineto 0 -%d Lh mul rlineto\n",greenlines); printf(" Rm Li sub neg 0 rlineto 0 %d Lh mul rlineto\n",greenlines); printf(" 0.98 setgray fill\n"); printf(" /Cv Cv %d Lh mul sub def\n",greenlines*2); printf(" Cv 0 lt { exit } if\n"); printf(" } loop\n"); printf(" grestore\n"); } printf(" } def\n"); if (page_furniture) { printf("/Ip { Gb .5 setlinewidth\n"); if (include_headers) { printf(" 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath\n"); } else { printf(" 0 Tm moveto Rm 0 rlineto\n"); } printf(" gsave .98 setgray fill grestore stroke\n"); if (include_footers) { printf(" 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath\n"); } else { printf(" 0 0 moveto Rm 0 rlineto\n"); } printf(" gsave .98 setgray fill grestore stroke\n"); printf(" 0 Bf moveto 0 Tm Bh sub lineto stroke newpath\n"); printf(" } def\n"); } else { printf("/Ip { } def\n"); } printf("/Cp { Ip .3 setlinewidth newpath\n"); printf(" Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath\n"); printf(" } def\n"); printf("/So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def\n"); printf("/Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def\n"); printf("/Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def\n"); if (ps_level == '2'){ printf("<> setpagedevice\n", left_margin+right_margin, top_margin+bottom_margin); } /* * Print cover sheet */ if (no_cover_sheet == FALSE) { if (user_name == NULL) { dm('h',3, "postscript.c:PS_header() use_environment = %d\n", use_environment); if (!use_environment) user_name = "testuser"; else { char *u = getenv("USER"); if (u == 0) { user_name = ""; } else { user_name = strdup(u); } } if (*user_name == '\0') user_name = "Unknown user"; dm('h',3, "postscript.c:PS_header() Username = %s\n", user_name); } printf("%%%%Page: Cover %ld\n", physical_page_no++); printf("70 70 moveto\n"); printf("/Helvetica findfont 10 scalefont setfont\n"); printf("(Trueprint %s) show\n", version); printf("70 725 moveto\n"); printf("/Helvetica-Bold findfont 20 scalefont setfont\n"); printf("(For: %s) show\n", user_name); printf("70 700 moveto\n"); printf("(Printed on: %s) show\n",expand_string("%L", TRUE)); if (print_body == TRUE) { printf("70 675 moveto\n"); printf("(Last page number: %ld) show\n", total_pages); for (file_index = 0; file_index < (no_of_files>20?20:no_of_files); file_index++) printf("70 %d moveto (File: %s) show\n", 650 - (file_index*25), file_name(file_index)); if (no_of_files > 20) printf("70 150 moveto (Etc....) show\n"); } printf("showpage\n"); if (no_of_sides == '2') { printf("%%%%Page: Coverback %ld\n", physical_page_no++); printf("showpage\n"); } } } /* * Function: * PS_side_full * Returns TRUE if this is the last logical page on a side. */ boolean PS_side_full(void) { boolean retval = FALSE; if (logical_page_no != 0) { retval = ((logical_page_no % logical_pages_on_physical_page) == 0); } dm('O',2, "postscript.c:PS_side_full() returning %d\n", retval); return retval; } /* * Function: * PS_endpage * decides whether to print out `showpage' or not and updates various * other bits & pieces. * Returns true if this is the last page on a sheet. */ boolean PS_endpage(boolean print_page) { static boolean page_has_printing = FALSE; boolean reached_end_of_sheet; /* * If this logical page is to be printed then the overall physical page * needs to be printed out. */ if (print_page) { page_has_printing = TRUE; } /* * Remember if we have reached the end of a sheet */ reached_end_of_sheet = (((no_of_sides == '2') && left_page && ((logical_page_no % logical_pages_on_physical_page) == 0)) || ((no_of_sides == '1') && ((logical_page_no % logical_pages_on_physical_page) == 0)) ); /* * If the previous side is now full, then we're moving on to a new * physical page and we may need to change left/right page info. We * also need to print out either a showpage or delete the output from postscript */ if (PS_side_full()) { physical_page_no++; if (no_of_sides == '2') { left_page = !left_page; right_page = !right_page; } if (pass == 1) { if (page_has_printing) { printf("showpage\n"); } else { printf("erasepage initgraphics\n"); } } page_has_printing = FALSE; } return reached_end_of_sheet; } /* * Function: * PS_startpage * prints out parameters in the header and footer boxes, and print other * page-furniture. Maintains logical_page_no. * * print_headers indicates whether this page should be printed or not. * Actually the whole page is always printed - however by the end of the * sheet if print_headers was false for every logical page on that * sheet then the output is thrown away. */ void PS_startpage(char *head1, char *head2, char *head3, char *foot1, char *foot2, char *foot3, char *msg_string, long page_no,long hdr_total_pages, boolean index_page) { short message_pointsize; char *message; unsigned short gap; logical_page_no++; dm('O',2, "postscript.c:PS_startpage(), logical page = %d, physical page = %d\n", logical_page_no, physical_page_no); if (pass == 0) return; dm('h',4,"Printing page %s/%s/%s %s/%s/%s + %s, page %d, total %d, index %d\n", head1, head2, head3, foot1, foot2, foot3, msg_string, page_no, hdr_total_pages, index_page); dm('h',4,"postscript.c:PS_startpage layout %d no_of_sides %c page_no %d\n", layout, no_of_sides, page_no); message = expand_string(msg_string, index_page); /* * Work out if we need to indent for holepunch or not */ if (!no_holepunch && right_page) gap = HOLEPUNCH_WIDTH - pos_left; else gap = 0; /* * Next translate and rotate as appropriate for 1-on-1, 2-on-1, 3-on-1 or 4-on-1 * Also print the page header if this is the first logical page on a physical * page. */ switch (layout) { case ONE_ON_ONE: printf("%%%%Page: %d %ld\n",logical_page_no, physical_page_no); if (orientation == 'p') printf("%d %d translate\n", pos_left+gap, pos_bottom); if (orientation == 'l') printf("%d %d translate 90 rotate\n", pos_right+gap, pos_bottom); break; case TWO_ON_ONE: switch (logical_page_no & 1) { case 1: printf("%%%%Page: %d %ld\n",logical_page_no, physical_page_no); printf("gsave\n"); if (orientation == 'p') printf("%d %d translate .64 .64 scale 90 rotate\n", pos_right+gap, pos_bottom); else printf("%d %d translate .64 .64 scale\n", pos_left+gap, pos_centre_top); break; case 0: printf("grestore\n"); if (orientation == 'p') printf("%d %d translate .64 .64 scale 90 rotate\n", pos_right+gap, pos_centre_top); else printf("%d %d translate .64 .64 scale\n", pos_left+gap, pos_bottom); } break; case THREE_ON_ONE: switch (logical_page_no & 1) { case 1: printf("%%%%Page: %d %ld\n",logical_page_no, physical_page_no); printf("gsave\n"); if (orientation == 'p') printf("%d %d translate .5 .5 scale\n", pos_left+gap, pos_bottom); else printf("%d %d translate .5 .5 scale 90 rotate\n", pos_centre_left+gap, pos_bottom); break; case 0: printf("grestore\n"); if (orientation == 'p') printf("%d %d translate .5 .5 scale\n", pos_centre_right+gap, pos_bottom); else printf("%d %d translate .5 .5 scale 90 rotate\n", pos_right+gap, pos_bottom); } break; case FOUR_ON_ONE: switch (logical_page_no & 3) { case 1: printf("%%%%Page: %d %ld\n",logical_page_no, physical_page_no); printf("gsave\n"); if (orientation == 'p') printf("%d %d translate .5 .5 scale\n", pos_left+gap, pos_centre_top); else printf("%d %d translate .5 .5 scale 90 rotate\n", pos_centre_left+gap, pos_bottom); break; case 2: printf("grestore gsave\n"); if (orientation == 'p') printf("%d %d translate .5 .5 scale\n", pos_left+gap, pos_bottom); else printf("%d %d translate .5 .5 scale 90 rotate\n", pos_right+gap, pos_bottom); break; case 3: printf("grestore gsave\n"); if (orientation == 'p') printf("%d %d translate .5 .5 scale\n", pos_centre_right+gap, pos_centre_top); else printf("%d %d translate .5 .5 scale 90 rotate\n", pos_centre_left+gap, pos_centre_top); break; case 0: printf("grestore\n"); if (orientation == 'p') printf("%d %d translate .5 .5 scale\n", pos_centre_right+gap, pos_bottom); else printf("%d %d translate .5 .5 scale 90 rotate\n", pos_right+gap, pos_centre_top); } break; case NO_LAYOUT: abort(); } /* * Use the appropriate postscript macro to print the page frame, including header * and footer boxes and vertical lines */ if (!index_page && ((no_show_line_number == FALSE) || (no_show_indent_level == FALSE))) printf("Cp "); else printf("Ip "); /* * Next print out the message string */ if ((message != NULL) && (strlen(message) != 0)) { message_pointsize = printable_width / strlen(message); printf("gsave\n"); printf(".9 setgray\n"); printf("Rm 2 div Tm 2 div translate "); if (orientation == 'l') printf("30 rotate\n"); else printf("60 rotate\n"); printf("/Courier-Bold findfont %d scalefont setfont ", message_pointsize); printf("-216 0 moveto (%s) show\n", message); printf("grestore\n"); } if (include_headers) { /* * Set up the font and Ypos to print the header strings */ printf("HF setfont /Ypos Tm Bh sub Ps 2 div add def\n"); balance_strings(head1, head2, head3, page_no, index_page); } if (include_footers) { /* * Set up the font and Ypos to print the footer strings */ printf("HF setfont /Ypos Ps 2 div def\n"); balance_strings(foot1, foot2, foot3, page_no, index_page); } if (index_page) { printf("CF setfont "); } printf("/Vpos Tm Bh sub Ps sub def\n"); } /* * Function: * PS_end_output() * */ void PS_end_output(void) { printf("%%%%Trailer\n"); printf("%%%%EOF\n"); } /* * Function: * balance_strings() */ void balance_strings(char *string1, char *string2, char *string3, long page_no, boolean index_page) { char *s1, *s2, *s3; if (right_page) { s1 = strdup(expand_string(string1, index_page)); s2 = strdup(expand_string(string2, index_page)); s3 = strdup(expand_string(string3, index_page)); } else { s1 = strdup(expand_string(string3, index_page)); s2 = strdup(expand_string(string2, index_page)); s3 = strdup(expand_string(string1, index_page)); } /* start end1 start2 mid2 end2 start3 end3 */ /* s1 s2 s3 */ printf("Ps Ypos moveto\n"); printf("(%s) show ",s1); /* print first string at extreme left hand edge */ printf("currentpoint pop dup "); /* . end1 end1 */ printf("Rm Ps sub "); /* . end1 end1 end3 */ printf("(%s) stringwidth pop ", s3); /* . end1 end1 end3 length3 */ printf("sub dup Ypos moveto\n"); /* . end1 end1 start3 */ printf("(%s) show\n",s3); printf("exch sub 2 div add "); /* . mid2 */ printf("(%s) stringwidth pop ",s2); /* . mid2 length2 */ printf("2 div sub Ypos moveto\n"); /* . */ printf("(%s) show\n",s2); } /* * Function: * PS_pagesize() * sets up all variables corresponding to page size & related measurements, using * margins from printer_stats(). * Specifically if length is unspecified then it is calculated from pointsize, * else pointsize is calculated from length. * Then width is calculated from pointsize. */ void PS_pagesize(char *printer, int *width_ptr, int *length_ptr) { float margin_height; short tmp_sides; printer_stats(printer, &tmp_sides, &left_margin, &right_margin, &top_margin, &bottom_margin); if (no_of_sides == '0') { if (tmp_sides == 1) no_of_sides = '1'; else no_of_sides = '2'; } dm('O',3,"postscript.c:PS_pagesize left %d right %d top %d bottom %d\n", left_margin, right_margin, top_margin, bottom_margin); dm('O',3,"postscript.c:PS_pagesize pointsize %d\n", pointsize); if (HOLEPUNCH_WIDTH < left_margin) no_holepunch = TRUE; if (!no_holepunch) printable_width = right_margin - HOLEPUNCH_WIDTH; else printable_width = right_margin - left_margin; if (!no_top_holepunch) printable_height = top_margin - bottom_margin - HOLEPUNCH_HEIGHT; else printable_height = top_margin - bottom_margin; if ((*length_ptr == -1) && (pointsize == 0)) abort(); if (layout == ONE_ON_ONE) { logical_pages_on_physical_page = 1; if (orientation == 'p') { logical_pages_rotated = FALSE; virtual_width = printable_width; virtual_height = printable_height; } else { logical_pages_rotated = TRUE; virtual_width = printable_height; virtual_height = printable_width; } } else if (layout == TWO_ON_ONE) { logical_pages_on_physical_page = 2; if (orientation == 'p') { logical_pages_rotated = TRUE; virtual_width = printable_height/2 * 1.56 - 3; virtual_height = printable_width * 1.56; } else { logical_pages_rotated = FALSE; virtual_width = printable_width * 1.56; virtual_height = printable_height/2 * 1.56 - 3; } } else if (layout == THREE_ON_ONE) { logical_pages_on_physical_page = 2; if (orientation == 'p') { logical_pages_rotated = FALSE; virtual_width = printable_width - 4; virtual_height = printable_height * 2; } else { logical_pages_rotated = TRUE; virtual_width = printable_height * 2; virtual_height = printable_width - 4; } } else { logical_pages_on_physical_page = 4; if (orientation == 'p') { logical_pages_rotated = FALSE; virtual_width = printable_width - 4; virtual_height = printable_height - 4; } else { logical_pages_rotated = TRUE; virtual_width = printable_height - 4; virtual_height = printable_width - 4; } } pos_left = left_margin; pos_centre_left = left_margin + printable_width/2 - 2; pos_centre_right = left_margin + printable_width/2 + 2; pos_right = left_margin + printable_width; pos_bottom = bottom_margin; pos_centre_bottom = bottom_margin + printable_height/2 - 2; pos_centre_top = bottom_margin + printable_height/2 + 2; pos_top = bottom_margin + printable_height; dm('O',3,"postscript.c:PS_pagesize virtual width %d, virtual height %d\n", virtual_width, virtual_height); dm('O',3,"postscript.c:PS_pagesize specified width %d, specified length %d\n", *width_ptr, *length_ptr); if (!include_headers) header_box_height = 0; else header_box_height = 1.5 * pointsize; if (!include_footers) footer_box_height = 0; else footer_box_height = 1.5 * pointsize; margin_height = header_box_height + footer_box_height; if (*length_ptr == -1) *length_ptr = (virtual_height - margin_height) / (pointsize + interline_gap); else pointsize = (short)(virtual_height - (interline_gap * *length_ptr))/(3 + *length_ptr); dm('O',3,"virtual_width = %d, pointsize = %d %d\n", virtual_width, pointsize, 0.6*pointsize); if (*width_ptr == -1) *width_ptr = 1.66 * virtual_width / pointsize; dm('O',3,"postscript.c:PS_pagesize width to be used %d, length to be used %d\n", *width_ptr, *length_ptr); if (((no_show_line_number == FALSE) || (no_show_indent_level == FALSE)) && (*width_ptr >= 8)) (*width_ptr) -= 8; dm('O',3,"postscript.c:PS_pagesize width to be used %d, length to be used %d\n", *width_ptr, *length_ptr); } static void set_no_of_sides_default(char value) { no_of_sides = '0'; } static void set_no_of_sides(const char *p, const char *s, char value) { no_of_sides = value; } trueprint-5.3/src/diffs.c0000644000076400007640000002103107052654426011143 /* * Source file: * diffs.c * * Implements the highlighting of differences between old and new versions * of files. */ #include "config.h" #ifndef DIFF_CMD #include "trueprint.h" #include "diffs.h" /* If there is no diff command just provide stubs */ void setup_diffs(void) { return; } void init_diffs(char newfile[]) { return; } void end_diffs(void) { return; } boolean getdelline(long current_line, char *input_line, char_status input_status[]) { return 0; } boolean line_inserted(long current_line) { return 0; } #else #include #include /* Ultrix needs these sys header files this way around */ #include #include #include #include #include #include "trueprint.h" #include "utils.h" #include "main.h" #include "output.h" #include "openpipe.h" #include "options.h" #include "debug.h" #include "diffs.h" static char *diffs_string; /* * Private part */ static unsigned short read_values(FILE *,long *value1_ptr, long *value2_ptr); static boolean read_long(FILE *, long *); static void parse_line(void); static stream_status get_diff_char(char *input_char, char_status *status); static FILE *diffs_stream; static boolean diffs_on; static long diff_start_line; static long diff_end_line; static long lines_deleted; static long lines_added; /* * Function: * setup_diffs */ void setup_diffs(void) { diffs_string = NULL; diffs_stream = NULL; string_option("O", "diff", NULL, &diffs_string, NULL, NULL, OPT_MISC, "if is a file then print diffs between and input file\n" " otherwise use as a prefix and print diffs"); } /* * Function: * init_diffs * * Initialises the diffs system: * checks to see if any old version was provided and returns if not; * calls end_diffs() if necessary; * starts up the diff process; */ void init_diffs(char newfile[]) { char command[COMMAND_LEN]; char *diff_cmd; struct stat dummy; /* Check to see if any old versions given */ if (diffs_string == NULL) { /* turn off diffs and return */ diffs_on = FALSE; return; } diffs_on = TRUE; if ((diff_cmd = getenv("TP_DIFF_CMD")) == NULL) { diff_cmd = DIFF_CMD; } /* * diffs_stream is only set if still reading from * diff process, so need to finish the old diffs. */ if (diffs_stream != NULL) end_diffs(); /* * Check to see if diffs_string is a valid prefix or * a filename... */ sprintf(command,"%s%s",diffs_string,newfile); if (stat(command,&dummy) == 0) { sprintf(command,"%s %s%s %s", diff_cmd,diffs_string,newfile,newfile); } else if (stat(diffs_string,&dummy) == 0) { sprintf(command, "%s %s %s", diff_cmd, diffs_string, newfile); } dm('d',3,"diffs command: %s\n",command); if ((diffs_stream = fopenpipe(command, "r")) == NULL) abort; parse_line(); } /* * Function: * read_values * * scan a line reading one integer, and reading a second if the next * character is a "," */ unsigned short read_values(FILE *stream, long *value1_ptr, long *value2_ptr) { int next_char; unsigned short retval; *value1_ptr = 0; *value2_ptr = 0; /* read first value - if none then return*/ if (!read_long(stream, value1_ptr)) return 0; /* skip spaces and check for a comma */ while ((next_char = getc(stream)) == ' ') ; if (next_char == ',') { /* if next char was a comma read second value */ if (!read_long(stream, value2_ptr)) { fprintf(stderr, gettext(CMD_NAME ": internal error reading diffs\n")); exit(2); } /* and skip spaces again */ while ((next_char = getc(stream)) == ' ') ; retval = 2; } else { retval = 1; *value2_ptr = *value1_ptr; } if (next_char != EOF) { /* replace last char in buffer for calling function */ ungetc((int)next_char,stream); } return(retval); } /* * Function: * read_long * * Reads a long from a stream */ boolean read_long(FILE *stream, long *value) { boolean retval = FALSE; int next_char; *value = 0; while (TRUE) { if ((next_char = getc(stream)) == EOF) break; if (!isdigit(next_char)) break; retval = TRUE; *value = (*value * 10) + (next_char - '0'); } if (next_char != EOF) { ungetc(next_char, stream); } return retval; } /* * Function: * parse_line * * Reads a line from the diff stream, reading start and end line numbers * for both the old and new files and the change type (d, a or c). */ void parse_line(void) { long delete_start; long delete_end; int diff_type; /* * Read the first two values - if there aren't any then we've * reached the end of the file. These values refer to the * first file so we're only interested in them for deleting lines. */ if (read_values(diffs_stream, &delete_start, &delete_end) == 0) { end_diffs(); diffs_on = FALSE; return; } /* * Calculate the number of lines deleted. * If delete start and delete end are the same then 1 line has been * deleted... i.e. one more than the difference. */ lines_deleted = delete_end - delete_start + 1; diff_type = getc(diffs_stream); /* a=add, d=del, c=change */ switch (diff_type) { case 'a': case 'd': case 'c': break; default: fprintf(stderr, gettext(CMD_NAME ": warning, bad diffs stream format char %c!\n"), diff_type); end_diffs(); diffs_on = FALSE; return; } /* Same as before, only for new version of file */ if (read_values(diffs_stream, &diff_start_line, &diff_end_line) == 0) { fprintf(stderr, gettext(CMD_NAME ": warning, bad diffs stream format!\n")); end_diffs(); diffs_on = FALSE; return; } lines_added = diff_end_line - diff_start_line + 1; if (diff_type == 'a') lines_deleted = 0; if (diff_type == 'd') { lines_added = 0; /* * deleted lines are actually *after* the specified line, * so we need to pretend they're one line later... */ diff_start_line += 1; diff_end_line += 1; } /* Skip to the end of the line */ while (getc(diffs_stream) != '\n') ; } /* * Function: * end_diffs * * Finish off the diffs system: * - close the diffs stream (i.e. kill off the diff process); */ void end_diffs(void) { if (!diffs_on) return; dm('d',3,"diffs: closing diffs\n"); fclosepipe(diffs_stream); diffs_stream = NULL; } /* * Function: * get_diff_char * * Simple function to be passed to getnextline() (which expands tabs, etc) * in getdelline(), so we don't need to duplicate the functionality of * getnextline(). */ stream_status get_diff_char(char *input_char, char_status *status) { *status = CHAR_NORMAL; *input_char = (char)getc(diffs_stream); return(STREAM_OK); } /* * Function: * getdelline * * Returns: * TRUE if a(nother) deleted line occurs after current line, returns * line in parameters. * FALSE if no deleted line between current line and next line. */ boolean getdelline(long current_line, char *input_line, char_status input_status[]) { boolean blank_line; /* * Check whether there is a deleted line waiting... */ if ((current_line != diff_start_line) || !diffs_on || (lines_deleted == 0)) return(FALSE); /* * First skip the first two characters of the line - * they should be "< " */ if ((getc(diffs_stream)!='<') || (getc(diffs_stream)!=' ')) { fprintf(stderr, gettext(CMD_NAME ": diffs stream in unexpected format\n")); exit(2); } /* Read in the next line from diff stream */ getnextline(get_diff_char,&blank_line,input_line,input_status); lines_deleted -= 1; if (lines_deleted == 0) { /* * If there are lines added then this is a "change" and * the added lines will be dealt with by line_inserted(). * Otherwise we need to find the next difference with * parse_line(). */ if (lines_added == 0) parse_line(); else /* else skip over line of ---- */ while (getc(diffs_stream) != '\n') ; } return(TRUE); } /* * Function: * line_inserted * * Returns: * INSERT if line_number has been inserted * NORMAL otherwise */ boolean line_inserted(long current_line) { boolean retval = FALSE; if (!diffs_on) return(FALSE); if ((current_line >= diff_start_line) && (current_line <= diff_end_line)) { /* skip over line */ while (getc(diffs_stream) != '\n') ; retval = TRUE; } /* If reached the end of the insertion... */ if (current_line >= diff_end_line) parse_line(); return(retval); } #endif trueprint-5.3/src/input.c0000644000076400007640000001172407052654426011217 /* * Source file: * input.c * * Contains the functions that look after getting input from the source files. * These are the functions that the functions in lang_*.c use. */ #include "config.h" #include #include #include #include #if HAVE_UNISTD_H # include #else int read(int fildes, void *buf, unsigned int nbyte); #endif #include "trueprint.h" #include "utils.h" #include "main.h" #include "debug.h" #include "input.h" /* * Public part */ long char_number; int got_some_input; /* * Private part */ /* Arbitrary size - should never need more than 2 */ #define UNGET_STACKSIZE 8 static char *unget_charstackptr; static char *unget_statstackptr; static char *unget_charstackbase; static char *unget_statstackbase; static unsigned short unget_stackdepth; static int input_stream; /* My private version of getchar */ static stream_status buffered_read(char *input_char); /* * Function: * set_input_stream * Very C++.... returns FALSE if the file is empty. * Assumes that if it returns false then stream will not be used. */ boolean set_input_stream(int stream) { char test_char; stream_status test_status; /* * Reset the unget stack */ unget_charstackptr = unget_charstackbase; unget_statstackptr = unget_statstackbase; unget_stackdepth = 0; input_stream = stream; if ((test_status = getnextchar(&test_char)) == STREAM_EMPTY_FILE) { return FALSE; } else { ungetnextchar(test_char, test_status); return TRUE; } } /* * Function: * setup_input */ void setup_input(void) { unget_stackdepth = 0; got_some_input = 0; unget_charstackbase = xmalloc(UNGET_STACKSIZE); unget_charstackptr = unget_charstackbase; unget_statstackbase = xmalloc(UNGET_STACKSIZE); unget_statstackptr = unget_statstackbase; } /* * Function: * init_input */ void init_input(void) { char_number = -1; } /* * Function: * buffered_read * * Reads buffered input from standard input, returns next character. * Collapses cr/lf to cr and cr/ff to ff. * Can return any value from buffered_read_status. */ stream_status buffered_read(char *input_char) { static char input_buffer[BUFFER_SIZE]; static short buffer_pointer = 0; static int buffer_size=0; /* * If there's nothing in the buffer, read it in - this will * happen the first time this function is called and at the * beginning of each file. */ if (buffer_size == 0) { if ((buffer_size = read(input_stream,input_buffer,BUFFER_SIZE)) < 0) { fprintf(stderr, gettext(CMD_NAME ": cannot read file %s, %s\n"), current_filename, strerror(errno)); exit(2); } if (buffer_size == 0) return(STREAM_EMPTY_FILE); /* Set the global flag to indicate that there is at least some input */ got_some_input = 1; buffer_pointer = 0; } *input_char = input_buffer[buffer_pointer++]; /* * If buffer has been totally read then read in the next buffer-full. */ if (buffer_pointer == buffer_size) { if ((buffer_size = read(input_stream,input_buffer,BUFFER_SIZE)) < 0) { fprintf(stderr, gettext(CMD_NAME ": cannot read file %s, %s\n"), current_filename, strerror(errno)); exit(2); } if (buffer_size == 0) return(STREAM_FILE_END); /* * Reset the buffer */ buffer_pointer = 0; } /* * At this point we have a character to be returned, and we know * that input_buffer[buffer_pointer] contains the next character. * This gives us the opportunity to collapse lf/cr to cr and cr/ff * to ff. */ if (((*input_char == '\r') && (input_buffer[buffer_pointer] == '\n')) || ((*input_char == '\n') && (input_buffer[buffer_pointer] == '\f'))) return buffered_read(input_char); else return(STREAM_OK); } /* * Function: * ungetnextchar * * Conceptually puts the char back into the input stream, just like * ungetc(). */ void ungetnextchar(char input_char, stream_status status) { dm('I',7,"input.c:ungetnextchar(%c,%d)\n",input_char,status); dm('I',8,"input.c:ungetnextchar char stack = %x, stat stack = %x, size = %d\n", unget_charstackptr, unget_statstackptr, unget_stackdepth); if (unget_stackdepth++ == UNGET_STACKSIZE) abort(); *(unget_charstackptr++) = input_char; *(unget_statstackptr++) = (char)status; char_number --; } /* * Function: * getnextchar * * Returns the next character from the input stream. Detects end of file * and keeps char_number up-to-date. */ stream_status getnextchar(char *input_char) { char_number += 1; /* * Check unget stack */ if (unget_stackdepth > 0) { dm('I',8,"input.c:getnextchar char stack = %x, stat stack = %x, size = %d\n", unget_charstackptr, unget_statstackptr, unget_stackdepth); unget_stackdepth--; *input_char = *(--unget_charstackptr); dm('I',7,"input.c:getnextchar returning %c, %d from stack\n", *input_char, *(unget_statstackptr-1)); return *(--unget_statstackptr); } return buffered_read(input_char); } trueprint-5.3/src/lang_perl.h0000644000076400007640000000020507052654426012020 /* * Include file: * lang_perl.h */ extern stream_status get_perl_char(char *, char_status *); extern char lang_perl_defaults[]; trueprint-5.3/src/language.c0000644000076400007640000001465607217537562011656 /* * Source file: * language.c */ #include "config.h" #include #include #include #include "trueprint.h" #include "main.h" #include "lang_c.h" #include "lang_cxx.h" #include "lang_report.h" #include "lang_sh.h" #include "lang_pascal.h" #include "lang_java.h" #include "lang_perl.h" #include "lang_pike.h" #include "lang_text.h" #include "lang_verilog.h" #include "options.h" #include "utils.h" #include "language.h" boolean restart_language; short braces_depth; char *language_list = "arguments to --language:\n" " c C\n" " v Verilog\n" " cxx C++\n" " report trueprint report file\n" " sh shell\n" " pascal Pascal\n" " perl Perl\n" " pike Pike\n" " java Java\n" " text plain text\n" " list compiler or assembler listing file\n" " pseudoc C pseudocode\n"; /* * Private part */ typedef enum { NO_LANGUAGE, C, CXX, PSEUDOC, REPORT, SHELL, PASCAL, PERL, PIKE, LIST, TEXT, JAVA, VERILOG } languages; get_char_fn get_char; static languages language; static void set_language_opt(const char *prefix, const char *option, char *value); static void set_language_default(char *value); static languages filename_to_language(char *); /****************************************************************************** * Function: * setup_language */ void setup_language(void) { language = NO_LANGUAGE; string_option("t", "language", NULL, NULL, &set_language_opt, &set_language_default, OPT_MISC, "treat input as language. Use --help languages for list."); } /****************************************************************************** * Function: * set_language_default */ void set_language_default(char *value) { if (value == NULL) language = NO_LANGUAGE; else if (strcmp(value,"c") == 0) language = C; else if (strcmp(value,"v") == 0) language = VERILOG; else if (strcmp(value,"cxx") == 0) language = CXX; else if (strcmp(value,"report") == 0) language = REPORT; else if (strcmp(value,"sh") == 0) language = SHELL; else if (strcmp(value,"pascal") == 0) language = PASCAL; else if (strcmp(value,"perl") == 0) language = PERL; else if (strcmp(value,"pike") == 0) language = PIKE; else if (strcmp(value,"java") == 0) language = JAVA; else if (strcmp(value,"text") == 0) language = TEXT; else if (strcmp(value,"list") == 0) language = LIST; else if (strcmp(value,"pseudoc") == 0)language = PSEUDOC; else { fprintf(stderr, gettext(CMD_NAME ": unrecognized language type: %s\n"), value); exit(1); } } /****************************************************************************** * Function: * set_language_opt */ void set_language_opt(const char *prefix, const char *option, char *value) { set_language_default(value); } /****************************************************************************** * Function: * filename_to_language */ languages filename_to_language(char *filename) { languages retval; char *suffix; dm('l',2,"Finding language for filename %s\n",filename); if ((suffix = strrchr(filename,'.')) == (char *)0) { retval = TEXT; } else { dm('l',2,"Finding language for suffix %s\n",suffix); if (strcmp(suffix,".c") == 0) retval = C; else if (strcmp(suffix,".v") == 0) retval = VERILOG; else if (strcmp(suffix,".h") == 0) retval = C; else if (strcmp(suffix,".cxx") == 0) retval = CXX; else if (strcmp(suffix,".cpp") == 0) retval = CXX; else if (strcmp(suffix,".cc") == 0) retval = CXX; else if (strcmp(suffix,".C") == 0) retval = CXX; /* James Card */ else if (strcmp(suffix,".hpp") == 0) retval = CXX; else if (strcmp(suffix,".H") == 0) retval = CXX; /* James Card */ else if (strcmp(suffix,".pc") == 0) retval = PSEUDOC; else if (strcmp(suffix,".ph") == 0) retval = PSEUDOC; else if (strcmp(suffix,".rep") == 0) retval = REPORT; else if (strcmp(suffix,".sh") == 0) retval = SHELL; else if (strcmp(suffix,".pas") == 0) retval = PASCAL; else if (strcmp(suffix,".pl") == 0) retval = PERL; else if (strcmp(suffix,".pm") == 0) retval = PERL; else if (strcmp(suffix,".pmod") == 0) retval = PIKE; else if (strcmp(suffix,".pike") == 0) retval = PIKE; else if (strcmp(suffix,".java") == 0) retval = JAVA; else if (strcmp(suffix,".lst") == 0) retval = LIST; else retval = TEXT; } dm('l',2,"Language is %d\n",retval); return retval; } /****************************************************************************** * Function: * language_defaults */ char * language_defaults(char *filename) { char *retval; switch((language!=NO_LANGUAGE) ? language : filename_to_language(filename)) { case C: retval = lang_c_defaults; break; case VERILOG: retval = lang_verilog_defaults; break; case CXX: retval = lang_cxx_defaults; break; case PSEUDOC: retval = lang_pc_defaults; break; case REPORT: retval = lang_report_defaults; break; case SHELL: retval = lang_sh_defaults; break; case PASCAL: retval = lang_pascal_defaults; break; case PERL: retval = lang_perl_defaults; break; case PIKE: retval = lang_pike_defaults; break; case JAVA: retval = lang_java_defaults; break; case TEXT: retval = lang_text_defaults; break; case LIST: retval = lang_list_defaults; break; default: abort(); } return retval; } /****************************************************************************** * Function: * set_get_char * Called for each file to set get_char appropriately. language must be * set. */ void set_get_char(char *filename) { /* * restart_language is used to tell the language-specific routines * to reset */ restart_language = TRUE; switch((language!=NO_LANGUAGE) ? language : filename_to_language(filename)) { case C: get_char = get_c_char; break; case VERILOG: get_char = get_verilog_char; break; case CXX: get_char = get_cxx_char; break; case PSEUDOC: get_char = get_pc_char; break; case REPORT: get_char = get_report_char; break; case SHELL: get_char = get_sh_char; break; case PASCAL: get_char = get_pascal_char; break; case PERL: get_char = get_perl_char; break; case PIKE: get_char = get_pike_char; break; case JAVA: get_char = get_java_char; break; case TEXT: get_char = get_text_char; break; case LIST: get_char = get_text_char; break; default: abort(); } } trueprint-5.3/src/postscript.h0000644000076400007640000000102607052654426012271 /* * Include file: * postscript.h */ extern boolean no_show_indent_level; extern boolean no_show_line_number; extern void setup_postscript(void); extern void init_postscript(void); extern void PS_header(char *, boolean); extern boolean PS_endpage(boolean print_page); extern void PS_startpage(char *h1, char *h2, char *h3, char *f1, char *f2, char *f3, char *message, long page_no,long hdr_total_pages,boolean index_page); extern void PS_end_output(void); extern void PS_pagesize(char *printer, int *width_ptr, int *length_ptr); trueprint-5.3/src/diffs.h0000644000076400007640000000042407052654426011153 /* * Source file: * diffs.h */ extern void setup_diffs(void); extern void init_diffs(char newfile[]); extern void end_diffs(void); extern boolean getdelline(long current_line, char *input_line, char_status input_status[]); extern boolean line_inserted(long current_line); trueprint-5.3/src/input.h0000644000076400007640000000042707052654426011222 /* * Source file: * input.h */ extern long char_number; extern int got_some_input; extern boolean set_input_stream(int); extern stream_status getnextchar(char *); extern void ungetnextchar(char, stream_status); extern void setup_input(void); extern void init_input(void); trueprint-5.3/src/lang_pike.c0000644000076400007640000002131507052654426012006 /* * Source file: * lang_pike.c * * Contains get_pike_char(), which parses pike code. */ #include "config.h" #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_pike.h" /* * Public part */ char lang_pike_defaults[] = "--f --F --i"; /* * Private part */ typedef enum { IP_CODE, IP_COMMENT_START, IP_COMMENT, IP_COMMENT_LINE, IP_COMMENT_END, IP_STRING, IP_QUOTE_STRING, IP_ESCAPED } pike_ip_states; typedef enum { FN_INITIAL_SPACE, FN_FINAL_CHARS, FN_NAME, FN_CHAINED_NAME, FN_TRAIL_SPACE, FN_OPEN_BRACKET, FN_DBL_OPEN_BRACKET, FN_CLOSE_BRACKET, FN_ARG, FN_SEMICOLON, FN_BODY, FN_MACRO, FN_MACRO_ESCAPED } pike_fn_states; int is_pike_reserved_word(char *fn_name) { if( (strcmp(fn_name,"if")==0) || (strcmp(fn_name,"class")==0) || (strcmp(fn_name,"else")==0) || (strcmp(fn_name,"do")==0) || (strcmp(fn_name,"while")==0) || (strcmp(fn_name,"for")==0) || (strcmp(fn_name,"foreach")==0) || (strcmp(fn_name,"catch")==0) || (strcmp(fn_name,"int")==0) || (strcmp(fn_name,"array")==0) || (strcmp(fn_name,"object")==0) || (strcmp(fn_name,"program")==0) || (strcmp(fn_name,"multiset")==0) || (strcmp(fn_name,"mapping")==0) || (strcmp(fn_name,"string")==0) || (strcmp(fn_name,"float")==0) || (strcmp(fn_name,"constant")==0) || (strcmp(fn_name,"switch")==0) ) { return 1; } return 0; } /* * get_pike_char() * detects comment starts and ends; * finds function names; * detects function ends; */ stream_status get_pike_char(char *input_char, char_status *status) { static pike_ip_states state=IP_CODE; static pike_ip_states saved_state; pike_ip_states old_state=state; stream_status retval; static pike_fn_states fn_state; static pike_fn_states saved_fn_state; static short fn_name_index; static char fn_name[SYMBOL_LEN] = "UNINITIALIZED"; static long start_char, end_char; static long fn_page_number; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; saved_state = IP_CODE; fn_state = FN_INITIAL_SPACE; start_char = 0; end_char = 0; fn_page_number= 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case IP_CODE: switch (*input_char) { case '/': state = IP_COMMENT_START; { stream_status s; char c; s = getnextchar(&c); if ((c == '*') || (c == '/')) *status = CHAR_ITALIC; ungetnextchar(c,s); } break; case '{': braces_depth += 1; if ( (fn_state == FN_CLOSE_BRACKET) || (fn_state == FN_CHAINED_NAME) || (fn_state == FN_BODY) || (fn_state == FN_SEMICOLON) ) { if(!is_pike_reserved_word(fn_name)) { /* got function! */ add_function(fn_name,start_char,end_char,fn_page_number,current_filename); fn_state = FN_BODY; } fn_name_index = 0; } break; /*case '}': if (((braces_depth -= 1) == 0) && (fn_state == FN_BODY))*/ case '}': braces_depth -= 1; if (fn_state == FN_BODY) { end_function(page_number); retval|=STREAM_FUNCTION_END; fn_state = FN_INITIAL_SPACE; } break; case '"': state=IP_STRING; break; case '\'': state=IP_QUOTE_STRING; break; default: ; } break; case IP_COMMENT_START: switch (*input_char) { case '/': state=IP_COMMENT_LINE; *status=CHAR_ITALIC; break; case '*': state=IP_COMMENT; *status=CHAR_ITALIC; break; case '{': state=IP_CODE; braces_depth+=1; break; case '}': if ((braces_depth -= 1) == 0) retval|=STREAM_FUNCTION_END; break; default: state=IP_CODE; break; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case '*': state=IP_COMMENT_END; break; default: ; } break; case IP_COMMENT_LINE: *status = CHAR_ITALIC; switch (*input_char) { case '\n': state=IP_CODE; break; default: ; } break; case IP_COMMENT_END: *status = CHAR_ITALIC; switch (*input_char) { case '/': state=IP_CODE; break; case '*': break; default: state=IP_COMMENT; break; } break; case IP_STRING: switch (*input_char) { case '"': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; default: ; } break; case IP_QUOTE_STRING: switch (*input_char) { case '\'': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; default: ; } break; case IP_ESCAPED: state=saved_state; break; default: abort(); } if ((state == IP_CODE) && (old_state != IP_COMMENT_END)) switch (fn_state) { case FN_INITIAL_SPACE: if (isalpha(*input_char)) { fn_page_number = page_number; fn_name[fn_name_index++] = *input_char; start_char = char_number; fn_state = FN_NAME; } if (*input_char == '#') { saved_fn_state = fn_state; fn_state = FN_MACRO; } break; case FN_MACRO: if (*input_char == '\\') fn_state = FN_MACRO_ESCAPED; if (*input_char == '\n') fn_state = saved_fn_state; break; case FN_MACRO_ESCAPED: fn_state = FN_MACRO; break; case FN_NAME: if (isalnum(*input_char) || (*input_char == '_') || (*input_char == ':') || (*input_char == '~')) fn_name[fn_name_index++] = *input_char; else if (isspace(*input_char)) { fn_name[fn_name_index] = 0; end_char = char_number-1; if(!is_pike_reserved_word(fn_name)) { fn_state = FN_TRAIL_SPACE; } else { // if we don't reset this, then the returntype will // become part of the function name... fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } } else if (*input_char == '(') { fn_name[fn_name_index] = 0; end_char = char_number-1; if(!is_pike_reserved_word(fn_name)) { fn_state = FN_OPEN_BRACKET; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_CHAINED_NAME: /* * This state is a bit of a cheat - we stay in this state * until the other FSM finds a {. This may find more * methods than are strictly there, but it'll work in all * normal cases. */ break; case FN_TRAIL_SPACE: if (isspace(*input_char)) break; else if (*input_char == '(') { fn_name[fn_name_index] = 0; if(!is_pike_reserved_word(fn_name)) { fn_state = FN_OPEN_BRACKET; } } else if (isalpha(*input_char)) { fn_name_index = 0; fn_name[fn_name_index++] = *input_char; fn_page_number = page_number; start_char = char_number; fn_state = FN_NAME; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_OPEN_BRACKET: if (*input_char == '(') fn_state = FN_DBL_OPEN_BRACKET; if (*input_char == ')') fn_state = FN_CLOSE_BRACKET; break; case FN_DBL_OPEN_BRACKET: if (*input_char == ')') fn_state = FN_OPEN_BRACKET; break; case FN_CLOSE_BRACKET: if (isspace(*input_char)) { break; } else if (*input_char == ':') { fn_state = FN_CHAINED_NAME; } else if (isalpha(*input_char) || (*input_char == '[')) { /* check for [ in case of bp listings! */ fn_state = FN_ARG; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_ARG: if (*input_char == ';') fn_state = FN_SEMICOLON; /* Treat ] as a semicolon in case of bp listings */ if (*input_char == ']') fn_state = FN_SEMICOLON; break; case FN_SEMICOLON: if (isspace(*input_char)) break; if (*status == CHAR_ITALIC) break; /* Take care of arg ending in ...[]; */ if (*input_char != ';') fn_state = FN_ARG; break; case FN_BODY: break; default: abort(); } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/language.h0000644000076400007640000000050707052654426011645 /* * Header file: * language.h */ typedef stream_status (*get_char_fn)(char *, char_status *); extern get_char_fn get_char; extern boolean restart_language; extern short braces_depth; extern char *language_list; extern void setup_language(void); extern char *language_defaults(char *); extern void set_get_char(char *); trueprint-5.3/src/print_prompt.c0000644000076400007640000001477507052654426012626 /* * Source file: * print_prompt.c */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "index.h" #include "utils.h" #include "options.h" #include "output.h" #include "print_prompt.h" /* * Public part */ char *print_selection; /* * Private part */ static boolean check_selection(long page_no, char *filename); static boolean no_prompt_to_print; /* * Function: * setup_print_prompter() */ void setup_print_prompter(void) { string_option("A", "print-pages", NULL, &print_selection, NULL, NULL, OPT_PRINT, "specify list of pages to be printed"); boolean_option("a", "no-prompt", "prompt", TRUE, &no_prompt_to_print, NULL, NULL, OPT_PRINT, "don't prompt for each page, whether it should be printed or not", "prompt for each page, whether it should be printed or not"); } /* * Function: * print_prompt * * Returns whether or not this page should be printed. Uses * -a and -A information. */ boolean print_prompt(page_types type, long filepage_no, char *filename) { char *fn_name; char prompt[MAXLINELENGTH]; char response[INPUT_LINE_LEN]; char *response_ptr; boolean retval=UNSET; static int yes_count=0; static int no_count=0; static boolean all_yes=FALSE, all_no=FALSE; if (pass == 0) return FALSE; if (all_yes) return TRUE; if (all_no) return FALSE; if (print_selection != NULL) return check_selection(page_number, filename); if (yes_count != 0) { yes_count--; return TRUE; } if (no_count != 0) { no_count--; return FALSE; } if (no_prompt_to_print==FALSE) { switch(type) { case PAGE_BODY: fn_name = get_function_name(page_number); if (*fn_name) sprintf(prompt, "Print page %5ld, page %3ld of %s %s(%s%s)?", page_number, filepage_no, filename, page_changed(page_number)?"[changed]":"", fn_name, function_changed(page_number)?"[changed]":""); else sprintf(prompt, "Print page %5ld, page %3ld of %s %s?", page_number, filepage_no, filename, page_changed(page_number)?"[changed]":""); break; case PAGE_BLANK: sprintf(prompt, "Print blank page %5ld?", page_number+1); break; case PAGE_SPECIAL: sprintf(prompt, "Print %s?", filename); break; default: abort(); } while (retval == UNSET) { fprintf(stderr, gettext("%s [n] ? for help: "), prompt); fflush(stderr); fgets(response,INPUT_LINE_LEN-1,stdin); response_ptr = response; skipspaces(&response_ptr); switch (*response_ptr++) { case 'y': case 'Y': yes_count = strtol(response_ptr, &response_ptr, 10); if ((yes_count == 0) && (*response_ptr == '*')) all_yes = TRUE; if (yes_count == 1) yes_count = 0; retval = TRUE; break; case 'n': case 'N': no_count = strtol(response_ptr, &response_ptr, 10); if ((no_count == 0) && (*response_ptr == '*')) all_no = TRUE; if (no_count == 1) no_count = 0; /*FALLTHROUGH*/ case '\0': retval = FALSE; break; case 'p': case 'P': print_selection = strdup(response_ptr); retval = check_selection(page_number, filename); break; case '?': default: fprintf(stderr, "---------------------------------------------\n"); fprintf(stderr, gettext("y print this page\n")); fprintf(stderr, gettext("y print pages\n")); fprintf(stderr, gettext("y* print all remaining pages\n")); fprintf(stderr, gettext("n skip this page\n")); fprintf(stderr, gettext("n skip pages\n")); fprintf(stderr, gettext("n* skip all remaining pages\n")); fprintf(stderr, gettext("p print all remaining pages that match \n")); fprintf(stderr, gettext("? show this message\n\n")); fprintf(stderr, gettext("format for :\n")); fprintf(stderr, gettext(" comma-separated list of specifiers:\n")); fprintf(stderr, gettext(" print page \n")); fprintf(stderr, gettext(" - print all pages from page to \n")); fprintf(stderr, gettext(" print all pages for function\n")); fprintf(stderr, gettext(" f print function index\n")); fprintf(stderr, gettext(" F print file index\n")); fprintf(stderr, gettext(" c print cross reference info\n")); fprintf(stderr, gettext("e.g. p 1-3,main,5,6 will print pages 1,2,3,5,6 and all\n")); fprintf(stderr, gettext(" pages for function main.\n")); fprintf(stderr, "---------------------------------------------\n"); } } return retval; } return TRUE; } /* * Function: * check_selection * * Returns whether or not this page should be printed, using the -A * string. */ static boolean check_selection(long page_no, char *filename) { char *s_index = print_selection; long start_page, end_page; size_t name_length; char *fn_name = NULL; if (page_no != 0) fn_name = get_function_name(page_no); while (*s_index) { start_page = strtol(s_index, &s_index, 10); skipspaces(&s_index); if ((start_page != 0) && (*s_index == '-')) { s_index++; end_page = strtol(s_index, &s_index, 10); if ((start_page <= page_no) && (page_no <= end_page)) return TRUE; skipspaces(&s_index); } if ((start_page != 0) && ((*s_index == ',')||(*s_index == '\0'))) { if (start_page == page_no) return TRUE; } if ((start_page == 0) && (*s_index != '\0')) { name_length=0; while ((s_index[name_length] != ',') && (s_index[name_length] != '\0') && !isspace(s_index[name_length])) name_length++; if (name_length == 1) { switch (*s_index) { case 'f': if (filename && (strcmp(filename, "function index")==0)) return TRUE; break; case 'F': if (filename && (strcmp(filename, "file index")==0)) return TRUE; break; case 'd': if (page_changed(page_no)) return TRUE; break; case 'D': if (function_changed(page_no)) return TRUE; break; default: fprintf(stderr, gettext(CMD_NAME ": ignoring unrecognized letter %c\n"), *s_index); } } if (fn_name && (strlen(fn_name) == name_length) && (strncmp(get_function_name(page_no), s_index, name_length) == 0)) return TRUE; s_index += name_length; } skipspaces(&s_index); if (*s_index == ',') s_index++; skipspaces(&s_index); } return FALSE; } trueprint-5.3/src/expand_str.c0000644000076400007640000001603207052654426012224 /* * Source file: * expand_str.c */ #include "config.h" #if TM_IN_SYS_TIME # include #else # include #endif #include #include #include #include #include "trueprint.h" #include "main.h" #include "index.h" #include "debug.h" #include "output.h" #include "utils.h" #include "expand_str.h" /* * Public part */ /* * Private part */ static char *expand_character(char,boolean); static void add_string(char **, char *, size_t *); static void add_character(char **, char, size_t *); /***************************************************************************** * Function: * expand_string */ char * expand_string(char *original_string, boolean index_page) { static char *output_buffer=NULL; static size_t buffer_size = 100; char *current_char; if (original_string) dm('h', 5, "expand_string.c:expand_string() Expanding string %s\n", original_string); else dm('h', 5, "expand_string.c:expand_string() Expanding null string\n"); /* * Initialize output buffer */ if (output_buffer == NULL) output_buffer = xmalloc(100); *output_buffer = '\0'; if (original_string) { /* * Run through input string, expanding characters as necessary */ for (current_char = original_string; *current_char; current_char++) { if (*current_char != '%') { add_character(&output_buffer, *current_char, &buffer_size); continue; } add_string(&output_buffer, expand_character(*++current_char,index_page), &buffer_size); } } else { *output_buffer = '\0'; } dm('h', 5, "expand_string.c:expand_string Returning string %s\n", output_buffer); return output_buffer; } /***************************************************************************** * Function: * expand_character */ char * expand_character(char character, boolean index_page) { static char *output_buffer=NULL; static struct tm *t=NULL; static char *daynames[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static char *monnames[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; struct tm *ft; /* * Initialize time buffer */ if (t == NULL) { time_t now; if (!use_environment) { now = 387774000; t = gmtime(&now); } else { now = time((time_t *)NULL); t = localtime(&now); } } /* * Initialize output buffer */ if (output_buffer == NULL) output_buffer = xmalloc(100); *output_buffer = '\0'; switch (character) { case '%': /* percent character */ return "%"; case 'm': /* month of year */ sprintf(output_buffer, "%02d", t->tm_mon + 1); return output_buffer; case 'd': /* day of month */ sprintf(output_buffer, "%02d", t->tm_mday); return output_buffer; case 'y': /* year - four digits */ sprintf(output_buffer, "%4d", t->tm_year + 1900); return output_buffer; case 'D': /* date as mm/dd/yy */ sprintf(output_buffer, "%02d/%02d/%02d", t->tm_mon+1, t->tm_mday, t->tm_year); return output_buffer; case 'L': /* date as %a %h %d %T %y */ sprintf(output_buffer, "%s %s %02d %02d:%02d:%02d %4d", daynames[t->tm_wday], monnames[t->tm_mon], t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, t->tm_year + 1900); return output_buffer; case 'H': /* hour - 00 to 23 */ sprintf(output_buffer, "%02d", t->tm_hour); return output_buffer; case 'M': /* minute - 00 to 59 */ sprintf(output_buffer, "%02d", t->tm_min); return output_buffer; case 'S': /* second - 00 to 59 */ sprintf(output_buffer, "%02d", t->tm_sec); return output_buffer; case 'T': /* time as HH:MM:SS */ sprintf(output_buffer, "%02d:%02d:%02d", t->tm_hour, t->tm_min, t->tm_sec); return output_buffer; case 'j': /* day of year - 001 to 366 */ sprintf(output_buffer, "%3d", t->tm_yday); return output_buffer; case 'w': /* day of week - Sunday = 0 */ sprintf(output_buffer, "%d", t->tm_wday); return output_buffer; case 'a': /* abbreviated weekday - Sun to Sat */ return daynames[t->tm_wday]; case 'h': /* abbreviated month - Jan to Dec */ return monnames[t->tm_mon]; case 'r': /* time in AM/PM notation */ if (t->tm_hour > 12) sprintf(output_buffer, "%02d:%02dpm", t->tm_hour-12, t->tm_min); else sprintf(output_buffer, "%02d:%02dam", t->tm_hour, t->tm_min); return output_buffer; case 'p': /* page number in current file */ if (index_page) return ""; sprintf(output_buffer, "%ld", file_page_number); return output_buffer; case 'P': /* page number overall */ if (index_page) return ""; sprintf(output_buffer, "%ld", page_number); return output_buffer; case 'f': /* total page numbers in current file */ if (index_page) return ""; sprintf(output_buffer, "%ld", get_file_last_page(file_number) - get_file_first_page(file_number) + 1); return output_buffer; case 'c': /* short-form modified (changed) date of current file */ if (index_page) return ""; ft = get_file_modified_time(file_number); if (ft == NULL) return ""; sprintf(output_buffer, "%02d/%02d/%02d", ft->tm_mon+1, ft->tm_mday, ft->tm_year); return output_buffer; case 'C': /* long-form modified (changed) date of current file */ if (index_page) return ""; ft = get_file_modified_time(file_number); if (ft == NULL) return ""; sprintf(output_buffer, "%s %s %02d %02d:%02d:%02d %4d", daynames[ft->tm_wday], monnames[ft->tm_mon], ft->tm_mday, ft->tm_hour, ft->tm_min, ft->tm_sec, ft->tm_year + 1900); return output_buffer; case 'F': /* final page number overall */ if (index_page) return ""; sprintf(output_buffer, "%ld", total_pages); return output_buffer; case 'n': /* current filename */ if (index_page) return ""; return file_name(file_number); case 'N': /* current function name */ if (index_page) return ""; return get_function_name(page_number); case 'l': /* login name */ if (!use_environment) return "testuser"; { char *u = getenv("USER"); if (u == 0) return ""; else return u; } default: return "?"; } } static void add_string(char **buffer_ptr, char *string, size_t *bufflen_ptr) { size_t required_length; required_length = strlen(*buffer_ptr)+strlen(string)+1; if (required_length > *bufflen_ptr) { *buffer_ptr = xrealloc(*buffer_ptr, required_length); *bufflen_ptr = required_length; } strcat(*buffer_ptr, string); return; } static void add_character(char **buffer_ptr, char character, size_t *bufflen_ptr) { size_t required_length; required_length = strlen(*buffer_ptr)+2; if (required_length > *bufflen_ptr) { *buffer_ptr = xrealloc(*buffer_ptr, required_length); *bufflen_ptr = required_length; } (*buffer_ptr)[required_length-1] = '\0'; (*buffer_ptr)[required_length-2] = character; return; } trueprint-5.3/src/lang_c.c0000644000076400007640000002776407052654426011316 /* * Source file: * lang_c.c * * Contains get_c_char(), which parses C code. */ #include "config.h" #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_c.h" /* * Public part */ char lang_c_defaults[] = "--f --F --i"; char lang_pc_defaults[] = "--f --F --i"; /* * Private part */ typedef enum { IP_CODE, IP_COMMENT_START, IP_COMMENT, IP_COMMENT_LINE, IP_COMMENT_END, IP_STRING, IP_QUOTE_STRING, IP_ESCAPED } c_ip_states; typedef enum { FN_INITIAL_SPACE, FN_FINAL_CHARS, FN_NAME, FN_TRAIL_SPACE, FN_OPEN_BRACKET, FN_DBL_OPEN_BRACKET, FN_CLOSE_BRACKET, FN_ARG, FN_SEMICOLON, FN_BODY, FN_MACRO, FN_MACRO_ESCAPED } c_fn_states; /* * get_c_char() * detects comment starts and ends; * finds function names; * detects function ends; */ stream_status get_c_char(char *input_char, char_status *status) { static c_ip_states state=IP_CODE; static c_ip_states saved_state; c_ip_states old_state=state; stream_status retval; static c_fn_states fn_state; static c_fn_states saved_fn_state; static short fn_name_index; static char fn_name[SYMBOL_LEN] = "UNINITIALIZED"; static long start_char, end_char; static long fn_page_number; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; saved_state = IP_CODE; fn_state = FN_INITIAL_SPACE; start_char = 0; end_char = 0; fn_page_number= 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case IP_CODE: switch (*input_char) { case '/': state = IP_COMMENT_START; { stream_status s; char c; s = getnextchar(&c); if ((c == '*') || (c == '/')) *status = CHAR_ITALIC; ungetnextchar(c,s); } break; case '{': braces_depth += 1; if ((fn_state == FN_CLOSE_BRACKET) || (fn_state == FN_SEMICOLON)) { /* got function! */ add_function(fn_name,start_char,end_char,fn_page_number,current_filename); fn_name_index = 0; fn_state = FN_BODY; } break; case '}': if (((braces_depth -= 1) == 0) && (fn_state == FN_BODY)) { end_function(page_number); retval|=STREAM_FUNCTION_END; fn_state = FN_INITIAL_SPACE; } break; case '"': state=IP_STRING; break; case '\'': state=IP_QUOTE_STRING; break; default: ; } break; case IP_COMMENT_START: switch (*input_char) { case '/': state=IP_COMMENT_LINE; *status=CHAR_ITALIC; break; case '*': state=IP_COMMENT; *status=CHAR_ITALIC; break; case '{': state=IP_CODE; braces_depth+=1; break; case '}': if ((braces_depth -= 1) == 0) retval|=STREAM_FUNCTION_END; break; default: state=IP_CODE; break; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case '*': state=IP_COMMENT_END; break; default: ; } break; case IP_COMMENT_LINE: *status = CHAR_ITALIC; switch (*input_char) { case '\n': state=IP_CODE; break; default: ; } break; case IP_COMMENT_END: *status = CHAR_ITALIC; switch (*input_char) { case '/': state=IP_CODE; break; case '*': break; default: state=IP_COMMENT; break; } break; case IP_STRING: switch (*input_char) { case '"': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; default: ; } break; case IP_QUOTE_STRING: switch (*input_char) { case '\'': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; default: ; } break; case IP_ESCAPED: state=saved_state; break; default: abort(); } if ((state == IP_CODE) && (old_state != IP_COMMENT_END)) switch (fn_state) { case FN_INITIAL_SPACE: if (isalpha(*input_char)) { fn_page_number = page_number; fn_name[fn_name_index++] = *input_char; start_char = char_number; fn_state = FN_NAME; } if (*input_char == '#') { saved_fn_state = fn_state; fn_state = FN_MACRO; } break; case FN_MACRO: if (*input_char == '\\') fn_state = FN_MACRO_ESCAPED; if (*input_char == '\n') fn_state = saved_fn_state; break; case FN_MACRO_ESCAPED: fn_state = FN_MACRO; break; case FN_NAME: if (isalnum(*input_char) || (*input_char == '_')) fn_name[fn_name_index++] = *input_char; else if (isspace(*input_char)) { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_TRAIL_SPACE; } else if (*input_char == '(') { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_OPEN_BRACKET; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_TRAIL_SPACE: if (isspace(*input_char)) break; else if (*input_char == '(') { fn_name[fn_name_index] = 0; fn_state = FN_OPEN_BRACKET; } else if (isalpha(*input_char)) { fn_name_index = 0; fn_name[fn_name_index++] = *input_char; fn_page_number = page_number; start_char = char_number; fn_state = FN_NAME; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_OPEN_BRACKET: if (*input_char == '(') fn_state = FN_DBL_OPEN_BRACKET; if (*input_char == ')') fn_state = FN_CLOSE_BRACKET; break; case FN_DBL_OPEN_BRACKET: if (*input_char == ')') fn_state = FN_OPEN_BRACKET; break; case FN_CLOSE_BRACKET: if (isspace(*input_char)) break; /* check for [ in case of bp listings! */ else if (isalpha(*input_char) || (*input_char == '[')) fn_state = FN_ARG; else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_ARG: if (*input_char == ';') fn_state = FN_SEMICOLON; /* Treat ] as a semicolon in case of bp listings */ if (*input_char == ']') fn_state = FN_SEMICOLON; break; case FN_SEMICOLON: if (isspace(*input_char)) break; if (*status == CHAR_ITALIC) break; /* Take care of arg ending in ...[]; */ if (*input_char != ';') fn_state = FN_ARG; break; case FN_BODY: break; default: abort(); } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } /* * get_pc_char() * Weaker version of get_c_char() - ignores strings * detects comment starts and ends; * finds function names; * detects function ends; * returns one of the following: */ stream_status get_pc_char(char *input_char, char_status *status) { static c_ip_states state=IP_CODE; static c_ip_states saved_state=IP_CODE; c_ip_states old_state=state; stream_status retval; static c_fn_states fn_state=FN_INITIAL_SPACE; static c_fn_states saved_fn_state; static short fn_name_index=0; static char fn_name[SYMBOL_LEN] = "UNINITIALIZED"; static long start_char=0, end_char=0; static long fn_page_number=0; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; saved_state = IP_CODE; fn_state = FN_INITIAL_SPACE; fn_name_index = 0; start_char = 0; end_char = 0; fn_page_number= 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case IP_CODE: switch (*input_char) { case '/': state = IP_COMMENT_START; break; case '{': braces_depth += 1; if ((fn_state == FN_CLOSE_BRACKET) || (fn_state == FN_SEMICOLON)) { /* got function! */ add_function(fn_name,start_char,end_char,fn_page_number,current_filename); fn_name_index = 0; fn_state = FN_BODY; } break; case '}': if (((braces_depth -= 1) == 0) && (fn_state == FN_BODY)) { end_function(page_number); retval|=STREAM_FUNCTION_END; fn_state = FN_INITIAL_SPACE; } break; /* case '"': state=IP_STRING; break; */ /* case '\'': state=IP_QUOTE_STRING; break; */ default: ; } break; case IP_COMMENT_START: switch (*input_char) { case '/': break; case '*': state=IP_COMMENT; { stream_status s; char c; s = getnextchar(&c); if (c == '*') *status = CHAR_ITALIC; ungetnextchar(c,s); } break; case '{': state=IP_CODE; braces_depth+=1; break; case '}': if ((braces_depth -= 1) == 0) retval|=STREAM_FUNCTION_END; break; default: state=IP_CODE; break; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case '*': state=IP_COMMENT_END; break; default: ; } break; case IP_COMMENT_END: *status = CHAR_ITALIC; switch (*input_char) { case '/': state=IP_CODE; break; case '*': break; default: state=IP_COMMENT; break; } break; /* * case IP_STRING: * switch (*input_char) { * case '"': state=IP_CODE; break; * case '\\': saved_state=state; state=IP_ESCAPED; break; * } * break; */ /* * case IP_QUOTE_STRING: * switch (*input_char) { * case '\'': state=IP_CODE; break; * case '\\': saved_state=state; state=IP_ESCAPED; break; * } * break; */ case IP_ESCAPED: state=saved_state; break; default: abort(); } if ((state == IP_CODE) && (old_state != IP_COMMENT_END)) switch (fn_state) { case FN_INITIAL_SPACE: if (isalpha(*input_char)) { fn_page_number = page_number; fn_name[fn_name_index++] = *input_char; start_char = char_number; fn_state = FN_NAME; } if (*input_char == '#') { saved_fn_state = fn_state; fn_state = FN_MACRO; } break; case FN_MACRO: if (*input_char == '\\') fn_state = FN_MACRO_ESCAPED; if (*input_char == '\n') fn_state = saved_fn_state; break; case FN_MACRO_ESCAPED: fn_state = FN_MACRO; break; case FN_NAME: if (isalnum(*input_char) || (*input_char == '_')) fn_name[fn_name_index++] = *input_char; else if (isspace(*input_char)) { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_TRAIL_SPACE; } else if (*input_char == '(') { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_OPEN_BRACKET; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_TRAIL_SPACE: if (isspace(*input_char)) break; else if (*input_char == '(') { fn_name[fn_name_index] = 0; fn_state = FN_OPEN_BRACKET; } else if (isalpha(*input_char)) { fn_name_index = 0; fn_name[fn_name_index++] = *input_char; fn_page_number = page_number; start_char = char_number; fn_state = FN_NAME; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_OPEN_BRACKET: if (*input_char == '(') fn_state = FN_DBL_OPEN_BRACKET; if (*input_char == ')') fn_state = FN_CLOSE_BRACKET; break; case FN_DBL_OPEN_BRACKET: if (*input_char == ')') fn_state = FN_OPEN_BRACKET; break; case FN_CLOSE_BRACKET: if (isspace(*input_char)) break; else /* check for [ in case of bp listings! */ if (isalpha(*input_char) || (*input_char == '[')) fn_state = FN_ARG; else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_ARG: if (*input_char == ';') fn_state = FN_SEMICOLON; /* Treat ] as a semicolon in case of bp listings */ if (*input_char == ']') fn_state = FN_SEMICOLON; break; case FN_SEMICOLON: if (isspace(*input_char)) break; if (*status == CHAR_ITALIC) break; /* Take care of arg ending in ...[]; */ if (*input_char != ';') fn_state = FN_ARG; break; case FN_BODY: break; default: abort(); } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/lang_pike.h0000644000076400007640000000021307052654426012005 /* * Include file: * lang_pike.h */ extern stream_status get_pike_char(char *, char_status *); extern char lang_pike_defaults[]; trueprint-5.3/src/main.c0000644000076400007640000006007207322205501010766 /* * Source file: * main.c * * Contains the main program body for trueprint. The structure of the code * is very simple - main() initialises various things, using handle_options() * to read options and set up defaults. Then it calls print_page() until * the end of input without printing anything (first pass) to get page numbers * & etc. for the indices. The two indices are then printed, followed by * the second pass when the text is printed out by once again calling * print_page() until end of input. * * Exit codes: * 0 Normal exit * 1 Bad parameters * 2 Internal error or resource problem */ #include "config.h" #ifdef MSWIN #include #include #include #endif #include #include #include #include #include #include #if HAVE_FCNTL_H # include #endif #ifndef O_RDONLY # define O_RDONLY 0 #endif #include #if HAVE_UNISTD_H # include #else int close(int fildes); int dup(int fildes); #endif #include "trueprint.h" #include "options.h" #include "debug.h" #include "diffs.h" #include "index.h" #include "language.h" #include "postscript.h" #include "output.h" #include "openpipe.h" #include "printers_fl.h" #include "print_prompt.h" #include "input.h" #include "headers.h" #include "utils.h" #include "main.h" /****************************************************************************** * Public part */ unsigned int no_of_files; char *current_filename; short pass; unsigned int file_number; long total_pages; int page_width; int page_length; boolean use_environment; /* * Private variables */ static boolean no_print_body; static boolean no_print_file_index; static boolean no_print_function_index; static char *destination; static char *printer_destination; static short no_of_copies; static char **file_names; static char *output_filename; static boolean redirect_output; /* * Functions */ int main(int, char**); static void setup_main(void); static void print_files(void); static void set_dest(const char *p, const char *o, char *value); static void set_dest_default(char *value); static void print_help(const char *p, const char *o, char *value); static void print_version(const char *p, const char *o); #ifdef LOGTOOL static void write_log(void); #else #define write_log() #endif /****************************************************************************** * Function: * main * * Analyse parameters, * Sort out font and page size, * perform first pass to sort out function names, etc., * sort out output stream (either stdout or x9700|opr) * print the index pages, * perform second pass, printing out pages. */ int main(int argc, char **argv) { unsigned int last_param_used; int pipe_handle = -1; #ifdef MSWIN FILE *pipe_fhandle = NULL; #endif /* * Need to set this here as it is used by setup_printers_fl() */ use_environment = TRUE; /* * Set up various modules, including option declaration. * setup_options() must come first. */ setup_options(); setup_debug(); setup_input(); setup_diffs(); setup_headers(); setup_index(); setup_language(); setup_output(); setup_postscript(); setup_printers_fl(); setup_print_prompter(); setup_main(); /* * Handle command line options. */ /* * use_environment is itself used when setting options, so * initialize it here. The default is to use environment stuff, * so set it to 1 (true). */ use_environment = 1; /* * Note that the debug option will not be set before this line - the dm * function should not be called before this function call. */ last_param_used = handle_options(argc, argv); /* * Next check $TP_OPTS to see if the user has customised anything... */ dm('o',1,"Looking at TP_OPTS options\n"); handle_string_options(getenv("TP_OPTS")); /* * Write the log file - this doesn't do anything if LOGTOOL * is not defined */ write_log(); /* * Set file_names to the first unused parameter - all remaining * parameters are source file names. */ dm('P',1,"Checking parameters\n"); if (last_param_used < (unsigned int)argc) { file_names = &(argv[last_param_used]); no_of_files = (unsigned int)argc - last_param_used; dm('P',1,"Got %d file names\n", no_of_files); } else { /* * No file names - use a list with just "-" for stdin */ static char *stdin_filenames[] = { "-", 0 }; file_names = stdin_filenames; no_of_files = 1; dm('P',1,"No filenames - reading stdin\n"); } /* * End of the user options, so set the default options for * the language. * If language has been set then this will use it instead of filename. */ dm('l',1,"Setting language for filename %s\n", file_names[0]); handle_string_options(language_defaults(file_names[0])); /* * Now set up the other defaults that haven't been overridden yet. * DEFAULT_OPTS used to be the mechanism for setting defaults - * now (v3.7) it has been replaced by set_option_defaults(), * but DEFAULT_OPTS is kept in case somebody wants to override * the default defaults in trueprint.h. Note that if --ignore-environment * is set then the defaults from DEFAULT_OPTS are ignored; otherwise * make check would fail if DEFAULT_OPTS is not empty. */ dm('o',1,"Setting default options\n"); if (use_environment) handle_string_options(DEFAULT_OPTS); set_option_defaults(); /* * And finally calculate the page dimensions. */ PS_pagesize(destination, &page_width, &page_length); dm('O',1,"Page width is %d, page length is %d\n", page_width, page_length); /* * If redirect_output is set then calculate the output filename. * Do it now so we can catch the error condition that redirect-output * is being used with stdin. */ if (redirect_output) { if (strcmp(file_names[0],"-") == 0) { fprintf(stderr, gettext(CMD_NAME ": cannot use redirect-output option with stdin\n")); exit(1); } /* Grab a buffer long enough for filename plus .ps plus NULL */ output_filename = xmalloc(strlen(file_names[0])+4); strcpy(output_filename,file_names[0]); /* Add .ps to the filename */ { char *suffix; /* point suffix to the dot, if any, in the filename */ suffix = strrchr(output_filename,'.'); /* If there is no . in filename then point suffix to the string end */ if (suffix == NULL) { suffix = output_filename+strlen(output_filename); } /* Now write .ps to the end of the string */ *(suffix++) = '.'; *(suffix++) = 'p'; *(suffix++) = 's'; *(suffix++) = '\0'; } dm('O',1,"main.c:main() Redirecting output to %s\n",output_filename); } /* * Perform first pass to get function names and locations. */ dm('p', 1, "Starting first pass\n"); pass = 0; init_postscript(); print_files(); total_pages = page_number; if (!got_some_input) { fprintf(stderr, gettext(CMD_NAME ": empty input, not submitting print job\n")); exit(1); } dm('p', 1, "Starting second pass\n"); pass = 1; init_postscript(); /* * Now set up output stream to print command. Put the filehandle into * pipe_handle. */ if ((strlen(output_filename) > 0) && (strcmp(output_filename,"-") != 0)) { #ifdef MSWIN pipe_handle = _creat(output_filename, _S_IREAD | _S_IWRITE ); #else pipe_handle = creat(output_filename, 0666); #endif if (pipe_handle == -1) { fprintf(stderr, gettext(CMD_NAME ": cannot open %s for writing, %s\n"), output_filename, strerror(errno)); exit(1); } /* now dup the pipe_handle into stdout so all stdout goes to the pipe */ #ifdef MSWIN if (!((close(1) == 0) && (_dup(pipe_handle) == 1))) abort(); #else if (!((close(1) == 0) && (dup(pipe_handle) == 1))) abort(); #endif dm('O',1,"Sending output to %s\n",output_filename); } #if defined(PRINT_CMD) else if (strcmp(output_filename,"-") == 0) #else else #endif { /* * In the case that the output filename is "-" or there isn't a print * command, leave stdout alone so that all output goes simply to stdout. */ } #if defined(PRINT_CMD) else { char print_cmd_line[200]; char *tp_print_cmd = getenv("TP_PRINT_CMD"); dm('P',1,"Setting up pipe for printer\n"); if ((tp_print_cmd != NULL) && (*tp_print_cmd != '\0')) { sprintf(print_cmd_line,"%s", getenv("TP_PRINT_CMD")); } else { sprintf(print_cmd_line,"%s %s %s%d", PRINT_CMD, printer_destination, PRINT_CMD_COUNT_FLAG, no_of_copies); } dm('P',1,"Printer command is %s\n", print_cmd_line); #ifdef MSWIN pipe_fhandle = _popen(print_cmd_line, "w"); if (pipe_fhandle == NULL) abort(); /* now dup the pipe_handle into stdout so all stdout goes to the pipe */ if (!((close(1) == 0) && (dup(_fileno(pipe_fhandle)) == 1))) abort(); #else /* openpipe exits on failure, so don't bother to check return code */ pipe_handle = openpipe(print_cmd_line, "w"); /* now dup the pipe_handle into stdout so all stdout goes to the pipe */ if (!((close(1) == 0) && (dup(pipe_handle) == 1))) abort(); #endif } #endif /* defined(PRINT_CMD) */ /* * Print out the Postscript header * If use_environment is not set, use an old version id */ dm('P',1,"Print out postscript header\n"); PS_header(use_environment?VERSION:"3.6.5", !no_print_body); /* * These function calls do precisely what you think they do... */ dm('i',1,"sort function names & print indices if necessary\n"); sort_function_names(); if ((no_print_function_index == FALSE) && (print_prompt(PAGE_SPECIAL, 0, "function index") == TRUE)) print_index(); if ((no_of_files > 1) && (no_print_file_index == FALSE) && (print_prompt(PAGE_SPECIAL, 0, "file index") == TRUE)) print_out_file_index(); /* * Now perform second pass to print out listings. */ if (no_print_body == FALSE) { print_files(); } /* * Finish up the postscript output */ PS_end_output(); fflush(stdout); close(1); #ifdef MSWIN if (pipe_fhandle != NULL) _pclose(pipe_fhandle); #else if (pipe_handle != -1) closepipe(pipe_handle); #endif return(0); } /****************************************************************************** * Function: * print_files * Print files one at a time, opening the file and setting the stream * for the input routines. Sets global variables current_filename * and file_number. */ void print_files(void) { int stream; static int stdin_stream = -1; init_input(); init_output(); for (file_number = 0; file_names[file_number]; file_number++) { current_filename = file_names[file_number]; dm('p', 3, "Looking at file %s\n", current_filename); if (strcmp(current_filename, "-") == 0) { if (pass == 0) { /* * Create a temporary file and copy stdin to it, then use it. * Note that we can only use stdin once. */ char input_buffer[BUFFER_SIZE]; int buffer_size; if (stdin_stream != -1) { fprintf(stderr, gettext(CMD_NAME ": cannot specify stdin twice on command line\n")); exit(1); } stdin_stream = fileno(tmpfile()); while ((buffer_size = read(fileno(stdin),input_buffer,BUFFER_SIZE)) > 0) { if (write (stdin_stream, input_buffer, buffer_size) <= 0) { perror(CMD_NAME ": cannot write to tmp file"); exit(1); } } } if (lseek(stdin_stream,0,SEEK_SET) == (off_t)-1) perror(CMD_NAME ": cannot seek to start of tmp file"); stream = stdin_stream; } else if ((stream = open(file_names[file_number], O_RDONLY)) == -1) { fprintf(stderr, gettext(CMD_NAME ": cannot open file %s, %s\n"), current_filename, strerror(errno)); exit(1); } dm('f',3,"Opened stream %d to read file %s\n",stream,file_names[file_number]); if (pass==0) { dm('i',3,"Pass file %s to index module\n",current_filename); add_file(current_filename, file_number, page_number+1); } /* * set_input_stream will return FALSE if there is something wrong * with the file, e.g. if it is empty. */ if (set_input_stream(stream)) { dm('d',3,"Init diffs for pass %d, file %s\n", pass, current_filename); init_diffs(current_filename); print_file(); dm('d',3,"Ending diffs for pass %d, file %s\n", pass, current_filename); end_diffs(); } else { fprintf(stderr, gettext(CMD_NAME ": cannot read %s - possibly an empty file\n"), current_filename); } /* Close file unless it was tmp file storing stdin */ if (strcmp(file_names[file_number],"-") != 0) { if (close(stream) == -1) { fprintf(stderr, gettext(CMD_NAME ": cannot close %s, %s\n"), file_names[file_number],strerror(errno)); exit(1); } } if (pass==0) { dm('i',3,"End file for index module\n"); end_file(file_number, page_number); } } } /****************************************************************************** * Function: * setup_main * Simply declare options and initialize global variables */ void setup_main(void) { page_width = -1; page_length = -1; destination=NULL; printer_destination = ""; no_of_copies = -1; /* * -d and -P have the same meaning - one is from SYSV and the other * is from Berkeley */ string_option("d", "printer", "", NULL, &set_dest, &set_dest_default, OPT_OUTPUT, "use printer "); string_option("P", "printer", "", NULL, &set_dest, &set_dest_default, OPT_OUTPUT, "use printer "); string_option("s", "output", "", &output_filename, NULL, NULL, OPT_OUTPUT, "send output to filename ; use - for stdout"); boolean_option("r", "redirect-output", "no-redirect-output", FALSE, &redirect_output, NULL, NULL, OPT_OUTPUT, "redirect output to .ps file named after first filename", "don't redirect output"); short_option("c", "copies", 1, NULL, 0, 1, 200, &no_of_copies, NULL, NULL, OPT_OUTPUT, "specify number of copies to be printed", NULL); boolean_option("F", "no-file-index", "file-index", FALSE, &no_print_file_index, NULL, NULL, OPT_PRINT, "don't print file index", "print file index"); boolean_option("f", "no-function-index", "function-index", FALSE, &no_print_function_index, NULL, NULL, OPT_PRINT, "don't print function index", "print function index"); optional_string_option("H", "help", &print_help, OPT_MISC, "Type help information\n" " --help=all-options - list all options\n" " --help=misc-options - list miscellaneous options\n" " --help=page-furniture-options - list page furniture options\n" " --help=text-format-options - list text formatting options\n" " --help=print-options - list options that select what to print\n" " --help=page-format-options - list page format options\n" " --help=output-options - list options that affect where output goes\n" " --help=language - list languages\n" " --help=prompt - format for --print-pages string\n" " --help=debug - format for --debug string\n" " --help=header - format for header & footer strings\n" " --help=report - file format for --language=report input\n" " --help=environment - list environment vars used" ); noparm_option("V", "version", FALSE, &print_version, NULL, OPT_MISC, "Type version information"); boolean_option("B", "no-print-body", "print-body", FALSE, &no_print_body, NULL, NULL, OPT_PRINT, "don't print body of text", "print body of text"); boolean_option("N", "use-environment", "ignore-environment", TRUE, &use_environment, NULL, NULL, OPT_MISC, "use environment variables", "don't use values from environment, such as time,\n" " $USER, etc. This is for test purposes, to make test results\n" " more reproducible"); int_option("w", "line-wrap", -1, "no-line-wrap", 0, -1, 200, &page_width, NULL, NULL, OPT_TEXT_FORMAT, "specify the line-wrap column.", "turn off line-wrap"); int_option("l", "page-length", -1, NULL, 0, 5, 200, &page_length, NULL, NULL, OPT_TEXT_FORMAT, "specify number of lines on a page, point size is\n" " calculated appropriately", NULL); } /****************************************************************************** * Function: * set_dest_default * Handler for -d option to set default */ void set_dest_default(char *value) { set_dest(NULL,NULL,value); } /****************************************************************************** * Function: * set_dest * Handler for -d option */ void set_dest(const char *p, const char *o, char *value) { #ifdef PRINT_CMD if (destination) return; if (*value == '\0') { destination = getenv("PRINTER"); } else { destination = strdup(value); } dm('O',1,"Setting destination to %s\n",destination); if (destination && (*destination != '\0')) { printer_destination = xmalloc(strlen(destination)+strlen(PRINT_CMD_DEST_FLAG)+2); sprintf(printer_destination, "%s %s", PRINT_CMD_DEST_FLAG, destination); } else { printer_destination = ""; } #else return; #endif } /****************************************************************************** * Function: * print_help * Handler for -H option */ void print_help(const char *p, const char *o, char *value) { if (value) { printf(gettext("Help for %s:\n"),value); if (strcmp(value,"all-options") == 0) { print_usage_msgs(OPT_MISC); print_usage_msgs(OPT_PAGE_FURNITURE); print_usage_msgs(OPT_TEXT_FORMAT); print_usage_msgs(OPT_PRINT); print_usage_msgs(OPT_PAGE_FORMAT); print_usage_msgs(OPT_OUTPUT); } else if (strcmp(value,"misc-options") == 0) { print_usage_msgs(OPT_MISC); } else if (strcmp(value,"page-furniture-options") == 0) { print_usage_msgs(OPT_PAGE_FURNITURE); } else if (strcmp(value,"text-format-options") == 0) { print_usage_msgs(OPT_TEXT_FORMAT); } else if (strcmp(value,"print-options") == 0) { print_usage_msgs(OPT_PRINT); } else if (strcmp(value,"page-format-options") == 0) { print_usage_msgs(OPT_PAGE_FORMAT); } else if (strcmp(value,"output-options") == 0) { print_usage_msgs(OPT_OUTPUT); } else if (strcmp(value,"language") == 0) { printf("%s",gettext(language_list)); } else if (strcmp(value,"environment") == 0) { printf("%s", gettext( " Environment variables used by trueprint:\n" " TP_DIFF_CMD: command used to generate diffs, devault is diff\n" " USER: username for headers, footers, coversheet, etc.\n" " TP_OPTS: default trueprint options, overridden by command line opts\n" " TP_PRINT_CMD: command used to print output, default is lp or lpr\n" " PRINTER: name of printer to send output to\n" )); } else if (strcmp(value,"prompt") == 0) { printf("%s", gettext( "--print-pages \n" " Format for :\n" " is a comma separated list of specifiers. A specifier can be\n" " a single page number, a range of page numbers, a function name, or a\n" " special letter:\n" " A range of pages is specified by the lower number, then a dash, then the\n" " upper number\n" " A special letter can be d, D, f, F or c for\n" " changed pages, changed functions, function index, file index or cross\n" " reference information respectively - note that the page will only be printed\n" " if it would have been printed without the -A option\n" " For example: trueprint --print-pages 1-5,main,f main.c\n" " will print out pages 1-5, all pages for function main, and the function index\n")); } else if (strcmp(value,"header") == 0) { printf("%s", gettext( " Format for :\n" " is used to specify header and footer contents, and can contain the\n" " following sequences:\n" " %% a percent character\n" " %m month of year\n" " %d day of month\n" " %y year e.g. 1993\n" " %D date mm/dd/yy\n" " %L long date e.g. Fri Oct 8 11:49:51 1993\n" " %c file modification date mm/dd/yy\n" " %C file modification date in long format\n" " %H hour\n" " %M minute\n" " %S second\n" " %T time HH:MM:SS\n" " %j day of year ddd\n" " %w day of week (Sunday = 0)\n" " %a abbreviated weekday\n" " %h abbreviated month\n" " %r time in am/pm notation\n" " %p page number in current file\n" " %P overall page number\n" " %f number of pages in current file\n" " %F final overall page number\n" " %n current filename\n" " %N current functionname\n" " %l login name\n")); } else if (strcmp(value,"debug") == 0) { printf("%s", gettext( " Format for : series of char/digit pairs where char\n" " specifies information, digit specifies level of detail, in\n" " general 1=stuff that happens once, 2=per-pass, 3=per-file,\n" " 4=per-page, 8=per-line - but this is not fully implemented...\n" " Current chars are: o=options, i=index, O=output, P=parameters\n" " l=language, p=pass, h=headers/footers, I=input,\n" " d=diffs, f=file/stream handling, D=destination/printer\n" " @=all of the above\n")); } else if (strcmp(value,"report") == 0) { printf("%s", gettext( " Format for files when using --language=report:\n" " Strings between ^B amd ^E are printed in bold and\n" " are indexed as function names.\n" " Strings between ^C and ^C are printed in italics\n" )); } else { printf(gettext(CMD_NAME ": Unrecognized help option:%s\nUse --help for valid options\n"),value); } } else { printf("%s", gettext( "Usage: trueprint \n" "For details see:\n" " --help=all-options - list all options\n" " --help=misc-options - list miscellaneous options\n" " --help=page-furniture-options - list page furniture options\n" " --help=text-format-options - list text formatting options\n" " --help=print-options - list options that select what to print\n" " --help=page-format-options - list page format options\n" " --help=output-options - list options that affect where output goes\n" " --help=language - list languages\n" " --help=prompt - format for --print-pages string\n" " --help=debug - format for --debug string\n" " --help=header - format for header & footer strings\n" " --help=report - file format for --language=report input\n" " --help=environment - list environment vars used\n" )); } printf(gettext("Report bugs to bug-trueprint@gnu.org\n")); exit(0); } /****************************************************************************** * Function: * print_version * Handler for -V option */ void print_version(const char *p, const char *o) { printf("GNU Trueprint %s\n", VERSION); printf(gettext( "Copyright (C) 1999 Free Software Foundation, Inc.\n" "GNU Trueprint comes with NO WARRANTY,\n" "to the extent permitted by law.\n" "You may redistribute copies of GNU Trueprint\n" "under the terms of the GNU General Public License.\n" "For more information about these matters,\n" "see the file named COPYING.\n" )); exit(0); } #ifdef LOGTOOL /****************************************************************************** * Function: * write_log */ void write_log(void) { char *log_cmd; size_t log_cmd_length=COMMAND_LEN; char *tp_opts; int i; if (use_environment != TRUE) return; log_cmd = xmalloc(log_cmd_length); log_cmd[0] = '\0'; tp_opts = getenv("TP_OPTS"); sprintf(log_cmd,"%s %s", LOGTOOL, "trueprint"); if (tp_opts != NULL) sprintf(log_cmd, "%s %s%s%s", log_cmd, "TPOPTS=\"<",tp_opts,">\""); for (i=1; i log_cmd_length ) { log_cmd_length += COMMAND_LEN; log_cmd = xmalloc(log_cmd_length) } sprintf(log_cmd, "%s \" <%s>\"", log_cmd, argv[i]); } system(log_cmd); } #endif trueprint-5.3/src/print_prompt.h0000644000076400007640000000041307052654426012613 /* * Include file: * print_prompter.h */ typedef enum { PAGE_SPECIAL, PAGE_BLANK, PAGE_BODY } page_types; extern void setup_print_prompter(void); extern boolean print_prompt(page_types type, long filepage_no, char *file); extern void skipspaces(char **); trueprint-5.3/src/expand_str.h0000644000076400007640000000005507052654426012227 extern char *expand_string(char *, boolean); trueprint-5.3/src/lang_c.h0000644000076400007640000000032607052654426011304 /* * Include file: * lang_c.h */ extern stream_status get_c_char(char *, char_status *); extern char lang_c_defaults[]; extern stream_status get_pc_char(char *, char_status *); extern char lang_pc_defaults[]; trueprint-5.3/src/lang_report.c0000644000076400007640000000414707052654426012375 /* * Source file: * lang_report.c * * Contains get_report_char() which parses text files in a special * format. ^B marks the beginning of a 'function name', ^E marks the end, * and ^C is the comment delimiter */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "output.h" #include "lang_report.h" /* * Public part */ char lang_report_defaults[] = "-i --F --f --b"; /* * Private part */ typedef enum { IP_TEXT, IP_COMMENT, IP_TAG } report_ip_states; /* * get_report_char() * detects comment starts and ends; * finds function names; */ stream_status get_report_char(char *input_char, char_status *status) { static report_ip_states state=IP_TEXT; stream_status retval; static size_t tag_index=0; static long tag_start_char=0; static char tag_name[SYMBOL_LEN]="UNINITIALIZED"; static long tag_page_number=0; *status = CHAR_NORMAL; retval = getnextchar(input_char); switch (state) { case IP_TEXT: switch (*input_char) { case 2: /* ^B */ retval = getnextchar(input_char); tag_index = 0; tag_name[tag_index++] = *input_char; tag_start_char = char_number; tag_page_number = page_number; state = IP_TAG; break; case 3: /* ^C */ *status = CHAR_ITALIC; retval = getnextchar(input_char); state=IP_COMMENT; break; default: ; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case 3: /* ^C */ retval = getnextchar(input_char); state=IP_TEXT; break; default: ; } break; case IP_TAG: switch (*input_char) { case 5: /* ^E */ tag_name[tag_index++] = '\0'; add_function(tag_name,tag_start_char,char_number-1,tag_page_number,current_filename); end_function(page_number); retval = getnextchar(input_char); state=IP_TEXT; break; default: tag_name[tag_index++] = *input_char; break; } break; default: ; } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/main.h0000644000076400007640000000046507052654426011011 /* * Include file: * main.h */ /* * Globally available externs */ extern unsigned int no_of_files; extern char *current_filename; extern short pass; extern unsigned int file_number; extern int page_length; extern int page_width; extern long total_pages; extern boolean use_environment; trueprint-5.3/src/printers_fl.c0000644000076400007640000001470707052654426012413 /* * Source file: * printers_fl.c * * Reads in the printers file and returns values based on printer name */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "utils.h" #include "debug.h" #include "printers_fl.h" /* * Private part */ typedef struct printer_type { char *name; short sides; int left, right,top,bottom; struct printer_type *next; } printer_type; typedef struct printer_record { char *names; char *type; struct printer_record *next; } printer_record; static struct printer_type *parse_printer_type(char *line); static struct printer_record *parse_printer_record(char *line); static char *printers_filename; /****************************************************************************** * Function: * setup_printersile_fl * If environment variable PRINTERS_FILE is set then use that, otherwise * use the configured value for PRINTERS_FILE. */ void setup_printers_fl(void) { printers_filename = NULL; if (use_environment) printers_filename = getenv("TP_PRINTERS_FILE"); if ((printers_filename == NULL) || (strlen(printers_filename) == 0)) printers_filename = PRINTERS_FILE; } /****************************************************************************** * Function: * printer_stats * * Looks up printer in printers_filename. */ void printer_stats(char *printer, short *sides, unsigned short *lm, unsigned short *rm, unsigned short *tm, unsigned short *bm) { char buffer[1024]; char *env_printer; FILE *printers_file; printer_record *printers_list = NULL; printer_type *types_list = NULL; printer_record *tmp_printer = NULL; printer_type *tmp_type = NULL; printer_record *this_printer = NULL; printer_type *this_type = NULL; /* * Set up defaults */ *lm = 15; *rm = 590; *tm = 776; *bm = 30; *sides = 1; /* * If this is a test and nothing should be taken from outside trueprint, * then simply use the default settings */ if (!use_environment) { env_printer = "testprinter"; dm('D',3,"Using testprinter entry\n"); return; } /* * If there is no printer name use the defaults */ if ((printer == NULL) || (*printer == '\0')) { if (((env_printer = getenv("PRINTER")) == NULL) || (*env_printer == '\0')) { dm('D',3, CMD_NAME ": $PRINTER null or not defined: using default printer properties\n"); return; } else { printer = env_printer; } } /* * Open the printers file, and return defaults if we can't */ if ((printers_file = fopen(printers_filename, "r")) == NULL) { fprintf(stderr, gettext(CMD_NAME ": warning: cannot open %s, %s\n"), printers_filename, strerror(errno)); return; } /* * Read in the printer file information */ while (fgets(buffer, 1024, printers_file)) { if (strlen(buffer) == 0) { /* Ignore empty lines */ } else if (*buffer == '#') { /* Ignore comment lines */ } else if (strncmp(buffer, "type",4) == 0) { tmp_type = parse_printer_type(buffer); tmp_type->next = types_list; types_list = tmp_type; } else if (strncmp(buffer, "printer", 7) == 0) { tmp_printer = parse_printer_record(buffer); tmp_printer->next = printers_list; printers_list = tmp_printer; } } /* * Find printer */ for (tmp_printer = printers_list; tmp_printer; tmp_printer = tmp_printer->next) { char *s = strtok(tmp_printer->names,","); while (s) { dm('D',5,"Comparing printer names %s and %s\n",printer,s); if (strcmp(printer,s) == 0) { this_printer = tmp_printer; break; } s = strtok(NULL,","); } if (this_printer) break; } /* * If printer not found, return defaults */ if (!this_printer) { fprintf(stderr, gettext(CMD_NAME ": warning: cannot find printer %s in %s\n"), printer, printers_filename); fprintf(stderr, gettext(CMD_NAME ": send mail to %s if you want to have it added\n"), TP_ADMIN_USER); return; } /* * Find type */ for (tmp_type = types_list; tmp_type; tmp_type = tmp_type->next) { if (strcmp(this_printer->type,tmp_type->name) == 0) { this_type = tmp_type; break; } } /* * If printer type not found, return defaults */ if (!this_type) { fprintf(stderr, gettext(CMD_NAME ": warning: cannot find printer type %s in %s\n"), this_printer->type, printers_filename); fprintf(stderr, gettext(CMD_NAME ": you should notify %s\n"), TP_ADMIN_USER); return; } if (fclose(printers_file) == EOF) { perror(CMD_NAME ": Cannot close printers file"); exit(2); } dm('D',3,"printers_file.c: Printer type %s\n", this_type->name); *lm = this_type->left; *rm = this_type->right; *tm = this_type->top; *bm = this_type->bottom; *sides = this_type->sides; dm('D',3,"left = %d, right = %d, top = %d, bottom = %d, sides = %d\n", *lm,*rm,*tm,*bm,*sides); } /****************************************************************************** * Function: * parse_printer_type * */ struct printer_type *parse_printer_type(char *line) { struct printer_type *r = xmalloc(sizeof(printer_type)); /* Ignore "type" field */ strtok(line, ":"); r->name = strdup(strtok(NULL, ":")); r->sides = (short) atoi(strtok(NULL, ":")); r->left = (unsigned short) atoi(strtok(NULL, ":")); r->right = (unsigned short) atoi(strtok(NULL, ":")); r->top = (unsigned short) atoi(strtok(NULL, ":")); r->bottom = (unsigned short) atoi(strtok(NULL, ":")); r->next = NULL; if ((r->sides != 1) && (r->sides != 2)) { fprintf(stderr, gettext(CMD_NAME ": printers file %s: type %s: second field must be 1 or 2, but is %d\n"), printers_filename, r->name, r->sides); exit(2); } dm('D',3,"Read type %s entry: %d:%d:%d:%d:%d\n", r->name,r->sides,r->left,r->right,r->top,r->bottom); return r; } /****************************************************************************** * Function: * parse_printer_record * */ struct printer_record *parse_printer_record(char *line) { struct printer_record *r = xmalloc(sizeof(printer_record)); /* Ignore "printer" field */ strtok(line, ":"); r->names = strdup(strtok(NULL, ":")); r->type = strdup(strtok(NULL, ":")); /* Overwrite newline at end of last field */ r->type[strlen(r->type)-1] = '\0'; r->next = NULL; dm('D',3,"Read printer entry: %s:%s\n", r->names,r->type); return r; } trueprint-5.3/src/getopt.c0000644000076400007640000007242707052654426011371 /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu before changing it! Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO #define _NO_PROTO #endif #ifdef HAVE_CONFIG_H #include #endif #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ #include #include #endif /* GNU C library. */ #ifdef VMS #include #if HAVE_STRING_H - 0 #include #endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ #ifdef HAVE_LIBINTL_H # include # define _(msgid) gettext (msgid) #else # define _(msgid) (msgid) #endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg = NULL; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ #include #define my_index strchr #else /* Avoid depending on library functions or files whose names are inconsistent. */ char *getenv (); static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ #if !defined (__STDC__) || !__STDC__ /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); #endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } # ifdef text_set_element text_set_element (__libc_subinit, store_args_and_env); # endif /* text_set_element */ # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined (__STDC__) && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined (__STDC__) && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ trueprint-5.3/src/lang_cxx.c0000644000076400007640000001535307052654426011665 /* * Source file: * lang_cxx.c * * Contains get_cxx_char(), which parses C++ code. */ #include "config.h" #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_cxx.h" /* * Public part */ char lang_cxx_defaults[] = "--f --F --i"; /* * Private part */ typedef enum { IP_CODE, IP_COMMENT_START, IP_COMMENT, IP_COMMENT_LINE, IP_COMMENT_END, IP_STRING, IP_QUOTE_STRING, IP_ESCAPED } cxx_ip_states; typedef enum { FN_INITIAL_SPACE, FN_FINAL_CHARS, FN_NAME, FN_CHAINED_NAME, FN_TRAIL_SPACE, FN_OPEN_BRACKET, FN_DBL_OPEN_BRACKET, FN_CLOSE_BRACKET, FN_ARG, FN_SEMICOLON, FN_BODY, FN_MACRO, FN_MACRO_ESCAPED } cxx_fn_states; /* * get_cxx_char() * detects comment starts and ends; * finds function names; * detects function ends; */ stream_status get_cxx_char(char *input_char, char_status *status) { static cxx_ip_states state=IP_CODE; static cxx_ip_states saved_state; cxx_ip_states old_state=state; stream_status retval; static cxx_fn_states fn_state; static cxx_fn_states saved_fn_state; static short fn_name_index; static char fn_name[SYMBOL_LEN] = "UNINITIALIZED"; static long start_char, end_char; static long fn_page_number; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; saved_state = IP_CODE; fn_state = FN_INITIAL_SPACE; start_char = 0; end_char = 0; fn_page_number= 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case IP_CODE: switch (*input_char) { case '/': state = IP_COMMENT_START; { stream_status s; char c; s = getnextchar(&c); if ((c == '*') || (c == '/')) *status = CHAR_ITALIC; ungetnextchar(c,s); } break; case '{': braces_depth += 1; if ((fn_state == FN_CLOSE_BRACKET) || (fn_state == FN_CHAINED_NAME) || (fn_state == FN_SEMICOLON)) { /* got function! */ add_function(fn_name,start_char,end_char,fn_page_number,current_filename); fn_name_index = 0; fn_state = FN_BODY; } break; case '}': if (((braces_depth -= 1) == 0) && (fn_state == FN_BODY)) { end_function(page_number); retval|=STREAM_FUNCTION_END; fn_state = FN_INITIAL_SPACE; } break; case '"': state=IP_STRING; break; case '\'': state=IP_QUOTE_STRING; break; default: ; } break; case IP_COMMENT_START: switch (*input_char) { case '/': state=IP_COMMENT_LINE; *status=CHAR_ITALIC; break; case '*': state=IP_COMMENT; *status=CHAR_ITALIC; break; case '{': state=IP_CODE; braces_depth+=1; break; case '}': if ((braces_depth -= 1) == 0) retval|=STREAM_FUNCTION_END; break; default: state=IP_CODE; break; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case '*': state=IP_COMMENT_END; break; default: ; } break; case IP_COMMENT_LINE: *status = CHAR_ITALIC; switch (*input_char) { case '\n': state=IP_CODE; break; default: ; } break; case IP_COMMENT_END: *status = CHAR_ITALIC; switch (*input_char) { case '/': state=IP_CODE; break; case '*': break; default: state=IP_COMMENT; break; } break; case IP_STRING: switch (*input_char) { case '"': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; default: ; } break; case IP_QUOTE_STRING: switch (*input_char) { case '\'': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; default: ; } break; case IP_ESCAPED: state=saved_state; break; default: abort(); } if ((state == IP_CODE) && (old_state != IP_COMMENT_END)) switch (fn_state) { case FN_INITIAL_SPACE: if (isalpha(*input_char)) { fn_page_number = page_number; fn_name[fn_name_index++] = *input_char; start_char = char_number; fn_state = FN_NAME; } if (*input_char == '#') { saved_fn_state = fn_state; fn_state = FN_MACRO; } break; case FN_MACRO: if (*input_char == '\\') fn_state = FN_MACRO_ESCAPED; if (*input_char == '\n') fn_state = saved_fn_state; break; case FN_MACRO_ESCAPED: fn_state = FN_MACRO; break; case FN_NAME: if (isalnum(*input_char) || (*input_char == '_') || (*input_char == ':') || (*input_char == '~')) fn_name[fn_name_index++] = *input_char; else if (isspace(*input_char)) { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_TRAIL_SPACE; } else if (*input_char == '(') { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_OPEN_BRACKET; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_CHAINED_NAME: /* * This state is a bit of a cheat - we stay in this state * until the other FSM finds a {. This may find more * methods than are strictly there, but it'll work in all * normal cases. */ break; case FN_TRAIL_SPACE: if (isspace(*input_char)) break; else if (*input_char == '(') { fn_name[fn_name_index] = 0; fn_state = FN_OPEN_BRACKET; } else if (isalpha(*input_char)) { fn_name_index = 0; fn_name[fn_name_index++] = *input_char; fn_page_number = page_number; start_char = char_number; fn_state = FN_NAME; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_OPEN_BRACKET: if (*input_char == '(') fn_state = FN_DBL_OPEN_BRACKET; if (*input_char == ')') fn_state = FN_CLOSE_BRACKET; break; case FN_DBL_OPEN_BRACKET: if (*input_char == ')') fn_state = FN_OPEN_BRACKET; break; case FN_CLOSE_BRACKET: if (isspace(*input_char)) { break; } else if (*input_char == ':') { fn_state = FN_CHAINED_NAME; } else if (isalpha(*input_char) || (*input_char == '[')) { /* check for [ in case of bp listings! */ fn_state = FN_ARG; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_ARG: if (*input_char == ';') fn_state = FN_SEMICOLON; /* Treat ] as a semicolon in case of bp listings */ if (*input_char == ']') fn_state = FN_SEMICOLON; break; case FN_SEMICOLON: if (isspace(*input_char)) break; if (*status == CHAR_ITALIC) break; /* Take care of arg ending in ...[]; */ if (*input_char != ';') fn_state = FN_ARG; break; case FN_BODY: break; default: abort(); } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/lang_report.h0000644000076400007640000000021307052654426012370 /* * Include file: * lang_report.h */ extern stream_status get_report_char(char *, char_status *); extern char lang_report_defaults[]; trueprint-5.3/src/openpipe.c0000644000076400007640000000716307052654426011701 /* * Source file: * openpipe.c * * Contains openpipe - a replacement for the non-POSIX function popen. * This returns an int rather than a FILE * to make it general purpose - * fdopen can be used outside to convert this to a FILE * */ #include "config.h" #include #include #include #include #include #if HAVE_SYS_WAIT_H # include #endif #ifndef WNOHANG # define WNOHANG 1 #endif #if HAVE_UNISTD_H # include #else extern int close(int fildes); extern int dup(int fildes); extern pid_t fork(void); extern int pipe(int fildes[2]); extern pid_t waitpid(pid_t pid, int *stat_loc, int options); #endif #include "trueprint.h" #include "utils.h" #include "main.h" #include "debug.h" #include "openpipe.h" /* * Function: * openpipe * * Open a pipe. Write an initial character through the new pipe to make sure * that it works (there was a bug associated with a subprocess which didn't * write anything to the pipe). */ int openpipe(const char *command, char *mode) { int fildes[2]; int parent_pipe_end; int child_pipe_end; char *child_pipe_mode; if (strcmp(mode, "w") == 0) { parent_pipe_end = 1; child_pipe_end = 0; child_pipe_mode = "read"; } else if (strcmp(mode, "r") == 0) { parent_pipe_end = 0; child_pipe_end = 1; child_pipe_mode = "write"; } else abort(); if (pipe(fildes) != 0) { perror(CMD_NAME ": Cannot create pipe"); exit(2); } dm('f',3,"openpipe(): opened pipe with handles read=%d and write=%d\n",fildes[0],fildes[1]); switch (fork()) { case -1: /* Error */ perror(CMD_NAME ": Cannot fork"); exit(2); /*NOTREACHED*/ case 0: /* Child process */ if (!((close(fildes[parent_pipe_end]) == 0) && (close(child_pipe_end) == 0) && (dup(fildes[child_pipe_end]) == child_pipe_end))) { fprintf(stderr, gettext(CMD_NAME ": cannot redirect %s for child, %s\n"), child_pipe_mode, strerror(errno)); exit(2); } /* Write a single byte through the pipe to establish it */ if (child_pipe_end == 1) { write(fildes[child_pipe_end],"z",1); } else { char buff[1]; read(fildes[child_pipe_end],buff,1); if (*buff != 'z') { fprintf(stderr, gettext(CMD_NAME ": failed to open pipe properly\n")); exit(2); } } if (system(command) < 0) { perror(CMD_NAME ": Cannot start pipe"); exit(2); } else exit(0); /*NOTREACHED*/ default: /* Parent process */ if (close(fildes[child_pipe_end]) != 0) { fprintf(stderr, gettext(CMD_NAME ": cannot close %s end of pipe for parent, %s\n"), child_pipe_mode, strerror(errno)); exit(2); } /* Write a single byte through the pipe to establish it */ if (parent_pipe_end == 1) { write(fildes[parent_pipe_end],"z",1); } else { char buff[1]; read(fildes[parent_pipe_end],buff,1); if (*buff != 'z') { fprintf(stderr, gettext(CMD_NAME ": failed to open pipe properly\n")); exit(2); } } return fildes[parent_pipe_end]; } } FILE * fopenpipe(const char *command, char *mode) { int handle; FILE *fd; handle = openpipe(command, mode); fd = fdopen(handle, mode); dm('f',3,"Opened pipe %d, %s, handle %d for command = %s\n",handle,mode,fd,command); return fd; } void closepipe(int handle) { int statloc; close(handle); waitpid(-1, &statloc, 0); } void fclosepipe(FILE *fp) { closepipe(fileno(fp)); /* need to call fclose() to deallocate FILE buffer */ if (fclose(fp) != EOF) perror(CMD_NAME ": could not close diff stream"); } trueprint-5.3/src/printers_fl.h0000644000076400007640000000025407052654426012410 extern void setup_printers_fl(void); extern void printer_stats(char *printer,short *sides, unsigned short *lm, unsigned short *rm, unsigned short *tm, unsigned short *bm); trueprint-5.3/src/getopt.h0000644000076400007640000001076707052654426011375 /* Declarations for getopt. Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _GETOPT_H #define _GETOPT_H 1 #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { #if defined (__STDC__) && __STDC__ const char *name; #else char *name; #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ #define no_argument 0 #define required_argument 1 #define optional_argument 2 #if defined (__STDC__) && __STDC__ #ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind, int long_only); #else /* not __STDC__ */ extern int getopt (); extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); #endif /* __STDC__ */ #ifdef __cplusplus } #endif #endif /* getopt.h */ trueprint-5.3/src/lang_cxx.h0000644000076400007640000000020207052654426011655 /* * Include file: * lang_cxx.h */ extern stream_status get_cxx_char(char *, char_status *); extern char lang_cxx_defaults[]; trueprint-5.3/src/lang_sh.c0000644000076400007640000002120507052654426011466 /* * Source file: * lang_sh.c * * Contains get_sh_char() which parses shell code. */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_sh.h" /* * Public part */ char lang_sh_defaults[] = "-i --F --f"; /* * Private part */ typedef enum { IP_CODE, IP_STRING, IP_QSTRING, IP_COMMENT, IP_COMMAND, IP_VAR1, IP_VARBODY, IP_HD1, IP_HD2, IP_HDSTART, IP_HD, IP_HDSTARTLINE, IP_HDCHECKSTRING } sh_ip_states; typedef enum { F1_CODE, F1_FUNCTION, F1_LEADING_SPACE, F1_NAME, F1_TRAILING_SPACE, F1_FNTEXT } sh_f1_states; typedef enum { FN_INITIAL_SPACE, FN_NAME, FN_TRAIL_SPACE, FN_OPEN_BRACKET, FN_CLOSE_BRACKET, FN_FNTEXT } sh_fn_states; /* * get_sh_char() * detects comment starts and ends; * finds function names; * detects function ends; * returns one of the following: * CHAR * COMMENT_START * COMMENT_END * FUNCTION_END * FILE_END * INPUT_END * FUNCTION_NAME_START * FUNCTION_NAME_END */ stream_status get_sh_char(char *input_char, char_status *status) { static sh_ip_states state=IP_CODE; stream_status retval; static sh_f1_states f1_state=F1_CODE; static sh_fn_states fn_state=FN_INITIAL_SPACE; static size_t f1_index=0; static short fn_index=0; static long f1_start_char=0; static long fn_start_char=0; static long f1_end_char=0; static long fn_end_char=0; static char f1_name[SYMBOL_LEN]="UNINITIALIZED"; static char fn_name[SYMBOL_LEN]="UNINITIALIZED"; static char here_marker[SYMBOL_LEN]; static short here_marker_index; static short here_marker_length; static long f1_page_number=0; static long fn_page_number=0; static char function[]="function"; static boolean escaped=FALSE; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; f1_state = F1_CODE; fn_state = FN_INITIAL_SPACE; f1_index = 0; fn_index = 0; f1_start_char = 0; fn_start_char = 0; f1_end_char = 0; fn_end_char = 0; f1_page_number= 0; fn_page_number= 0; escaped = FALSE; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); dm('L',9,"lang_sh.c:state=%d,f1_state=%d,fn_state=%d,input=%c\n",state,f1_state,fn_state,*input_char); /* First a short switch to sort out escaped stuff... */ switch (state) { case IP_CODE: case IP_STRING: case IP_QSTRING: case IP_COMMAND: case IP_VARBODY: if (escaped) { escaped=FALSE; break; } /* otherwise drop through */ case IP_HD1: case IP_HD2: case IP_VAR1: case IP_HDSTART: if ((*input_char == '\\') && !escaped) { escaped = TRUE; break; } /* otherwise drop through */ default: switch (state) { case IP_CODE: switch (*input_char) { case '$': state=IP_VAR1; break; case '"': state=IP_STRING; break; case '\'': state=IP_QSTRING; break; case '`': state=IP_COMMAND; break; case '#': *status = CHAR_ITALIC; state=IP_COMMENT; break; case '<': state=IP_HD1; break; case '{': if (braces_depth == 0) { if (f1_state == F1_TRAILING_SPACE) { add_function(f1_name,f1_start_char,f1_end_char,f1_page_number,current_filename); f1_index = 0; f1_state = F1_FNTEXT; } else if (fn_state == FN_CLOSE_BRACKET) { add_function(fn_name, fn_start_char, fn_end_char,fn_page_number,current_filename); fn_index = 0; fn_state = FN_FNTEXT; } } braces_depth++; break; case '}': if (((braces_depth -= 1) == 0) && ((f1_state == F1_FNTEXT) || (fn_state == FN_FNTEXT))) { end_function(page_number); retval |= STREAM_FUNCTION_END; f1_state = F1_CODE; fn_state = FN_INITIAL_SPACE; } break; default: ; } break; case IP_STRING: if (*input_char == '"') state=IP_CODE; break; case IP_QSTRING: if (*input_char == '\'') state=IP_CODE; break; case IP_COMMAND: if (*input_char == '`') state=IP_CODE; break; case IP_COMMENT: *status = CHAR_ITALIC; if (*input_char == '\n') { state=IP_CODE; } break; case IP_VAR1: if (escaped) { state=IP_CODE; escaped=FALSE; break; } if (*input_char == '{') state=IP_VARBODY; else state=IP_CODE; break; case IP_VARBODY: if (*input_char == '}') state=IP_CODE; break; case IP_HD1: if (escaped) { state=IP_CODE; escaped=FALSE; break; } if (*input_char == '<') state=IP_HD2; else state=IP_CODE; break; case IP_HD2: if ((escaped || ((*input_char != '-') && (!isspace(*input_char)))) && (*input_char != '"') && (*input_char != '\'')) { escaped = FALSE; here_marker[here_marker_index=0] = *input_char; state = IP_HDSTART; break; } if (*input_char == '-') break; if (isspace(*input_char) || (*input_char == '"') || (*input_char == '\'')) break; state=IP_CODE; break; case IP_HDSTART: if ((escaped || !isspace(*input_char)) && (*input_char != '"') && (*input_char != '\'')) { escaped = FALSE; here_marker[++here_marker_index] = *input_char; break; } here_marker_length = here_marker_index+1; here_marker_index = 0; state=IP_HD; break; case IP_HD: if (*input_char == '\n') state = IP_HDSTARTLINE; break; case IP_HDSTARTLINE: if ((*input_char == '\n') || (isspace(*input_char))) break; state=IP_HDCHECKSTRING; /* else fall through */ case IP_HDCHECKSTRING: if ((*input_char == '"') || (*input_char == '\'')) break; if (*input_char != here_marker[here_marker_index++]) { if ((here_marker_index == here_marker_length+1) && (*input_char == '\n')) { state=IP_CODE; break; } state=IP_HD; here_marker_index=0; } break; default: abort(); } } if (state == IP_CODE) { switch (f1_state) { case F1_CODE: if (*input_char == 'f') { f1_index = 1; f1_state = F1_FUNCTION; f1_page_number = page_number; } break; case F1_FUNCTION: if (*input_char == function[f1_index++]) { if (f1_index == strlen(function)) f1_state = F1_LEADING_SPACE; } else f1_state = F1_CODE; break; case F1_LEADING_SPACE: if (isspace(*input_char)) break; if (isalpha(*input_char)) { f1_page_number = page_number; f1_name[f1_index=0] = *input_char; f1_start_char = char_number; f1_state=F1_NAME; break; } f1_state = F1_CODE; break; case F1_NAME: if (isalnum(*input_char) || (*input_char == '_')) { f1_name[++f1_index] = *input_char; } else { f1_name[++f1_index] = '\0'; f1_end_char = char_number - 1; f1_state = F1_TRAILING_SPACE; } break; case F1_TRAILING_SPACE: if (!isspace(*input_char)) f1_state = F1_FNTEXT; break; default: ; } } if (state == IP_CODE) { switch (fn_state) { case FN_INITIAL_SPACE: if (isalpha(*input_char)) { fn_page_number = page_number; fn_name[fn_index++] = *input_char; fn_start_char = char_number; fn_state = FN_NAME; } break; case FN_NAME: if (isalnum(*input_char) || (*input_char == '_')) fn_name[fn_index++] = *input_char; else if (isspace(*input_char)) { fn_name[fn_index] = '\0'; fn_end_char = char_number - 1; fn_state = FN_TRAIL_SPACE; } else if (*input_char == '(') { fn_name[fn_index] = '\0'; fn_end_char = char_number - 1; fn_state = FN_OPEN_BRACKET; } else { fn_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_TRAIL_SPACE: if (isspace(*input_char)) break; else if (*input_char == '(') fn_state = FN_OPEN_BRACKET; else if (isalpha(*input_char)) { fn_index=0; fn_page_number = page_number; fn_name[fn_index++] = *input_char; fn_start_char = char_number; fn_state = FN_NAME; } else { fn_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_OPEN_BRACKET: if (*input_char == ')') fn_state = FN_CLOSE_BRACKET; break; case FN_CLOSE_BRACKET: if (isspace(*input_char)) break; fn_index=0; fn_page_number = page_number; fn_name[fn_index++] = *input_char; fn_start_char = char_number; fn_state = FN_NAME; break; default: ; } } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/openpipe.h0000644000076400007640000000033207052654426011675 /* * Header file: * openpipe.h */ extern int openpipe(const char *command, char *mode); extern FILE *fopenpipe(const char *command, char *mode); extern void closepipe(int handle); extern void fclosepipe(FILE *fp); trueprint-5.3/src/trueprint.h0000644000076400007640000000377507052654426012130 /* * Include file: * trueprint.h */ #define CMD_NAME "trueprint" /* * TP_ADMIN_USER contains the mail address of the administrator. * You should change this address! */ #define TP_ADMIN_USER "root@localhost" /* * Default settings for options, only needed if the defaults that are * hard-coded are not good enough. */ #define DEFAULT_OPTS "" /* * LOGTOOL is set to the tool to be used to log invocations of trueprint. To turn * off logging, comment this line out */ /* #define LOGTOOL ... */ /* * Maximum length of a command to be passed to system() */ #define COMMAND_LEN 2000 /* * Maximum length of an input or output line for diff, indexes, etc. */ #define INPUT_LINE_LEN 200 /* * Maximum length of a symbol, in the language parsing stuff */ #define SYMBOL_LEN 70 /* * Maximum line length of an output line for source code */ #define MAXLINELENGTH 2000 /* * Buffer size - input is read in in blocks this size */ #define BUFFER_SIZE 4096 /* * Postscript max and min values */ #define MAXPOINTSIZE 50 #define MINPOINTSIZE 5 #define MAXINTERLINE_GAP 10 #define MININTERLINE_GAP 0 /* * Maximum size of greenlines */ #define MAXGREENLINES 10 /* * HOLEPUNCH_WIDTH is the space, in points, left blank for holepunches. * 54 points is 3/4" */ #define HOLEPUNCH_WIDTH 54 /* * HOLEPUNCH_HEIGHT is the space, in points, left blank for two-hole * holepunches (that punch at the top of the page). * 36 points is 1/2" */ #define HOLEPUNCH_HEIGHT 36 /* * Characters that we can break lines on. BREAKSLENGTH is set to the * number of these characters */ #define BREAKS ";({,. " #define BREAKSLENGTH 7 #define PUTS(x) (void)fputs(x,stdout) #define BACKSPACE (char)8 typedef enum { CHAR_NORMAL, CHAR_ITALIC, CHAR_BOLD, CHAR_UNDERLINE } char_status; typedef enum { STREAM_EMPTY_FILE = -1, STREAM_OK = 0x0, STREAM_PAGE_END = 0x1, STREAM_FUNCTION_END = 0x2, STREAM_FILE_END = 0x4 } stream_status; #undef TRUE #undef FALSE typedef enum { UNSET = -1, FALSE = 0, TRUE = 1 } boolean; trueprint-5.3/src/getopt1.c0000644000076400007640000001072007052654426011436 /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "getopt.h" #if !defined (__STDC__) || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ trueprint-5.3/src/lang_java.c0000644000076400007640000001605407052654426012003 /* * Source file: * lang_java.c * * Contains get_java_char(), which partially parses Java code. * It is essentially the same as get_c_char, except that it handles * java methods the same as c functions, and handles // comments. * No special indication of classes; that would require this parser to * understand a lot more of the language, such as the "class" keyword. * It doesn't recognize a method that's within a class within a method * within a class. * * Modified by Lezz to fit in with Trueprint 4.1.1 codebase (thanks Terry!) * * $Log: lang_java.c,v $ * Revision 1.1 1999/08/25 01:00:05 lgiles * Initial revision * * Revision 1.2 1998/08/28 19:30:41 tplatt * modified to handle "throws" clauses in method declarations, * added some (commented out) debug code * * Revision 1.1 98/08/17 18:49:13 18:49:13 tplatt (Terry L. Platt) * Initial revision * * * (created from lang_c.c Revision 1.2 98/08/17 16:55:14 ) */ #include "config.h" #include #include /* XXDEBUG */ #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_java.h" /* * Public part */ char lang_java_defaults[] = "-fy -Fy -xy -bn"; /* * Private part */ typedef enum { IP_CODE, IP_COMMENT_START, /* got "/" */ IP_COMMENT, /* got comment start */ IP_CPP_COMMENT, /* got "//" for Java & C++*/ IP_COMMENT_END, /* got comment end */ IP_STRING, /* got opening quote */ IP_QUOTE_STRING, /* got opening apostrophe */ IP_ESCAPED /* backslash inside STRING or QUOTE_STRING */ } java_ip_states; typedef enum { FN_INITIAL_SPACE, FN_FINAL_CHARS, FN_NAME, FN_TRAIL_SPACE, FN_OPEN_BRACKET, FN_DBL_OPEN_BRACKET, FN_CLOSE_BRACKET, FN_SEMICOLON, FN_BODY, FN_MACRO, FN_MACRO_ESCAPED } java_fn_states; /* * get_java_char() * detects comment starts and ends; * finds method names; * detects method ends; */ stream_status get_java_char(char *input_char, char_status *status) { static java_ip_states state=IP_CODE; static java_ip_states saved_state; /* for escaped char in a string */ java_ip_states old_state=state; stream_status retval; static java_fn_states fn_state=FN_INITIAL_SPACE; static java_fn_states saved_fn_state; /* for macros */ static short fn_name_index=0; static char fn_name[SYMBOL_LEN] = "UNINITIALIZED"; static long start_char, end_char; static long fn_page_number; static short saved_braces_depth = 0; /* for Java method extents */ *status = CHAR_NORMAL; if (restart_language == TRUE) { state = IP_CODE; saved_state = IP_CODE; fn_state = FN_INITIAL_SPACE; start_char = 0; end_char = 0; fn_page_number= 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case IP_CODE: switch (*input_char) { case '/': state = IP_COMMENT_START; { stream_status s; char c; s = getnextchar(&c); if (c == '*') *status = CHAR_ITALIC; ungetnextchar(c,s); } break; case '{': braces_depth += 1; if ((fn_state == FN_CLOSE_BRACKET) || (fn_state == FN_SEMICOLON)) { /* got method! */ add_function(fn_name,start_char,end_char,fn_page_number, current_filename); fn_name_index = 0; fn_state = FN_BODY; saved_braces_depth = braces_depth; /*Java*/ } break; case '}': if (((braces_depth -= 1) == saved_braces_depth-1) && (fn_state == FN_BODY)) { end_function(page_number); retval|=STREAM_FUNCTION_END; fn_state = FN_INITIAL_SPACE; } break; case '"': state=IP_STRING; break; case '\'': state=IP_QUOTE_STRING; break; } break; case IP_COMMENT_START: switch (*input_char) { case '/': state=IP_CPP_COMMENT; *status=CHAR_ITALIC; break; /*Java & C++*/ case '*': state=IP_COMMENT; *status=CHAR_ITALIC; break; case '{': state=IP_CODE; braces_depth+=1; break; case '}': if ((braces_depth -= 1) == 0) retval|=STREAM_FUNCTION_END; break; default: state=IP_CODE; break; } break; case IP_COMMENT: *status = CHAR_ITALIC; switch (*input_char) { case '*': state=IP_COMMENT_END; break; } break; case IP_CPP_COMMENT: /*Java & C++ */ switch (*input_char) { case '\n': state=IP_CODE; break; } break; case IP_COMMENT_END: *status = CHAR_ITALIC; switch (*input_char) { case '/': state=IP_CODE; break; case '*': break; default: state=IP_COMMENT; break; } break; case IP_STRING: switch (*input_char) { case '"': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; } break; case IP_QUOTE_STRING: switch (*input_char) { case '\'': state=IP_CODE; break; case '\\': saved_state=state; state=IP_ESCAPED; break; } break; case IP_ESCAPED: state=saved_state; break; default: abort(); } /* end of switch (state) */ if ((state == IP_CODE) && (old_state != IP_COMMENT_END)) switch (fn_state) { case FN_INITIAL_SPACE: if (isalpha(*input_char)) { fn_page_number = page_number; fn_name[fn_name_index++] = *input_char; start_char = char_number; fn_state = FN_NAME; } if (*input_char == '#') { saved_fn_state = fn_state; fn_state = FN_MACRO; } break; case FN_MACRO: if (*input_char == '\\') fn_state = FN_MACRO_ESCAPED; if (*input_char == '\n') fn_state = saved_fn_state; break; case FN_MACRO_ESCAPED: fn_state = FN_MACRO; break; case FN_NAME: if (isalnum(*input_char) || (*input_char == '_')) fn_name[fn_name_index++] = *input_char; else if (isspace(*input_char)) { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_TRAIL_SPACE; } else if (*input_char == '(') { fn_name[fn_name_index] = 0; end_char = char_number-1; fn_state = FN_OPEN_BRACKET; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_TRAIL_SPACE: if (isspace(*input_char)) break; else if (*input_char == '(') { fn_name[fn_name_index] = 0; fn_state = FN_OPEN_BRACKET; } else if (isalpha(*input_char)) { fn_name_index = 0; fn_name[fn_name_index++] = *input_char; fn_page_number = page_number; start_char = char_number; fn_state = FN_NAME; } else { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_OPEN_BRACKET: if (*input_char == '(') fn_state = FN_DBL_OPEN_BRACKET; if (*input_char == ')') fn_state = FN_CLOSE_BRACKET; break; case FN_DBL_OPEN_BRACKET: if (*input_char == ')') fn_state = FN_OPEN_BRACKET; break; case FN_CLOSE_BRACKET: if (ispunct(*input_char)) { fn_name_index = 0; fn_state = FN_INITIAL_SPACE; } break; case FN_BODY: break; default: abort(); } /* end of switch (fn_state) */ if (pass==1) *status = get_function_name_posn(char_number, *status); return(retval); } trueprint-5.3/src/lang_sh.h0000644000076400007640000000017707052654426011500 /* * Include file: * lang_sh.h */ extern stream_status get_sh_char(char *, char_status *); extern char lang_sh_defaults[]; trueprint-5.3/src/options.c0000644000076400007640000011421207220411462011533 /* * Source file: * options.c */ #include "config.h" #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "getopt.h" #endif extern int optind; /* undocumented variable used to reset getopt() */ #include "trueprint.h" /* needed for boolean type */ #include "utils.h" /* needed for strdup */ #include "debug.h" /* needed for dm macro */ #include "options.h" /****************************************************************************** * Macros */ /* If there are more than MAX_OPTIONS options then this must be increased */ #define MAX_OPTIONS 256 /* This must specify a bit outside the range of MAX_OPTIONS */ #define OPT_FLAG 0x1000 #define SHORT_OPTION(opt) (short_options[('A'<=opt&&opt<='Z')?(opt-'A')*2:\ ('a'<=opt&&opt<='z')?(opt-'a')*2+1:\ ('0'<=opt&&opt<='9')?opt-'0'+52:\ 62]) #define PRINTUSAGE printf(gettext(" Usage: trueprint \n Use -H for details\n")) /****************************************************************************** * Typedefs */ typedef enum { NOPARM, OPTIONAL, BOOLEAN, CHAR, CHOICE, SHORT, INT, STRING, FLAG_STRING } option_types; typedef struct option_type{ char letter; option_types type; boolean set; char need_string; option_class class; union { struct { char *string; boolean default_opt; void (*handler)(const char *p, const char *s); void (*set_default)(void); char *help_string; } onoparm; struct { char *string; void (*handler)(const char *p, const char *s, char *value); char *help_string; } ooptional; struct { char *true_string; char *false_string; boolean *var; boolean default_value; void (*handler)(const char *p, const char *s, boolean value); void (*set_default)(boolean value); char *true_help_string; char *false_help_string; } obool; struct { char *string; char *var; char default_value; char *valid_set; void (*handler)(const char *p, const char *s, char value, char *valid_set); void (*set_default)(char value); char *help_string; } ochar; struct { char *var; char *choice1_string; char *choice2_string; char choice1; /* Also default */ char choice2; void (*handler)(const char *p, const char *s, char value); void (*set_default)(char value); char *choice1_help_string; char *choice2_help_string; } ochoice; struct { char *string; short *var; short default_value; char *special_string; short special_value; short min; short max; void (*handler)(const char *p, const char *s, short value, short min, short max); void (*set_default)(short value); char *help_string; char *special_help_string; } oshrt; struct { char *string; int *var; int default_value; char *special_string; short special_value; int min; int max; void (*handler)(const char *p, const char *s, int value, int min, int max); void (*set_default)(int value); char *help_string; char *special_help_string; } oint; struct { char *string; char **var; char *default_value; void (*handler)(const char *p, const char *s, char *value); void (*set_default)(char *value); char *help_string; } ostrng; struct { char *set_string; char *not_set_string; boolean flag_var; char **var; boolean default_value; char *true_value; char *false_value; void (*handler)(const char *p, const char *s, boolean value, char *true_value, char *false_value); void (*set_default)(boolean value, char *string_value); char *set_help_string; char *not_set_help_string; } oflg; } t; } option_type; /****************************************************************************** * Private functions */ static void set_option(int option, char *prefix, const char *option_name, char *value); static void set_option_default(int option); /****************************************************************************** * Constant variables and data structures */ static int short_options[62]; static struct option_type option_list[MAX_OPTIONS+1]; static struct option long_options[MAX_OPTIONS+1]; static int next_option; static int next_long_option; static int this_option; /****************************************************************************** * Function: * setup_options */ void setup_options(void) { next_option = 0; next_long_option = 0; } /****************************************************************************** * Function: * handle_string_options * * This function takes options as a single string, parses them into * a char[][], and calls handle_options. */ void handle_string_options(char *options) { int opt_argc = -1; char arguments[100][100]; char *opt_argv[100]; int options_index = -1; int argv_index = 0; boolean quoted = FALSE; boolean ended = FALSE; if (options == (char *)0) return; if (strlen(options) == 0) return; while (ended == FALSE) { switch (options[++options_index]) { case ' ': case ' ': if (quoted) { if (argv_index == 0) opt_argc += 1; arguments[opt_argc][argv_index++] = options[options_index]; continue; } if (argv_index > 0) { arguments[opt_argc][argv_index] = '\0'; argv_index = 0; } break; case '\0': if (argv_index > 0) { arguments[opt_argc][argv_index] = '\0'; argv_index = 0; } ended = TRUE; break; case '"': if (quoted) quoted = FALSE; else quoted = TRUE; break; default: if (argv_index == 0) opt_argc += 1; arguments[opt_argc][argv_index++] = options[options_index]; break; } } opt_argc += 1; for (argv_index=0; argv_index < opt_argc; argv_index++) opt_argv[argv_index+1] = arguments[argv_index]; opt_argv[0] = opt_argv[1]; opt_argc += 1; handle_options(opt_argc, opt_argv); return; } /****************************************************************************** * Function: * handle_options * * This function handles the options passed to the program, and also * the defaults for each language. Since the options passed to the * program gake priority and are also found first, this function * will only assign a value to a flag if the flag has not previously * been set. */ unsigned int handle_options(int argc, char **argv) { int option; int option_index; int short_option_index = 0; int long_option_index; char short_option_list[125]; /* 125 = (26+26+10)*2 + 1 */ /* * Since this function will be called twice, we need to initialise * getopt_long() variables to make sure that it behaves properly during * the second call. */ optind = 1; /* * Set up the string of single-letter options and set the last long_option * to all zeros - this will be done multiple times each time trueprint * is invoked, but it's quick so it shouldn't hurt. */ for (option_index = 0; option_index < next_long_option; option_index++) { if (option_list[option_index].letter) { short_option_list[short_option_index++] = option_list[option_index].letter; if (option_list[option_index].need_string) short_option_list[short_option_index++] = ':'; } } long_options[next_long_option].name = 0; long_options[next_long_option].has_arg = 0; long_options[next_long_option].flag = 0; long_options[next_long_option].val = 0; /* * Loop through the options. This call will set this_option * to the option number if it is looking at a long option. */ while ((option = getopt_long((unsigned int)argc, argv, short_option_list, long_options, &long_option_index) ) != EOF) { if (option == '?') { fprintf(stderr, gettext(CMD_NAME ": failed to parse options\n")); exit(1); } else if (option != 0) { char *option_name; option_name = xmalloc(2); option_name[0] = option; option_name[1] = '\0'; option_index = SHORT_OPTION(option); set_option(option_index,"-",option_name,optarg); } else { set_option(this_option, "--", long_options[long_option_index].name,optarg); } } return(optind); } /****************************************************************************** * Option declaration functions */ /****************************************************************************** * noparm_option * -c * --s * Calls handler if used. * Uses either single-letter option or string long option or both */ void noparm_option(char *c, char *s, boolean default_opt, void (*handler)(const char *p, const char *s), void (*set_default)(void), option_class class, char *help_string) { int option_index = next_option++; if (s) { int long_option_index = next_long_option++; long_options[long_option_index].name = s; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } /* * This checks for an internal error, so it is OK to * risk an out-of-bounds access * before checking for the bounds limit. */ if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if (handler == NULL) abort(); if (default_opt && set_default == NULL) abort(); if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; option_list[option_index].type = NOPARM; option_list[option_index].class = class; option_list[option_index].need_string = FALSE; option_list[option_index].set = FALSE; option_list[option_index].t.onoparm.string = s; option_list[option_index].t.onoparm.default_opt = default_opt; option_list[option_index].t.onoparm.handler = handler; option_list[option_index].t.onoparm.set_default = set_default; option_list[option_index].t.onoparm.help_string = help_string; } /****************************************************************************** * optional_string_option * -c * --s * --s=[string] * Note that only the long option has the optional string. * Calls handler if used. * Uses either single-letter option or string long option or both */ void optional_string_option(char *c, char *s, void (*handler)(const char *p, const char *s, char *value), option_class class, char *help_string) { int option_index = next_option++; if (s) { int long_option_index = next_long_option++; long_options[long_option_index].name = s; long_options[long_option_index].has_arg = 2; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } /* * This checks for an internal error, so it is OK to * risk an out-of-bounds access * before checking for the bounds limit. */ if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if (handler == NULL) abort(); if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; option_list[option_index].type = OPTIONAL; option_list[option_index].class = class; option_list[option_index].need_string = FALSE; option_list[option_index].set = FALSE; option_list[option_index].t.ooptional.string = s; option_list[option_index].t.ooptional.handler = handler; option_list[option_index].t.ooptional.help_string = help_string; } /****************************************************************************** * boolean_option * -c = set option to TRUE * --c = set option to FALSE * --s1 = set option to TRUE * --s2 = set option to FALSE */ void boolean_option(char *c, char *s1, char *s2, boolean default_value, boolean *var, void (*handler)(const char *p, const char *s, boolean value), void (*set_default)(boolean value), option_class class, char *true_help_string, char *false_help_string) { int option_index = next_option++; if (c) { int long_option_index = next_long_option++; option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; long_options[long_option_index].name = c; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index | OPT_FLAG; } else option_list[option_index].letter = 0; if (s1) { int long_option_index = next_long_option++; long_options[long_option_index].name = s1; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if (s2) { int long_option_index = next_long_option++; long_options[long_option_index].name = s2; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index | OPT_FLAG; } if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = BOOLEAN; option_list[option_index].class = class; option_list[option_index].need_string = FALSE; option_list[option_index].set = FALSE; option_list[option_index].t.obool.true_string = s1; option_list[option_index].t.obool.false_string = s2; option_list[option_index].t.obool.var = var; option_list[option_index].t.obool.default_value = default_value; option_list[option_index].t.obool.handler = handler; option_list[option_index].t.obool.set_default = set_default; option_list[option_index].t.obool.true_help_string = true_help_string; option_list[option_index].t.obool.false_help_string = false_help_string; } /****************************************************************************** * choice_option * -c * --s1 * --s2 */ void choice_option(char *c, char *s1, char *s2, char choice1, char choice2, char *var, void (*handler)(const char *p, const char *s, char value), void (*set_default)(char value), option_class class, char *choice1_help_string, char *choice2_help_string) { int option_index = next_option++; if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; if (s1) { int long_option_index = next_long_option++; long_options[long_option_index].name = s1; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if (s2) { int long_option_index = next_long_option++; long_options[long_option_index].name = s2; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index | OPT_FLAG; } if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = CHOICE; option_list[option_index].class = class; option_list[option_index].need_string = TRUE; option_list[option_index].set = FALSE; option_list[option_index].t.ochoice.var = var; option_list[option_index].t.ochoice.choice1_string = s1; option_list[option_index].t.ochoice.choice2_string = s2; option_list[option_index].t.ochoice.choice1 = choice1; option_list[option_index].t.ochoice.choice2 = choice2; option_list[option_index].t.ochoice.handler = handler; option_list[option_index].t.ochoice.set_default = set_default; option_list[option_index].t.ochoice.choice1_help_string = choice1_help_string; option_list[option_index].t.ochoice.choice2_help_string = choice2_help_string; } /****************************************************************************** * char_option * -c * --s */ void char_option(char *c, char *s, char default_value, char *valid_set, char *var, void (*handler)(const char *p, const char *s, char value, char *var), void (*set_default)(char value), option_class class, char *help_string) { int option_index = next_option++; if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; if (s) { int long_option_index = next_long_option++; long_options[long_option_index].name = s; long_options[long_option_index].has_arg = 1; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = CHAR; option_list[option_index].class = class; option_list[option_index].need_string = TRUE; option_list[option_index].set = FALSE; option_list[option_index].t.ochar.string = s; option_list[option_index].t.ochar.var = var; option_list[option_index].t.ochar.default_value = default_value; option_list[option_index].t.ochar.valid_set = valid_set; option_list[option_index].t.ochar.handler = handler; option_list[option_index].t.ochar.set_default = set_default; option_list[option_index].t.ochar.help_string = help_string; } /****************************************************************************** * short_option * -c * --s */ void short_option(char *c, char *s, short default_value, char *special_string, short special_value, short min, short max, short *var, void (*handler)(const char *p, const char *s, short value, short min, short max), void (*set_default)(short value), option_class class, char *help_string, char *special_help_string) { int option_index = next_option++; if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; if (s) { int long_option_index = next_long_option++; long_options[long_option_index].name = s; long_options[long_option_index].has_arg = 1; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if (special_string) { int long_option_index = next_long_option++; long_options[long_option_index].name = special_string; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index | OPT_FLAG; } if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = SHORT; option_list[option_index].class = class; option_list[option_index].need_string = TRUE; option_list[option_index].set = FALSE; option_list[option_index].t.oshrt.string = s; option_list[option_index].t.oshrt.var = var; option_list[option_index].t.oshrt.min = min; option_list[option_index].t.oshrt.max = max; option_list[option_index].t.oshrt.default_value = default_value; option_list[option_index].t.oshrt.handler = handler; option_list[option_index].t.oshrt.set_default = set_default; option_list[option_index].t.oshrt.help_string = help_string; option_list[option_index].t.oshrt.special_string = special_string; option_list[option_index].t.oshrt.special_value = special_value; option_list[option_index].t.oshrt.special_help_string = special_help_string; } /****************************************************************************** * int_option * -c * --s */ void int_option(char *c, char *s, int default_value, char *special_string, int special_value, int min, int max, int *var, void (*handler)(const char *p, const char *s, int value, int min, int max), void (*set_default)(int value), option_class class, char *help_string, char *special_help_string) { int option_index = next_option++; if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; if (s) { int long_option_index = next_long_option++; long_options[long_option_index].name = s; long_options[long_option_index].has_arg = 1; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if (special_string) { int long_option_index = next_long_option++; long_options[long_option_index].name = special_string; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index | OPT_FLAG; } if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = INT; option_list[option_index].class = class; option_list[option_index].need_string = TRUE; option_list[option_index].set = FALSE; option_list[option_index].t.oint.string = s; option_list[option_index].t.oint.var = var; option_list[option_index].t.oint.min = min; option_list[option_index].t.oint.max = max; option_list[option_index].t.oint.default_value = default_value; option_list[option_index].t.oint.handler = handler; option_list[option_index].t.oint.set_default = set_default; option_list[option_index].t.oint.help_string = help_string; option_list[option_index].t.oint.special_string = special_string; option_list[option_index].t.oint.special_value = special_value; option_list[option_index].t.oint.special_help_string = special_help_string; } /****************************************************************************** * string_option * -c * --s */ void string_option(char *c, char *s, char *default_value, char **var, void (*handler)(const char *p, const char *s, char *value), void (*set_default)(char *value), option_class class, char *help_string) { int option_index = next_option++; if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; if (s) { int long_option_index = next_long_option++; long_options[long_option_index].name = s; long_options[long_option_index].has_arg = 1; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = STRING; option_list[option_index].class = class; option_list[option_index].need_string = TRUE; option_list[option_index].set = FALSE; option_list[option_index].t.ostrng.string = s; option_list[option_index].t.ostrng.var = var; option_list[option_index].t.ostrng.default_value = default_value; option_list[option_index].t.ostrng.handler = handler; option_list[option_index].t.ostrng.set_default = set_default; option_list[option_index].t.ostrng.help_string = help_string; } /****************************************************************************** * flag_string_option * -c * --c * -s1 * --s2 */ void flag_string_option(char *c, char *s1, char *s2, boolean default_value, char *true_value, char *false_value, char **var, void (*handler)(const char *p, const char *s, boolean value, char *true_value, char *false_value), void (*set_default)(boolean value, char *string_value), option_class class, char *set_help_string, char *not_set_help_string) { int option_index = next_option++; if (c) { option_list[option_index].letter = *c; SHORT_OPTION(*c) = option_index; } else option_list[option_index].letter = 0; if (s1) { int long_option_index = next_long_option++; long_options[long_option_index].name = s1; long_options[long_option_index].has_arg = 1; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index; } if (s2) { int long_option_index = next_long_option++; long_options[long_option_index].name = s2; long_options[long_option_index].has_arg = 0; long_options[long_option_index].flag = &this_option; long_options[long_option_index].val = option_index | OPT_FLAG; } if ((next_option > MAX_OPTIONS) || (next_long_option > MAX_OPTIONS)) abort(); if ((var == NULL) && (handler == NULL)) abort(); if ((var != NULL) && (handler != NULL)) abort(); if ((handler == NULL) != (set_default == NULL)) abort(); option_list[option_index].type = FLAG_STRING; option_list[option_index].class = class; option_list[option_index].need_string = FALSE; option_list[option_index].set = FALSE; option_list[option_index].t.oflg.var = var; option_list[option_index].t.oflg.set_string = s1; option_list[option_index].t.oflg.not_set_string = s2; option_list[option_index].t.oflg.default_value = default_value; option_list[option_index].t.oflg.true_value = true_value; option_list[option_index].t.oflg.false_value = false_value; option_list[option_index].t.oflg.handler = handler; option_list[option_index].t.oflg.set_default = set_default; option_list[option_index].t.oflg.set_help_string = set_help_string; option_list[option_index].t.oflg.not_set_help_string = not_set_help_string; } /****************************************************************************** * set_option - sets the option */ void set_option(int index, char *prefix, const char *option_name, char *value) { boolean flag_set = ((index & OPT_FLAG) != 0); struct option_type *op; if (flag_set) op = &option_list[index-OPT_FLAG]; else op = &option_list[index]; if (value) dm('o',3,"Trying to set option %s%s to %s\n", prefix, option_name, value); else dm('o',3,"Trying to set option %s%s\n", prefix, option_name); if (op->set) { dm('o',3,"Option %s%s already set\n", prefix, option_name); return; } switch (op->type) { case NOPARM: (*(op->t.onoparm.handler))(prefix, option_name); break; case OPTIONAL: (*(op->t.ooptional.handler))(prefix, option_name, value); break; case BOOLEAN: if (op->t.obool.var) { *(op->t.obool.var) = (!flag_set); } else { (*(op->t.obool.handler))(prefix, option_name, !flag_set); } break; case CHAR: if (strlen(value) != 1) { fprintf(stderr, gettext(CMD_NAME ": must have one character parameter for %s%s flag, but got '%s'\n"),prefix,option_name,value); exit(1); } /* TODO: Need to check that c is in valid_set */ if (op->t.ochar.var) { *(op->t.ochar.var) = *value; } else { (*(op->t.ochar.handler))(prefix, option_name, *value, op->t.ochar.valid_set); } break; case CHOICE: if (strlen(prefix) == 1) { /* This is a short option */ if (strlen(value) != 1) { fprintf(stderr, gettext(CMD_NAME ": must have one character parameter for %s%s flag, but got '%s'\n"),prefix,option_name,value); exit(1); } if ((*value != op->t.ochoice.choice1) && (*value != op->t.ochoice.choice2)) { fprintf(stderr, gettext(CMD_NAME ": option %s%s can only take %c or %c, not %c\n"),prefix,option_name,op->t.ochoice.choice1,op->t.ochoice.choice2,*value); exit(1); } if (op->t.ochoice.var) { *(op->t.ochoice.var) = *value; } else { (*(op->t.ochoice.handler))(prefix, option_name, *value); } } else { /* This is a long option */ char chosen_value; if (strcmp(option_name,op->t.ochoice.choice1_string) == 0) { /* First option selected */ chosen_value = op->t.ochoice.choice1; } else { /* Second option selected */ chosen_value = op->t.ochoice.choice2; } if (op->t.ochoice.var) { *(op->t.ochoice.var) = chosen_value; } else { (*(op->t.ochoice.handler))(prefix, option_name, chosen_value); } } break; case SHORT: if (flag_set) { if (op->t.oshrt.var) { *(op->t.oshrt.var) = op->t.oshrt.special_value; } else { (*(op->t.oshrt.handler))(prefix, option_name, op->t.oshrt.special_value, op->t.oshrt.min, op->t.oshrt.max); } } else { int intvalue = atoi(value); if ((intvalue > op->t.oshrt.max) || (intvalue < op->t.oshrt.min)) { fprintf(stderr, gettext(CMD_NAME ": option %s%s not between %d and %d\n"),prefix,option_name,op->t.oshrt.min,op->t.oshrt.max); exit(1); } if (op->t.oshrt.var) { *(op->t.oshrt.var) = (short)intvalue; } else { (*(op->t.oshrt.handler))(prefix, option_name, (short)intvalue, op->t.oshrt.min, op->t.oshrt.max); } } break; case INT: if (flag_set) { if (op->t.oint.var) { *(op->t.oint.var) = op->t.oint.special_value; } else { (*(op->t.oint.handler))(prefix, option_name, op->t.oint.special_value, op->t.oint.min, op->t.oint.max); } } else { int intvalue = atoi(value); if ((intvalue > op->t.oint.max) || (intvalue < op->t.oint.min)) { fprintf(stderr, gettext(CMD_NAME ": option %s%s not between %d and %d\n"),prefix,option_name,op->t.oint.min,op->t.oint.max); exit(1); } if (op->t.oint.var) { *(op->t.oint.var) = intvalue; } else { (*(op->t.oint.handler))(prefix, option_name, intvalue, op->t.oint.min, op->t.oint.max); } } break; case STRING: if (op->t.ostrng.var) { *(op->t.ostrng.var) = strdup(value); } else { (*(op->t.ostrng.handler))(prefix, option_name, value); } break; case FLAG_STRING: if (op->t.oflg.var) { if (flag_set) { if (op->t.oflg.true_value) { *(op->t.oflg.var) = strdup(op->t.oflg.true_value); } else { *(op->t.oflg.var) = NULL; } } else { if (op->t.oflg.false_value) { *(op->t.oflg.var) = strdup(op->t.oflg.false_value); } else { *(op->t.oflg.var) = NULL; } } } else { (*(op->t.oflg.handler))(prefix, option_name, !flag_set, op->t.oflg.true_value, op->t.oflg.false_value); } break; default: abort(); } op->set = TRUE; dm('o',3,"Succeeded - %s%s has not been set before\n",prefix,option_name); } /****************************************************************************** * Function: * set_option_default */ void set_option_default(int index) { option_type *op = &option_list[index]; dm('o',3,"Trying to set option %d to default value\n", index); if (op->set) { dm('o',3,"Option %d already set\n", index); return; } switch (op->type) { case NOPARM: if (op->t.onoparm.default_opt) (*(op->t.onoparm.set_default))(); break; case OPTIONAL: break; case BOOLEAN: if (op->t.obool.var) { *(op->t.obool.var) = op->t.obool.default_value; } else { (*(op->t.obool.set_default))(op->t.obool.default_value); } break; case CHAR: if (op->t.ochar.var) { *(op->t.ochar.var) = op->t.ochar.default_value; } else { (*(op->t.ochar.set_default))(op->t.ochar.default_value); } break; case CHOICE: if (op->t.ochoice.var) { *(op->t.ochoice.var) = op->t.ochoice.choice1; } else { (*(op->t.ochoice.set_default))(op->t.ochoice.choice1); } break; case SHORT: if (op->t.oshrt.var) { *(op->t.oshrt.var) = op->t.oshrt.default_value; } else { (*(op->t.oshrt.set_default))(op->t.oshrt.default_value); } break; case INT: if (op->t.oint.var) { *(op->t.oint.var) = op->t.oint.default_value; } else { (*(op->t.oint.set_default))(op->t.oint.default_value); } break; case STRING: if (op->t.ostrng.var) { if (op->t.ostrng.default_value) { *(op->t.ostrng.var) = strdup(op->t.ostrng.default_value); } else { *(op->t.ostrng.var) = NULL; } } else { if (op->t.ostrng.default_value) { (*(op->t.ostrng.set_default))(strdup(op->t.ostrng.default_value)); } else { (*(op->t.ostrng.set_default))(NULL); } } break; case FLAG_STRING: if (op->t.oflg.var) { if (op->t.oflg.default_value) { if (op->t.oflg.true_value) { *(op->t.oflg.var) = strdup(op->t.oflg.true_value); } else { *(op->t.oflg.var) = NULL; } } else { if (op->t.oflg.false_value) { *(op->t.oflg.var) = strdup(op->t.oflg.false_value); } else { *(op->t.oflg.var) = NULL; } } } else { if (op->t.oflg.default_value) { if (op->t.oflg.true_value) { (*(op->t.oflg.set_default))(1, strdup(op->t.oflg.true_value)); } else { (*(op->t.oflg.set_default))(1, NULL); } } else { if (op->t.oflg.false_value) { (*(op->t.oflg.set_default))(0, strdup(op->t.oflg.false_value)); } else { (*(op->t.oflg.set_default))(0, NULL); } } } break; default: abort(); } dm('o',3,"Succeeded - option %d has not been set before\n",index); } /****************************************************************************** * Function: * print_usage_msgs */ void print_usage_msgs(option_class class) { int option_index; switch (class){ case OPT_MISC: printf(gettext("Miscellaneous options:\n")); break; case OPT_PAGE_FURNITURE: printf(gettext("Page furniture options:\n")); break; case OPT_TEXT_FORMAT: printf(gettext("Text formatting options:\n")); break; case OPT_PRINT: printf(gettext("Print selection options:\n")); break; case OPT_PAGE_FORMAT: printf(gettext("Page format options:\n")); break; case OPT_OUTPUT: printf(gettext("Output options:\n")); break; } for (option_index=0; option_index < next_option; option_index++) { option_type *op = &option_list[option_index]; if (class == op->class) { switch (op->type) { case NOPARM: if (op->letter) printf("-%c ",op->letter); if (op->t.onoparm.string) printf("--%s",op->t.onoparm.string); printf("\n %s\n",gettext(op->t.onoparm.help_string)); break; case OPTIONAL: if (op->letter) printf("-%c ",op->letter); if (op->t.ooptional.string) printf("--%s[=]",op->t.ooptional.string); printf("\n %s\n",gettext(op->t.ooptional.help_string)); break; case BOOLEAN: if (op->letter) printf("-%c ",op->letter); if (op->t.obool.true_string) printf("--%s",op->t.obool.true_string); printf("\n %s\n",gettext(op->t.obool.true_help_string)); if (op->letter) printf("--%c ",op->letter); if (op->t.obool.false_string) printf("--%s",op->t.obool.false_string); printf("\n %s\n",gettext(op->t.obool.false_help_string)); break; case CHAR: if (op->letter) printf("-%c ",op->letter); if (op->t.ochar.string) printf("--%s ",op->t.ochar.string); printf("\n %s\n",gettext(op->t.ochar.help_string)); break; case CHOICE: if (op->letter) printf("-%c %c ",op->letter,op->t.ochoice.choice1); if (op->t.ochoice.choice1_string) printf("--%s",op->t.ochoice.choice1_string); printf("\n %s\n",gettext(op->t.ochoice.choice1_help_string)); if (op->letter) printf("-%c %c ",op->letter,op->t.ochoice.choice2); if (op->t.ochoice.choice2_string) printf("--%s",op->t.ochoice.choice2_string); printf("\n %s\n",gettext(op->t.ochoice.choice2_help_string)); break; case SHORT: if (op->letter) printf("-%c ",op->letter); if (op->t.oshrt.string) printf("--%s=",op->t.oshrt.string); printf("\n %s\n",gettext(op->t.oshrt.help_string)); if (op->t.oshrt.special_string) printf("--%s\n %s\n", op->t.oshrt.special_string, gettext(op->t.oshrt.special_help_string)); break; case INT: if (op->letter) printf("-%c ",op->letter); if (op->t.oint.string) printf("--%s=",op->t.oint.string); printf("\n %s\n",gettext(op->t.oint.help_string)); if (op->t.oint.special_string) printf("--%s\n %s\n", op->t.oint.special_string, gettext(op->t.oint.special_help_string)); break; case STRING: if (op->letter) printf("-%c ",op->letter); if (op->t.ostrng.string) printf("--%s=",op->t.ostrng.string); printf("\n %s\n",gettext(op->t.ostrng.help_string)); break; case FLAG_STRING: if (op->letter) printf("-%c ",op->letter); if (op->t.oflg.set_string) printf("--%s=",op->t.oflg.set_string); printf("\n %s\n",gettext(op->t.oflg.set_help_string)); if (op->letter) printf("--%c ",op->letter); if (op->t.oflg.set_string) printf("--%s",op->t.oflg.not_set_string); printf("\n %s\n",gettext(op->t.oflg.not_set_help_string)); } } } } /****************************************************************************** * Function: * set_option_defaults */ void set_option_defaults(void) { int option_index; for (option_index=0; option_index < next_option; option_index++) { set_option_default(option_index); } } trueprint-5.3/src/utils.c0000644000076400007640000000123107216036605011203 /* * Source file: * utils.c */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "utils.h" void skipspaces(char **ptr) { while (**ptr && isspace(**ptr)) (*ptr)++; } void * xmalloc(size_t s) { void *r; if ((r = malloc(s)) == NULL) { fprintf(stderr, gettext(CMD_NAME ": cannot allocate memory\n")); exit(2); } return r; } void * xrealloc(void *v, size_t s) { void *r; if ((r = realloc(v,s)) == NULL) { fprintf(stderr, gettext(CMD_NAME ": cannot reallocate memory\n")); exit(2); } return r; } #if ! HAVE_GETTEXT #endif trueprint-5.3/src/headers.c0000644000076400007640000000516007052654426011470 /* * Source file: * headers.c * * Prints page headers. All functions are just front-ends to PS_startpage(). */ #include "config.h" #include #include "trueprint.h" #include "postscript.h" #include "options.h" #include "headers.h" static char *top_left_string; static char *top_centre_string; static char *top_right_string; static char *bottom_left_string; static char *bottom_centre_string; static char *bottom_right_string; static char *message_string; /* * Function: * setup_headers */ void setup_headers(void) { top_left_string = NULL; string_option("X", "left-header", "%L", &top_left_string, NULL, NULL, OPT_PAGE_FURNITURE, "specify string for left side of header"); bottom_left_string = NULL; string_option("x", "left-footer", "%L", &bottom_left_string, NULL, NULL, OPT_PAGE_FURNITURE, "specify string for left side of footer"); top_centre_string = NULL; string_option("Y", "center-header", "%N", &top_centre_string, NULL, NULL, OPT_PAGE_FURNITURE, "specify string for center of header"); bottom_centre_string = NULL; string_option("y", "center-footer", "%n %p", &bottom_centre_string, NULL, NULL, OPT_PAGE_FURNITURE, "specify string for center of footer"); top_right_string = NULL; string_option("Z", "right-header", "Page %P of %F", &top_right_string, NULL, NULL, OPT_PAGE_FURNITURE, "specify string for right side of header"); bottom_right_string = NULL; string_option("z", "right-footer", "Page %P of %F", &bottom_right_string, NULL, NULL, OPT_PAGE_FURNITURE, "specify string for right side of footer"); message_string = NULL; string_option("m", "message", NULL, &message_string, NULL, NULL, OPT_PAGE_FURNITURE, "message to be printed over page"); } /* * Function: * print_text_header */ void print_text_header(long page_number, long total_pages) { PS_startpage(top_left_string, top_centre_string, top_right_string, bottom_left_string, bottom_centre_string, bottom_right_string, message_string, page_number, total_pages, FALSE); } /* * Function: * print_file_header */ void print_file_header(long page_no) { char page_no_string[10]; sprintf(page_no_string, "Page %ld", page_no); PS_startpage("%L", "File Index", page_no_string, "%L", "File Index", page_no_string, message_string, page_no, 0, TRUE); } /* * Function: * print_index_header */ void print_index_header(long page_no) { char page_no_string[10]; sprintf(page_no_string, "Page %ld", page_no); PS_startpage("%L", "Function Index", page_no_string, "%L", "Function Index", page_no_string, message_string, page_no, 0, TRUE); } trueprint-5.3/src/lang_java.h0000644000076400007640000000020507052654426011777 /* * Include file: * lang_java.h */ extern stream_status get_java_char(char *, char_status *); extern char lang_java_defaults[]; trueprint-5.3/src/lang_text.c0000644000076400007640000000273707052654426012051 /* * Source file: * lang_text.c * * Contains get_text_char() which "parses" straight text. */ #include "config.h" #include #include #include "trueprint.h" #include "input.h" #include "lang_text.h" /* * Public part */ char lang_text_defaults[] = "-i -n -f -b"; char lang_list_defaults[] = "-i --n -w0 -l66 -b -f"; /* * Private part */ /* * get_text_char() * Basically just calls getnextchar and passes up information. * returns: * CHAR * FILE_END * INPUT_END */ stream_status get_text_char(char *input_char, char_status *status) { stream_status retval; *status = CHAR_NORMAL; retval = getnextchar(input_char); if (*input_char != BACKSPACE) { char nextchar; char_status nextstatus; nextstatus = getnextchar(&nextchar); if (nextchar == BACKSPACE) { char nextnextchar; char_status nextnextstatus; nextnextstatus = getnextchar(&nextnextchar); if (nextnextchar == BACKSPACE) { /* Special case - start of a string of backspaces */ ungetnextchar(nextnextchar, nextnextstatus); ungetnextchar(nextchar, nextstatus); } else if (nextnextchar == *input_char) { *status = CHAR_BOLD; } else if (nextnextchar == '_') { *status = CHAR_UNDERLINE; } else { *input_char = nextnextchar; } } else /* nextchar != BACKSPACE */ { ungetnextchar(nextchar, nextstatus); } } return retval; } trueprint-5.3/src/options.h0000644000076400007640000000756707052654426011572 /* * File: * options.h * Supports option processing. * Declaration functions are used to declare an option: * - specify either var or handler, not both. * - handler will be called just once. */ typedef enum option_class { OPT_MISC, /* Miscellaneous options */ OPT_PAGE_FURNITURE, /* Options that affect page furniture */ OPT_TEXT_FORMAT, /* Options that affect text layout */ OPT_PRINT, /* Options that (de)select stuff to print */ OPT_PAGE_FORMAT, /* Options that affect overall page presentation */ OPT_OUTPUT /* Options that affect or control where output goes */ } option_class; void setup_options(void); void handle_string_options(char *); unsigned int handle_options(int, char **); void set_option_defaults(void); void print_usage_msgs(option_class); /* * noparm option - option with no parameter * If default_opt is true then the handler will always * be called. It is up to the handler to work out if this * option should be obeyed or not. This is intended to * handle the case e.g. for -1, -2, -3 or -4 where * -1 is the default - the handler will remember if * any other option was invoked first. If invoked * because of the default_opt flag then set_default will * be used. * Must specify a handler and a set_default. */ void noparm_option(char *c, char *s, boolean default_opt, void (*handler)(const char *p, const char *s), void (*set_default)(void), option_class class, char *help_string); /* option that takes an optional string */ void optional_string_option(char *c, char *s, void (*handler)(const char *p, const char *s, char *value), option_class class, char *help_string); /* * boolean option - either y or n */ void boolean_option(char *c, char *s1, char *s2, boolean default_value, boolean *var, void (*handler)(const char *p, const char *s, boolean value), void (*set_default)(boolean value), option_class class, char *true_help_string, char *false_help_string); void choice_option(char *c, char *s1, char *s2, char choice1, char choice2, char *var, void (*handler)(const char *p, const char *s, char value), void (*set_default)(char value), option_class class, char *choice1_help_string, char *choice2_help_string); /* char option - one of a set of characters */ void char_option(char *c, char *s, char default_value, char *valid_set, char *var, void (*handler)(const char *p, const char *s, char value, char *var), void (*set_default)(char value), option_class class, char *help_string); /* short & int options */ void short_option(char *c, char *s, short default_value, char *special, short special_value, short min, short max, short *var, void (*handler)(const char *p, const char *s, short value, short min, short max), void (*set_default)(short value), option_class class, char *help_string, char *special_help_string); void int_option(char *c, char *s, int default_value, char *special, int special_value, int min, int max, int *var, void (*handler)(const char *p, const char *s, int value, int min, int max), void (*set_default)(int value), option_class class, char *help_string, char *special_help_string); /* string option */ void string_option(char *c, char *s, char *default_value, char **var, void (*handler)(const char *p, const char *s, char *value), void (*set_default)(char *value), option_class class, char *help_string); /* flag option for setting string */ void flag_string_option(char *c, char *s1, char *s2, boolean default_value, char *true_value, char *false_value, char **var, void (*handler)(const char *p, const char *s, boolean value, char *true_value, char *false_value), void (*set_default)(boolean value, char *string), option_class class, char *set_help_string, char *not_set_help_string); trueprint-5.3/src/utils.h0000644000076400007640000000022307255530247011214 #include "replace/replace.h" #include void skipspaces(char **); extern void *xmalloc(size_t); extern void *xrealloc(void *, size_t); trueprint-5.3/src/headers.h0000644000076400007640000000030707052654426011473 /* * Include file: * headers.h */ extern void setup_headers(void); void print_text_header(long, long); void print_file_header(long); void print_index_header(long); void print_cflow_header(long); trueprint-5.3/src/lang_pascal.c0000644000076400007640000001130207052654426012314 /* * Source file: * lang_pascal.c * * Contains get_pascal_char(), which parses C code. */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "input.h" #include "index.h" #include "language.h" #include "output.h" #include "lang_pascal.h" /* * Public part */ char lang_pascal_defaults[] = "--f --F --i"; /* * Private part */ typedef enum { PAS_SPACE, PAS_COMMENT_START, PAS_COMMENT_END, PAS_COMMENT } pascal_states; typedef enum { FN_CODE, FN_PROCEDURE, FN_FUNCTION, FN_BEGIN, FN_END, FN_SPACE, FN_NAME } pascal_fn_states; static char procedure_string[] = "procedure"; static char function_string[] = "function"; static char begin_string[] = "begin"; static char end_string[] = "end"; /* * get_pascal_char() * detects comment starts and ends; * finds function names; * detects function ends; * returns one of the following: * CHAR * COMMENT_START * COMMENT_END * FUNCTION_END * FILE_END * INPUT_END * FUNCTION_NAME_START * FUNCTION_NAME_END */ stream_status get_pascal_char(char *input_char, char_status *status) { stream_status retval; static pascal_states state = PAS_SPACE; static pascal_fn_states fn_state = FN_CODE; static long start_char; static char fn_name[SYMBOL_LEN]; static long fn_page; static size_t token_index; static short function_depth = 0; *status = CHAR_NORMAL; if (restart_language == TRUE) { state = PAS_SPACE; fn_state = FN_CODE; function_depth = 0; braces_depth = 0; restart_language = FALSE; } retval = getnextchar(input_char); switch (state) { case PAS_SPACE: if (isspace(*input_char)) break; if (*input_char == '{') { state = PAS_COMMENT; *status = CHAR_ITALIC; } else if (*input_char == '(') { stream_status s; char c; s = getnextchar(&c); if (c == '*') *status = CHAR_ITALIC; ungetnextchar(c,s); state=PAS_COMMENT_START; } break; case PAS_COMMENT_START: if (*input_char == '*') { state = PAS_COMMENT; *status = CHAR_ITALIC; } else state = PAS_SPACE; break; case PAS_COMMENT_END: *status = CHAR_ITALIC; if (*input_char == ')') state = PAS_SPACE; break; case PAS_COMMENT: *status = CHAR_ITALIC; if (*input_char == '}') { state = PAS_SPACE; } else if (*input_char == '*') { state = PAS_COMMENT_END; } break; default: abort(); } if ((state == PAS_SPACE) || (state == PAS_COMMENT_START)) { switch (fn_state) { case FN_CODE: if (*input_char == 'b'){fn_state=FN_BEGIN;token_index=1;break;} if (*input_char == 'e'){fn_state=FN_END;token_index=1;break;} if (*input_char == 'f'){fn_state=FN_FUNCTION;token_index=1;break;} if (*input_char == 'p'){fn_state=FN_PROCEDURE;token_index=1;break;} break; case FN_PROCEDURE: if (*input_char == procedure_string[token_index]) { if (++token_index == strlen(procedure_string)) { token_index = 0; fn_state = FN_SPACE; } } else fn_state = FN_CODE; break; case FN_FUNCTION: if (*input_char == function_string[token_index]) { if (++token_index == strlen(function_string)) { token_index = 0; fn_state = FN_SPACE; } } else fn_state = FN_CODE; break; case FN_BEGIN: if (*input_char == begin_string[token_index]) { if (++token_index == strlen(begin_string)) { token_index = 0; fn_state = FN_CODE; braces_depth++; } } else fn_state = FN_CODE; break; case FN_END: if (*input_char == end_string[token_index]) { if (++token_index == strlen(end_string)) { token_index = 0; fn_state = FN_CODE; if (braces_depth != 0) if (--braces_depth == function_depth) { retval|=STREAM_FUNCTION_END; end_function(page_number); function_depth--; } } } else fn_state = FN_CODE; break; case FN_SPACE: if (!isspace(*input_char)) { if (isalpha(*input_char)) { token_index = 0; fn_name[token_index++] = *input_char; start_char = char_number; fn_page = page_number; fn_state = FN_NAME; } else fn_state = FN_CODE; } break; case FN_NAME: if ((isalnum(*input_char)||*input_char == '_') && (token_index < SYMBOL_LEN-1)) fn_name[token_index++] = *input_char; else { fn_name[token_index] = '\0'; add_function(fn_name,start_char,char_number-1,fn_page,current_filename); fn_state = FN_CODE; function_depth = braces_depth; } break; default: abort(); } } if (pass==1) *status = get_function_name_posn(char_number,*status); return(retval); } trueprint-5.3/src/lang_text.h0000644000076400007640000000025007052654426012042 /* * Include file: * lang_text.h */ extern stream_status get_text_char(char *, char_status *); extern char lang_text_defaults[]; extern char lang_list_defaults[]; trueprint-5.3/src/output.c0000644000076400007640000004320207322201756011406 /* * Source file: * output.c * * Contains the formatting and output functions. */ #include "config.h" #include #include #include #include #include "trueprint.h" #include "main.h" #include "diffs.h" #include "headers.h" #include "index.h" #include "postscript.h" #include "language.h" #include "print_prompt.h" #include "debug.h" #include "options.h" #include "utils.h" #include "output.h" /****************************************************************************** * Public part */ long file_page_number; long page_number; /****************************************************************************** * Private part */ typedef enum { INSERT, DELETE, NORMAL } diff_states; static void add_char(short position,char character,char_status status,char *line,char_status line_status[]); static int line_end(char *input_line, int last_char_printed); static stream_status printnextline(void); static boolean blank_page(unsigned int file_number, boolean print_page); /* * Local variables */ static boolean no_clever_wrap; static short min_line_length; static short tabsize; static boolean no_function_page_breaks; static boolean new_sheet_after_file; static boolean no_expand_page_break; static long line_number; static boolean reached_end_of_sheet; static char *segment_ends[4][3] = { /* INSERT DELETE NORMAL */ /* NORMAL */ { ") BF setfont show ", ") CF setfont So show ", ") CF setfont show " }, /* ITALIC */ { ") IF setfont Bs ", ") IF setfont So show ", ") IF setfont show " }, /* BOLD */ { ") BF setfont show ", ") BF setfont So show ", ") BF setfont show " }, /* UNDERLINE */ { ") BF setfont Ul show", ") CF setfont So Ul show ",") CF setfont Ul show " }, }; /****************************************************************************** * Function: * init_output */ void init_output(void) { line_number = 0; page_number = 0; } /****************************************************************************** * Function: * setup_output */ void setup_output(void) { boolean_option("b", "no-page-break-after-function", "page-break-after-function", TRUE, &no_function_page_breaks, NULL, NULL, OPT_TEXT_FORMAT, "don't print page breaks at the end of functions", "print page breaks at the end of functions"); boolean_option(NULL, "new-sheet-after-file", "no-new-sheet-after-file", TRUE, &new_sheet_after_file, NULL, NULL, OPT_TEXT_FORMAT, "Print each file on a new sheet of paper", "Don't print each file on a new sheet of paper"); boolean_option("W", "no-intelligent-line-wrap", "intelligent-line-wrap", FALSE, &no_clever_wrap, NULL, NULL, OPT_TEXT_FORMAT, "Wrap lines at exactly the line-wrap column", "Wrap lines intelligently at significant characters, such\n" " as a space"); short_option("L", "minimum-line-length", 10, NULL, 0, 5, 4096, &min_line_length, NULL, NULL, OPT_TEXT_FORMAT, "minimum line length permitted by intelligent line wrap (default 10)", NULL); short_option("T", "tabsize", 8, NULL, 0, 1, 20, &tabsize, NULL, NULL, OPT_TEXT_FORMAT, "set tabsize (default 8)", NULL); boolean_option("E", "ignore-form-feeds", "form-feeds", FALSE, &no_expand_page_break, NULL, NULL, OPT_TEXT_FORMAT, "don't expand form feed characters to new page", "expand form feed characters to new page"); } /****************************************************************************** * Function: * add_char * * Simply adds a character plus status to a couple of arrays */ void add_char(short position,char character,char_status status,char *line,char_status line_status[]) { if (position >= MAXLINELENGTH) fprintf(stderr, gettext(CMD_NAME ": line too long! Are you sure this is a program listing?\n")); line[position] = character; line_status[position] = status; } /****************************************************************************** * Function: * getnextline * Gets the next full line of input and expands tabs. * Always returns data, even if it is a blank line. */ stream_status getnextline(stream_status (*get_input_char)(char *,char_status *), boolean *blank_line, char input_line[], char_status input_status[]) { char input_char; short line_position=0; stream_status retval = STREAM_OK; char_status status; *blank_line = TRUE; do { retval |= get_input_char(&input_char,&status); if (!isspace(input_char)) *blank_line = FALSE; if (input_char == '\t') { /* * if we read a tab then expand it out. */ short tab_stop = tabsize + line_position - line_position%tabsize; short cursor; for (cursor=line_position;cursor < tab_stop;cursor++) add_char(cursor,' ',status,input_line,input_status); line_position = tab_stop; } else if (input_char == '\n') { break; } else if (input_char == '\014') { /* * if a newpage character then convert to space */ if (no_expand_page_break == FALSE) { retval |= STREAM_PAGE_END; add_char(line_position++,' ',status,input_line,input_status); } else { add_char(line_position++,'_',status,input_line,input_status); } } else if (iscntrl(input_char)) { /* * if a control character then convert to underscore */ add_char(line_position++,'_',status,input_line,input_status); } else { add_char(line_position++,input_char,status,input_line,input_status); } } while (!(retval & (STREAM_FILE_END))); /* * put a null at the end of the line */ input_line[line_position] = 0; return(retval); } /* * function: * line_end * * we have a line that may need to be broken. * search from the end of the line backwards, looking for a suitable * place to break the line. */ int line_end(char *input_line, int last_char_printed) { int input_line_length; boolean got_end=FALSE; short break_index; int output_line_end; input_line_length = (int)strlen(input_line); dm('O',4,"output.c:line_end() line length is %d\n",input_line_length); if (page_width == 0) { /* * The line doesn't need to be broken */ output_line_end = input_line_length - 1; return(output_line_end); } if ((input_line_length - last_char_printed) > page_width) { if (no_clever_wrap == TRUE) { /* * Don't need to do anything clever - just return the * point in the string which is "page_width" plus * the last point printed. */ return (last_char_printed + page_width); } /* * the line needs to be broken. there is an array, breaks, * containing valid symbols that a line can be broken on. * what now needs to be done is to work through the array, * starting with the most desirable break character, until * one of the break characters is found in the line and then * the line can be broken there. */ for (break_index=0; break_index < BREAKSLENGTH; break_index++) { for (output_line_end = last_char_printed + page_width; output_line_end > last_char_printed + min_line_length; output_line_end--) if (input_line[output_line_end] == BREAKS[break_index]) { got_end=TRUE; break; } if (got_end == TRUE) break; } if (got_end == FALSE) output_line_end = last_char_printed+page_width; if (output_line_end >= input_line_length) output_line_end = input_line_length; } else /* the line doesn't need to be broken at all. */ output_line_end = input_line_length - 1; return(output_line_end); } /* * function: * printnextline * * prints a line of code on stdout, splitting at appropriate locations. * behaves very similarly for pass 0 and for pass 1, except it doesn't * print anything out during pass 0. */ stream_status printnextline() { static char input_line[MAXLINELENGTH]; static char_status input_status[MAXLINELENGTH]; static int last_char_printed; static int input_line_length=0; int output_line_end; static stream_status retval=STREAM_OK; int output_char_idx; boolean first_line_segment=FALSE; short count; static diff_states diff_state=NORMAL; boolean blank_line; char_status last_char_status; /* * See if we need to read in a new line */ if (input_line_length == 0) { /* * we do - check to see if there might be a deleted * line that needs to be printed before the current * line. if diff_state is delete then there is already * a line waiting in input_line... * * diff_state: * NORMAL need another line, retval set to return of previous * getnextline() or LINE * DELETE line waiting in input_line, retval set to return of * previous getnextline() or LINE * INSERT should never happen */ dm('O',4,"output.c:printnextline() Need new line\n"); switch (diff_state) { case NORMAL: dm('O',4,"output.c:printnextline() diff_state is NORMAL\n"); if (getdelline(line_number+1,input_line,input_status)){ dm('O',4,"output.c:printnextline() Found deleted line - diff_state is now DELETE\n"); diff_state = DELETE; } else { /* * there isn't a deleted line - get * the next line and check if this is * an inserted line. */ line_number += 1; retval = getnextline(get_char,&blank_line,input_line,input_status); if (line_inserted(line_number)) { dm('O',4,"output.c:printnextline() This line is inserted - diff_state is now INSERT\n"); diff_state = INSERT; } else { dm('O',4,"output.c:printnextline() Nothing unusual - diff_state is still NORMAL\n"); diff_state = NORMAL; } } break; case DELETE: dm('O',4,"output.c:printnextline() diff_state is DELETE\n"); /* * There is already a line in input_line, put there at the end * of the previous call to print_page() */ break; case INSERT: default: abort(); } input_line_length = (int)strlen(input_line); last_char_printed = -1; first_line_segment = TRUE; /* * At this point * diff_state * NORMAL print the line, retval set to return of getnextline() * DELETE print the deleted line, retval is set to return of * previous getnextline() or LINE * INSERT print the line as an inserted line, retval is set to * return of getnextline() */ /* * page_has_changed() flags this page and function as having changed */ if (diff_state != NORMAL) page_has_changed(page_number); if (pass == 1) { /* * a new line of source file is about to be printed - so * the appropriate line start, including line number and * a mark to show insertions or deletions, needs to be * printed. */ if (diff_state == DELETE) { dm('O',4,"output.c:printnextline() Printing line with diff state DELETE\n"); if ((no_show_line_number == FALSE) || (no_show_indent_level == FALSE)) PUTS("Lpt (- ) CFs setfont show ("); else PUTS("Lpt (-) CFs setfont show ("); } else { if (diff_state == INSERT) { dm('O',4,"output.c:printnextline() Printing line with diff state INSERT\n"); PUTS("Lpt BFs setfont (+"); } else { dm('O',4,"output.c:printnextline() Printing line with diff state NORMAL\n"); PUTS("Lpt CFs setfont ( "); } if (blank_line) PUTS(" "); else if ((no_show_line_number == FALSE) || (no_show_indent_level == FALSE)) { if (no_show_line_number == FALSE) printf("%5ld ",line_number); else PUTS(" "); if ((no_show_indent_level == FALSE) && (braces_depth != 0)) printf("%2d ",braces_depth); else PUTS(" "); } PUTS(") show ("); } } } else { if (pass == 1) { if (diff_state == DELETE) { dm('O',4,"output.c:printnextline() Printing line with diff state DELETE\n"); PUTS("Lpt CFs setfont ( "); } else if (diff_state == INSERT) { dm('O',4,"output.c:printnextline() Printing line with diff state INSERT\n"); PUTS("Lpt BFs setfont ( "); } else { dm('O',4,"output.c:printnextline() Printing line with diff state NORMAL\n"); PUTS("Lpt CFs setfont ( "); } if ((no_show_line_number == FALSE) || (no_show_indent_level == FALSE)) PUTS(" "); PUTS(") show ("); } } /* * now work out where (and if) the line needs to be split... */ output_line_end = line_end(input_line,last_char_printed); if (pass == 1) { output_char_idx = last_char_printed; if ((no_clever_wrap == FALSE) && !first_line_segment) { /* want to pad the outgoing line with leading spaces */ int leading_spaces = page_width - (output_line_end - last_char_printed); for (count=1; count < leading_spaces; count++) putchar(' '); } /* * now print the line a character at a time... with some clever * coding this could probably be speeded up by printing sections * of the line instead of single characters. */ last_char_status = input_status[output_char_idx+1]; while (output_char_idx < output_line_end) { output_char_idx += 1; /* * Check to see if anything should be printed * out before printing the character */ if (last_char_status != input_status[output_char_idx]) { PUTS(segment_ends[last_char_status][diff_state]); PUTS("("); } /* * Print the character.... */ switch(input_line[output_char_idx]) { case '(': case ')': case '\\': putchar('\\'); break; default: ; } putchar(input_line[output_char_idx]); last_char_status = input_status[output_char_idx]; } PUTS(segment_ends[last_char_status][diff_state]); PUTS(" Nl\n"); output_char_idx++; } last_char_printed = output_line_end; /* * Have we reached the end of the line to be printed? */ if (last_char_printed == input_line_length-1) { /* * At this point: * diff_state * NORMAL line printed, retval set to return of getnextline() * INSERT line printed, retval is set to return of getnextline() * DELETE deleted line printed, retval is set to return of * previous getnextline() or STREAM_OK * * We should now check to see if there are * any deleted lines to be printed. If there are then set diff_state * and start printing them next time round. Otherwise return retval. */ input_line_length = 0; if (getdelline(line_number+1,input_line,input_status)) { diff_state = DELETE; dm('O',3,"output.c:printnextline() Return value is STREAM_OK\n"); return(STREAM_OK); } diff_state = NORMAL; if (retval & STREAM_FILE_END) { /* * Set everything up for the next file */ line_number = 0; retval = STREAM_OK; dm('O',3,"output.c:printnextline() Return value is STREAM_FILE_END\n"); return (STREAM_FILE_END); } dm('O',3,"output.c:printnextline() Return value is %x\n", retval); return(retval); } else { dm('O',3,"output.c:printnextline() Not fully printed this line - return value is LINE\n"); return(STREAM_OK); } } /****************************************************************************** * function: * blank_page * prints out a blank page (well, what did you expect!). */ boolean blank_page(unsigned int file_number, boolean output_page) { file_page_number += 1; page_number += 1; print_text_header(page_number, total_pages); return PS_endpage(output_page); } /****************************************************************************** * function: * print_page * * prints out a single page of a file. */ boolean print_page(void) { short page_line_number = 0; stream_status retval=STREAM_OK; file_page_number += 1; page_number += 1; dm('O',2,"output.c:print_page() Printing file %d page %d, filepage %d, pass %d\n", file_number, page_number, file_page_number, pass); /* * Print a page header */ print_text_header(page_number, total_pages); /* * now print out enough lines to fill the page or until we've reached * a page break (which is caused by end of input, file, function or * a newpage character). */ while (page_line_number < page_length) { dm('O',3,"output.c:print_page() Printing line %d\n", page_line_number); retval = printnextline(); page_line_number += 1; if ((retval & (STREAM_PAGE_END|STREAM_FILE_END)) || ((retval & STREAM_FUNCTION_END) && (no_function_page_breaks == FALSE))) break; } /* * And finally end the page */ reached_end_of_sheet = PS_endpage(print_prompt(PAGE_BODY, file_page_number, file_name(file_number))); dm('O',2,"output.c:print_page() retval %x\n", retval); return (!(retval & STREAM_FILE_END)); } /* * function: * print_file * * prints out a page at a time, calling blank_page to ensure an even number * of pages at the end of the file. */ void print_file(void) { file_page_number = 0; /* * set get_char appropriately */ set_get_char(current_filename); while (print_page()); /* * we want to ensure that each file starts on an odd page (i.e. a * new sheet of paper, and also that the whole output has an even * number of pages in total, so print any blank pages necessary. */ if (new_sheet_after_file) { /* * Print blank pages until the last page printed was the last page * on a physical sheet. */ while (!reached_end_of_sheet) { dm('O',3,"output.c:print_page() Printing a blank page\n"); reached_end_of_sheet = blank_page(file_number, print_prompt(PAGE_BLANK, 0, NULL)); } } } trueprint-5.3/tests/0000777000076400007640000000000007322207151010333 5trueprint-5.3/tests/Makefile.in0000664000076400007640000001324207322207150012317 # Makefile.in generated automatically by automake 1.4 from Makefile.am # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ GOT_DIFF_CMD = @GOT_DIFF_CMD@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PRINT_CMD = @PRINT_CMD@ RANLIB = @RANLIB@ VERSION = @VERSION@ EXTRA_DIST = Run OLDtest6.c test1.c test1.out test10.out test11.out test12.out test13.out test14.out test15.out test16.out test17.out test18.out test19.out test2.c test2.out test20.out test21 test21.out test22.out test23.out test24.out test25.out test26.out test27.out test28.out test29.out test3 test3.out test30.out test31.out test32.out test33.out test34.out test35.out test36.out test37.out test38.out test39.out test4.new test4.old test4.out test40.out test41.out test42.out test43.out test44.out test45.out test46.out test47.out test48.out test5.out test6.c test6.out test7 test7.out test8.out test9.out MAINTAINERCLEANFILES = Makefile.in TESTS_ENVIRONMENT = top_builddir=$(top_builddir) TESTS = Run mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = ../config.h ../config.h CONFIG_CLEAN_FILES = DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = tests distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done check-TESTS: $(TESTS) @failed=0; all=0; \ srcdir=$(srcdir); export srcdir; \ for tst in $(TESTS); do \ if test -f $$tst; then dir=.; \ else dir="$(srcdir)"; fi; \ if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ all=`expr $$all + 1`; \ echo "PASS: $$tst"; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="$$failed of $$all tests failed"; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0 info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) -rm -f config.cache config.log stamp-h stamp-h[0-9]* maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." maintainer-clean: maintainer-clean-am .PHONY: tags distdir check-TESTS info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-am install-data install-am install uninstall-am uninstall \ all-redirect all-am all installdirs mostlyclean-generic \ distclean-generic clean-generic maintainer-clean-generic clean \ mostlyclean distclean maintainer-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: trueprint-5.3/tests/Makefile.am0000664000076400007640000000170107217547610012316 ## Makefile.am -- Process this file with automake to produce Makefile.in EXTRA_DIST = \ Run \ OLDtest6.c \ test1.c \ test1.out \ test10.out \ test11.out \ test12.out \ test13.out \ test14.out \ test15.out \ test16.out \ test17.out \ test18.out \ test19.out \ test2.c \ test2.out \ test20.out \ test21 \ test21.out \ test22.out \ test23.out \ test24.out \ test25.out \ test26.out \ test27.out \ test28.out \ test29.out \ test3 \ test3.out \ test30.out \ test31.out \ test32.out \ test33.out \ test34.out \ test35.out \ test36.out \ test37.out \ test38.out \ test39.out \ test4.new \ test4.old \ test4.out \ test40.out \ test41.out \ test42.out \ test43.out \ test44.out \ test45.out \ test46.out \ test47.out \ test48.out \ test5.out \ test6.c \ test6.out \ test7 \ test7.out \ test8.out \ test9.out MAINTAINERCLEANFILES = Makefile.in TESTS_ENVIRONMENT = top_builddir=$(top_builddir) TESTS = Run trueprint-5.3/tests/Run0000755000076400007640000004623207322203426010751 #!/bin/sh # To run the tests, run "make check" from the parent directory. # To regenerate the outputs, run: # top_builddir= srcdir= ./Run generate passed=0 echo top_builddir = $top_builddir echo srcdir = $srcdir top_builddir=`cd $top_builddir && pwd` TRUEPRINT=$top_builddir/src/trueprint TP_OPTS="--N" TP_PRINT_CMD=cat export TP_PRINT_CMD TP_OPTS test=1 echo -n "$test Single C source file... " args="test1.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=2 echo -n "$test Two C source files... " args="test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=3 echo -n "$test Text file followed by C source file... " args="test3 test1.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=4 echo -n "$test Diff of two files... " args="-O test4.old test4.new" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=5 echo -n "$test Diff of two files with long options... " args="--diff=test4.old test4.new" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=6 echo -n "$test Another diff of two files... " args="-O test4.new test4.old" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=7 echo -n "$test Another diff of two files with long options... " args="--diff=test4.new test4.old" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=8 echo -n "$test Diffs using a prefix... " args="-O OLD test6.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=9 echo -n "$test Diffs using a prefix with long options... " args="--diff=OLD test6.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=10 echo -n "$test Very long source line... " args="test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=11 echo -n "$test Set interline gap & pointsize & page length -g -p -l... " args="-g7 -p9 -l45 test1.c test3" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=12 echo -n "$test Set interline gap & pointsize & page length with long options... " args="--leading=7 --point-size=9 --page-length=45 test1.c test3" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=13 echo -n "$test Change date & time in headers -X... " args="-X Header-test test4.new test4.old" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=14 echo -n "$test Change date & time in headers with long options... " args="--left-header=Header-test test4.new test4.old" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=15 echo -n "$test Use login name in headers -X %l... " args="-X %l test6.c test1.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=16 echo -n "$test Use login name in headers --left-header=%l... " args="--left-header=%l test6.c test1.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=17 echo -n "$test Print message over page -m... " args="-m Overprint-test test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=18 echo -n "$test Print message over page --message... " args="--message=Overprint-test test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=19 echo -n "$test Use current filename for message string -m %n... " args="-m %n test4.new test4.old" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=20 echo -n "$test Use current filename for message string --message %n... " args="--message=%n test4.new test4.old" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=21 echo -n "$test Use landscape mode -ol... " args="-ol test1.c test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=22 echo -n "$test Use landscape mode with long option... " args="--landscape test1.c test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=23 echo -n "$test Print 2-on-1 -2... " args="-2 test1.c test7 test6.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=24 echo -n "$test Print 2-on-1 --two-up... " args="--two-up test1.c test7 test6.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=25 echo -n "$test Print 4-on-1 -4... " args="-4 test1.c test7 test6.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=26 echo -n "$test Print 4-on-1 --four-up... " args="--four-up test1.c test7 test6.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=27 echo -n "$test Long lines & page width -w... " args="-w 40 test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=28 echo -n "$test Long lines & page width --line-wrap... " args="--line-wrap=40 test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=29 echo -n "$test Turn off intelligent linewrap -Wn... " args="-W -w 40 test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=30 echo -n "$test Turn off intelligent linewrap with long options... " args="--no-intelligent-line-wrap --line-wrap=40 test7" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=31 echo -n "$test Exclude braces depth count for C, line number count -in -nn... " args="-i -n test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=32 echo -n "$test Exclude braces depth count for C, line number count with long options... " args="--no-braces-depth --no-line-numbers test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=33 echo -n "$test Print double-sided -S2... " args="-S2 test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=34 echo -n "$test Print double-sided --double-sided... " args="--double-sided test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=35 echo -n "$test Suppress everything -C -F -f -B... " args="-C -F -f -B test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=36 echo -n "$test Suppress everything using long options... " args="--no-cover-sheet --no-file-index --no-function-index --no-print-body test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=37 echo -n "$test Set tabsize wierdly -T5... " args="-T5 test21" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=38 echo -n "$test Set tabsize wierdly using long option... " args="--tabsize=5 test21" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=39 echo -n "$test Set headers/footers... " args="-x Test-%%-%m-%d-%y -y %D-%L-%H-%M -z %S-%T-%j-%w -X %a-%h-%r-%p -Y %h-%r-%p-%P -Z %f-%F-%n-%N -m Login-%l test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=40 echo -n "$test Set headers/footers using long options... " args="--left-footer=Test-%%-%m-%d-%y --center-footer=%D-%L-%H-%M --right-footer=%S-%T-%j-%w --left-header=%a-%h-%r-%p --center-header=%h-%r-%p-%P --right-header=%f-%F-%n-%N --message=Login-%l test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=41 echo -n "$test Indent for holepunch --I... " args="--I -ol -2 test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=42 echo -n "$test Indent for holepunch using long options... " args="--holepunch --landscape --two-up test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=43 echo -n "$test Suppress headers --K... " args="--K test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=44 echo -n "$test Suppress headers using long options... " args="--no-headers test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=45 echo -n "$test Suppress footers --k... " args="--k -ol -2 test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=46 echo -n "$test Suppress footers using long options... " args="--no-footers --landscape --two-up test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out else ( cd $srcdir; $TRUEPRINT $args ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=47 echo -n "$test Stdin for default... " args="" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out < test1.c else ( cd $srcdir; $TRUEPRINT $args < test1.c ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=48 echo -n "$test - for stdin... " args="test1.c - test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out < test6.c else ( cd $srcdir; $TRUEPRINT $args < test6.c ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi test=49 echo -n "$test No new sheet for new file" args="--no-new-sheet-after-file --four-up test1.c test2.c" if [ "$1" = "generate" ] ; then ( cd $srcdir; $TRUEPRINT $args ) > test$test.out < test6.c else ( cd $srcdir; $TRUEPRINT $args < test6.c ) | diff - $srcdir/test$test.out > test$test.dif if [ $? -ne "0" ] ; then echo "failed" else echo "passed" ; rm test$test.dif passed=`expr $passed + 1` fi fi echo "$passed out of 49 tests passed" echo "To complete the test, print a file using trueprint" if test $passed -eq 49; then exit 0; else exit 1; fi trueprint-5.3/tests/OLDtest6.c0000644000076400007640000000513307052654426012034 /* * Source file: * openpipe.c * * Contains openpipe - a replacement for the non-POSIX function popen. * This returns an int rather than a FILE * to make it general purpose. * NOTE THAT THE VARIABLE cmd_name IS NOT DEFINED IN THIS FILE */ #define _POSIX_SOURCE #include #include #include #include #include #include #include /**************************************************************************** * Function: * openpipe * * Opens a pipe to or from a command. This is _not_ a direct replacement for * popen because: * - in the case of failure it prints an error message and calls exit, * instead of just returning NULL; * - it returns an int instead of a FILE *; * - it is called openpipe instead of popen */ int openpipe(const char *command, char *mode) { int fildes[2]; int parent_pipe_end; int child_pipe_end; char *child_pipe_mode; if (strcmp(mode, "w") == 0) { parent_pipe_end = 1; child_pipe_end = 0; child_pipe_mode = "read"; } else if (strcmp(mode, "r") == 0) { parent_pipe_end = 0; child_pipe_end = 1; child_pipe_mode = "write"; } else { (void)fprintf(stderr, "%s: Internal error: popen() called with bad mode %s", cmd_name, mode); exit(2); } if (pipe(fildes) != 0) { (void)fprintf(stderr, "%s: Cannot create pipe, %s\n", cmd_name, strerror(errno)); exit(2); } switch (fork()) { case -1: /* Error */ (void)fprintf(stderr, "%s: Cannot fork, %s\n", cmd_name, strerror(errno)); exit(2); /*NOTREACHED*/ case 0: /* Child process */ if (!((close(fildes[parent_pipe_end]) == 0) && (close(child_pipe_end) == 0) && (dup(fildes[child_pipe_end]) == child_pipe_end))) { (void)fprintf(stderr,"%s: Cannot redirect %s for child, %s\n", cmd_name, child_pipe_mode, strerror(errno)); exit(2); } if (system(command) < 0) { (void)fprintf(stderr,"%s: Cannot start pipe, %s\n",cmd_name, strerror(errno)); exit(2); } else exit(0); /*NOTREACHED*/ default: /* Parent process */ if (close(fildes[child_pipe_end]) != 0) { (void)fprintf(stderr,"%s: Cannot close %s end of pipe for parent, %s\n",cmd_name, child_pipe_mode, strerror(errno)); exit(2); } return fildes[parent_pipe_end]; } } FILE * fopenpipe(const char *command, char *mode) { int handle; handle = openpipe(command, mode); return fdopen(handle, mode); } void closepipe(int handle) { int statloc; (void)close(handle); (void)waitpid(-1, &statloc, WNOHANG); } void fclosepipe(FILE *fp) { closepipe(fileno(fp)); } trueprint-5.3/tests/test1.c0000644000076400007640000000462407052654426011474 /* * Source file: * openpipe.c * * Contains openpipe - a replacement for the non-POSIX function popen. * This returns an int rather than a FILE * to make it general purpose - * fdopen can be used outside to convert this to a FILE * */ #define _POSIX_SOURCE #include #include #include #include #include #include #ifdef _ultrix extern int close(int fildes); extern int dup(int fildes); extern pid_t fork(void); extern int pipe(int fildes[2]); #else #include #endif #include "trueprint.h" #include "main.h" #include "openpipe.h" int openpipe(const char *command, char *mode) { int fildes[2]; int parent_pipe_end; int child_pipe_end; char *child_pipe_mode; if (strcmp(mode, "w") == 0) { parent_pipe_end = 1; child_pipe_end = 0; child_pipe_mode = "read"; } else if (strcmp(mode, "r") == 0) { parent_pipe_end = 0; child_pipe_end = 1; child_pipe_mode = "write"; } else { (void)fprintf(stderr, "%s: Internal error: popen() called with bad mode %s", cmd_name, mode); exit(2); } if (pipe(fildes) != 0) { (void)fprintf(stderr, "%s: Cannot create pipe, %s\n", cmd_name, strerror(errno)); exit(2); } switch (fork()) { case -1: /* Error */ (void)fprintf(stderr, "%s: Cannot fork, %s\n", cmd_name, strerror(errno)); exit(2); /*NOTREACHED*/ case 0: /* Child process */ if (!((close(fildes[parent_pipe_end]) == 0) && (close(child_pipe_end) == 0) && (dup(fildes[child_pipe_end]) == child_pipe_end))) { (void)fprintf(stderr,"%s: Cannot redirect %s for child, %s\n", cmd_name, child_pipe_mode, strerror(errno)); exit(2); } if (system(command) < 0) { (void)fprintf(stderr,"%s: Cannot start pipe, %s\n",cmd_name, strerror(errno)); exit(2); } else exit(0); /*NOTREACHED*/ default: /* Parent process */ if (close(fildes[child_pipe_end]) != 0) { (void)fprintf(stderr,"%s: Cannot close %s end of pipe for parent, %s\n",cmd_name, child_pipe_mode, strerror(errno)); exit(2); } return fildes[parent_pipe_end]; } } FILE * fopenpipe(const char *command, char *mode) { int handle; handle = openpipe(command, mode); return fdopen(handle, mode); } void closepipe(int handle) { int statloc; (void)close(handle); (void)waitpid(-1, &statloc, WNOHANG); } void fclosepipe(FILE *fp) { closepipe(fileno(fp)); } trueprint-5.3/tests/test1.out0000644000076400007640000003243207322203436012046 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 2) show 70 650 moveto (File: test1.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( openpipe....................1 (test1.c)) show Nl showpage %%Page: 2 3 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test10.out0000644000076400007640000000521307322203437012124 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends way beyond the normal width of a normal line and goes on ) CF setfont show Nl Lpt CFs setfont ( ) show ( until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test11.out0000644000076400007640000006321007322203437012126 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 8 def /SPs 6 def /Lh 15 def /Rm 575 def /Tm 746 def /Bh 13 def /Bf 13 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test3) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 3 (test1.c) ) show Nl Lpt( openpipe....................1 (test1.c)) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................3) show Nl Lpt( openpipe 1) show Nl Lpt( test3 4) BF setfont show CF setfont Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 6 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add (test3 1) stringwidth pop 2 div sub Ypos moveto (test3 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) CF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) CF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) CF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) CF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) CF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) CF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) CF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 35 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl showpage %%Page: 7 8 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (test3 2) stringwidth pop 2 div sub Ypos moveto (test3 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 46 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 ) show ( /* Error */) CF setfont show Nl Lpt CFs setfont ( 60 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 ) show ( /* Child process */) CF setfont show Nl Lpt CFs setfont ( 66 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 ) show ( /* Parent process */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 ) show ( }) CF setfont show Nl showpage %%Page: 8 9 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (test3 3) stringwidth pop 2 div sub Ypos moveto (test3 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 94 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 105 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 115 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test12.out0000644000076400007640000006321007322203437012127 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 8 def /SPs 6 def /Lh 15 def /Rm 575 def /Tm 746 def /Bh 13 def /Bf 13 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test3) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 3 (test1.c) ) show Nl Lpt( openpipe....................1 (test1.c)) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................3) show Nl Lpt( openpipe 1) show Nl Lpt( test3 4) BF setfont show CF setfont Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 6 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add (test3 1) stringwidth pop 2 div sub Ypos moveto (test3 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) CF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) CF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) CF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) CF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) CF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) CF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) CF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 35 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl showpage %%Page: 7 8 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (test3 2) stringwidth pop 2 div sub Ypos moveto (test3 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 46 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 ) show ( /* Error */) CF setfont show Nl Lpt CFs setfont ( 60 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 ) show ( /* Child process */) CF setfont show Nl Lpt CFs setfont ( 66 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 ) show ( /* Parent process */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 ) show ( }) CF setfont show Nl showpage %%Page: 8 9 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (test3 3) stringwidth pop 2 div sub Ypos moveto (test3 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 94 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 105 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 115 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test13.out0000644000076400007640000000762407322203437012137 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 2) show 70 650 moveto (File: test4.new) show 70 625 moveto (File: test4.old) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test4.new 1) BF setfont show CF setfont Nl Lpt( test4.old 2) BF setfont show CF setfont Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Header-test) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (test4.new 1) stringwidth pop 2 div sub Ypos moveto (test4.new 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt CFs setfont ( ) show (Last two lines) CF setfont show Nl Lpt CFs setfont ( ) show (added) CF setfont show Nl showpage %%Page: 3 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Header-test) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (test4.old 1) stringwidth pop 2 div sub Ypos moveto (test4.old 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (First two lines) CF setfont show Nl Lpt CFs setfont ( ) show (deleted) CF setfont show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test14.out0000644000076400007640000000762407322203437012140 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 2) show 70 650 moveto (File: test4.new) show 70 625 moveto (File: test4.old) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test4.new 1) BF setfont show CF setfont Nl Lpt( test4.old 2) BF setfont show CF setfont Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Header-test) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (test4.new 1) stringwidth pop 2 div sub Ypos moveto (test4.new 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt CFs setfont ( ) show (Last two lines) CF setfont show Nl Lpt CFs setfont ( ) show (added) CF setfont show Nl showpage %%Page: 3 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Header-test) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (test4.old 1) stringwidth pop 2 div sub Ypos moveto (test4.old 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (First two lines) CF setfont show Nl Lpt CFs setfont ( ) show (deleted) CF setfont show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test15.out0000644000076400007640000006316407322203437012142 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test6.c) show 70 625 moveto (File: test1.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test6.c) ) show Nl Lpt( closepipe...................4 (test1.c)) show Nl Lpt( fclosepipe 2 (test6.c) ) show Nl Lpt( fclosepipe..................4 (test1.c)) show Nl Lpt( fopenpipe 2 (test6.c) ) show Nl Lpt( fopenpipe...................4 (test1.c)) show Nl Lpt( openpipe 1 (test6.c) ) show Nl Lpt( openpipe....................3 (test1.c)) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test6.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test1.c 3) BF setfont show CF setfont Nl Lpt( closepipe 4) show Nl Lpt( fclosepipe..................4) show Nl Lpt( fopenpipe 4) show Nl Lpt( openpipe....................3) show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 6 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test16.out0000644000076400007640000006316407322203437012143 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test6.c) show 70 625 moveto (File: test1.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test6.c) ) show Nl Lpt( closepipe...................4 (test1.c)) show Nl Lpt( fclosepipe 2 (test6.c) ) show Nl Lpt( fclosepipe..................4 (test1.c)) show Nl Lpt( fopenpipe 2 (test6.c) ) show Nl Lpt( fopenpipe...................4 (test1.c)) show Nl Lpt( openpipe 1 (test6.c) ) show Nl Lpt( openpipe....................3 (test1.c)) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test6.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test1.c 3) BF setfont show CF setfont Nl Lpt( closepipe 4) show Nl Lpt( fclosepipe..................4) show Nl Lpt( fopenpipe 4) show Nl Lpt( openpipe....................3) show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 6 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (testuser) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test17.out0000644000076400007640000000543307322203437012137 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Overprint-test) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends way beyond the normal width of a normal line and goes on ) CF setfont show Nl Lpt CFs setfont ( ) show ( until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test18.out0000644000076400007640000000543307322203437012140 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Overprint-test) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends way beyond the normal width of a normal line and goes on ) CF setfont show Nl Lpt CFs setfont ( ) show ( until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test19.out0000644000076400007640000001030407322203437012132 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 2) show 70 650 moveto (File: test4.new) show 70 625 moveto (File: test4.old) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test4.new 1) BF setfont show CF setfont Nl Lpt( test4.old 2) BF setfont show CF setfont Nl showpage %%Page: 2 3 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 63 scalefont setfont -216 0 moveto (test4.new) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (test4.new 1) stringwidth pop 2 div sub Ypos moveto (test4.new 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt CFs setfont ( ) show (Last two lines) CF setfont show Nl Lpt CFs setfont ( ) show (added) CF setfont show Nl showpage %%Page: 3 4 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 63 scalefont setfont -216 0 moveto (test4.old) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (test4.old 1) stringwidth pop 2 div sub Ypos moveto (test4.old 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (First two lines) CF setfont show Nl Lpt CFs setfont ( ) show (deleted) CF setfont show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test2.c0000644000076400007640000000266607052654430011474 /* @(#)getopt.c */ #define _POSIX_SOURCE #include #include #include "trueprint.h" #include "main.h" /* * get option letter from argument vector */ int optind = 1; /* index into parent argv vector */ char *optarg; /* argument associated with option */ static int optopt; /* character checked for validity */ int getopt(int nargc, char **nargv, char *ostr) { register char *oli; /* option letter list index */ static char *place = ""; /* option letter processing */ if(!*place) { /* update scanning pointer */ if(optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) { place = ""; return(EOF); } if (*place == '-') { /* found "--" */ ++optind; place = ""; return EOF; } } /* option letter okay? */ if ((optopt = (int)*place++) == (int)':' || !(oli = strchr(ostr,optopt))) { if(!*place) ++optind; (void)fprintf(stderr, "%s: illegal option -- %c\n", cmd_name, optopt); return '?'; } if (*++oli != ':') { /* don't need argument */ optarg = NULL; if (!*place) ++optind; } else { /* need an argument */ if (*place) { /* no white space */ optarg = place; } else if (nargc <= ++optind) { /* no arg */ place = ""; (void)fprintf(stderr, "%s: option requires an argument -- %c\n", cmd_name, optopt); optopt = '?'; } else { optarg = nargv[optind]; /* white space */ } place = ""; ++optind; } return optopt; /* dump back option letter */ } trueprint-5.3/tests/test2.out0000644000076400007640000005133107322203436012046 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test20.out0000644000076400007640000001030407322203437012122 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 2) show 70 650 moveto (File: test4.new) show 70 625 moveto (File: test4.old) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test4.new 1) BF setfont show CF setfont Nl Lpt( test4.old 2) BF setfont show CF setfont Nl showpage %%Page: 2 3 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 63 scalefont setfont -216 0 moveto (test4.new) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (test4.new 1) stringwidth pop 2 div sub Ypos moveto (test4.new 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt CFs setfont ( ) show (Last two lines) CF setfont show Nl Lpt CFs setfont ( ) show (added) CF setfont show Nl showpage %%Page: 3 4 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 63 scalefont setfont -216 0 moveto (test4.old) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (test4.old 1) stringwidth pop 2 div sub Ypos moveto (test4.old 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (First two lines) CF setfont show Nl Lpt CFs setfont ( ) show (deleted) CF setfont show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test210000644000076400007640000000014407052654430011321 This is a file with a lot of tabs in it mixed with various other things like spaces and so on. trueprint-5.3/tests/test21.out0000644000076400007640000003756707322203437012147 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 746 def /Tm 575 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test7) show showpage %%Page: 1 2 590 30 translate 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( openpipe....................1 (test1.c)) show Nl showpage %%Page: 2 3 590 30 translate 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test7 4) BF setfont show CF setfont Nl showpage %%Page: 3 4 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl showpage %%Page: 4 5 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl showpage %%Page: 5 6 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (fopenpipe) stringwidth pop 2 div sub Ypos moveto (fopenpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 6 7 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( 2 ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( 3 ) show (This is a very long line that extends way beyond the normal width of a normal line and goes on until at least the ) CF setfont show Nl Lpt CFs setfont ( ) show ( hundredth column.) CF setfont show Nl Lpt CFs setfont ( 4 ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test22.out0000644000076400007640000003756707322203437012150 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 746 def /Tm 575 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test7) show showpage %%Page: 1 2 590 30 translate 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( openpipe....................1 (test1.c)) show Nl showpage %%Page: 2 3 590 30 translate 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test7 4) BF setfont show CF setfont Nl showpage %%Page: 3 4 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl showpage %%Page: 4 5 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl showpage %%Page: 5 6 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (fopenpipe) stringwidth pop 2 div sub Ypos moveto (fopenpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 6 7 590 30 translate 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( 2 ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( 3 ) show (This is a very long line that extends way beyond the normal width of a normal line and goes on until at least the ) CF setfont show Nl Lpt CFs setfont ( ) show ( hundredth column.) CF setfont show Nl Lpt CFs setfont ( 4 ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test23.out0000644000076400007640000007210107322203437012130 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 578 def /Tm 897 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test7) show 70 600 moveto (File: test6.c) show showpage %%Page: 1 2 gsave 590 30 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( closepipe...................6 (test6.c)) show Nl Lpt( fclosepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................6 (test6.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( fopenpipe...................6 (test6.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl Lpt( openpipe....................5 (test6.c)) show Nl grestore 590 405 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 3 gsave 590 30 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test7 3) BF setfont show CF setfont Nl Lpt( test6.c 5) BF setfont show CF setfont Nl Lpt( closepipe...................6) show Nl Lpt( fclosepipe 6) show Nl Lpt( fopenpipe...................6) show Nl Lpt( openpipe 5) show Nl grestore 590 405 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 4 gsave 590 30 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl grestore 590 405 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 7 5 gsave 590 30 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( 2 ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567) CF setfont show Nl Lpt CFs setfont ( ) show ( 890) CF setfont show Nl Lpt CFs setfont ( 3 ) show (This is a very long line that extends way beyond the normal width of a normal line and ) CF setfont show Nl Lpt CFs setfont ( ) show ( goes on until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( 4 ) show (This is another short line.) CF setfont show Nl grestore 590 405 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add (test7 2) stringwidth pop 2 div sub Ypos moveto (test7 2) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 6 gsave 590 30 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl grestore 590 405 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test24.out0000644000076400007640000007210107322203437012131 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 578 def /Tm 897 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test7) show 70 600 moveto (File: test6.c) show showpage %%Page: 1 2 gsave 590 30 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( closepipe...................6 (test6.c)) show Nl Lpt( fclosepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................6 (test6.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( fopenpipe...................6 (test6.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl Lpt( openpipe....................5 (test6.c)) show Nl grestore 590 405 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 3 gsave 590 30 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test7 3) BF setfont show CF setfont Nl Lpt( test6.c 5) BF setfont show CF setfont Nl Lpt( closepipe...................6) show Nl Lpt( fclosepipe 6) show Nl Lpt( fopenpipe...................6) show Nl Lpt( openpipe 5) show Nl grestore 590 405 translate .64 .64 scale 90 rotate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 4 gsave 590 30 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl grestore 590 405 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 7 5 gsave 590 30 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( 2 ) show (123456789012345678901234567890123456789012345678901234567890123456789012345678901234567) CF setfont show Nl Lpt CFs setfont ( ) show ( 890) CF setfont show Nl Lpt CFs setfont ( 3 ) show (This is a very long line that extends way beyond the normal width of a normal line and ) CF setfont show Nl Lpt CFs setfont ( ) show ( goes on until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( 4 ) show (This is another short line.) CF setfont show Nl grestore 590 405 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add (test7 2) stringwidth pop 2 div sub Ypos moveto (test7 2) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 6 gsave 590 30 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl grestore 590 405 translate .64 .64 scale 90 rotate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test25.out0000644000076400007640000010560607322203437012141 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 571 def /Tm 742 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 12) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test7) show 70 600 moveto (File: test6.c) show showpage %%Page: 1 2 gsave 15 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( closepipe..................10 (test6.c)) show Nl Lpt( fclosepipe 2 (test1.c) ) show Nl Lpt( fclosepipe.................10 (test6.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( fopenpipe..................10 (test6.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl Lpt( openpipe....................9 (test6.c)) show Nl grestore gsave 15 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 3 gsave 15 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test7 5) BF setfont show CF setfont Nl Lpt( test6.c 9) BF setfont show CF setfont Nl Lpt( closepipe..................10) show Nl Lpt( fclosepipe 10) show Nl Lpt( fopenpipe..................10) show Nl Lpt( openpipe 9) show Nl grestore gsave 15 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 4 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 12) stringwidth pop sub dup Ypos moveto (Page 1 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 12) stringwidth pop sub dup Ypos moveto (Page 1 of 12) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 12) stringwidth pop sub dup Ypos moveto (Page 2 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 12) stringwidth pop sub dup Ypos moveto (Page 2 of 12) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 12) stringwidth pop sub dup Ypos moveto (Page 3 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 12) stringwidth pop sub dup Ypos moveto (Page 3 of 12) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 12) stringwidth pop sub dup Ypos moveto (Page 4 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 12) stringwidth pop sub dup Ypos moveto (Page 4 of 12) show exch sub 2 div add (test1.c 4) stringwidth pop 2 div sub Ypos moveto (test1.c 4) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 13 5 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 12) stringwidth pop sub dup Ypos moveto (Page 5 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 12) stringwidth pop sub dup Ypos moveto (Page 5 of 12) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( 2 ) show (12345678901234567890123456789012345678901234567890123456789012345678901234567890123456) CF setfont show Nl Lpt CFs setfont ( ) show ( 7890) CF setfont show Nl Lpt CFs setfont ( 3 ) show (This is a very long line that extends way beyond the normal width of a normal line ) CF setfont show Nl Lpt CFs setfont ( ) show ( and goes on until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( 4 ) show (This is another short line.) CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 12) stringwidth pop sub dup Ypos moveto (Page 6 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 12) stringwidth pop sub dup Ypos moveto (Page 6 of 12) show exch sub 2 div add (test7 2) stringwidth pop 2 div sub Ypos moveto (test7 2) show /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 7 of 12) stringwidth pop sub dup Ypos moveto (Page 7 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 7 of 12) stringwidth pop sub dup Ypos moveto (Page 7 of 12) show exch sub 2 div add (test7 3) stringwidth pop 2 div sub Ypos moveto (test7 3) show /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 8 of 12) stringwidth pop sub dup Ypos moveto (Page 8 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 8 of 12) stringwidth pop sub dup Ypos moveto (Page 8 of 12) show exch sub 2 div add (test7 4) stringwidth pop 2 div sub Ypos moveto (test7 4) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 17 6 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 9 of 12) stringwidth pop sub dup Ypos moveto (Page 9 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 9 of 12) stringwidth pop sub dup Ypos moveto (Page 9 of 12) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 10 of 12) stringwidth pop sub dup Ypos moveto (Page 10 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 10 of 12) stringwidth pop sub dup Ypos moveto (Page 10 of 12) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 11 of 12) stringwidth pop sub dup Ypos moveto (Page 11 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 11 of 12) stringwidth pop sub dup Ypos moveto (Page 11 of 12) show exch sub 2 div add (test6.c 3) stringwidth pop 2 div sub Ypos moveto (test6.c 3) show /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 12 of 12) stringwidth pop sub dup Ypos moveto (Page 12 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 12 of 12) stringwidth pop sub dup Ypos moveto (Page 12 of 12) show exch sub 2 div add (test6.c 4) stringwidth pop 2 div sub Ypos moveto (test6.c 4) show /Vpos Tm Bh sub Ps sub def showpage %%Trailer %%EOF trueprint-5.3/tests/test26.out0000644000076400007640000010560607322203440012134 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 571 def /Tm 742 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 12) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test7) show 70 600 moveto (File: test6.c) show showpage %%Page: 1 2 gsave 15 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( closepipe..................10 (test6.c)) show Nl Lpt( fclosepipe 2 (test1.c) ) show Nl Lpt( fclosepipe.................10 (test6.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( fopenpipe..................10 (test6.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl Lpt( openpipe....................9 (test6.c)) show Nl grestore gsave 15 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 3 gsave 15 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test7 5) BF setfont show CF setfont Nl Lpt( test6.c 9) BF setfont show CF setfont Nl Lpt( closepipe..................10) show Nl Lpt( fclosepipe 10) show Nl Lpt( fopenpipe..................10) show Nl Lpt( openpipe 9) show Nl grestore gsave 15 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 4 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 12) stringwidth pop sub dup Ypos moveto (Page 1 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 12) stringwidth pop sub dup Ypos moveto (Page 1 of 12) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 12) stringwidth pop sub dup Ypos moveto (Page 2 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 12) stringwidth pop sub dup Ypos moveto (Page 2 of 12) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 12) stringwidth pop sub dup Ypos moveto (Page 3 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 12) stringwidth pop sub dup Ypos moveto (Page 3 of 12) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 12) stringwidth pop sub dup Ypos moveto (Page 4 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 12) stringwidth pop sub dup Ypos moveto (Page 4 of 12) show exch sub 2 div add (test1.c 4) stringwidth pop 2 div sub Ypos moveto (test1.c 4) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 13 5 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 12) stringwidth pop sub dup Ypos moveto (Page 5 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 12) stringwidth pop sub dup Ypos moveto (Page 5 of 12) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( 2 ) show (12345678901234567890123456789012345678901234567890123456789012345678901234567890123456) CF setfont show Nl Lpt CFs setfont ( ) show ( 7890) CF setfont show Nl Lpt CFs setfont ( 3 ) show (This is a very long line that extends way beyond the normal width of a normal line ) CF setfont show Nl Lpt CFs setfont ( ) show ( and goes on until at least the hundredth column.) CF setfont show Nl Lpt CFs setfont ( 4 ) show (This is another short line.) CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 12) stringwidth pop sub dup Ypos moveto (Page 6 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 12) stringwidth pop sub dup Ypos moveto (Page 6 of 12) show exch sub 2 div add (test7 2) stringwidth pop 2 div sub Ypos moveto (test7 2) show /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 7 of 12) stringwidth pop sub dup Ypos moveto (Page 7 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 7 of 12) stringwidth pop sub dup Ypos moveto (Page 7 of 12) show exch sub 2 div add (test7 3) stringwidth pop 2 div sub Ypos moveto (test7 3) show /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 8 of 12) stringwidth pop sub dup Ypos moveto (Page 8 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 8 of 12) stringwidth pop sub dup Ypos moveto (Page 8 of 12) show exch sub 2 div add (test7 4) stringwidth pop 2 div sub Ypos moveto (test7 4) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 17 6 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 9 of 12) stringwidth pop sub dup Ypos moveto (Page 9 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 9 of 12) stringwidth pop sub dup Ypos moveto (Page 9 of 12) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 10 of 12) stringwidth pop sub dup Ypos moveto (Page 10 of 12) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 10 of 12) stringwidth pop sub dup Ypos moveto (Page 10 of 12) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 11 of 12) stringwidth pop sub dup Ypos moveto (Page 11 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 11 of 12) stringwidth pop sub dup Ypos moveto (Page 11 of 12) show exch sub 2 div add (test6.c 3) stringwidth pop 2 div sub Ypos moveto (test6.c 3) show /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 12 of 12) stringwidth pop sub dup Ypos moveto (Page 12 of 12) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 12 of 12) stringwidth pop sub dup Ypos moveto (Page 12 of 12) show exch sub 2 div add (test6.c 4) stringwidth pop 2 div sub Ypos moveto (test6.c 4) show /Vpos Tm Bh sub Ps sub def showpage %%Trailer %%EOF trueprint-5.3/tests/test27.out0000644000076400007640000000550707322203440012134 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show ( 1234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends ) CF setfont show Nl Lpt CFs setfont ( ) show (way beyond the normal width of a normal ) CF setfont show Nl Lpt CFs setfont ( ) show ( line and goes on until at least the ) CF setfont show Nl Lpt CFs setfont ( ) show ( hundredth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test28.out0000644000076400007640000000550707322203440012135 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show ( 1234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends ) CF setfont show Nl Lpt CFs setfont ( ) show (way beyond the normal width of a normal ) CF setfont show Nl Lpt CFs setfont ( ) show ( line and goes on until at least the ) CF setfont show Nl Lpt CFs setfont ( ) show ( hundredth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test29.out0000644000076400007640000000542107322203440012131 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends wa) CF setfont show Nl Lpt CFs setfont ( ) show (y beyond the normal width of a normal li) CF setfont show Nl Lpt CFs setfont ( ) show (ne and goes on until at least the hundre) CF setfont show Nl Lpt CFs setfont ( ) show (dth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test30000644000076400007640000000462407052654430011250 /* * Source file: * openpipe.c * * Contains openpipe - a replacement for the non-POSIX function popen. * This returns an int rather than a FILE * to make it general purpose - * fdopen can be used outside to convert this to a FILE * */ #define _POSIX_SOURCE #include #include #include #include #include #include #ifdef _ultrix extern int close(int fildes); extern int dup(int fildes); extern pid_t fork(void); extern int pipe(int fildes[2]); #else #include #endif #include "trueprint.h" #include "main.h" #include "openpipe.h" int openpipe(const char *command, char *mode) { int fildes[2]; int parent_pipe_end; int child_pipe_end; char *child_pipe_mode; if (strcmp(mode, "w") == 0) { parent_pipe_end = 1; child_pipe_end = 0; child_pipe_mode = "read"; } else if (strcmp(mode, "r") == 0) { parent_pipe_end = 0; child_pipe_end = 1; child_pipe_mode = "write"; } else { (void)fprintf(stderr, "%s: Internal error: popen() called with bad mode %s", cmd_name, mode); exit(2); } if (pipe(fildes) != 0) { (void)fprintf(stderr, "%s: Cannot create pipe, %s\n", cmd_name, strerror(errno)); exit(2); } switch (fork()) { case -1: /* Error */ (void)fprintf(stderr, "%s: Cannot fork, %s\n", cmd_name, strerror(errno)); exit(2); /*NOTREACHED*/ case 0: /* Child process */ if (!((close(fildes[parent_pipe_end]) == 0) && (close(child_pipe_end) == 0) && (dup(fildes[child_pipe_end]) == child_pipe_end))) { (void)fprintf(stderr,"%s: Cannot redirect %s for child, %s\n", cmd_name, child_pipe_mode, strerror(errno)); exit(2); } if (system(command) < 0) { (void)fprintf(stderr,"%s: Cannot start pipe, %s\n",cmd_name, strerror(errno)); exit(2); } else exit(0); /*NOTREACHED*/ default: /* Parent process */ if (close(fildes[child_pipe_end]) != 0) { (void)fprintf(stderr,"%s: Cannot close %s end of pipe for parent, %s\n",cmd_name, child_pipe_mode, strerror(errno)); exit(2); } return fildes[parent_pipe_end]; } } FILE * fopenpipe(const char *command, char *mode) { int handle; handle = openpipe(command, mode); return fdopen(handle, mode); } void closepipe(int handle) { int statloc; (void)close(handle); (void)waitpid(-1, &statloc, WNOHANG); } void fclosepipe(FILE *fp) { closepipe(fileno(fp)); } trueprint-5.3/tests/test3.out0000644000076400007640000005370607322203436012057 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test3) show 70 625 moveto (File: test1.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test3 1) BF setfont show CF setfont Nl Lpt( test1.c 3) BF setfont show CF setfont Nl Lpt( closepipe 4) show Nl Lpt( fclosepipe..................4) show Nl Lpt( fopenpipe 4) show Nl Lpt( openpipe....................3) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test3 1) stringwidth pop 2 div sub Ypos moveto (test3 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/*) CF setfont show Nl Lpt CFs setfont ( ) show ( * Source file:) CF setfont show Nl Lpt CFs setfont ( ) show ( * openpipe.c) CF setfont show Nl Lpt CFs setfont ( ) show ( *) CF setfont show Nl Lpt CFs setfont ( ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) CF setfont show Nl Lpt CFs setfont ( ) show ( * This returns an int rather than a FILE * to make it general purpose -) CF setfont show Nl Lpt CFs setfont ( ) show ( * fdopen can be used outside to convert this to a FILE *) CF setfont show Nl Lpt CFs setfont ( ) show ( */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( ) show (#else) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (openpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( ) show ( /* Error */) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( case 0:) CF setfont show Nl showpage %%Page: 3 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 4) stringwidth pop sub dup Ypos moveto (Page 2 of 4) show exch sub 2 div add (test3 2) stringwidth pop 2 div sub Ypos moveto (test3 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( /* Child process */) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( default:) CF setfont show Nl Lpt CFs setfont ( ) show ( /* Parent process */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( ) show (fopenpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (closepipe\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (fclosepipe\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/*) IF setfont show Nl Lpt CFs setfont ( ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( ) show ( *) IF setfont show Nl Lpt CFs setfont ( ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( ) show (#else) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( case 0:) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 4) stringwidth pop sub dup Ypos moveto (Page 4 of 4) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( default:) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test30.out0000644000076400007640000000542107322203440012121 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test7) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test7 1) stringwidth pop 2 div sub Ypos moveto (test7 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (This is a short line) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890123456789012345678901234567890) CF setfont show Nl Lpt CFs setfont ( ) show (1234567890) CF setfont show Nl Lpt CFs setfont ( ) show (This is a very long line that extends wa) CF setfont show Nl Lpt CFs setfont ( ) show (y beyond the normal width of a normal li) CF setfont show Nl Lpt CFs setfont ( ) show (ne and goes on until at least the hundre) CF setfont show Nl Lpt CFs setfont ( ) show (dth column.) CF setfont show Nl Lpt CFs setfont ( ) show (This is another short line.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test31.out0000644000076400007640000004615607322203440012134 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/*) IF setfont show Nl Lpt CFs setfont ( ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( ) show ( *) IF setfont show Nl Lpt CFs setfont ( ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( ) show (#else) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( default:) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (/*) IF setfont show Nl Lpt CFs setfont ( ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test32.out0000644000076400007640000004615607322203440012135 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/*) IF setfont show Nl Lpt CFs setfont ( ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( ) show ( *) IF setfont show Nl Lpt CFs setfont ( ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( ) show (#else) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( default:) CF setfont show Nl Lpt CFs setfont ( ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (/*) IF setfont show Nl Lpt CFs setfont ( ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test33.out0000644000076400007640000005520307322203440012127 %!PS-Adobe-2.0 statusdict /setduplexmode known { true statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: Coverback 2 showpage %%Page: 1 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 5 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 4 6 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 6 8 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 2 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 2 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 7 9 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Page: 8 10 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 4 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 4 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (test2.c 2) stringwidth pop 2 div sub Ypos moveto (test2.c 2) show /Vpos Tm Bh sub Ps sub def showpage %%Trailer %%EOF trueprint-5.3/tests/test34.out0000644000076400007640000005520307322203440012130 %!PS-Adobe-2.0 statusdict /setduplexmode known { true statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 4) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: Coverback 2 showpage %%Page: 1 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 4 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 5 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 4 6 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 2) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 4) stringwidth pop sub dup Ypos moveto (Page 1 of 4) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 6 8 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 2 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 2 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 7 9 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 4) stringwidth pop sub dup Ypos moveto (Page 3 of 4) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Page: 8 10 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Page 4 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Page 4 of 4) show currentpoint pop dup Rm Ps sub (Fri Apr 16 03:00:00 1982) stringwidth pop sub dup Ypos moveto (Fri Apr 16 03:00:00 1982) show exch sub 2 div add (test2.c 2) stringwidth pop 2 div sub Ypos moveto (test2.c 2) show /Vpos Tm Bh sub Ps sub def showpage %%Trailer %%EOF trueprint-5.3/tests/test35.out0000644000076400007640000000237007322203440012126 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Trailer %%EOF trueprint-5.3/tests/test36.out0000644000076400007640000000237007322203440012127 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Trailer %%EOF trueprint-5.3/tests/test37.out0000644000076400007640000000462307322203440012133 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test21) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test21 1) stringwidth pop 2 div sub Ypos moveto (test21 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( This is a file) CF setfont show Nl Lpt CFs setfont ( ) show ( with a lot of) CF setfont show Nl Lpt CFs setfont ( ) show (tabs in it mixed with various other) CF setfont show Nl Lpt CFs setfont ( ) show ( things like spaces and so on.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test38.out0000644000076400007640000000462307322203440012134 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test21) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test21 1) stringwidth pop 2 div sub Ypos moveto (test21 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( This is a file) CF setfont show Nl Lpt CFs setfont ( ) show ( with a lot of) CF setfont show Nl Lpt CFs setfont ( ) show (tabs in it mixed with various other) CF setfont show Nl Lpt CFs setfont ( ) show ( things like spaces and so on.) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test39.out0000644000076400007640000005326707322203440012145 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Cp gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri-Apr-03:00am-1) show currentpoint pop dup Rm Ps sub (2-3-test1.c-openpipe) stringwidth pop sub dup Ypos moveto (2-3-test1.c-openpipe) show exch sub 2 div add (Apr-03:00am-1-1) stringwidth pop 2 div sub Ypos moveto (Apr-03:00am-1-1) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Test-%-04-16-1982) show currentpoint pop dup Rm Ps sub (00-03:00:00-105-5) stringwidth pop sub dup Ypos moveto (00-03:00:00-105-5) show exch sub 2 div add (04/16/82-Fri Apr 16 03:00:00 1982-03-00) stringwidth pop 2 div sub Ypos moveto (04/16/82-Fri Apr 16 03:00:00 1982-03-00) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri-Apr-03:00am-2) show currentpoint pop dup Rm Ps sub (2-3-test1.c-openpipe) stringwidth pop sub dup Ypos moveto (2-3-test1.c-openpipe) show exch sub 2 div add (Apr-03:00am-2-2) stringwidth pop 2 div sub Ypos moveto (Apr-03:00am-2-2) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Test-%-04-16-1982) show currentpoint pop dup Rm Ps sub (00-03:00:00-105-5) stringwidth pop sub dup Ypos moveto (00-03:00:00-105-5) show exch sub 2 div add (04/16/82-Fri Apr 16 03:00:00 1982-03-00) stringwidth pop 2 div sub Ypos moveto (04/16/82-Fri Apr 16 03:00:00 1982-03-00) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri-Apr-03:00am-1) show currentpoint pop dup Rm Ps sub (1-3-test2.c-getopt) stringwidth pop sub dup Ypos moveto (1-3-test2.c-getopt) show exch sub 2 div add (Apr-03:00am-1-3) stringwidth pop 2 div sub Ypos moveto (Apr-03:00am-1-3) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Test-%-04-16-1982) show currentpoint pop dup Rm Ps sub (00-03:00:00-105-5) stringwidth pop sub dup Ypos moveto (00-03:00:00-105-5) show exch sub 2 div add (04/16/82-Fri Apr 16 03:00:00 1982-03-00) stringwidth pop 2 div sub Ypos moveto (04/16/82-Fri Apr 16 03:00:00 1982-03-00) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test4.new0000644000076400007640000000005407052654430012032 These two lines remain Last two lines added trueprint-5.3/tests/test4.old0000644000076400007640000000005707052654430012022 First two lines deleted These two lines remain trueprint-5.3/tests/test4.out0000644000076400007640000000470507322203436012053 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test4.new) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test4.new 1) stringwidth pop 2 div sub Ypos moveto (test4.new 1) show /Vpos Tm Bh sub Ps sub def Lpt (-) CFs setfont show (First two lines) CF setfont So show Nl Lpt (-) CFs setfont show (deleted) CF setfont So show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt BFs setfont (+) show (Last two lines) BF setfont show Nl Lpt BFs setfont (+) show (added) BF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test40.out0000644000076400007640000005326707322203440012135 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Cp gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri-Apr-03:00am-1) show currentpoint pop dup Rm Ps sub (2-3-test1.c-openpipe) stringwidth pop sub dup Ypos moveto (2-3-test1.c-openpipe) show exch sub 2 div add (Apr-03:00am-1-1) stringwidth pop 2 div sub Ypos moveto (Apr-03:00am-1-1) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Test-%-04-16-1982) show currentpoint pop dup Rm Ps sub (00-03:00:00-105-5) stringwidth pop sub dup Ypos moveto (00-03:00:00-105-5) show exch sub 2 div add (04/16/82-Fri Apr 16 03:00:00 1982-03-00) stringwidth pop 2 div sub Ypos moveto (04/16/82-Fri Apr 16 03:00:00 1982-03-00) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri-Apr-03:00am-2) show currentpoint pop dup Rm Ps sub (2-3-test1.c-openpipe) stringwidth pop sub dup Ypos moveto (2-3-test1.c-openpipe) show exch sub 2 div add (Apr-03:00am-2-2) stringwidth pop 2 div sub Ypos moveto (Apr-03:00am-2-2) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Test-%-04-16-1982) show currentpoint pop dup Rm Ps sub (00-03:00:00-105-5) stringwidth pop sub dup Ypos moveto (00-03:00:00-105-5) show exch sub 2 div add (04/16/82-Fri Apr 16 03:00:00 1982-03-00) stringwidth pop 2 div sub Ypos moveto (04/16/82-Fri Apr 16 03:00:00 1982-03-00) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp gsave .9 setgray Rm 2 div Tm 2 div translate 60 rotate /Courier-Bold findfont 41 scalefont setfont -216 0 moveto (Login-testuser) show grestore HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri-Apr-03:00am-1) show currentpoint pop dup Rm Ps sub (1-3-test2.c-getopt) stringwidth pop sub dup Ypos moveto (1-3-test2.c-getopt) show exch sub 2 div add (Apr-03:00am-1-3) stringwidth pop 2 div sub Ypos moveto (Apr-03:00am-1-3) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Test-%-04-16-1982) show currentpoint pop dup Rm Ps sub (00-03:00:00-105-5) stringwidth pop sub dup Ypos moveto (00-03:00:00-105-5) show exch sub 2 div add (04/16/82-Fri Apr 16 03:00:00 1982-03-00) stringwidth pop 2 div sub Ypos moveto (04/16/82-Fri Apr 16 03:00:00 1982-03-00) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test41.out0000644000076400007640000005635107322203440012133 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 836 def /Tm 578 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 gsave 54 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................5 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl grestore 54 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 3 gsave 54 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 5) BF setfont show CF setfont Nl Lpt( getopt 5) show Nl grestore 54 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 4 gsave 54 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl grestore 54 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl showpage %%Page: 7 5 gsave 54 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (fopenpipe) stringwidth pop 2 div sub Ypos moveto (fopenpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore 54 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add (test1.c 4) stringwidth pop 2 div sub Ypos moveto (test1.c 4) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 6 gsave 54 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\(stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl grestore 54 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (test2.c 2) stringwidth pop 2 div sub Ypos moveto (test2.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test42.out0000644000076400007640000005635107322203440012134 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 836 def /Tm 578 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 gsave 54 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................5 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl grestore 54 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 3 gsave 54 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 5) BF setfont show CF setfont Nl Lpt( getopt 5) show Nl grestore 54 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 4 gsave 54 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl grestore 54 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl showpage %%Page: 7 5 gsave 54 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (fopenpipe) stringwidth pop 2 div sub Ypos moveto (fopenpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (test1.c 3) stringwidth pop 2 div sub Ypos moveto (test1.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore 54 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add (test1.c 4) stringwidth pop 2 div sub Ypos moveto (test1.c 4) show /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 6 gsave 54 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\(stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl grestore 54 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (test2.c 2) stringwidth pop 2 div sub Ypos moveto (test2.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test43.out0000644000076400007640000004653107322203440012134 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 0 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto Rm 0 rlineto gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test44.out0000644000076400007640000004653107322203440012135 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 0 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto Rm 0 rlineto gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test45.out0000644000076400007640000005121207322203440012126 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 897 def /Tm 578 def /Bh 15 def /Bf 0 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto Rm 0 rlineto gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 gsave 15 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................5 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl grestore 15 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 3 gsave 15 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 5) BF setfont show CF setfont Nl Lpt( getopt 5) show Nl grestore 15 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 4 gsave 15 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore 15 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl showpage %%Page: 7 5 gsave 15 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (closepipe) stringwidth pop 2 div sub Ypos moveto (closepipe) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore 15 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 6 gsave 15 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\(stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl grestore 15 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test46.out0000644000076400007640000005121207322203440012127 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 897 def /Tm 578 def /Bh 15 def /Bf 0 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto Rm 0 rlineto gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 6) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 gsave 15 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 3 (test1.c) ) show Nl Lpt( fclosepipe..................3 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................5 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl grestore 15 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 3 3 gsave 15 405 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................3) show Nl Lpt( fclosepipe 3) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 5) BF setfont show CF setfont Nl Lpt( getopt 5) show Nl grestore 15 30 translate .64 .64 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 4 gsave 15 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 6) stringwidth pop sub dup Ypos moveto (Page 1 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\(\) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore 15 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 6) stringwidth pop sub dup Ypos moveto (Page 2 of 6) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl showpage %%Page: 7 5 gsave 15 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 6) stringwidth pop sub dup Ypos moveto (Page 3 of 6) show exch sub 2 div add (closepipe) stringwidth pop 2 div sub Ypos moveto (closepipe) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore 15 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 6) stringwidth pop sub dup Ypos moveto (Page 4 of 6) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 6 gsave 15 405 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 6) stringwidth pop sub dup Ypos moveto (Page 5 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\(stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl grestore 15 30 translate .64 .64 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 6 of 6) stringwidth pop sub dup Ypos moveto (Page 6 of 6) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test47.out0000644000076400007640000002613207322203440012133 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 2) show 70 650 moveto (File: -) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 2) stringwidth pop sub dup Ypos moveto (Page 1 of 2) show exch sub 2 div add (- 1) stringwidth pop 2 div sub Ypos moveto (- 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show (/*) CF setfont show Nl Lpt CFs setfont ( ) show ( * Source file:) CF setfont show Nl Lpt CFs setfont ( ) show ( * openpipe.c) CF setfont show Nl Lpt CFs setfont ( ) show ( *) CF setfont show Nl Lpt CFs setfont ( ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) CF setfont show Nl Lpt CFs setfont ( ) show ( * This returns an int rather than a FILE * to make it general purpose -) CF setfont show Nl Lpt CFs setfont ( ) show ( * fdopen can be used outside to convert this to a FILE *) CF setfont show Nl Lpt CFs setfont ( ) show ( */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( ) show (#else) CF setfont show Nl Lpt CFs setfont ( ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (int) CF setfont show Nl Lpt CFs setfont ( ) show (openpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( ) show ( /* Error */) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( case 0:) CF setfont show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 2) stringwidth pop sub dup Ypos moveto (Page 2 of 2) show exch sub 2 div add (- 2) stringwidth pop 2 div sub Ypos moveto (- 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( ) show ( /* Child process */) CF setfont show Nl Lpt CFs setfont ( ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( default:) CF setfont show Nl Lpt CFs setfont ( ) show ( /* Parent process */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( ) show (fopenpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (closepipe\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show (void) CF setfont show Nl Lpt CFs setfont ( ) show (fclosepipe\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( ) show ({) CF setfont show Nl Lpt CFs setfont ( ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test48.out0000644000076400007640000007673407322203440012151 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 5) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: -) show 70 600 moveto (File: test2.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................5 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl showpage %%Page: 2 3 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( - 3) BF setfont show CF setfont Nl Lpt( test2.c 5) BF setfont show CF setfont Nl Lpt( getopt......................5) show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 5) stringwidth pop sub dup Ypos moveto (Page 1 of 5) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 5) stringwidth pop sub dup Ypos moveto (Page 1 of 5) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 5) stringwidth pop sub dup Ypos moveto (Page 2 of 5) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 5) stringwidth pop sub dup Ypos moveto (Page 2 of 5) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 5 6 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 5) stringwidth pop sub dup Ypos moveto (Page 3 of 5) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 5) stringwidth pop sub dup Ypos moveto (Page 3 of 5) show exch sub 2 div add (- 1) stringwidth pop 2 div sub Ypos moveto (- 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) CF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) CF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) CF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) CF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) CF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) CF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) CF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 35 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 ) show ( /* Error */) CF setfont show Nl Lpt CFs setfont ( 60 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 ) show ( case 0:) CF setfont show Nl showpage %%Page: 6 7 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 5) stringwidth pop sub dup Ypos moveto (Page 4 of 5) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4 of 5) stringwidth pop sub dup Ypos moveto (Page 4 of 5) show exch sub 2 div add (- 2) stringwidth pop 2 div sub Ypos moveto (- 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 65 ) show ( /* Child process */) CF setfont show Nl Lpt CFs setfont ( 66 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 ) show ( /*NOTREACHED*/) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 ) show ( /* Parent process */) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 94 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 105 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 115 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Page: 7 8 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 5) stringwidth pop sub dup Ypos moveto (Page 5 of 5) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 5 of 5) stringwidth pop sub dup Ypos moveto (Page 5 of 5) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test49.out0000664000076400007640000006057307322203440012146 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 571 def /Tm 742 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test1.c) show 70 625 moveto (File: test2.c) show showpage %%Page: 1 2 gsave 15 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test1.c) ) show Nl Lpt( fclosepipe..................2 (test1.c)) show Nl Lpt( fopenpipe 2 (test1.c) ) show Nl Lpt( getopt......................3 (test2.c)) show Nl Lpt( openpipe 1 (test1.c) ) show Nl grestore gsave 15 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 5 3 gsave 15 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( test1.c 1) BF setfont show CF setfont Nl Lpt( closepipe...................2) show Nl Lpt( fclosepipe 2) show Nl Lpt( fopenpipe...................2) show Nl Lpt( openpipe 1) show Nl Lpt( test2.c 3) BF setfont show CF setfont Nl Lpt( getopt 3) show Nl grestore gsave 15 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2) stringwidth pop sub dup Ypos moveto (Page 2) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore gsave 304 405 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3) stringwidth pop sub dup Ypos moveto (Page 3) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def grestore 304 30 translate .5 .5 scale Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 4) stringwidth pop sub dup Ypos moveto (Page 4) show exch sub 2 div add (File Index) stringwidth pop 2 div sub Ypos moveto (File Index) show CF setfont /Vpos Tm Bh sub Ps sub def showpage %%Page: 9 4 gsave 15 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test1.c 1) stringwidth pop 2 div sub Ypos moveto (test1.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt CFs setfont ( 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont show Nl Lpt CFs setfont ( 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont show Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (#ifdef _ultrix) CF setfont show Nl Lpt CFs setfont ( 20 ) show (extern int close\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 21 ) show (extern int dup\(int fildes\);) CF setfont show Nl Lpt CFs setfont ( 22 ) show (extern pid_t fork\(void\);) CF setfont show Nl Lpt CFs setfont ( 23 ) show (extern int pipe\(int fildes[2]\);) CF setfont show Nl Lpt CFs setfont ( 24 ) show (#else) CF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 26 ) show (#endif) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 28 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 29 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( 30 ) show (#include "openpipe.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl grestore gsave 15 30 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test1.c 2) stringwidth pop 2 div sub Ypos moveto (test1.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show (stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl grestore gsave 304 405 translate .5 .5 scale Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (getopt) stringwidth pop 2 div sub Ypos moveto (getopt) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test2.c 1) stringwidth pop 2 div sub Ypos moveto (test2.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/* @\(#\)getopt.c */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 3 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 5 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 6 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 8 ) show (#include "trueprint.h") CF setfont show Nl Lpt CFs setfont ( 9 ) show (#include "main.h") CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 11 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 12 ) show ( * get option letter from argument vector) IF setfont show Nl Lpt CFs setfont ( 13 ) show ( */) IF setfont show Nl Lpt CFs setfont ( 14 ) show (int optind = 1; ) CF setfont show (/* index into parent argv vector */) IF setfont show Nl Lpt CFs setfont ( 15 ) show (char *optarg; ) CF setfont show (/* argument associated with option */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 17 ) show (static int optopt; ) CF setfont show (/* character checked for validity */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 19 ) show (int) CF setfont show Nl Lpt CFs setfont ( 20 ) show (getopt) BF setfont show (\(int nargc, char **nargv, char *ostr\)) CF setfont show Nl Lpt CFs setfont ( 21 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 22 1 ) show ( register char *oli; ) CF setfont show (/* option letter list index */) IF setfont show Nl Lpt CFs setfont ( 23 1 ) show ( static char *place = ""; ) CF setfont show (/* option letter processing */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 25 2 ) show ( if\(!*place\) { ) CF setfont show (/* update scanning pointer */) IF setfont show Nl Lpt CFs setfont ( 26 3 ) show ( if\(optind >= nargc || *\(place = nargv[optind]\) != '-' || !*++place\) {) CF setfont show Nl Lpt CFs setfont ( 27 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 28 3 ) show ( return\(EOF\);) CF setfont show Nl Lpt CFs setfont ( 29 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 30 3 ) show ( if \(*place == '-'\) { ) CF setfont show (/* found "--" */) IF setfont show Nl Lpt CFs setfont ( 31 3 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 32 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 33 3 ) show ( return EOF;) CF setfont show Nl Lpt CFs setfont ( 34 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 35 1 ) show ( } ) CF setfont show (/* option letter okay? */) IF setfont show Nl Lpt CFs setfont ( 36 2 ) show ( if \(\(optopt = \(int\)*place++\) == \(int\)':' || !\(oli = strchr\(ostr,optopt\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 37 2 ) show ( if\(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 38 2 ) show ( \(void\)fprintf\(stderr, "%s: illegal option -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 39 2 ) show ( return '?';) CF setfont show Nl Lpt CFs setfont ( 40 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(*++oli != ':'\) { ) CF setfont show (/* don't need argument */) IF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( optarg = NULL;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( if \(!*place\) ++optind;) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else { ) CF setfont show (/* need an argument */) IF setfont show Nl Lpt CFs setfont ( 45 3 ) show ( if \(*place\) { ) CF setfont show (/* no white space */) IF setfont show Nl Lpt CFs setfont ( 46 3 ) show ( optarg = place;) CF setfont show Nl Lpt CFs setfont ( 47 3 ) show ( } else if \(nargc <= ++optind\) { ) CF setfont show (/* no arg */) IF setfont show Nl Lpt CFs setfont ( 48 3 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 49 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr, "%s: option requires an argument -- %c\\n", cmd_name, optopt\);) CF setfont show Nl Lpt CFs setfont ( 50 3 ) show ( optopt = '?';) CF setfont show Nl Lpt CFs setfont ( 51 3 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 52 3 ) show ( optarg = nargv[optind]; ) CF setfont show (/* white space */) IF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( place = "";) CF setfont show Nl Lpt CFs setfont ( 55 2 ) show ( ++optind;) CF setfont show Nl Lpt CFs setfont ( 56 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 57 1 ) show ( return optopt; ) CF setfont show (/* dump back option letter */) IF setfont show Nl Lpt CFs setfont ( 58 ) show (}) CF setfont show Nl %%Trailer %%EOF trueprint-5.3/tests/test5.out0000644000076400007640000000470507322203437012055 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test4.new) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test4.new 1) stringwidth pop 2 div sub Ypos moveto (test4.new 1) show /Vpos Tm Bh sub Ps sub def Lpt (-) CFs setfont show (First two lines) CF setfont So show Nl Lpt (-) CFs setfont show (deleted) CF setfont So show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt BFs setfont (+) show (Last two lines) BF setfont show Nl Lpt BFs setfont (+) show (added) BF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test6.c0000644000076400007640000000462407052654430011474 /* * Source file: * openpipe.c * * Contains openpipe - a replacement for the non-POSIX function popen. * This returns an int rather than a FILE * to make it general purpose - * fdopen can be used outside to convert this to a FILE * */ #define _POSIX_SOURCE #include #include #include #include #include #include #ifdef _ultrix extern int close(int fildes); extern int dup(int fildes); extern pid_t fork(void); extern int pipe(int fildes[2]); #else #include #endif #include "trueprint.h" #include "main.h" #include "openpipe.h" int openpipe(const char *command, char *mode) { int fildes[2]; int parent_pipe_end; int child_pipe_end; char *child_pipe_mode; if (strcmp(mode, "w") == 0) { parent_pipe_end = 1; child_pipe_end = 0; child_pipe_mode = "read"; } else if (strcmp(mode, "r") == 0) { parent_pipe_end = 0; child_pipe_end = 1; child_pipe_mode = "write"; } else { (void)fprintf(stderr, "%s: Internal error: popen() called with bad mode %s", cmd_name, mode); exit(2); } if (pipe(fildes) != 0) { (void)fprintf(stderr, "%s: Cannot create pipe, %s\n", cmd_name, strerror(errno)); exit(2); } switch (fork()) { case -1: /* Error */ (void)fprintf(stderr, "%s: Cannot fork, %s\n", cmd_name, strerror(errno)); exit(2); /*NOTREACHED*/ case 0: /* Child process */ if (!((close(fildes[parent_pipe_end]) == 0) && (close(child_pipe_end) == 0) && (dup(fildes[child_pipe_end]) == child_pipe_end))) { (void)fprintf(stderr,"%s: Cannot redirect %s for child, %s\n", cmd_name, child_pipe_mode, strerror(errno)); exit(2); } if (system(command) < 0) { (void)fprintf(stderr,"%s: Cannot start pipe, %s\n",cmd_name, strerror(errno)); exit(2); } else exit(0); /*NOTREACHED*/ default: /* Parent process */ if (close(fildes[child_pipe_end]) != 0) { (void)fprintf(stderr,"%s: Cannot close %s end of pipe for parent, %s\n",cmd_name, child_pipe_mode, strerror(errno)); exit(2); } return fildes[parent_pipe_end]; } } FILE * fopenpipe(const char *command, char *mode) { int handle; handle = openpipe(command, mode); return fdopen(handle, mode); } void closepipe(int handle) { int statloc; (void)close(handle); (void)waitpid(-1, &statloc, WNOHANG); } void fclosepipe(FILE *fp) { closepipe(fileno(fp)); } trueprint-5.3/tests/test6.out0000644000076400007640000000470507322203437012056 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test4.old) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test4.old 1) stringwidth pop 2 div sub Ypos moveto (test4.old 1) show /Vpos Tm Bh sub Ps sub def Lpt BFs setfont (+) show (First two lines) BF setfont show Nl Lpt BFs setfont (+) show (deleted) BF setfont show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt (-) CFs setfont show (Last two lines) CF setfont So show Nl Lpt (-) CFs setfont show (added) CF setfont So show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test70000644000076400007640000000042007052654430011242 This is a short line 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 This is a very long line that extends way beyond the normal width of a normal line and goes on until at least the hundredth column. This is another short line. trueprint-5.3/tests/test7.out0000644000076400007640000000470507322203437012057 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li 0 def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 1) show 70 650 moveto (File: test4.old) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add () stringwidth pop 2 div sub Ypos moveto () show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 1) stringwidth pop sub dup Ypos moveto (Page 1 of 1) show exch sub 2 div add (test4.old 1) stringwidth pop 2 div sub Ypos moveto (test4.old 1) show /Vpos Tm Bh sub Ps sub def Lpt BFs setfont (+) show (First two lines) BF setfont show Nl Lpt BFs setfont (+) show (deleted) BF setfont show Nl Lpt CFs setfont ( ) show (These two lines) CF setfont show Nl Lpt CFs setfont ( ) show (remain) CF setfont show Nl Lpt (-) CFs setfont show (Last two lines) CF setfont So show Nl Lpt (-) CFs setfont show (added) CF setfont So show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test8.out0000644000076400007640000003624107322203437012060 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test6.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test6.c) ) show Nl Lpt( fclosepipe..................3 (test6.c)) show Nl Lpt( fopenpipe 2 (test6.c) ) show Nl Lpt( openpipe....................1 (test6.c)) show Nl showpage %%Page: 2 3 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt (- ) CFs setfont show ( * This returns an int rather than a FILE * to make it general purpose.) CF setfont So show Nl Lpt (- ) CFs setfont show ( * NOTE THAT THE VARIABLE cmd_name IS NOT DEFINED IN THIS FILE) CF setfont So show Nl Lpt BFs setfont (+ 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont Bs Nl Lpt BFs setfont (+ 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont Bs Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt BFs setfont (+ ) show () BF setfont show Nl Lpt BFs setfont (+ 19 ) show (#ifdef _ultrix) BF setfont show Nl Lpt BFs setfont (+ 20 ) show (extern int close\(int fildes\);) BF setfont show Nl Lpt BFs setfont (+ 21 ) show (extern int dup\(int fildes\);) BF setfont show Nl Lpt BFs setfont (+ 22 ) show (extern pid_t fork\(void\);) BF setfont show Nl Lpt BFs setfont (+ 23 ) show (extern int pipe\(int fildes[2]\);) BF setfont show Nl Lpt BFs setfont (+ 24 ) show (#else) BF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt BFs setfont (+ 26 ) show (#endif) BF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt (- ) CFs setfont show (/****************************************************************************) CF setfont So show Nl Lpt (- ) CFs setfont show ( * Function:) CF setfont So show Nl Lpt (- ) CFs setfont show ( * openpipe) CF setfont So show Nl Lpt (- ) CFs setfont show ( *) CF setfont So show Nl Lpt (- ) CFs setfont show ( * Opens a pipe to or from a command. This is _not_ a direct replacement for) CF setfont So show Nl Lpt (- ) CFs setfont show ( * popen because:) CF setfont So show Nl Lpt (- ) CFs setfont show ( * - in the case of failure it prints an error message and calls exit,) CF setfont So show Nl Lpt (- ) CFs setfont show ( * instead of just returning NULL;) CF setfont So show Nl Lpt (- ) CFs setfont show ( * - it returns an int instead of a FILE *;) CF setfont So show Nl Lpt (- ) CFs setfont show ( * - it is called openpipe instead of popen) CF setfont So show Nl Lpt (- ) CFs setfont show ( */) CF setfont So show Nl Lpt BFs setfont (+ 28 ) show (#include "trueprint.h") BF setfont show Nl Lpt BFs setfont (+ 29 ) show (#include "main.h") BF setfont show Nl Lpt BFs setfont (+ 30 ) show (#include "openpipe.h") BF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (fclosepipe) stringwidth pop 2 div sub Ypos moveto (fclosepipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test6.c 3) stringwidth pop 2 div sub Ypos moveto (test6.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF trueprint-5.3/tests/test9.out0000644000076400007640000003624107322203437012061 %!PS-Adobe-2.0 statusdict /setduplexmode known { false statusdict /setduplexmode get exec } if /Ps 10 def /SPs 7 def /Lh 11 def /Rm 575 def /Tm 746 def /Bh 15 def /Bf 15 def /CF /Courier findfont Ps scalefont def /IF /Courier-Oblique findfont Ps scalefont def /BF /Courier-Bold findfont Ps scalefont def /CFs /Courier findfont SPs scalefont def /IFs /Courier-Oblique findfont SPs scalefont def /BFs /Courier-Bold findfont SPs scalefont def /HF /Helvetica findfont Ps scalefont def /Li CFs setfont (1234567890) stringwidth pop def /Nl { /Vpos Vpos Lh sub def } def /Lpt { 0 Vpos moveto } def /Gb { } def /Ip { Gb .5 setlinewidth 0 Tm moveto 0 Bh neg rlineto Rm 0 rlineto 0 Bh rlineto closepath gsave .98 setgray fill grestore stroke 0 0 moveto 0 Bf rlineto Rm 0 rlineto 0 Bf neg rlineto closepath gsave .98 setgray fill grestore stroke 0 Bf moveto 0 Tm Bh sub lineto stroke newpath } def /Cp { Ip .3 setlinewidth newpath Li 0 Bf add moveto Li Tm Bh sub lineto stroke newpath } def /So { gsave dup stringwidth pop Ps 3 div 0 exch rmoveto 0 rlineto fill grestore } def /Ul { gsave dup stringwidth pop 0 -1 rmoveto 0 rlineto fill grestore } def /Bs { gsave dup show grestore 0.5 0.5 rmoveto show } def <> setpagedevice %%Page: Cover 1 70 70 moveto /Helvetica findfont 10 scalefont setfont (Trueprint 3.6.5) show 70 725 moveto /Helvetica-Bold findfont 20 scalefont setfont (For: testuser) show 70 700 moveto (Printed on: Fri Apr 16 03:00:00 1982) show 70 675 moveto (Last page number: 3) show 70 650 moveto (File: test6.c) show showpage %%Page: 1 2 15 30 translate Ip HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1) stringwidth pop sub dup Ypos moveto (Page 1) show exch sub 2 div add (Function Index) stringwidth pop 2 div sub Ypos moveto (Function Index) show CF setfont /Vpos Tm Bh sub Ps sub def Lpt( closepipe 2 (test6.c) ) show Nl Lpt( fclosepipe..................3 (test6.c)) show Nl Lpt( fopenpipe 2 (test6.c) ) show Nl Lpt( openpipe....................1 (test6.c)) show Nl showpage %%Page: 2 3 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 1 of 3) stringwidth pop sub dup Ypos moveto (Page 1 of 3) show exch sub 2 div add (test6.c 1) stringwidth pop 2 div sub Ypos moveto (test6.c 1) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 1 ) show (/*) IF setfont show Nl Lpt CFs setfont ( 2 ) show ( * Source file:) IF setfont show Nl Lpt CFs setfont ( 3 ) show ( * openpipe.c) IF setfont show Nl Lpt CFs setfont ( 4 ) show ( *) IF setfont show Nl Lpt CFs setfont ( 5 ) show ( * Contains openpipe - a replacement for the non-POSIX function popen.) IF setfont show Nl Lpt (- ) CFs setfont show ( * This returns an int rather than a FILE * to make it general purpose.) CF setfont So show Nl Lpt (- ) CFs setfont show ( * NOTE THAT THE VARIABLE cmd_name IS NOT DEFINED IN THIS FILE) CF setfont So show Nl Lpt BFs setfont (+ 6 ) show ( * This returns an int rather than a FILE * to make it general purpose -) IF setfont Bs Nl Lpt BFs setfont (+ 7 ) show ( * fdopen can be used outside to convert this to a FILE *) IF setfont Bs Nl Lpt CFs setfont ( 8 ) show ( */) IF setfont show Nl Lpt CFs setfont ( ) show () IF setfont show Nl Lpt CFs setfont ( 10 ) show (#define _POSIX_SOURCE) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 12 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 13 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 14 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 15 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 16 ) show (#include ) CF setfont show Nl Lpt CFs setfont ( 17 ) show (#include ) CF setfont show Nl Lpt BFs setfont (+ ) show () BF setfont show Nl Lpt BFs setfont (+ 19 ) show (#ifdef _ultrix) BF setfont show Nl Lpt BFs setfont (+ 20 ) show (extern int close\(int fildes\);) BF setfont show Nl Lpt BFs setfont (+ 21 ) show (extern int dup\(int fildes\);) BF setfont show Nl Lpt BFs setfont (+ 22 ) show (extern pid_t fork\(void\);) BF setfont show Nl Lpt BFs setfont (+ 23 ) show (extern int pipe\(int fildes[2]\);) BF setfont show Nl Lpt BFs setfont (+ 24 ) show (#else) BF setfont show Nl Lpt CFs setfont ( 25 ) show (#include ) CF setfont show Nl Lpt BFs setfont (+ 26 ) show (#endif) BF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt (- ) CFs setfont show (/****************************************************************************) CF setfont So show Nl Lpt (- ) CFs setfont show ( * Function:) CF setfont So show Nl Lpt (- ) CFs setfont show ( * openpipe) CF setfont So show Nl Lpt (- ) CFs setfont show ( *) CF setfont So show Nl Lpt (- ) CFs setfont show ( * Opens a pipe to or from a command. This is _not_ a direct replacement for) CF setfont So show Nl Lpt (- ) CFs setfont show ( * popen because:) CF setfont So show Nl Lpt (- ) CFs setfont show ( * - in the case of failure it prints an error message and calls exit,) CF setfont So show Nl Lpt (- ) CFs setfont show ( * instead of just returning NULL;) CF setfont So show Nl Lpt (- ) CFs setfont show ( * - it returns an int instead of a FILE *;) CF setfont So show Nl Lpt (- ) CFs setfont show ( * - it is called openpipe instead of popen) CF setfont So show Nl Lpt (- ) CFs setfont show ( */) CF setfont So show Nl Lpt BFs setfont (+ 28 ) show (#include "trueprint.h") BF setfont show Nl Lpt BFs setfont (+ 29 ) show (#include "main.h") BF setfont show Nl Lpt BFs setfont (+ 30 ) show (#include "openpipe.h") BF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 32 ) show (int) CF setfont show Nl Lpt CFs setfont ( 33 ) show (openpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 35 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 36 1 ) show ( int fildes[2];) CF setfont show Nl Lpt CFs setfont ( 37 1 ) show ( int parent_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 38 1 ) show ( int child_pipe_end;) CF setfont show Nl Lpt CFs setfont ( 39 1 ) show ( char *child_pipe_mode;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 41 2 ) show ( if \(strcmp\(mode, "w"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 42 2 ) show ( parent_pipe_end = 1; child_pipe_end = 0;) CF setfont show Nl Lpt CFs setfont ( 43 2 ) show ( child_pipe_mode = "read";) CF setfont show Nl Lpt CFs setfont ( 44 2 ) show ( } else if \(strcmp\(mode, "r"\) == 0\) {) CF setfont show Nl Lpt CFs setfont ( 45 2 ) show ( parent_pipe_end = 0; child_pipe_end = 1;) CF setfont show Nl Lpt CFs setfont ( 46 2 ) show ( child_pipe_mode = "write";) CF setfont show Nl Lpt CFs setfont ( 47 2 ) show ( } else {) CF setfont show Nl Lpt CFs setfont ( 48 2 ) show ( \(void\)fprintf\(stderr, "%s: Internal error: popen\() CF setfont show Nl Lpt CFs setfont ( ) show ( \) called with bad mode %s", cmd_name, mode\);) CF setfont show Nl Lpt CFs setfont ( 49 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 50 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl showpage %%Page: 3 4 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (openpipe) stringwidth pop 2 div sub Ypos moveto (openpipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 2 of 3) stringwidth pop sub dup Ypos moveto (Page 2 of 3) show exch sub 2 div add (test6.c 2) stringwidth pop 2 div sub Ypos moveto (test6.c 2) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 52 2 ) show ( if \(pipe\(fildes\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 53 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot create pipe, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 54 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 55 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 57 2 ) show ( switch \(fork\(\)\) {) CF setfont show Nl Lpt CFs setfont ( 58 2 ) show ( case -1:) CF setfont show Nl Lpt CFs setfont ( 59 2 ) show ( ) CF setfont show (/* Error */) IF setfont show Nl Lpt CFs setfont ( 60 2 ) show ( \(void\)fprintf\(stderr, "%s: Cannot fork, %s\\n", cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 61 2 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 62 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 64 2 ) show ( case 0:) CF setfont show Nl Lpt CFs setfont ( 65 2 ) show ( ) CF setfont show (/* Child process */) IF setfont show Nl Lpt CFs setfont ( 66 2 ) show ( if \(!\(\(close\(fildes[parent_pipe_end]\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 67 2 ) show ( \(close\(child_pipe_end\) == 0\) &&) CF setfont show Nl Lpt CFs setfont ( 68 3 ) show ( \(dup\(fildes[child_pipe_end]\) == child_pipe_end\)\)\) {) CF setfont show Nl Lpt CFs setfont ( 69 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot redirect %s for child, %s\\n", cmd_name, child_pipe_mode, strerror\() CF setfont show Nl Lpt CFs setfont ( ) show ( errno\)\);) CF setfont show Nl Lpt CFs setfont ( 70 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 71 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 73 3 ) show ( if \(system\(command\) < 0\) {) CF setfont show Nl Lpt CFs setfont ( 74 3 ) show ( \(void\)fprintf\(stderr,"%s: Cannot start pipe, %s\\n",cmd_name, strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 75 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 76 2 ) show ( } else exit\(0\);) CF setfont show Nl Lpt CFs setfont ( 77 2 ) show ( ) CF setfont show (/*NOTREACHED*/) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 79 2 ) show ( default:) CF setfont show Nl Lpt CFs setfont ( 80 2 ) show ( ) CF setfont show (/* Parent process */) IF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 82 3 ) show ( if \(close\(fildes[child_pipe_end]\) != 0\) {) CF setfont show Nl Lpt CFs setfont ( 83 3 ) show ( \(void\)fprintf\() CF setfont show Nl Lpt CFs setfont ( ) show ( stderr,"%s: Cannot close %s end of pipe for parent, %s\\n",cmd_name, child_pipe_mode,) CF setfont show Nl Lpt CFs setfont ( ) show ( strerror\(errno\)\);) CF setfont show Nl Lpt CFs setfont ( 84 3 ) show ( exit\(2\);) CF setfont show Nl Lpt CFs setfont ( 85 2 ) show ( }) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 87 2 ) show ( return fildes[parent_pipe_end];) CF setfont show Nl Lpt CFs setfont ( 88 1 ) show ( }) CF setfont show Nl Lpt CFs setfont ( 89 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 91 ) show (FILE *) CF setfont show Nl Lpt CFs setfont ( 92 ) show (fopenpipe) BF setfont show (\(const char *command, char *mode\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 94 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 95 1 ) show ( int handle;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 97 1 ) show ( handle = openpipe\(command, mode\);) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 99 1 ) show ( return fdopen\(handle, mode\);) CF setfont show Nl Lpt CFs setfont ( 100 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 102 ) show (void) CF setfont show Nl Lpt CFs setfont ( 103 ) show (closepipe) BF setfont show (\(int handle\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 105 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 106 1 ) show ( int statloc;) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 108 1 ) show ( \(void\)close\(handle\);) CF setfont show Nl Lpt CFs setfont ( 109 1 ) show ( \(void\)waitpid\(-1, &statloc, WNOHANG\);) CF setfont show Nl Lpt CFs setfont ( 110 ) show (}) CF setfont show Nl Lpt CFs setfont ( ) show () CF setfont show Nl Lpt CFs setfont ( 112 ) show (void) CF setfont show Nl showpage %%Page: 4 5 15 30 translate Cp HF setfont /Ypos Tm Bh sub Ps 2 div add def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (fclosepipe) stringwidth pop 2 div sub Ypos moveto (fclosepipe) show HF setfont /Ypos Ps 2 div def Ps Ypos moveto (Fri Apr 16 03:00:00 1982) show currentpoint pop dup Rm Ps sub (Page 3 of 3) stringwidth pop sub dup Ypos moveto (Page 3 of 3) show exch sub 2 div add (test6.c 3) stringwidth pop 2 div sub Ypos moveto (test6.c 3) show /Vpos Tm Bh sub Ps sub def Lpt CFs setfont ( 113 ) show (fclosepipe) BF setfont show (\(FILE *fp\)) CF setfont show Nl Lpt CFs setfont ( ) show () BF setfont show Nl Lpt CFs setfont ( 115 1 ) show ({) CF setfont show Nl Lpt CFs setfont ( 116 1 ) show ( closepipe\(fileno\(fp\)\);) CF setfont show Nl Lpt CFs setfont ( 117 ) show (}) CF setfont show Nl showpage %%Trailer %%EOF