diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-11-08 08:22:03 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-11-08 08:22:03 +0000 |
commit | e454a5216a97e26de92a5ed4072a7dc00df54849 (patch) | |
tree | 90980ca73a3a031081c6c8103902bf6efd2b8c0e | |
parent | 96d20af0f5c73740cf97266de570a4ab5834d2cb (diff) |
dvi2tty 5.3.3 (30oct10)
git-svn-id: svn://tug.org/texlive/trunk@20367 c570f23f-e606-0410-a88d-b1316a301751
69 files changed, 2659 insertions, 4955 deletions
diff --git a/Build/source/texk/README b/Build/source/texk/README index 4447f17d6c4..55e0c76151d 100644 --- a/Build/source/texk/README +++ b/Build/source/texk/README @@ -37,7 +37,7 @@ devnag - from devnag package installed in texmf-dist. dtl - ? -dvi2tty 5.3.1 - checked 25oct10 +dvi2tty 5.3.3 - checked 6nov10 http://www.mesa.nl/pub/dvi2tty/ dvidvi - ? diff --git a/Build/source/texk/dvi2tty/ChangeLog b/Build/source/texk/dvi2tty/ChangeLog index 6d9199993b1..4fd8af96cbe 100644 --- a/Build/source/texk/dvi2tty/ChangeLog +++ b/Build/source/texk/dvi2tty/ChangeLog @@ -1,3 +1,14 @@ +2010-11-06 Peter Breitenlohner <peb@mppmu.mpg.de> + + * dvi2tty.test: New shell script for 'make check' test. + * ligtest.tty, test{,s,u}.tty (new): Expected test output. + * Makefile.am: Add the new test. + +2010-11-06 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import dvi2tty-5.3.3. + * configure.ac: Adapted. + 2010-10-23 Peter Breitenlohner <peb@mppmu.mpg.de> Import dvi2tty-5.3.1. diff --git a/Build/source/texk/dvi2tty/Makefile.am b/Build/source/texk/dvi2tty/Makefile.am index ac4cb6637ad..aa99d31e86b 100644 --- a/Build/source/texk/dvi2tty/Makefile.am +++ b/Build/source/texk/dvi2tty/Makefile.am @@ -43,3 +43,15 @@ man1_MANS = \ $(DVI2TTY_TREE)/disdvi.1 \ $(DVI2TTY_TREE)/dvi2tty.1 +## Tests. +## +TESTS = dvi2tty.test + +TESTS_ENVIRONMENT = DVI2TTY_TREE=$(DVI2TTY_TREE) +DISTCLEANFILES = +EXTRA_DIST += $(TESTS) + +## dvi2tty.test +EXTRA_DIST += ligtest.tty test.tty tests.tty testu.tty +DISTCLEANFILES += ligtest.out test.out tests.out testu.out + diff --git a/Build/source/texk/dvi2tty/Makefile.in b/Build/source/texk/dvi2tty/Makefile.in index bcb283b3f63..efa1d7263e6 100644 --- a/Build/source/texk/dvi2tty/Makefile.in +++ b/Build/source/texk/dvi2tty/Makefile.in @@ -119,6 +119,8 @@ NROFF = nroff MANS = $(man1_MANS) ETAGS = etags CTAGS = ctags +am__tty_colors = \ +red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -251,7 +253,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../../m4 -EXTRA_DIST = $(DVI2TTY_TREE) $(DVI2TTY_TREE)-PATCHES +EXTRA_DIST = $(DVI2TTY_TREE) $(DVI2TTY_TREE)-PATCHES $(TESTS) \ + ligtest.tty test.tty tests.tty testu.tty INCLUDES = $(KPATHSEA_INCLUDES) AM_CPPFLAGS = -DKPATHSEA AM_CFLAGS = $(WARNING_CFLAGS) @@ -270,6 +273,9 @@ man1_MANS = \ $(DVI2TTY_TREE)/disdvi.1 \ $(DVI2TTY_TREE)/dvi2tty.1 +TESTS = dvi2tty.test +TESTS_ENVIRONMENT = DVI2TTY_TREE=$(DVI2TTY_TREE) +DISTCLEANFILES = ligtest.out test.out tests.out testu.out all: c-auto.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -544,6 +550,98 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + $(am__tty_colors); \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + col=$$red; res=XPASS; \ + ;; \ + *) \ + col=$$grn; res=PASS; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$tst[\ \ ]*) \ + xfail=`expr $$xfail + 1`; \ + col=$$lgn; res=XFAIL; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + col=$$red; res=FAIL; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + col=$$blu; res=SKIP; \ + fi; \ + echo "$${col}$$res$${std}: $$tst"; \ + done; \ + if test "$$all" -eq 1; then \ + tests="test"; \ + All=""; \ + else \ + tests="tests"; \ + All="All "; \ + fi; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="$$All$$all $$tests passed"; \ + else \ + if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ + banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all $$tests failed"; \ + else \ + if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ + banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + if test "$$skip" -eq 1; then \ + skipped="($$skip test was not run)"; \ + else \ + skipped="($$skip tests were not run)"; \ + fi; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + if test "$$failed" -eq 0; then \ + echo "$$grn$$dashes"; \ + else \ + echo "$$red$$dashes"; \ + fi; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes$$std"; \ + test "$$failed" -eq 0; \ + else :; fi + distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ @@ -708,6 +806,7 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(PROGRAMS) $(MANS) c-auto.h installdirs: @@ -735,6 +834,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -814,10 +914,10 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 -.MAKE: all install-am install-strip +.MAKE: all check-am install-am install-strip -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool ctags dist \ +.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \ + clean clean-binPROGRAMS clean-generic clean-libtool ctags dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ diff --git a/Build/source/texk/dvi2tty/configure b/Build/source/texk/dvi2tty/configure index 80ef74d5903..2ebe4ac0256 100755 --- a/Build/source/texk/dvi2tty/configure +++ b/Build/source/texk/dvi2tty/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for dvi2tty for TeX Live 5.3.1. +# Generated by GNU Autoconf 2.68 for dvi2tty for TeX Live 5.3.3. # # Report bugs to <tex-k@tug.org>. # @@ -570,12 +570,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvi2tty for TeX Live' PACKAGE_TARNAME='dvi2tty-for-tex-live' -PACKAGE_VERSION='5.3.1' -PACKAGE_STRING='dvi2tty for TeX Live 5.3.1' +PACKAGE_VERSION='5.3.3' +PACKAGE_STRING='dvi2tty for TeX Live 5.3.3' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="dvi2tty-5.3.1/dvi2tty.c" +ac_unique_file="dvi2tty-5.3.3/dvi2tty.c" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> @@ -1303,7 +1303,7 @@ if test "$ac_init_help" = "long"; then # 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 <<_ACEOF -\`configure' configures dvi2tty for TeX Live 5.3.1 to adapt to many kinds of systems. +\`configure' configures dvi2tty for TeX Live 5.3.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,7 +1374,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvi2tty for TeX Live 5.3.1:";; + short | recursive ) echo "Configuration of dvi2tty for TeX Live 5.3.3:";; esac cat <<\_ACEOF @@ -1486,7 +1486,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvi2tty for TeX Live configure 5.3.1 +dvi2tty for TeX Live configure 5.3.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1966,7 +1966,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dvi2tty for TeX Live $as_me 5.3.1, which was +It was created by dvi2tty for TeX Live $as_me 5.3.3, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -7319,7 +7319,7 @@ fi # Define the identity of the package. PACKAGE='dvi2tty-for-tex-live' - VERSION='5.3.1' + VERSION='5.3.3' cat >>confdefs.h <<_ACEOF @@ -12966,7 +12966,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -dvi2tty for TeX Live config.lt 5.3.1 +dvi2tty for TeX Live config.lt 5.3.3 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -14018,7 +14018,7 @@ if test "x$kpse_cv_kpse_debug" != xyes; then : fi -DVI2TTY_TREE=dvi2tty-5.3.1 +DVI2TTY_TREE=dvi2tty-5.3.3 ac_config_files="$ac_config_files Makefile" @@ -14562,7 +14562,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dvi2tty for TeX Live $as_me 5.3.1, which was +This file was extended by dvi2tty for TeX Live $as_me 5.3.3, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14628,7 +14628,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dvi2tty for TeX Live config.status 5.3.1 +dvi2tty for TeX Live config.status 5.3.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/dvi2tty/configure.ac b/Build/source/texk/dvi2tty/configure.ac index e40422c1c28..0233f715eee 100644 --- a/Build/source/texk/dvi2tty/configure.ac +++ b/Build/source/texk/dvi2tty/configure.ac @@ -6,7 +6,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -m4_define([dvi2tty_version], [5.3.1])[]dnl using unmodified dvi2tty source tree +m4_define([dvi2tty_version], [5.3.3])[]dnl using unmodified dvi2tty source tree AC_INIT([dvi2tty for TeX Live], dvi2tty_version, [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([dvi2tty-]dvi2tty_version[/dvi2tty.c]) diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/TL-Changes b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/TL-Changes deleted file mode 100644 index 6adeeebc1c7..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/TL-Changes +++ /dev/null @@ -1,9 +0,0 @@ -Changes applied to the dvi2tty-5.3.1 tree as obtained from: - http://www.mesa.nl/pub/dvi2tty/dvi2tty-5.3.1.tar.gz. - -Removed: - dvistuff.c.bak - -Renamed: - test.dvi.org -> test.org.dvi - diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-02-simple-typos b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-02-simple-typos deleted file mode 100644 index 82863912e0d..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-02-simple-typos +++ /dev/null @@ -1,24 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/README dvi2tty-5.3.1/README ---- dvi2tty-5.3.1.orig/README 2003-01-23 04:02:43.000000000 +0100 -+++ dvi2tty-5.3.1/README 2009-06-15 00:59:36.000000000 +0200 -@@ -3,7 +3,7 @@ - - dvi2tty is intended for previewing dvi-files on text-only - devices (terminals and lineprinters). --The program is basicly an improved C version of the pascal -+The program is basically an improved C version of the pascal - program written by Svante Lindahl (see README.ORG). - I translated it because I could not find a pascal compiler - on our machine that could compile it. -diff -ur dvi2tty-5.3.1.orig/commands.h dvi2tty-5.3.1/commands.h ---- dvi2tty-5.3.1.orig/commands.h 2003-01-23 04:00:22.000000000 +0100 -+++ dvi2tty-5.3.1/commands.h 2010-10-19 11:34:16.000000000 +0200 -@@ -65,7 +65,7 @@ - #define Z3 169 /* ??? */ - #define Z4 170 /* ??? */ - #define FONT_00 171 /* set current font to 0 */ --#define FONT_63 234 /* set current font to 0 */ -+#define FONT_63 234 /* set current font to 63 */ - #define FNT1 235 /* set current font */ - #define FNT2 236 /* Same as FNT1, except that arg is 2 bytes */ - #define FNT3 237 /* Same as FNT1, except that arg is 3 bytes */ diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-03-ANSI-C b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-03-ANSI-C deleted file mode 100644 index 1833fad4306..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-03-ANSI-C +++ /dev/null @@ -1,59 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/disdvi.c dvi2tty-5.3.1/disdvi.c ---- dvi2tty-5.3.1.orig/disdvi.c 2003-01-23 11:31:00.000000000 +0100 -+++ dvi2tty-5.3.1/disdvi.c 2010-10-21 08:07:43.000000000 +0200 -@@ -113,8 +113,6 @@ - - #if defined(VMS) - main (int argc, char ** argv); --#else --void main (int argc, char ** argv); - #endif - void bop (void); - void preamble (void); -@@ -138,7 +136,7 @@ - #if defined(VMS) - main(int argc, char **argv) - #else --void main(int argc, char **argv) -+int main(int argc, char **argv) - #endif - { - register int opcode; /* dvi opcode */ -diff -ur dvi2tty-5.3.1.orig/dvi2tty.c dvi2tty-5.3.1/dvi2tty.c ---- dvi2tty-5.3.1.orig/dvi2tty.c 2003-01-23 11:28:30.000000000 +0100 -+++ dvi2tty-5.3.1/dvi2tty.c 2010-10-21 08:31:44.000000000 +0200 -@@ -252,7 +252,6 @@ - */ - - #if defined(MSDOS) --void main (int, char **); - void setoption (char *); - void getargs (void); - void getpages (int, char *); -@@ -265,8 +264,6 @@ - - # if defined(VMS) - main (int argc, char ** argv); --# else --void main (int argc, char ** argv); - # endif - void setoption (char * optarg); - void getargs (void); -@@ -288,7 +285,7 @@ - #if defined(VMS) - main(int argc, char **argv) - #else --void main(int argc, char **argv) -+int main(int argc, char **argv) - #endif - { - -@@ -361,7 +358,7 @@ - * GETARGS -- Process options from command line and from environment. - */ - --void getargs() -+void getargs(void) - { - char *str, *envp; - bool DVIfound; /* if a dvi filename found */ diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-04-pager b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-04-pager deleted file mode 100644 index 81cb872384f..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-04-pager +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/dvi2tty.c dvi2tty-5.3.1/dvi2tty.c ---- dvi2tty-5.3.1.orig/dvi2tty.c 2010-10-21 08:31:44.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.c 2010-10-21 11:15:43.000000000 +0200 -@@ -180,7 +180,7 @@ - /* don't have terminals with Scand. nat. chars */ - #define WANTPAGER TRUE /* default: try to pipe through a pager (like */ - /* more) if stdout is tty and no -o switch */ --#define DEFPAGER "/usr/bin/pg" /* CHANGE TO YOUR LOCAL PAGER */ -+#define DEFPAGER "more" /* CHANGE TO YOUR LOCAL PAGER */ - - /*------------------ end of customization constants ---------------------*/ - diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-05-getline b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-05-getline deleted file mode 100644 index 29cf25e2d9e..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-05-getline +++ /dev/null @@ -1,78 +0,0 @@ - Apparently POSIX 2008 has getline and glibc 2.9.90 exports it. - Rename our getline to something that a standard won't usurp. - -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2003-01-23 04:01:12.000000000 +0100 -+++ dvi2tty-5.3.1/dvistuff.c 2010-10-22 11:03:32.000000000 +0200 -@@ -179,7 +181,7 @@ - void ruleaux (long, long, char); - long horizontalmove (long); - int skipnops (void); --linetype * getline (void); -+linetype * texlive_getline (void); - linetype * findline (void); - unsigned long num (int); - long snum (int); -@@ -208,7 +210,7 @@ - void ruleaux (long rulewt, long ruleht, char ch); - long horizontalmove (long amount); - int skipnops (void); --linetype * getline (void); -+linetype * texlive_getline (void); - linetype * findline (void); - unsigned long num (int size); - long snum (int size); -@@ -376,7 +376,7 @@ - h = 0L; v = 0L; /* initialize coordinates */ - x = 0L; w = 0L; y = 0L; z = 0L; /* initialize amounts */ - sptr = 0; /* initialize stack */ -- currentline = getline(); /* initialize list of lines */ -+ currentline = texlive_getline(); /* initialize list of lines */ - currentline->vv = 0L; - firstline = currentline; - lastline = currentline; -@@ -777,7 +777,7 @@ - * GETLINE -- Returns an initialized line-object - */ - --linetype *getline(void) -+linetype *texlive_getline(void) - { - register int i; - register linetype *temp; -@@ -793,7 +793,7 @@ - - return temp; - --} /* getline */ -+} /* texlive_getline */ - - - -@@ -809,7 +809,7 @@ - - if (v <= firstline->vv) { /* above first line */ - if (firstline->vv - v > lineheight) { -- temp = getline(); -+ temp = texlive_getline(); - temp->next = firstline; - firstline->prev = temp; - temp->vv = v; -@@ -820,7 +820,7 @@ - - if (v >= lastline->vv) { /* below last line */ - if (v - lastline->vv > lineheight) { -- temp = getline(); -+ temp = texlive_getline(); - temp->prev = lastline; - lastline->next = temp; - temp->vv = v; -@@ -843,7 +843,7 @@ - return temp->next; - - /* no line fits suitable, generate a new one */ -- currentline = getline(); -+ currentline = texlive_getline(); - currentline->next = temp->next; - currentline->prev = temp; - temp->next->prev = currentline; diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-06-bug-fix b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-06-bug-fix deleted file mode 100644 index 927f20ac1b3..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-06-bug-fix +++ /dev/null @@ -1,22 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2010-10-22 11:03:32.000000000 +0200 -+++ dvi2tty-5.3.1/dvistuff.c 2010-10-22 13:45:27.000000000 +0200 -@@ -596,7 +596,8 @@ - currentline = currentline->next) { - if (currentline != firstline) { - foo = ((currentline->vv - currentline->prev->vv)/lineheight)-1; -- foo &= 3; /* linespacings not too large */ -+ if (foo > 3) -+ foo = 3; /* linespacings not too large */ - for (i = 1; i <= (int) foo; i++) - putc('\n', output); - } -@@ -1246,7 +1245,7 @@ - - for (i = 0; i < namelen; i++) - name[i] = get1(); -- name[i] = '\0'; /* just to be sure */ -+ name[i] = '\0'; /* required */ - fnt->name = name; - if (new) { - fnt->next = fonts; diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-50-kpathsea b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-50-kpathsea deleted file mode 100644 index 9ca1eb8f22b..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-50-kpathsea +++ /dev/null @@ -1,116 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/disdvi.c dvi2tty-5.3.1/disdvi.c ---- dvi2tty-5.3.1.orig/disdvi.c 2010-10-21 08:07:43.000000000 +0200 -+++ dvi2tty-5.3.1/disdvi.c 2010-10-22 09:08:02.000000000 +0200 -@@ -60,6 +60,11 @@ - # include "macintosh.h" - #endif - -+#if defined(KPATHSEA) -+#define NO_DEBUG 1 -+#include <kpathsea/config.h> -+#include <kpathsea/lib.h> -+#endif - - - /* -@@ -181,7 +150,7 @@ - else - dvifp = stdin; - --#if defined(MSDOS) -+#if defined(MSDOS) || defined(WIN32) - setmode(fileno(dvifp), O_BINARY); - #endif - -diff -ur dvi2tty-5.3.1.orig/dvi2tty.c dvi2tty-5.3.1/dvi2tty.c ---- dvi2tty-5.3.1.orig/dvi2tty.c 2010-10-21 11:15:43.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.c 2010-10-22 14:10:28.000000000 +0200 -@@ -301,7 +301,7 @@ - #if defined(THINK_C) - if (inputfromfile) { - #endif --#if defined(MSDOS) -+#if defined(MSDOS) || defined(WIN32) - if ((DVIfile = fopen(DVIfilename, "rb")) == NULL) - #else - # if defined(VMS) -@@ -648,6 +648,48 @@ - } /* plcnxt */ - - -+#ifdef KPATHSEA -+#ifdef __DJGPP__ -+/* `stat' is way too expensive for such a simple job. */ -+#define READABLE(fn, st) \ -+ (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) -+#else -+#define READABLE(fn, st) \ -+ (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) -+#endif -+ -+static char * -+readable_file(char *name) -+{ -+ char *ret; -+ -+#ifdef WIN32 -+ unsigned int fa; -+ -+ fa = GetFileAttributes(name); -+ if (fa == 0xFFFFFFFF) { -+ ret = NULL; -+ } -+ else if ((fa & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) { -+ ret = NULL; -+ } -+ else { -+ ret = name; -+ } -+#else /* ! WIN32 */ -+ struct stat st; -+ -+ if (READABLE (name, st)) { -+ ret = name; -+ -+ } else { /* Some other error. */ -+ ret = NULL; -+ } -+#endif -+ return ret; -+ -+} -+#endif - - /* - * GETFNAME -- {Make sure we have a .dvi filename. -@@ -661,7 +704,11 @@ - if (i == 0) - usage(ign); - strcpy(DVIfilename, str); -+#ifdef KPATHSEA -+ if (!readable_file(DVIfilename)) -+#else - if ((i < 5) || strcmp(str+i-4, ".dvi")) -+#endif - strcat(DVIfilename, ".dvi"); - - return; -diff -ur dvi2tty-5.3.1.orig/dvi2tty.h dvi2tty-5.3.1/dvi2tty.h ---- dvi2tty-5.3.1.orig/dvi2tty.h 2003-01-23 04:01:04.000000000 +0100 -+++ dvi2tty-5.3.1/dvi2tty.h 2010-10-22 15:08:40.000000000 +0200 -@@ -32,8 +32,15 @@ - # endif - #endif - -+#if defined(KPATHSEA) -+#define NO_DEBUG 1 -+#include <kpathsea/config.h> -+#include <sys/types.h> -+#include <sys/stat.h> -+#else - #define TRUE 1 - #define FALSE 0 -+#endif - #define nil NULL - - /* diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-60-warnings b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-60-warnings deleted file mode 100644 index d090508a274..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-60-warnings +++ /dev/null @@ -1,236 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/disdvi.c dvi2tty-5.3.1/disdvi.c ---- dvi2tty-5.3.1.orig/disdvi.c 2010-10-22 09:08:02.000000000 +0200 -+++ dvi2tty-5.3.1/disdvi.c 2010-10-22 09:15:58.000000000 +0200 -@@ -124,7 +124,7 @@ - void postamble (void); - void postpostamble (void); - void fontdef (int x); --char * fontname (unsigned long fntnum); -+const char * fontname (unsigned long fntnum); - void special (int x); - void printnonprint (int ch); - unsigned long num (int size); -@@ -493,7 +493,7 @@ - * FONTNAME -- Return font name. - */ - --char * fontname(unsigned long fntnum) -+const char * fontname(unsigned long fntnum) - { - font * fnt; - -diff -ur dvi2tty-5.3.1.orig/dvi2tty.c dvi2tty-5.3.1/dvi2tty.c ---- dvi2tty-5.3.1.orig/dvi2tty.c 2010-10-22 14:10:28.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.c 2010-10-22 14:15:38.000000000 +0200 -@@ -236,13 +236,13 @@ - long foo; /* utility variable, "register" */ - #if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) - bool pager; /* tells if output is piped to a pager */ --char * path; /* name of the pager to run */ -+const char * path; /* name of the pager to run */ - #endif - char * progname; /* our name */ - int Argc; - char ** Argv; - char DVIfilename[MAXLEN]; --char * OUTfilename; -+const char * OUTfilename; - char optch; /* for option handling */ - - -@@ -252,26 +252,26 @@ - */ - - #if defined(MSDOS) --void setoption (char *); -+void setoption (const char *); - void getargs (void); --void getpages (int, char *); -+void getpages (int, const char *); - void plcnxt (int); --void getfname (char *); --int getinteger(int *, int *, char *); --int getlong (long *, int *, char *); -+void getfname (const char *); -+int getinteger(int *, int *, const char *); -+int getlong (long *, int *, const char *); - void usage (int); - #else - - # if defined(VMS) - main (int argc, char ** argv); - # endif --void setoption (char * optarg); -+void setoption (const char * optarg); - void getargs (void); --void getpages (int j, char * str); -+void getpages (int j, const char * str); - void plcnxt (int pagnr); --void getfname (char * str); --int getinteger(int * dest, int * j, char * str); --int getlong (long * dest, int * j, char * str); -+void getfname (const char * str); -+int getinteger(int * dest, int * j, const char * str); -+int getlong (long * dest, int * j, const char * str); - void usage (int uerr); - #endif - -@@ -360,7 +360,8 @@ - - void getargs(void) - { -- char *str, *envp; -+ const char *str; -+ char *envp; - bool DVIfound; /* if a dvi filename found */ - - #if !defined(THINK_C) -@@ -494,7 +495,7 @@ - * SETOPTION -- Process an option. - */ - --void setoption(char *optarg) -+void setoption(const char *optarg) - { - int j = 0; - -@@ -571,7 +572,7 @@ - * GETPAGES -- Getr a list of pages to print. - */ - --void getpages(int j, char *str) -+void getpages(int j, const char *str) - { - int i, c; - int num; -@@ -695,7 +696,7 @@ - * GETFNAME -- {Make sure we have a .dvi filename. - */ - --void getfname(char *str) -+void getfname(const char *str) - { - int i; - -@@ -722,7 +723,7 @@ - * call for it. - */ - --int getinteger(int *dest, int *j, char *str) -+int getinteger(int *dest, int *j, const char *str) - { - int cum; - int sgn; -@@ -758,7 +759,7 @@ - * call for it. - */ - --int getlong(long *dest, int *j, char *str) -+int getlong(long *dest, int *j, const char *str) - { - long cum; - int sgn; -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2010-10-22 13:45:27.000000000 +0200 -+++ dvi2tty-5.3.1/dvistuff.c 2010-10-22 14:07:21.391142887 +0200 -@@ -93,7 +93,9 @@ - * Structure and variable definitions - */ - -+#if 0 - char *dvistuff = "@(#) dvistuff.c 5.12 27may1996 M.J.E. Mol (c) 1989-1996"; -+#endif - - typedef struct { - long hh; -@@ -186,7 +188,7 @@ - void dochar (char); - void symchar (char); - void normchar (char); --void outchar (char); -+void outchar (unsigned char); - void putcharacter (long); - void setchar (long); - void fontdef (int); -@@ -215,7 +217,7 @@ - void dochar (char ch); - void symchar (char ch); - void normchar (char ch); --void outchar (char ch); -+void outchar (unsigned char ch); - void putcharacter (long charnr); - void setchar (long charnr); - void fontdef (int x); -@@ -382,18 +384,20 @@ - lastline = currentline; - firstcolumn = rightmargin; - if (pageswitchon) { -- if ((sequenceon ? pagecounter : pagenr) != firstpage->pag) -+ if ((sequenceon ? pagecounter : pagenr) != firstpage->pag) { - if (noffd) - fprintf(output, "^L\n"); - else - putc(FORM, output); -+ } - } - else -- if (backpointer != -1) /* not FORM at first page */ -+ if (backpointer != -1) { /* not FORM at first page */ - if (noffd) - fprintf(output, "^L\n"); - else - putc(FORM, output); -+ } - - return; - -@@ -588,7 +592,7 @@ - void printpage(void) - { - register int i, j; -- register char ch; -+ register unsigned char ch; - - if (sptr != 0) - fprintf(stderr, "dvi2tty: warning - stack not empty at eop.\n"); -@@ -667,7 +671,7 @@ - { - - register char ch; /* character to set rule with */ -- register long saveh, savev; -+ register long saveh = 0, savev; - /* rule -- starts up the recursive routine */ - if (!moving) - saveh = h; -@@ -837,11 +841,12 @@ - /* temp->vv < v < temp->next->vv --- temp is above, temp->next is below */ - topd = v - temp->vv; - botd = temp->next->vv - v; -- if ((topd < lineheight) || (botd < lineheight)) -+ if ((topd < lineheight) || (botd < lineheight)) { - if (topd < botd) /* take best fit */ - return temp; - else - return temp->next; -+ } - - /* no line fits suitable, generate a new one */ - currentline = texlive_getline(); -@@ -1071,7 +1076,7 @@ - * SHOULD BE MOVED OUT. - */ - --void outchar(char ch) -+void outchar(unsigned char ch) - { - register int i, j; - -@@ -1201,7 +1206,7 @@ - void setchar(long charnr) - { - -- outchar(allchar ? charnr : '#'); -+ outchar(allchar ? (unsigned char)charnr : '#'); - - return; - diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-70-disdvi-xetex b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-70-disdvi-xetex deleted file mode 100644 index 626051ec381..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-70-disdvi-xetex +++ /dev/null @@ -1,298 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/commands.h dvi2tty-5.3.1/commands.h ---- dvi2tty-5.3.1.orig/commands.h 2010-10-19 11:34:16.000000000 +0200 -+++ dvi2tty-5.3.1/commands.h 2010-10-20 11:34:16.000000000 +0200 -@@ -85,3 +85,12 @@ - #define TRAILER 223 /* trailer bytes in dvi file */ - - /* undefined_commands 250,251,252,253,254,255 */ -+ -+/* additional DVI commands for XeTeX extensions */ -+#define PIC_FILE 251 -+#define NAT_FNT 252 /* define a native font */ -+#define SET_GL_AR 253 -+#define SET_GL_ST 254 -+ -+/* additional DVI command for pTeX extensions */ -+#define DVI_DIR 255 /* set direction */ -diff -ur dvi2tty-5.3.1.orig/disdvi.1 dvi2tty-5.3.1/disdvi.1 ---- dvi2tty-5.3.1.orig/disdvi.1 2010-10-20 14:21:13.000000000 +0200 -+++ dvi2tty-5.3.1/disdvi.1 2010-10-23 13:10:17.000000000 +0200 -@@ -1,17 +1,25 @@ --.TH DISDVI 1 "20 October 2010" "TeX Live" -+.TH DISDVI 1 "23 October 2010" "TeX Live" - .SH NAME --disdvi \- `disassemble' a TeX DVI file -+disdvi \- `disassemble' a (p)TeX DVI or XeTeX XDV file - .SH SYNOPSIS - .B disdvi --dvi\-file -+.RB [ \-p ] -+.RI [ dvi_file [ \fB.dvi\fP ]] -+.br -+.B disdvi \-x -+.RI [ xdv_file [ \fB.xdv\fP ]] -+.br -+.B disdvi \-h - .SH DESCRIPTION - .I disdvi - interprets the contents of --.IR dvi\-file , -+.IR dvi_file -+or -+.IR xdv_file , - printing the DVI commands and text in a human-readable ASCII format on - the standard output. - .SH "SEE ALSO" --dvi2tty(SIPB) -+.BR dvi2tty (1) - .SH AUTHOR - Marcel J.E. Mol, Delft University of Technology, The Netherlands - .br -diff -ur dvi2tty-5.3.1.orig/disdvi.c dvi2tty-5.3.1/disdvi.c ---- dvi2tty-5.3.1.orig/disdvi.c 2010-10-22 09:15:58.000000000 +0200 -+++ dvi2tty-5.3.1/disdvi.c 2010-10-22 09:17:28.000000000 +0200 -@@ -107,6 +107,9 @@ - - char * progname; - -+int is_ptex = 0; -+int is_xetex = 0; -+const char * dvi_ext = ".dvi"; - - /* - * Function declarations -@@ -130,6 +133,11 @@ - unsigned long num (int size); - long snum (int size); - void usage (void); -+void picfile (int opcode); -+void natfontdef (int opcode); -+void glyphs (int opcode); -+void dvidir (int opcode); -+void invalid (int opcode); - - - -@@ -155,6 +163,25 @@ - - progname = *argv++; - -+ if ((argc > 1) && (*argv[0] == '-')) { -+ if (!strcmp(*argv, "-h")) { -+ usage(); -+ exit(0); -+ } -+ if (!strcmp(*argv, "-p")) -+ is_ptex = 1; -+ else if (!strcmp(*argv, "-x")) { -+ is_xetex = 1; -+ dvi_ext = ".xdv"; -+ } else { -+ fprintf(stderr, "Invalid option `%s'\n", *argv); -+ usage(); -+ exit(3); -+ } -+ argv++; -+ argc--; -+ } -+ - if (argc > 2) { - fprintf(stderr, "To many arguments\n"); - usage(); -@@ -162,21 +189,17 @@ - } - - if (argc == 2) { -- if (!strcmp(*argv, "-h")) { -- usage(); -- exit(0); -- } - if ((i = strlen(*argv)) == 0) { - fprintf(stderr, "Illegal empty filename\n"); - usage(); - exit(2); - } -- if ((i >= 5) && (!strcmp(*argv+i-4, ".dvi"))) -+ if ((i >= 5) && (!strcmp(*argv+i-4, dvi_ext))) - dvi_name = *argv; - else { - dvi_name = malloc((i+5) * sizeof(char)); - strcpy(dvi_name, *argv); -- strcat(dvi_name, ".dvi"); -+ strcat(dvi_name, dvi_ext); - } - if ((dvifp = fopen(dvi_name, "r")) == NULL) { - perror(dvi_name); -@@ -293,6 +316,12 @@ - case PRE : preamble(); break; - case POST : postamble(); break; - case POST_POST: postpostamble(); break; -+ case PIC_FILE : picfile(opcode); break; -+ case NAT_FNT : natfontdef(opcode); break; -+ case SET_GL_AR: -+ case SET_GL_ST: glyphs(opcode); break; -+ case DVI_DIR : dvidir(opcode); break; -+ default : invalid(opcode); - } - } - -@@ -616,9 +645,157 @@ - { - - fprintf(stderr, "\n%s\n\n", disdvi); -- fprintf(stderr, " disassembles TeX dvi files\n"); -- fprintf(stderr, "Usage: %s [-h | <dvi-file>[.dvi]]\n", progname); -+ fprintf(stderr, " disassembles (p)TeX dvi and XeTeX xdv files\n"); -+ fprintf(stderr, "Usage: %s [-h | [-p] [dvi_file[.dvi]]\n", progname); -+ fprintf(stderr, " | -x [xdv_file[.xdv]]]\n"); - - return; - - } /* usage */ -+ -+ -+ -+void picfile(int opcode) -+{ -+ int i; -+ -+ if (!is_xetex) { -+ invalid(opcode); -+ return; -+ } -+ -+ printf("PIC_FILE flags : %ld\n", get1()); -+ printf("%06ld: trans :", pc); -+ for (i=0; i<6; i++) -+ printf(" %ld", sget4()); -+ printf("\n%06ld: ", pc); -+ printf(" page : %ld\n", get2()); -+ printf("%06ld: ", pc); -+ i = (int) get1(); -+ printf(" path name (%3d) :", i); -+ while (i-- > 0) -+ putchar((int) get1()); -+ putchar('\n'); -+} /* picfile */ -+ -+ -+ -+void natfontdef(int opcode) -+{ -+ register int i; -+ char * name; -+ font * fnt; -+ int flags, namelen, famlen, stylen; -+ long fntnum; -+ int new = 0; -+ -+ if (!is_xetex) { -+ invalid(opcode); -+ return; -+ } -+ -+ fntnum = num(4); -+ printf("NAT_FNT: %ld\n", fntnum); -+ printf("%06ld: ", pc); -+ printf(" scale : %ld\n", get4()); -+ printf("%06ld: ", pc); -+ flags = get2(); -+ printf(" flags : %d\n", flags); -+ printf("%06ld: ", pc); -+ printf(" name : "); -+ namelen = (int) get1(); -+ famlen = (int) get1(); -+ stylen = (int) get1(); -+ fnt = fonts; -+ while (fnt != NULL && fnt->num != fntnum) -+ fnt = fnt->next; -+ if (fnt == NULL) { -+ if ((fnt = (font *) malloc(sizeof(font))) == NULL) { -+ perror("fontdef"); -+ exit(1); -+ } -+ fnt->num = fntnum; -+ new = 1; -+ } -+ else -+ free(fnt->name); /* free old name */ -+ if ((name = (char *) malloc((namelen+1) * sizeof(char))) == NULL) { -+ perror("fontdef"); -+ exit(1); -+ } -+ -+ for (i = 0; i < namelen; i++) -+ name[i] = get1(); -+ name[namelen] = '\0'; -+ fnt->name = name; -+ if (new) { -+ fnt->next = fonts; -+ fonts = fnt; -+ } -+ -+ printf("%s\n", name); -+ -+ if (famlen) { -+ printf(" family : "); -+ while (famlen-- > 0) -+ putchar((int) get1()); -+ putchar('\n'); -+ } -+ -+ if (stylen) { -+ printf(" style : "); -+ while (stylen-- > 0) -+ putchar((int) get1()); -+ putchar('\n'); -+ } -+} /* fontdef */ -+ -+ -+ -+void glyphs(int opcode) -+{ -+ long width; -+ int x, n, i, j; -+ long * xy; -+ -+ if (!is_xetex) { -+ invalid(opcode); -+ return; -+ } -+ -+ x = SET_GL_ST - opcode + 1; -+ width = sget4(); -+ n = get2(); -+ printf("GLYPH_%s width : %ld\n", x == 2 ? "ARR" : "STR", width); -+ if ((xy = (long *) malloc(n * x * sizeof(long))) == NULL) { -+ perror("glyphs"); -+ exit(1); -+ } -+ for (j=0; j < n * x; j++) -+ xy[j] = sget4(); -+ for (i=0, j=0; i < n; i++) { -+ printf(" x: %ld", xy[j++]); -+ if (x == 2) -+ printf(" y: %ld", xy[j++]); -+ printf(" g: %ld\n", get2()); -+ } -+} /* glyphs */ -+ -+ -+ -+void dvidir(int opcode) -+{ -+ if (!is_ptex) { -+ invalid(opcode); -+ return; -+ } -+ -+ printf("DVI_DIR: %ld\n", get1()); -+} /* dvidir */ -+ -+ -+ -+void invalid(int opcode) -+{ -+ printf("INVALID %d\n", opcode); -+} /* invalid */ diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-80-maybe-bug-fix b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-80-maybe-bug-fix deleted file mode 100644 index dc76051abdf..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-80-maybe-bug-fix +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2010-10-22 14:07:21.000000000 +0200 -+++ dvi2tty-5.3.1/dvistuff.c 2010-10-22 14:58:46.000000000 +0200 -@@ -1165,8 +1165,8 @@ - currentline->charactercount = j; - if (j < firstcolumn) - firstcolumn = j; -+ h += charwidth; - } -- h += charwidth; - - return; - diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-81-maybe-scand b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-81-maybe-scand deleted file mode 100644 index 39a1c07f4ae..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-81-maybe-scand +++ /dev/null @@ -1,61 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2010-10-22 14:58:46.000000000 +0200 -+++ dvi2tty-5.3.1/dvistuff.c 2010-10-23 19:03:03.000000000 +0200 -@@ -1104,18 +1104,18 @@ - * This code does not really belong here ... - * - *-------------------------------------------------------------* -- * The following is very specialized code, it handles national * -- * Swe/Fin characters. They are respectively: a and o with two * -- * dots ("a & "o) and a with a circle (Oa). In Swe/Fin "ASCII" * -- * these characters replace {}|[] and \. TeX outputs these by * -+ * The following is very specialized code, it handles some eu- * -+ * ropean characters. These are: a, o, u with two dots ("a & * -+ * "o & "u), and a with a circle (Oa). TeX outputs these by * - * first issuing the dots or circle and then backspace and set * -- * the a or o. When dvi2tty finds an a or o it searches in the * -- * near vicinity for the character codes that represent circle * -- * or dots and if one is found the corresponding national char * -- * replaces the special character codes. * -+ * the a, o, or u. When dvitty finds an a, o, or u it sear- * -+ * ches in the near vicinity for the character codes that re- * -+ * present circle or dots and if one is found the correspon- * -+ * ding Latin-1 character replaces the special character code. * - *-------------------------------------------------------------*/ -- if (!allchar && scascii) { -- if ((ch == 'a') || (ch == 'A') || (ch == 'o') || (ch == 'O')) { -+ if (scascii) { -+ if ((ch == 'a') || (ch == 'A') || (ch == 'o') || (ch == 'O') || -+ (ch == 'u') || (ch == 'U')) { - for (i = IMAX(leftmargin, j-2); - i <= IMIN(rightmargin, j+2); - i++) -@@ -1129,18 +1129,22 @@ - case 127 : - case 34 : /* DEL or " */ - if (ch == 'a') -- ch = '{'; /* } vi */ -+ ch = 0xe4; - else if (ch == 'A') /* dots ... */ -- ch = '['; -+ ch = 0xc4; - else if (ch == 'o') -- ch = '|'; -+ ch = 0xf6; - else if (ch == 'O') -- ch = '\\'; -+ ch = 0xd6; -+ else if (ch == 'u') -+ ch = 0xfc; -+ else if (ch == 'U') -+ ch = 0xdc; - break; - case 23 : if (ch == 'a') -- ch = /* { vi */ '}'; -+ ch = 0xe5; - else if (ch == 'A') /* circle */ -- ch = ']'; -+ ch = 0xc5; - break; - } - } diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-90-undo-some b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-90-undo-some deleted file mode 100644 index 61d5d06ba2e..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-90-undo-some +++ /dev/null @@ -1,1668 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/disdvi.c dvi2tty-5.3.1/disdvi.c ---- dvi2tty-5.3.1.orig/disdvi.c 2010-10-22 09:17:28.000000000 +0200 -+++ dvi2tty-5.3.1/disdvi.c 2010-10-24 14:03:20.000000000 +0200 -@@ -154,7 +154,7 @@ - { - register int opcode; /* dvi opcode */ - register int i; -- unsigned long fontnum; -+ int fontnum; - - #if defined(THINK_C) - argc = process_disdvi_command_line(&argv); -@@ -229,7 +229,7 @@ - printnonprint(opcode); /* it must be a non-printable */ - else if ((opcode >= FONT_00) && (opcode <= FONT_63)) - printf("FONT_%02d /* %s */\n", opcode - FONT_00, -- fontname((unsigned long) opcode - FONT_00)); -+ fontname(opcode - FONT_00)); - else - switch (opcode) { - case SET1 : -@@ -301,7 +301,7 @@ - case FNT2 : - case FNT3 : - case FNT4 : fontnum = num(opcode -FNT1 + 1); -- printf("FNT%d: %ld /* %s */\n", -+ printf("FNT%d: %d /* %s */\n", - opcode - FNT1 + 1, fontnum, - fontname(fontnum)); - break; -@@ -469,7 +469,7 @@ - char * name; - font * fnt; - int namelen; -- unsigned long fntnum; -+ long fntnum; - int new = 0; - - fntnum = num(x); -@@ -522,7 +522,7 @@ - * FONTNAME -- Return font name. - */ - --const char * fontname(unsigned long fntnum) -+const char * fontname(long fntnum) - { - font * fnt; - -diff -ur dvi2tty-5.3.1.orig/dvi2tty.c dvi2tty-5.3.1/dvi2tty.c ---- dvi2tty-5.3.1.orig/dvi2tty.c 2010-10-22 14:15:38.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.c 2010-10-24 14:28:11.424244541 +0200 -@@ -180,17 +180,17 @@ - /* don't have terminals with Scand. nat. chars */ - #define WANTPAGER TRUE /* default: try to pipe through a pager (like */ - /* more) if stdout is tty and no -o switch */ --#define DEFPAGER "more" /* CHANGE TO YOUR LOCAL PAGER */ -+#define DEFPAGER "more" /* CHANGE TO YOUR LOCAL PAGER */ - - /*------------------ end of customization constants ---------------------*/ - - #define MAXLEN 100 /* size of char-arrays for strings */ --#if defined(MSDOS) || defined(VMS) || defined(AMIGA) --#define OPTSET "haJwepPousltvbc" /* legal options */ --#define OPTWARG "wepPovb" /* options with argument */ -+#if defined(MSDOS) || defined(VMS) -+#define OPTSET "wepPousl" /* legal options */ -+#define OPTWARG "wepPo" /* options with argument */ - #else --#define OPTSET "haJwepPousqlfFtvbc"/* legal options */ --#define OPTWARG "wepPoFvb" /* options with argument */ -+#define OPTSET "wepPousqlfF"/* legal options */ -+#define OPTWARG "wepPoF" /* options with argument */ - #endif - - /* -@@ -206,19 +206,12 @@ - #define bdopt 7 /* bad option */ - #define onepp 8 /* only one page list allowed */ - #define noarg 9 /* argument expected */ --#if defined(THINK_C) --#define nored 10 /* if no input file, redirect stdin */ --#endif -- - -+#if 0 -+char *dvi2tty = "@(#) dvi2tty.c 4.1 27/03/90 M.J.E. Mol (c) 1989, 1990"; -+#endif - --/* -- * Variable definitions -- */ -- --char *dvi2tty = "@(#) dvi2tty.c 5.12 27may1996 M.J.E. Mol (c) 1989-1996"; --#define VERSION 5.2 -- -+/*---------------------------------------------------------------------------*/ - - printlisttype * currentpage; /* current page to print */ - printlisttype * firstpage; /* first page selected */ -@@ -227,14 +220,11 @@ - FILE * DVIfile; - FILE * output; - bool outputtofile; /* tells if output goes to file or stdout */ --#if defined(THINK_C) --bool inputfromfile; /* tells if input comes from file or stdin */ --#endif - int ttywidth; /* max nr of chars per printed line */ - int espace; /* to fake calcs with ttywidth */ - - long foo; /* utility variable, "register" */ --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) -+#if !defined(MSDOS) && !defined(VMS) - bool pager; /* tells if output is piped to a pager */ - const char * path; /* name of the pager to run */ - #endif -@@ -245,94 +235,67 @@ - const char * OUTfilename; - char optch; /* for option handling */ - -+/*---------------------------------------------------------------------------*/ - -- --/* -- * Function declarations -- */ -- --#if defined(MSDOS) --void setoption (const char *); --void getargs (void); --void getpages (int, const char *); --void plcnxt (int); --void getfname (const char *); --int getinteger(int *, int *, const char *); --int getlong (long *, int *, const char *); --void usage (int); -+#if defined(KPATHSEA) || defined(MSDOS) -+int main (int, char **); -+void setoption (const char *); -+void getargs (void); -+void getpages (int, const char *); -+void plcnxt (int); -+void getfname (const char *); -+int getinteger (int *, int *, const char *); -+void usage (int); - #else -+char * getenv (); -+FILE * popen (); - --# if defined(VMS) -- main (int argc, char ** argv); --# endif --void setoption (const char * optarg); --void getargs (void); --void getpages (int j, const char * str); --void plcnxt (int pagnr); --void getfname (const char * str); --int getinteger(int * dest, int * j, const char * str); --int getlong (long * dest, int * j, const char * str); --void usage (int uerr); -+int main (); -+void setoption (); -+void getargs (); -+void getpages (); -+void plcnxt (); -+void getfname (); -+int getinteger(); -+void usage (); - #endif - -- - /****************************************************************************/ - /* */ - /* M A I N */ - /* */ - /****************************************************************************/ - --#if defined(VMS) --main(int argc, char **argv) --#else - int main(int argc, char **argv) --#endif - { - --#if defined(THINK_C) -- argc = process_dvi_command_line(&argv); --#endif -- - progname = *argv; - Argc = argc; - Argv = argv; - - getargs(); /* read command line arguments */ --#if defined(THINK_C) -- if (inputfromfile) { --#endif --#if defined(MSDOS) || defined(WIN32) -- if ((DVIfile = fopen(DVIfilename, "rb")) == NULL) -+#if defined(DOSISH) -+ if ((DVIfile = fopen(DVIfilename, "rb")) == NULL) - #else --# if defined(VMS) -- if ((DVIfile = fopen(DVIfilename, "r","ctx=rec")) == NULL) --# else -- if ((DVIfile = fopen(DVIfilename, "r")) == NULL) --# endif -+#if defined(VMS) -+ if ((DVIfile = fopen(DVIfilename, "r","ctx=rec")) == NULL) -+#else -+ if ((DVIfile = fopen(DVIfilename, "r")) == NULL) - #endif -- errorexit(filop); /* can't open dvifile */ --#if defined(THINK_C) -- } -- else -- DVIfile = stdin; - #endif -+ errorexit(filop); /* can't open dvifile */ - - if (outputtofile) { /* open the outfile, if needed */ - if ((output = fopen(OUTfilename, "w")) == NULL) - errorexit(filcr); --#if defined(THINK_C) -- else -- set_creator((unsigned char*) OUTfilename); --#endif -- --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) -+#if !defined(MSDOS) && !defined(VMS) - pager = FALSE; - #endif - } - else { - output = stdout; --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) -- if (pager && isatty(fileno(output))) { /* try to pipe to a pager */ -+#if !defined(MSDOS) && !defined(VMS) -+ if (isatty(fileno(output)) && pager) { /* try to pipe to a pager */ - if ((output = popen(path, "w")) == NULL) /* get pipe to pager */ - errorexit(pipcr); /* make output to output */ - } -@@ -343,20 +306,79 @@ - - dvimain(); - --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) -+#if !defined(MSDOS) && !defined(VMS) - if (pager) - pclose(output); /* close pipe to pager */ - #endif - -- exit(0); -+ return 0; - - } /* main */ - -+/*----------------------------------------------------------------------------*/ - -+void setoption(const char *optarg) -+{ -+ int j = 0; -+ -+ while (strchr(OPTSET, optch) != NULL) { -+ switch (optch) { -+#if !defined(MSDOS) && !defined(VMS) -+ case 'q' : pager = FALSE; break; -+ case 'f' : pager = TRUE; break; -+#endif -+ case 'l' : noffd = TRUE; break; -+ case 's' : scascii = TRUE; break; -+ case 'u' : scascii = FALSE; break; -+ case 'P' : -+ sequenceon = TRUE; /* fall through */ -+ case 'p' : -+ if (pageswitchon) -+ usage(onepp); -+ getpages(j, optarg); -+ break; -+ case 'w' : -+ if (getinteger(&ttywidth, &j, optarg)) -+ usage(nan); -+ if (optarg[j] != '\0') -+ usage(gae); -+ if ((ttywidth < 16) || (ttywidth > 132)) -+ usage(wrnge); -+ break; -+ case 'e' : -+ if (getinteger(&espace, &j, optarg)) -+ usage(nan); -+ if (optarg[j] != '\0') -+ usage(gae); -+ break; -+ case 'o' : -+ OUTfilename = optarg; -+ outputtofile = TRUE; -+ j = strlen(optarg); -+ break; -+#if !defined(MSDOS) && !defined(VMS) -+ case 'F' : -+ pager = TRUE; -+ path = optarg; -+ j = strlen(optarg); -+ break; -+#endif -+ default : -+ usage(bdopt); -+ } -+ if ((optch = optarg[j]) == '\0') -+ break; -+ j++; -+ if ((strchr(OPTWARG, optch) != NULL) && (optarg[j]=='\0')) { -+ if (--Argc <= 0) -+ usage(noarg); -+ optarg = *++Argv; -+ j = 0; -+ } -+ } -+} /* setoption */ - --/* -- * GETARGS -- Process options from command line and from environment. -- */ -+/*----------------------------------------------------------------------------*/ - - void getargs(void) - { -@@ -364,67 +386,33 @@ - char *envp; - bool DVIfound; /* if a dvi filename found */ - --#if !defined(THINK_C) - if (Argc <= 1) - usage(ign); --#endif - - pageswitchon = FALSE; /* show all pages */ - sequenceon = FALSE; /* selected pages are TeX-numbered */ - outputtofile = FALSE; /* write to stdout */ --#if defined(THINK_C) -- inputfromfile = FALSE; /* read from stdin */ --#endif --#if !defined(MSDOS) && !defined(VMS) && !defined (THINK_C) && !defined(AMIGA) -+#if !defined(MSDOS) && !defined(VMS) - pager = WANTPAGER; /* want paging, compile time option */ - #endif -- accent = TRUE; /* show all accent etc. as extra char */ -- ttfont = FALSE; /* assume tt font (verbatim mode) */ - noffd = FALSE; /* print formfeed between pages */ - scascii = DEFSCAND; /* scandinavian, compile time option */ - ttywidth = 80; /* default terminal width */ - espace = 0; /* to fake ttywith calcs */ - DVIfound = FALSE; -- printfont = FALSE; /* do not print font switches */ -- allchar = FALSE; /* do not put out all characters */ - --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) -+#if !defined(MSDOS) && !defined(VMS) - if ((path = getenv("PAGER")) == NULL) /* find default pathname of page */ - path = DEFPAGER; /* program in case paging is wanted */ - #endif - -- /* -- * -- * With VAX-C under VMS getenv normally searches the environment array -- * looking for the variables HOME, TERM, PATH, and USER. In certain -- * situations getenv attempts to first perform a logical name translation -- * if none of the environment array strings are matched and then trying -- * to translate a CLI symbol. Unfortunately we need a CLI symbol defined -- * as; -- * -- * dvi2tty :== $path:dvi2tty.exe -- * -- * to invoke dvi2tty with command line arguments as it would be invoked -- * under Unix. So we use the logical DVI$DVI2TYY as the environment -- * variable from which options may be set. -- * -- */ -- -- /* -- * First process environment variable. -- */ -- --#if defined(VMS) -- if ((envp = getenv("DVI$DVI2TTY")) != NULL) { --#else -- if ((envp = getenv("DVI2TTY")) != NULL) { /* } keep vi happy */ --#endif -+ if ((envp = getenv("DVI2TTY")) != NULL) { - while (*envp == ' ') - envp++; - while (*envp) { /* environment var args */ - if (strchr(OPTSET, optch = *envp++) != NULL) { - /* -- * we always pass one option, and arrange for optarg ourselfes, -+ * we always pass one option, and arrange for optarg ourselfves, - * so setoption does not mesh up Argv - */ - if (strchr(OPTWARG, optch) != NULL) { -@@ -449,19 +437,12 @@ - } - } - -- /* -- * Now process command line options. -- */ -- - while (--Argc > 0) { /* command line args */ - str = *++Argv; - if (*str != '-') { /* argument is not an option */ - if (DVIfound) /* only one dvi file allowed */ - usage(onef); - getfname(str); --#if defined(THINK_C) -- inputfromfile = --#endif - DVIfound = TRUE; - } - else if (strchr(OPTSET, optch = *++str) != NULL) { -@@ -478,99 +459,11 @@ - } - - if (!DVIfound) --#if defined(THINK_C) /* Allow use of stdin for */ -- if (isatty(fileno(stdin))) -- usage(nored); /* Mac, if redirected */ --#else - usage(ign); --#endif -- -- return; - - } /* getargs */ - -- -- --/* -- * SETOPTION -- Process an option. -- */ -- --void setoption(const char *optarg) --{ -- int j = 0; -- -- while (strchr(OPTSET, optch) != NULL) { -- switch (optch) { -- case 'h' : usage(ign); break; --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) -- case 'q' : pager = FALSE; break; -- case 'f' : pager = TRUE; break; -- case 'F' : pager = TRUE; -- path = optarg; -- j = strlen(optarg); -- break; --#endif -- case 'J' : japan = TRUE; break; -- case 't' : ttfont = TRUE; break; -- case 'l' : noffd = TRUE; break; -- case 's' : scascii = TRUE; break; -- case 'u' : scascii = FALSE; break; -- case 'a' : accent = FALSE; break; -- case 'c' : allchar = TRUE; break; -- case 'P' : sequenceon = TRUE; /* fall through */ -- case 'p' : if (pageswitchon) -- usage(onepp); -- getpages(j, optarg); -- break; -- case 'w' : if (getinteger(&ttywidth, &j, optarg)) -- usage(nan); -- if (optarg[j] != '\0') -- usage(gae); -- if ((ttywidth < 16) || (ttywidth > MAXTERMWIDTH)) -- usage(wrnge); -- break; -- case 'e' : if (getinteger(&espace, &j, optarg)) -- usage(nan); -- if (optarg[j] != '\0') -- usage(gae); -- break; -- case 'v' : if (getlong(&lineheight, &j, optarg)) -- usage(nan); -- if (optarg[j] != '\0') -- usage(gae); -- /* lineheight *= 65536L; */ -- /* want to specify in pt, but have no getfloat */ -- break; -- case 'o' : OUTfilename = optarg; -- outputtofile = TRUE; -- j = strlen(optarg); -- break; -- case 'b' : printfont = TRUE; -- delim = optarg; -- if (!strlen(optarg)) -- printfont = FALSE; -- break; -- default : usage(bdopt); -- } -- if ((optch = optarg[j++]) == '\0') -- break; -- if ( (optarg[j] == '\0') && (strchr(OPTWARG, optch) != NULL) ) { -- if (--Argc <= 0) -- usage(noarg); -- optarg = *++Argv; -- j = 0; -- } -- } -- -- return; -- --} /* setoption */ -- -- -- --/* -- * GETPAGES -- Getr a list of pages to print. -- */ -+/*---------------------------------------------------------------------------*/ - - void getpages(int j, const char *str) - { -@@ -623,19 +516,11 @@ - } - currentpage = firstpage; - -- return; -- - } /* getpages */ - - -- --/* -- * PLCNXT -- Place page-nr next in list. -- */ -- --void plcnxt(int pagnr) -+void plcnxt(int pagnr) /* place page-nr next in list */ - { -- - currentpage = lastpage; - currentpage->pag = pagnr; - lastpage = (printlisttype *) malloc(sizeof(printlisttype)); -@@ -644,10 +529,9 @@ - lastpage->pag = 0; - currentpage->nxt = lastpage; - -- return; -- - } /* plcnxt */ - -+/*----------------------------------------------------------------------------*/ - - #ifdef KPATHSEA - #ifdef __DJGPP__ -@@ -675,13 +559,13 @@ - ret = NULL; - } - else { -- ret = name; -+ ret = (string) name; - } - #else /* ! WIN32 */ - struct stat st; - - if (READABLE (name, st)) { -- ret = name; -+ ret = (string) name; - - } else { /* Some other error. */ - ret = NULL; -@@ -692,10 +576,6 @@ - } - #endif - --/* -- * GETFNAME -- {Make sure we have a .dvi filename. -- */ -- - void getfname(const char *str) - { - int i; -@@ -705,23 +585,21 @@ - usage(ign); - strcpy(DVIfilename, str); - #ifdef KPATHSEA -- if (!readable_file(DVIfilename)) -+ if (readable_file(DVIfilename)) -+ return; -+ -+ strcat(DVIfilename, ".dvi"); -+ - #else -- if ((i < 5) || strcmp(str+i-4, ".dvi")) --#endif -+ if (!((i >= 5) && (str[i-1] == 'i') && (str[i-2] == 'v') && -+ (str[i-3] == 'd') && (str[i-4] == '.'))) { - strcat(DVIfilename, ".dvi"); -- -- return; -+ } -+#endif - - } /* getfname */ - -- -- -- --/* -- * GETINTEGER -- Convert ascii to an integer. I'm sure there is a library -- * call for it. -- */ -+/*----------------------------------------------------------------------------*/ - - int getinteger(int *dest, int *j, const char *str) - { -@@ -736,7 +614,6 @@ - } - else - sgn = 1; -- - if ((ch >= '0') && (ch <= '9')) { - cum = 0; - while ((ch >= '0') && (ch <= '9')) { -@@ -744,55 +621,13 @@ - ch = str[++(*j)]; - } - *dest = sgn * cum; -- - return 0; /* return ok */ - } -- - return 1; /* return error */ - - } /* getinteger */ - -- -- --/* -- * GETLONG -- Convert ascii to a long. I'm sure there is a library -- * call for it. -- */ -- --int getlong(long *dest, int *j, const char *str) --{ -- long cum; -- int sgn; -- char ch; -- -- ch = str[*j]; -- if (ch == '-') { -- sgn = -1; -- ch = str[++(*j)]; -- } -- else -- sgn = 1; -- -- if ((ch >= '0') && (ch <= '9')) { -- cum = 0; -- while ((ch >= '0') && (ch <= '9')) { -- cum = cum*10L + ch - '0'; -- ch = str[++(*j)]; -- } -- *dest = (long) sgn * cum; -- -- return 0; /* return ok */ -- } -- -- return 1; /* return error */ -- --} /* getinteger */ -- -- -- --/* -- * ERROREXIT -- Exit program with an erro message. -- */ -+/*----------------------------------------------------------------------------*/ - - void errorexit(int errorcode) - { -@@ -839,7 +674,7 @@ - break; - case filcr : fprintf(stderr, "Cannot create outfile\n"); - break; --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) -+#if !defined(MSDOS) && !defined(VMS) - case pipcr : fprintf(stderr, "Cannot create pipe to pager\n"); - break; - #endif -@@ -852,31 +687,23 @@ - #else - unlink(OUTfilename); - #endif -- - exit(errorcode); - - } /* errorexit */ - -- -- --/* -- * USAGE -- Print the usage info. Also print a warning/error message -- * if needed. -- */ -+/*----------------------------------------------------------------------------*/ - - void usage(int uerr) - { - -- fprintf(stderr, "%s", Copyright); -- - if (uerr != ign) { - fprintf(stderr,"%s: ", progname); - switch (uerr) { -- case wrnge : fprintf(stderr, "width arg out of range:16-%d", -- MAXTERMWIDTH); -+ case ign : fprintf(stderr, "%s", Copyright); -+ break; -+ case wrnge : fprintf(stderr, "width arg out of range:16-132"); - break; -- case nan : fprintf(stderr, -- "numeric argument expected for option %c", -+ case nan : fprintf(stderr, "numeric argument expected for option %c", - optch); - break; - case gae : fprintf(stderr, "garbage in argument for option %c", -@@ -886,47 +713,29 @@ - break; - case onef : fprintf(stderr, "only one infile argument allowed"); - break; -- case noarg : fprintf(stderr, -- "option argument expected for option %c", -+ case noarg : fprintf(stderr, "option argument expected for option %c", - optch); - break; - case bdopt : fprintf(stderr, "bad option %c", optch); - break; - case onepp : fprintf(stderr, "only one pagelist allowed"); - break; --#if defined(THINK_C) -- case nored : fprintf(stderr, "\nIf no input file is given in\ -- command string,\n\Standard Input must be redirected with the radio button."); -- break; --#endif - default : fprintf(stderr, "unknown usage error"); - break; - } - fprintf(stderr, "\n"); - } -- -- fprintf(stderr, "\n%s\n\n", dvi2tty); --#if defined(THINK_C) -- fprintf(stderr, "Usage: %s [ options ] [<dvi-file>[.dvi]]\n", progname); -- fprintf(stderr, "Read input from <dvi-file>, else read from Standard Input,\ --\nwhich must be redirected by means of the radio button.\n"); --#else -- fprintf(stderr, "Usage: %s [ options ] <dvi-file>[.dvi]\n", progname); --#endif -+ fprintf(stderr, "Usage: %s [ options ] dvifile[.dvi]\n", progname); - fprintf(stderr, "Options are:\n"); - fprintf(stderr, - " -ofile Write output to file, else write to stdout.\n"); - fprintf(stderr, -- " -plist Print pages whose TeX-page-number are in list.\n"); -+ " -plist Print pages whos TeX-page-number are in list.\n"); - fprintf(stderr, -- " -Plist Print pages whose sequential number are in list.\n"); -+ " -Plist Print pages whos sequential number are in list.\n"); - fprintf(stderr, - " -wn Print the lines with width n characters, default 80.\n"); -- fprintf(stderr, -- " -vn Use n for vertical line height, default 450000.\n"); -- fprintf(stderr, -- " -evalue Add/Substract this value for spacing (-20..20)\n"); --#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) -+#if !defined(MSDOS) && !defined(VMS) - fprintf(stderr, " -f Try to pipe to a pager if output is a tty"); - if (WANTPAGER) - fprintf(stderr, " (default).\n"); -@@ -940,23 +749,19 @@ - fprintf(stderr, " -Fprog Pipe output to pager prog.\n"); - #endif - fprintf(stderr, -- " -a Remove accents grave etc. from output: \\'{e} -> e.\n"); -- fprintf(stderr, -- " -t Assuming that document was made with tt fonts\n"); -- fprintf(stderr, - " -l Write ''^L'' instead of formfeed between pages.\n"); - fprintf(stderr, -- " -u National Swedish/Finnish characters printed as aaoAAO (default %s).\n", DEFSCAND ? "off" : "on"); -- fprintf(stderr, -- " -s National Swedish/Finnish characters printed as }{|][\\ (default %s).\n", DEFSCAND ? "on" : "off"); -- fprintf(stderr, -- " -J Allow processing of japanese fonts\n"); -- fprintf(stderr, -- " -c Override -a -u -s and print all characters 0-255.\n"); -+ " -u National Swedish/Finnish characters printed as aaoAAO"); -+ if (DEFSCAND) -+ fprintf(stderr, ".\n"); -+ else -+ fprintf(stderr, " (default).\n"); - fprintf(stderr, -- " -bdelim Print font switch as text: delimcmr10miled\n"); -- fprintf(stderr, " -h This help message.\n"); -- -+ " -s National Swedish/Finnish characters printed as }{|][\\"); -+ if (DEFSCAND) -+ fprintf(stderr, " (default).\n"); -+ else -+ fprintf(stderr, ".\n"); - exit(uerr); - - } /* usage */ -diff -ur dvi2tty-5.3.1.orig/dvi2tty.h dvi2tty-5.3.1/dvi2tty.h ---- dvi2tty-5.3.1.orig/dvi2tty.h 2010-10-22 15:08:40.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.h 2010-10-24 14:29:23.814830452 +0200 -@@ -23,33 +23,28 @@ - - #include <stdio.h> - #include <string.h> --#include <stdlib.h> -+ -+#include <sys/types.h> -+#include <sys/stat.h> -+ - #if defined(MSDOS) --# include <malloc.h> --#else --# if !defined(THINK_C) --# include <unistd.h> --# endif -+#define DOSISH -+#include <stdlib.h> -+#include <malloc.h> - #endif - - #if defined(KPATHSEA) - #define NO_DEBUG 1 - #include <kpathsea/config.h> --#include <sys/types.h> --#include <sys/stat.h> --#else -+#endif -+ -+#ifndef KPATHSEA - #define TRUE 1 - #define FALSE 0 - #endif - #define nil NULL - - /* -- * Define the maximum width of the terminal -- * (this is also used to define the with of the line structure in dvistuff.c) -- */ --#define MAXTERMWIDTH 332 -- --/* - * ERROR CODES , don't start with 0 - */ - -@@ -76,11 +71,7 @@ - #define pipcr 20 /* cannot creat pipe */ - #endif - -- -- --/* -- * Type definitions -- */ -+/*---------------------------------------------------------------------------*/ - - typedef char bool; - -@@ -91,22 +82,13 @@ - struct prlistptr *nxt; /* next item in list */ - } printlisttype; - -- -- --/* -- * Variable definitions -- */ -+/*---------------------------------------------------------------------------*/ - - extern bool outputtofile; /* output to file or stdout(dvi2tty.c)*/ - extern bool pageswitchon; /* user-set pages to print(dvistuff.c)*/ - extern bool sequenceon; /* not TeX pagenrs (dvistuff.c) */ - extern bool scascii; /* Scand. nat. chars (dvistuff.c) */ --extern bool accent; /* Output accent stuff(dvistuff.c) */ --extern bool ttfont; /* tt font assumed (dvistuff.c) */ --extern bool japan; /* japanes font support (dvistuff.c) */ - extern bool noffd; /* output ^L or formfeed (dvistuff.c) */ --extern bool printfont; /* include font switches (dvistuff.c) */ --extern bool allchar; /* output all characters (dvistuff.c */ - - extern printlisttype *currentpage; /* current page to print (dvi2tty.c) */ - extern printlisttype *firstpage; /* first page selected (dvi2tty.c) */ -@@ -115,29 +97,15 @@ - extern int ttywidth; /* screen width (dvi2tty.c) */ - extern int espace; /* extra screen width (dvi2tty.c) */ - extern long foo; /* temporary 'register' (dvi2tty.c) */ --extern long lineheight; /* height of a line (dvistuff.c) */ - extern int opcode; /* dvi opcode (dvistuff.c) */ --extern char * delim; /* printer font delim (dvistuff.c) */ - - extern FILE *DVIfile; /* dvi file (dvi2tty.c) */ - extern FILE *output; /* output file (dvi2tty.c) */ - -- -- --/* -- * Funtion declarations -- */ -+/*---------------------------------------------------------------------------*/ - - /* dvi2tty.c */ --#if defined(MSDOS) - void errorexit(int); --#else --void errorexit(int errorcode); --#endif - - /* dvistuff.c */ --#if defined(MSDOS) --void dvimain(void); --#else - void dvimain(void); --#endif -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2010-10-23 19:03:03.000000000 +0200 -+++ dvi2tty-5.3.1/dvistuff.c 2010-10-24 15:01:30.719544412 +0200 -@@ -23,23 +23,15 @@ - */ - - #include "dvi2tty.h" -- -+#include <sys/types.h> -+#include <sys/stat.h> - #if defined(VMS) --# include types.h --# include stat --#else --# if defined(THINK_C) --# include <unix.h> --# else --# include <sys/types.h> --# include <sys/stat.h> --# endif -+#include types.h -+#include stat - #endif -- --#if defined(MSDOS) || defined(THINK_C) --# include <math.h> -+#if defined(MSDOS) -+#include <math.h> - #endif -- - #include "commands.h" - - -@@ -58,10 +50,9 @@ - #define VERSIONID 2 /* dvi version number that pgm handles */ - #define VERTICALEPSILON 450000L /* crlf when increasing v more than this */ - --#define rightmargin MAXTERMWIDTH+20 -- /* nr of columns allowed to the right of h=0*/ -+#define rightmargin 152 /* nr of columns allowed to the right of h=0*/ - #define leftmargin -50 /* give some room for negative h-coordinate */ --#define LINELEN rightmargin - leftmargin + 1 -+#define LINELEN 203 /* rightmargin - leftmargin + 1 */ - - #define MOVE TRUE /* if advancing h when outputing a rule */ - #define STAY FALSE /* if not advancing h when outputing a rule */ -@@ -125,17 +116,7 @@ - bool pageswitchon; /* true if user-set pages to print */ - bool sequenceon; /* false if pagesw-nrs refers to TeX-nrs */ - bool scascii; /* if true make Scand. nat. chars right */ --bool accent; /* if true output accents etc: \'{e} etc. */ --bool ttfont = FALSE; /* if true we assumed ttfonts, not cmr */ --bool symbolfont = FALSE; /* true if font is a symbol font */ --bool japan = FALSE; /* switch to japanese fonts ... */ --bool mifont = FALSE; --int jfontnum = 0; - bool noffd; /* if true output ^L instead of formfeed */ --char * delim; /* -bdelim for font switch printing */ --bool printfont; /* true if user wants font switches printed */ --bool allchar; /* true if user sets all characters */ -- /* overrides sscasci, accent */ - - int opcode; /* dvi-opcodes */ - -@@ -149,8 +130,6 @@ - - long maxpagewidth; /* width of widest page in file */ - long charwidth; /* aprox width of character */ --long lineheight = VERTICALEPSILON; -- /* aprox height of a line */ - - linetype * currentline; /* pointer to current line on current page */ - linetype * firstline; /* pointer to first line on current page */ -@@ -161,6 +140,7 @@ - int sptr; /* stack pointer */ - - font * fonts = NULL; /* List of fontnames defined */ -+int symbolfont = FALSE; /* true if font is a symbol font */ - - - -@@ -168,7 +148,7 @@ - * Function definitions - */ - --#if defined(MSDOS) -+#if defined(KPATHSEA) || defined(MSDOS) - void postamble (void); - void preamble (void); - void walkpages (void); -@@ -193,38 +173,31 @@ - void setchar (long); - void fontdef (int); - void setfont (long); --void jischar (long); --int compute_jis (int, int, int *, int *); --int getjsubfont (char *); -- - #else --void postamble (void); --void preamble (void); --void walkpages (void); --void initpage (void); --void dopage (void); --void skippage (void); --void printpage (void); --bool inlist (long pagenr); --void rule (bool moving, long rulewt, long ruleht); --void ruleaux (long rulewt, long ruleht, char ch); --long horizontalmove (long amount); --int skipnops (void); --linetype * texlive_getline (void); --linetype * findline (void); --unsigned long num (int size); --long snum (int size); --void dochar (char ch); --void symchar (char ch); --void normchar (char ch); --void outchar (unsigned char ch); --void putcharacter (long charnr); --void setchar (long charnr); --void fontdef (int x); --void setfont (long fntnum); --void jischar (long charnr); --void compute_jis (int f, int c, int * ku, int * ten); --int getjsubfont (char * s); -+void postamble (); -+void preamble (); -+void walkpages (); -+void initpage (); -+void dopage (); -+void skippage (); -+void printpage (); -+bool inlist (); -+void rule (); -+void ruleaux (); -+long horizontalmove (); -+int skipnops (); -+linetype * texlive_getline (); -+linetype * findline (); -+unsigned long num (); -+long snum (); -+void dochar (); -+void symchar (); -+void normchar (); -+void outchar (); -+void putcharacter (); -+void setchar (); -+void fontdef (); -+void setfont (); - #if defined(VMS) - long vmsseek (); - long vms_ftell (); -@@ -249,8 +222,8 @@ - /* note that walkpages *must* immediately follow preamble */ - walkpages(); /* time to do the actual work! */ - -- return; -- -+- return; -+- - } /* dvimain */ - - -@@ -340,26 +313,30 @@ - - pagecounter = 0L; - while ((opcode = skipnops()) != POST) { -- - if (opcode != BOP) /* should be at start of page now */ - errorexit(nobop); -+ else { -+ pagecounter++; -+ pagenr = sget4(); /* get TeX page number */ -+ mseek(DVIfile, 36L, relative); /* skip page header */ -+ backpointer = sget4(); /* get previous page offset */ -+ if (pageswitchon) -+ if (sequenceon) -+ wantpage = inlist(pagecounter); -+ else -+ wantpage = inlist(pagenr); -+ else -+ wantpage = TRUE; - -- pagecounter++; -- pagenr = sget4(); /* get TeX page number */ -- mseek(DVIfile, 36L, relative); /* skip page header */ -- backpointer = sget4(); /* get previous page offset */ -- if (pageswitchon) -- wantpage = inlist(sequenceon ? pagecounter : pagenr); -- else -- wantpage = TRUE; -- -- if (wantpage) { -- initpage(); -- dopage(); -- printpage(); -- } -- else -+ if (wantpage) { -+ initpage(); -+ dopage(); -+ printpage(); -+ } -+ else { - skippage(); -+ } -+ } - } - - return; -@@ -417,12 +394,12 @@ - if (opcode <= LASTCHAR) - dochar((char) opcode); - else if ((opcode >= FONT_00) && (opcode <= FONT_63)) -- setfont((long) opcode - FONT_00); -+ setfont(opcode - FONT_00); - else if (opcode > POST_POST) - errorexit(illop); - else - switch (opcode) { -- case SET1 : japan ? jischar(get1()) : setchar(get1());break; -+ case SET1 : setchar(get1()); break; - case SET2 : setchar(get2()); break; - case SET3 : setchar(get3()); break; - case SET4 : setchar(get4()); break; -@@ -599,9 +576,9 @@ - for (currentline = firstline; currentline != nil; - currentline = currentline->next) { - if (currentline != firstline) { -- foo = ((currentline->vv - currentline->prev->vv)/lineheight)-1; -+ foo = ((currentline->vv - currentline->prev->vv)/VERTICALEPSILON)-1; - if (foo > 3) -- foo = 3; /* linespacings not too large */ -+ foo = 3; /* linespacings not too large */ - for (i = 1; i <= (int) foo; i++) - putc('\n', output); - } -@@ -610,7 +587,7 @@ - for (i = firstcolumn, j = 1; i <= currentline->charactercount; - i++, j++) { - ch = currentline->text[i - leftmargin]; -- if (ch >= SPACE || allchar) -+ if (ch >= SPACE) - putc(ch, output); - if ((j > (int) foo) && (currentline->charactercount > i+1)) { - fprintf(output, "*\n"); /* if line to large */ -@@ -681,7 +658,7 @@ - savev = v; - if ((ruleht / rulewt) > 0) /* value < 1 truncates to 0 */ - ch = '|'; -- else if (ruleht > (lineheight / 2)) -+ else if (ruleht > (VERTICALEPSILON / 2)) - ch = '='; - else - ch = '_'; -@@ -716,11 +693,11 @@ - outchar(ch); - wt -= (h-rmh); /* decrease the width left on line */ - } -- ruleht -= lineheight; /* decrease the height */ -- if (ruleht > lineheight) { /* still more vertical? */ -+ ruleht -= VERTICALEPSILON; /* decrease the height */ -+ if (ruleht > VERTICALEPSILON) { /* still more vertical? */ - rmh = h; /* save current h (right margin) */ - h = lmh; /* restore left margin */ -- v -= (lineheight + lineheight / 10); -+ v -= (VERTICALEPSILON + VERTICALEPSILON / 10); - ruleaux(rulewt, ruleht, ch); - h = rmh; /* restore right margin */ - } -@@ -813,7 +790,7 @@ - register long topd, botd; - - if (v <= firstline->vv) { /* above first line */ -- if (firstline->vv - v > lineheight) { -+ if (firstline->vv - v > VERTICALEPSILON) { - temp = texlive_getline(); - temp->next = firstline; - firstline->prev = temp; -@@ -824,7 +801,7 @@ - } - - if (v >= lastline->vv) { /* below last line */ -- if (v - lastline->vv > lineheight) { -+ if (v - lastline->vv > VERTICALEPSILON) { - temp = texlive_getline(); - temp->prev = lastline; - lastline->next = temp; -@@ -841,7 +818,7 @@ - /* temp->vv < v < temp->next->vv --- temp is above, temp->next is below */ - topd = v - temp->vv; - botd = temp->next->vv - v; -- if ((topd < lineheight) || (botd < lineheight)) { -+ if ((topd < VERTICALEPSILON) || (botd < VERTICALEPSILON)) { - if (topd < botd) /* take best fit */ - return temp; - else -@@ -886,7 +863,7 @@ - long snum(int size) - { - register int i; -- register long x; -+ register long x = 0; - - x = getc(DVIfile); - if (x & 0x80) -@@ -906,10 +883,8 @@ - - void dochar(char ch) - { -- -- if (japan && jfontnum) -- jischar((long) ch); -- else if (symbolfont == TRUE) -+ -+ if (symbolfont == TRUE) - symchar(ch); - else - normchar(ch); -@@ -936,8 +911,6 @@ - case 14: ch = 'O'; break; - case 15: ch = 'o'; break; - case 24: ch = '~'; break; -- case 32: ch = japan ? '<' : 32; break; /* really only for japan? */ -- case 33: ch = japan ? '>' : 33; break; /* really only for japan? */ - case 102: ch = '{'; break; - case 103: ch = '}'; break; - case 104: ch = '<'; break; -@@ -962,104 +935,58 @@ - { - - switch (ch) { -- case 11 : if (ttfont) -- ch = '^'; /* up symbol */ -- else if (!allchar) { -- outchar('f'); ch = 'f'; /* ligature */ -- } -- break; -- case 12 : if (ttfont) -- ch = 'v'; /* low symbol */ -- else if (!allchar) { -- outchar('f'); ch = 'i'; /* ligature */ -- } -+ case 11 : outchar('f'); ch = 'f'; break; /* ligature */ -+ case 12 : outchar('f'); ch = 'i'; break; /* ligature */ -+ case 13 : outchar('f'); ch = 'l'; break; /* ligature */ -+ case 14 : outchar('f'); outchar('f'); -+ ch = 'i'; break; /* ligature */ -+ case 15 : outchar('f'); outchar('f'); -+ ch = 'l'; break; /* ligature */ -+ case 16 : ch = 'i'; break; -+ case 17 : ch = 'j'; break; -+ case 25 : if (scascii) /* German sz ligature */ -+ ch = 0xdf; -+ else -+ {outchar('s'); ch = 's';} - break; -- case 13 : if (ttfont) -- ch = '`'; -- else if (!allchar) { -- outchar('f'); ch = 'l'; /* ligature */ -- } -- break; -- case 14 : if (ttfont) -- ch = 'i'; /* spanish ! */ -- else if (!allchar) { -- outchar('f'); outchar('f'); -- ch = 'i'; /* ligature */ -- } -+ case 26 : if (scascii) /* Dane/Norw ae */ -+ ch = 0xe6; -+ else -+ {outchar('a'); ch = 'e';} - break; -- case 15 : if (ttfont) -- ch = '.'; /* spanish ? */ -- else if (!allchar) { -- outchar('f'); outchar('f'); -- ch = 'l'; /* ligature */ -- } -+ case 27 : outchar('o'); ch = 'e'; break; /* Dane/Norw oe */ -+ case 28 : if (scascii) /* Dane/Norw /o */ -+ ch = 0xf8; -+ else -+ ch = 'o'; - break; -- case 16 : if (!allchar) ch = 'i'; break; -- case 17 : if (!allchar) ch = 'j'; break; -- case 25 : if (!allchar) { -- outchar('s'); -- ch = 's'; -- } -- break; /* German double s */ -- case 26 : if (!allchar) { -- outchar('a'); -- ch = 'e'; -- } -- break; /* Dane/Norw ae */ -- case 27 : if (!allchar) { -- outchar('o'); -- ch = 'e'; -- } -- break; /* Dane/Norw oe */ -- case 28 : if (!allchar) { -- if (scascii) -- ch = '|'; /* Dane/Norw /o */ -- else -- ch = 'o'; -- } -+ case 29 : if (scascii) /* Dane/Norw AE */ -+ ch = 0xc6; -+ else -+ {outchar('A'); ch = 'E';} - break; -- case 29 : if (!allchar) { -- outchar('A'); -- ch = 'E'; -- } -- break; /* Dane/Norw AE */ -- case 30 : if (!allchar) { -- outchar('O'); -- ch = 'E'; -- } -- break; /* Dane/Norw OE */ -- case 31 : if (!allchar) { -- if (scascii) -- ch = '\\'; /* Dane/Norw /O */ -- else -- ch = 'O'; -- } -+ case 30 : outchar('O'); ch = 'E'; break; /* Dane/Norw OE */ -+ case 31 : if (scascii) -+ ch = 0xd8; /* Dane/Norw /O */ -+ else -+ ch = 'O'; - break; -- case 32 : ch = allchar || ttfont ? ch : '_'; break; -- /* underlined blank */ -- case 58 : ch = allchar || !mifont ? ch : '.'; break; /* if japan */ -- case 59 : ch = allchar || !mifont ? ch : ','; break; /* if japan */ -- case 92 : ch = allchar || ttfont ? ch : '"'; break; /* \ from `` */ -- case 123 : ch = allchar || ttfont ? ch : '-'; break; /* { from -- */ -- case 124 : ch = allchar || ttfont ? ch : '_'; break; /* | from --- */ -- case 125 : ch = allchar || ttfont ? ch : '"'; break; /* } from \H */ -- case 126 : ch = allchar || ttfont ? ch : '"'; break; /* ~ from \~ */ -- case 127 : if (!allchar) ch = '"'; break; /* DEL from \" */ -- -- /* -- * Or should I use SPACE for non-accents ??? -- * This seems to work ... -- */ -- case 18 : ch = !allchar && accent ? '`' : ch; break; /* from \` */ -- case 19 : ch = !allchar && accent ? 0x27 : ch; break; /* from \' */ -- case 20 : ch = !allchar && accent ? '~' : ch; break; /* from \v */ -- case 21 : ch = !allchar && accent ? '~' : ch; break; /* from \u */ -- case 22 : ch = !allchar && accent ? '~' : ch; break; /* from \= */ -- case 24 : ch = !allchar && accent ? ',' : ch; break; /* from \c */ -- case 94 : ch = (!allchar && accent && !ttfont) ? '^' : ch; break; -- /* ^ from \^ */ -- case 95 : ch = (!allchar && accent && !ttfont) ? '`' : ch; break; -- /* _ from \. */ -+ case 92 : ch = '"'; break; /* \ from `` */ -+ case 123 : ch = '-'; break; /* { from -- */ -+ case 124 : ch = '_'; break; /* | from --- */ -+ case 125 : ch = '"'; break; /* } from \H */ -+ case 126 : ch = '"'; break; /* ~ from \~ */ -+ case 127 : ch = '"'; break; /* DEL from \" */ -+#if 0 -+ case 18 : ch = '`'; break /* from \` */ -+ case 19 : ch = ''''; break /* from \' */ -+ case 20 : ch = '~'; break /* from \v */ -+ case 21 : ch = '~'; break /* from \u */ -+ case 22 : ch = '~'; break /* from \= */ -+ case 24 : ch = ','; break /* from \c */ -+ case 94 : ch = '^'; break /* ^ from \^ */ -+ case 95 : ch = '`'; break /* _ from \. */ -+#endif - } - outchar(ch); - -@@ -1080,12 +1007,10 @@ - { - register int i, j; - --/* fprintf(stderr, "hor: %ld, ver: %ld\n", h, v); */ -- --#if defined(MSDOS) || defined(THINK_C) -- if (labs(v - currentline->vv) > lineheight / 2L) -+#if defined(MSDOS) -+ if (labs(v - currentline->vv) > VERTICALEPSILON / 2L) - #else -- if (abs(v - currentline->vv) > lineheight / 2L) -+ if (abs(v - currentline->vv) > VERTICALEPSILON / 2L) - #endif - currentline = findline(); - -@@ -1119,15 +1044,14 @@ - for (i = IMAX(leftmargin, j-2); - i <= IMIN(rightmargin, j+2); - i++) -- if ((currentline->text[i - leftmargin] == 127) || /* DEL */ -- (currentline->text[i - leftmargin] == 34) || /* " */ -+ if ((currentline->text[i - leftmargin] == 127) || -+ (currentline->text[i - leftmargin] == 34) || - (currentline->text[i - leftmargin] == 23)) - foo = i; - if (foo >= leftmargin) { - j = (int) foo; - switch (currentline->text[j - leftmargin]) { -- case 127 : -- case 34 : /* DEL or " */ -+ case 127 : case 34: - if (ch == 'a') - ch = 0xe4; - else if (ch == 'A') /* dots ... */ -@@ -1151,16 +1075,15 @@ - } - } - /*----------------- end of 'Scandinavian code' ----------------*/ -- - if (foo == leftmargin-1) - while ((currentline->text[j - leftmargin] != SPACE) - && (j < rightmargin)) { - j++; - h += charwidth; - } -- if ( allchar || ((ch >= SPACE) && (ch != DEL)) || -+ if ( ((ch >= SPACE) && (ch != DEL)) || - (scascii && (ch == 23)) ) { -- /* (scascii && (ch == DEL)) ) if VMS ??? */ -+ /* (scascii && (ch == DEL)) ) { if VMS ??? */ - if (j < rightmargin) - currentline->text[j - leftmargin] = ch; - else -@@ -1187,9 +1110,7 @@ - register long saveh; - - saveh = h; -- if (japan) -- dochar((char) charnr); -- else if (allchar || ((charnr >= 0) && (charnr <= LASTCHAR))) -+ if ((charnr >= 0) && (charnr <= LASTCHAR)) - outchar((char) charnr); - else - setchar(charnr); -@@ -1210,7 +1131,7 @@ - void setchar(long charnr) - { - -- outchar(allchar ? (unsigned char)charnr : '#'); -+ outchar((unsigned char)(charnr)); - - return; - -@@ -1280,147 +1201,29 @@ - { - font * fnt; - char * s; -- char * d; - - fnt = fonts; - while (fnt != NULL && fnt->num != fntnum) - fnt = fnt->next; -- symbolfont = FALSE; -- ttfont = FALSE; -- mifont = FALSE; -- jfontnum = 0; - if (fnt == NULL) { - /* error : font not found */ -+ symbolfont = FALSE; - return; - } - - s = fnt->name; -- d = delim; /* print delim and font name if -b was chosen */ -- if (printfont) { -- while (*d !=0) {putcharacter(*d); d++;} -- d = s; -- while (*d !=0) {putcharacter(*d); d++;} -- /* d = strrev(delim); */ -- while (*d !=0) {putcharacter(*d); d++;} -- } -- -- if (japan) -- jfontnum = getjsubfont(s); -- if (jfontnum == 0) { -- while ((s = strchr(s, 's')) != NULL) { -- if (strncmp("sy", s, 2) == 0) { -- symbolfont = TRUE; -- break; -- } -- s++; /* New line to fix bug; font names with 's' would hang */ -- } -- -- s = fnt->name; -- while ((s = strchr(s, 't')) != NULL) { -- if (strncmp("tt", s, 2) == 0) { -- ttfont = TRUE; -- break; -- } -- s++; /* New line to fix bug; font names with 's' would hang */ -- } -- -- s = fnt->name; -- while ((s = strchr(s, 'm')) != NULL) { -- if (strncmp("mi", s, 2) == 0) { -- mifont = TRUE; -- break; -- } -- s++; /* New line to fix bug; font names with 's' would hang */ -+ while ((s = strchr(s, 's')) != NULL) { -+ if (strncmp("sy", s, 2) == 0) { -+ symbolfont = TRUE; -+ return; - } -+ s++; /* New line to fix bug; font names with 's' would hang */ - } - -- -+ symbolfont = FALSE; - return; - - } /* setfont */ -- -- -- --void jischar(long charnr) --{ -- int Ku, Ten; -- -- compute_jis(jfontnum, (int) charnr, &Ku, &Ten); -- outchar(Ku+128); -- outchar(Ten+128); -- -- return; -- --} /* jischar */ -- --#define kushift(c) c+0x20 --#define tenshift(c) c+0x20 -- --void compute_jis(int f, int c, int *ku, int *ten) --{ -- int n; -- -- if (f <= 7) { -- if (f == 1) { -- if (c >= 100) { -- *ku = kushift(2); -- *ten = tenshift(c-100); -- } -- else { -- *ku = kushift(1); -- *ten = tenshift(c); -- } -- } -- else if (f == 2) { -- *ku = kushift(3); -- *ten = tenshift(c-32); -- } -- else { -- *ku = kushift(f+1); -- *ten = tenshift(c); -- } -- } -- else if (f <= 19) { /* Daiichi Suijun */ -- n = (f-8)*256+c; -- *ku = kushift((n/94)+16); -- *ten = tenshift((n%94)+1); -- } -- else { /* Daini Suijun */ -- n = (f-20)*256+c; -- *ku = kushift((n/94)+48); -- *ten = tenshift((n%94)+1); -- } -- -- return; -- --} /* compute_jis */ -- -- --#define NJSUBS 33 --char *jsf_names[]={ -- "jsy", "jroma", "jhira", "jkata", "jgreek", "jrussian", "jkeisen", -- "jka", "jkb", "jkc", "jkd", "jke", "jkf", "jkg", "jkh", "jki", "jkj", -- "jkk", "jkl", "jkm", "jkn", "jko", "jkp", "jkq", "jkr", "jks", "jkt", -- "jku", "jkv", "jkw", "jkx", "jky", "jkz" --}; -- -- --int getjsubfont(char *s) --{ -- int jf; -- -- if (s[0] == 'd' && (s[1] == 'm' || s[1] == 'g')) { -- for (jf = 0; jf < NJSUBS; jf++) { -- if (strncmp(&s[2], jsf_names[jf], strlen(jsf_names[jf])) == 0) -- return jf+1; -- } -- return 0; -- } -- else -- return 0; -- --} /* getjsubfont */ -- - - - -@@ -1429,10 +1232,7 @@ - */ - - #if defined(VMS) --long vmsseek(fp,n,dir) --FILE *fp; --long n; --long dir; -+long vmsseek(FILE *fp, long n, long dir) - { - long k,m,pos,val,oldpos; - struct stat buffer; -@@ -1484,8 +1284,7 @@ - - - --long vms_ftell(fp) --FILE *fp; -+long vms_ftell(FILE *fp) - { - char c; - long pos; -@@ -1507,9 +1306,7 @@ - - - --long vms_ungetc(c,fp) --char c; --FILE *fp; -+long vms_ungetc(char c, FILE *fp) - { - - if ((c == EOF) && feof(fp)) diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-91-undo-rest b/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-91-undo-rest deleted file mode 100644 index e79c8251ec2..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-91-undo-rest +++ /dev/null @@ -1,1630 +0,0 @@ -diff -ur dvi2tty-5.3.1.orig/commands.h dvi2tty-5.3.1/commands.h ---- dvi2tty-5.3.1.orig/commands.h 2010-10-20 11:34:16.000000000 +0200 -+++ dvi2tty-5.3.1/commands.h 2010-10-15 11:34:23.000000000 +0200 -@@ -1,23 +1,3 @@ --/* -- * dvi2tty -- * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> -- * -- * 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. -- * -- */ -- - /* DVI COMMANDS */ - #define SETC_000 0 /* typeset character 0 and move right */ - #define SETC_127 127 /* typeset character 127 and move right */ -diff -ur dvi2tty-5.3.1.orig/disdvi.c dvi2tty-5.3.1/disdvi.c ---- dvi2tty-5.3.1.orig/disdvi.c 2010-10-24 14:03:20.000000000 +0200 -+++ dvi2tty-5.3.1/disdvi.c 2010-10-15 11:36:32.000000000 +0200 -@@ -3,73 +3,34 @@ - /* disdvi --- disassembles TeX dvi files. */ - /* */ - /* */ --/* 2.25 23jan2003 M.J.E. Mol fixed bug in copying font name (name[i]) */ --/* 2.24 27may96 M.J.E. Mol A few typecasts added */ --/* 2.23 23jul95 M.J.E. Mol Cleanups from duz@roxi.ez.fht-mannheim.de */ --/* 2.22 13dec90 M.J.E. Mol Fixed bug in num(). Cleaned up code. */ --/* 2.21 03may90 M.J.E. Mol Created usage(). */ --/* 2.2 02may90 M.J.E. Mol Included port to VAX/VMS VAXC by */ --/* Robert Schneider. */ --/* 2.1 19jan90 M.J.E. Mol Maintain a list of fonts and */ -+/* 2.0 23/01/89 M.J.E. Mol (c) 1989 marcel@duteca.tudelft.nl */ -+/* 2.1 19/01/90 M.J.E. Mol Maintain a list of fonts and */ - /* show fontnames in font changes. */ - /* Show character code when printing ligatures */ --/* 2.0 23jan89 M.J.E. Mol (c) 1989 */ --/* marcel@mesa.nl */ -+/* */ - /* */ - /*****************************************************************************/ - --/* -- * dvi2tty -- * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> -- * -- * 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. -- * -- */ -- --char *disdvi = "@(#) disdvi.c 2.25 23jan2003 M.J.E. Mol (c) 1989-1996, marcel@mesa.nl"; -- --/* -- * Include files -- */ - --#include <stdio.h> --#include <stdlib.h> --#if defined(MSDOS) --# include <fcntl.h> --#else --# if !defined(THINK_C) /* Macintosh */ --# include <unistd.h> --# endif -+#if 0 -+char *disdvi = "@(#) disdvi.c 2.1 19/01/90 M.J.E. Mol (c) 1989, 1990"; - #endif -+ -+#include <stdio.h> - #include <ctype.h> --#include <string.h> - #include "commands.h" --#if defined(THINK_C) --# include "macintosh.h" --#endif - - #if defined(KPATHSEA) - #define NO_DEBUG 1 - #include <kpathsea/config.h> - #include <kpathsea/lib.h> -+#else -+#if defined(MSDOS) -+#include <stdlib.h> -+#include <string.h> -+#include <fcntl.h> -+#endif - #endif -- -- --/* -- * Constant definitions -- */ - - #define LASTCHAR 127 /* max dvi character, above are commands */ - -@@ -82,100 +43,80 @@ - #define sget3() snum(3) - #define sget4() snum(4) - -- -- --/* -- * Type definitions -- */ -- - typedef struct _font { - long num; - struct _font * next; - char * name; - } font; - -- -- --/* -- * Variable declarations -- */ -- - font * fonts = NULL; - FILE * dvifp; - char * dvi_name; - long pc = 0; - --char * progname; -- - int is_ptex = 0; - int is_xetex = 0; - const char * dvi_ext = ".dvi"; - --/* -- * Function declarations -- */ -- --#if !defined(THINK_C) -+#ifdef KPATHSEA -+extern void bop(void); -+extern void postamble(void); -+extern void preamble(void); -+extern void postpostamble(void); -+extern void special(int x); -+extern void fontdef(int x); -+extern const char *fontname(long fntnum); -+extern void printnonprint(int ch); -+extern unsigned long num(int size); -+extern long snum(int size); -+extern void picfile(int opcode); -+extern void natfontdef(int opcode); -+extern void glyphs(int opcode); -+extern void dvidir(int opcode); -+extern void invalid(int opcode); -+#else - char * malloc (); --#endif - --#if defined(VMS) -- main (int argc, char ** argv); -+int main (); -+void bop (); -+void preamble (); -+void postamble (); -+void postpostamble (); -+void fontdef (); -+char * fontname (); -+void special (); -+void printnonprint (); -+unsigned long num (); -+long snum (); -+void picfile (); -+void natfontdef (); -+void glyphs (); -+void dvidir (); -+void invalid (); - #endif --void bop (void); --void preamble (void); --void postamble (void); --void postpostamble (void); --void fontdef (int x); --const char * fontname (unsigned long fntnum); --void special (int x); --void printnonprint (int ch); --unsigned long num (int size); --long snum (int size); --void usage (void); --void picfile (int opcode); --void natfontdef (int opcode); --void glyphs (int opcode); --void dvidir (int opcode); --void invalid (int opcode); -- - - - --/* -- * MAIN -- -- */ -+/*---------------------------------------------------------------------------*/ - --#if defined(VMS) -- main(int argc, char **argv) --#else - int main(int argc, char **argv) --#endif - { - register int opcode; /* dvi opcode */ - register int i; - int fontnum; -+ char * progname; - --#if defined(THINK_C) -- argc = process_disdvi_command_line(&argv); --#endif -- -+ progname = *argv; - -- progname = *argv++; -- -- if ((argc > 1) && (*argv[0] == '-')) { -- if (!strcmp(*argv, "-h")) { -- usage(); -- exit(0); -- } -- if (!strcmp(*argv, "-p")) -+ if ((argc > 1) && (argv[1][0] == '-')) { -+ if (!strcmp(argv[1], "-p") || !strcmp(argv[1], "--ptex")) { - is_ptex = 1; -- else if (!strcmp(*argv, "-x")) { -+ } else if (!strcmp(argv[1], "-x") || !strcmp(argv[1], "--xetex")) { - is_xetex = 1; - dvi_ext = ".xdv"; - } else { -- fprintf(stderr, "Invalid option `%s'\n", *argv); -- usage(); -+ fprintf(stderr, "Invalid option `%s'\n", argv[1]); -+ fprintf(stderr, "Usage: %s [-p|--ptex|-x|--xetex] [dvi-file]\n", progname); - exit(3); - } - argv++; -@@ -184,21 +125,21 @@ - - if (argc > 2) { - fprintf(stderr, "To many arguments\n"); -- usage(); -+ fprintf(stderr, "Usage: %s [-p|--ptex|-x|--xetex] [dvi-file]\n", progname); - exit(1); - } - - if (argc == 2) { -- if ((i = strlen(*argv)) == 0) { -+ if ((i = strlen(argv[1])) == 0) { - fprintf(stderr, "Illegal empty filename\n"); -- usage(); -+ fprintf(stderr, "Usage: %s [-p|--ptex|-x|--xetex] [dvi-file]\n", progname); - exit(2); - } -- if ((i >= 5) && (!strcmp(*argv+i-4, dvi_ext))) -- dvi_name = *argv; -+ if ((i >= 5) && !strcmp(argv[1]+(i-4), dvi_ext)) -+ dvi_name = argv[1]; - else { - dvi_name = malloc((i+5) * sizeof(char)); -- strcpy(dvi_name, *argv); -+ strcpy(dvi_name, argv[1]); - strcat(dvi_name, dvi_ext); - } - if ((dvifp = fopen(dvi_name, "r")) == NULL) { -@@ -325,22 +266,19 @@ - } - } - -- exit(0); -- -+ return 0; - } /* main */ - - -+/*----------------------------------------------------------------------------*/ - --/* -- * BOP -- Process beginning of page. -- */ - - void bop(void) - { - int i; - - printf("BOP page number : %ld", sget4()); -- for (i=9; i > 0; i--) { -+ for (i=0; i < 9; i++) { - if (i % 3 == 0) - printf("\n%06ld: ", pc); - printf(" %6ld", sget4()); -@@ -348,15 +286,10 @@ - printf("\n%06ld: ", pc); - printf(" prev page offset : %06ld\n", sget4()); - -- return; -- - } /* bop */ - - -- --/* -- * POSTAMBLE -- Process post amble. -- */ -+/*---------------------------------------------------------------------------*/ - - void postamble(void) - { -@@ -377,16 +310,8 @@ - printf("%06ld: ", pc); - printf(" number of pages : %d\n", (int) get2()); - -- return; -- - } /* postamble */ - -- -- --/* -- * PREAMBLE -- Process pre amble. -- */ -- - void preamble(void) - { - register int i; -@@ -405,16 +330,9 @@ - putchar((int) get1()); - putchar('\n'); - -- return; -- - } /* preamble */ - - -- --/* -- * POSTPOSTAMBLE -- Process post post amble. -- */ -- - void postpostamble(void) - { - register int i; -@@ -432,38 +350,27 @@ - i = (int) get1(); - } - -- return; -- - } /* postpostamble */ - - - --/* -- * SPECIAL -- Process special opcode. -- */ -- --void special(int x) -+void special(register int x) - { - register long len; -+ register long i; - - len = num(x); - printf("XXX%d: %ld bytes\n", x, len); - printf("%06ld: ", pc); -- for (; len>0; len--) /* a bit dangerous ... */ -+ for (i = 0; i < len; i++) /* a bit dangerous ... */ - putchar((int) get1()); /* can be non-printables */ - putchar('\n'); - -- return; -- - } /* special */ - - - --/* -- * FONTDEF -- Process a font definition. -- */ -- --void fontdef(int x) -+void fontdef(register int x) - { - register int i; - char * name; -@@ -503,7 +410,7 @@ - - for (i = 0; i < namelen; i++) - name[i] = get1(); -- name[i] = '\0'; -+ name[namelen] = '\0'; - fnt->name = name; - if (new) { - fnt->next = fonts; -@@ -512,17 +419,12 @@ - - printf("%s\n", name); - -- return; -- - } /* fontdef */ - - - --/* -- * FONTNAME -- Return font name. -- */ -- --const char * fontname(long fntnum) -+const char * -+fontname(long fntnum) - { - font * fnt; - -@@ -531,18 +433,14 @@ - fnt = fnt->next; - if (fnt != NULL) - return fnt->name; -- -- return "unknown fontname"; -+ else -+ return "unknown fontname"; - - } /* fontname */ - - - --/* -- * PRINTNONPRINT -- Translate non-printable characters. -- */ -- --void printnonprint(int ch) -+void printnonprint(register int ch) - { - - printf("Char: "); -@@ -590,71 +488,41 @@ - } - putchar('\n'); - -- return; -- --} /* printnonprint */ -+} - - - --/* -- * NUM -- -- */ -- --unsigned long num(int size) -+unsigned long num(register int size) - { - register int i; -- register unsigned long x = 0; -+ register long x = 0; - - pc += size; -- for (i = size; i > 0; i--) -+ for (i = 0; i < size; i++) - x = (x << 8) + (unsigned) getc(dvifp); -- - return x; - - } /* num */ - - - --/* -- * SNUM -- -- */ -- --long snum(int size) -+long snum(register int size) - { - register int i; -- register long x; -+ register long x = 0; - - pc += size; - x = getc(dvifp); - if (x & 0x80) - x -= 0x100; -- for (i = size - 1; i > 0; i--) -+ for (i = 1; i < size; i++) - x = (x << 8) + (unsigned) getc(dvifp); -- - return x; - - } /* snum */ - - - --/* -- * USAGE -- -- */ -- --void usage(void) --{ -- -- fprintf(stderr, "\n%s\n\n", disdvi); -- fprintf(stderr, " disassembles (p)TeX dvi and XeTeX xdv files\n"); -- fprintf(stderr, "Usage: %s [-h | [-p] [dvi_file[.dvi]]\n", progname); -- fprintf(stderr, " | -x [xdv_file[.xdv]]]\n"); -- -- return; -- --} /* usage */ -- -- -- - void picfile(int opcode) - { - int i; -diff -ur dvi2tty-5.3.1.orig/dvi2tty.1 dvi2tty-5.3.1/dvi2tty.1 ---- dvi2tty-5.3.1.orig/dvi2tty.1 2010-10-20 14:21:13.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.1 2006-01-17 22:41:51.000000000 +0100 -@@ -1,38 +1,36 @@ --.TH DVI2TTY 1 "20 October 2010" "TeX Live" -+.TH DVI2TTY Local "7 June 1986" - .SH NAME --dvi2tty \- preview a TeX DVI\-file on an ordinary ascii terminal -+dvi2tty \- preview a dvi\-file on an ordinary ascii terminal - .SH SYNOPSIS - .B dvi2tty - [ options ] dvi\-file - .SH DESCRIPTION - .I dvi2tty --converts a TeX DVI\-file to a format that is appropriate for terminals --and line printers. The program is intended to be used for -+converts a TeX DVI\-file to a format that is apprporiate for terminals -+and lineprinters. The program is intended to be used for - preliminary proofreading of TeX-ed documents. - By default the output is directed to the terminal, - possibly through a pager (depending on how the program was installed), - but it can be directed to a file or a pipe. - .PP - The output leaves much to be desired, but is still --useful if you want to avoid walking to the --laser printer (or whatever) for each iteration of your -+usefull if you want to avoid walking to the -+laserprinter (or whatever) for each iteration of your - document. - .br - Since - .I dvi2tty --produces output for terminals and line printers the -+produces output for terminals and lineprinters the - representation of documents is naturally quite primitive. --In principle Font Changes are totally ignored, but --.I dvi2tty --recognizes --a few mathematical and special symbols that can be be displayed on an --ordinary ascii terminal, such as the '+' and '-' symbol. -+Fontchanges are totally ignored, which implies that -+special symbols, such as mathematical symbols, get mapped into the -+characters at the corresponding positions in the "standard" fonts. - .PP - If the width of the output text requires more columns than fits - in one line (c.f. the \-w option) it is broken into several lines by - .I dvi2tty - although they will be printed as one line on regular TeX output --devices (e.g. laser printers). To show that a broken line is really -+devices (e.g. laserprinters). To show that a broken line is really - just one logical line an asterisk (``*'') in the last position - means that the logical line is continued on the next physical - line output by -@@ -41,7 +39,7 @@ - in the first two columns. - .PP - Options may be specified in the environment variable DVI2TTY. --Any option on the command line, conflicting with one in the -+Any option on the commandline, conflicting with one in the - environment, will override the one from the environment. - .PP - .B Options: -@@ -56,7 +54,7 @@ - An example of format for list is ``1,3:6,8'' - to choose pages 1, 3 through 6 and 8. - Negative numbers can be used exactly as in TeX, --e g \-1 comes before \-4 as in ``\-p\-1:\-4,17''. -+e g \-1 comes before \-4 as in ``\-p-1:-4,17''. - .TP - .B \-P list - Like \-p except that page numbers refer to -@@ -73,59 +71,35 @@ - terminal into this mode as output will - probably look somewhat better. - .TP --.B \-v --Specify height of lines. Default value 450000. Allows to adjust linespacing. --.TP - .B \-q - Don't pipe the output through a pager. - This may be the default on some systems --(depending on the whims of the person installing the program). --.TP --.B \-e n --This option can be used to influence the spacing between words. --With a negative value the number of spaces --between words becomes less, with a positive value it becomes more. --\-e\-11 seems to worked well. -+(depending on the whims of the SA installing the program). - .TP - .B \-f --Pipe through a pager, $PAGER if defined, or whatever the installer of --the program compiled -+Pipe through a pager, $PAGER if defined, or whatever your SA compiled - in (often ``more''). This may be the default, but it is still okay - to redirect output with ``>'', the pager will not be used if output - is not going to a terminal. - .TP - .B \-F - Specify the pager program to be used. --This overrides the $PAGER and the default pager. -+This overides the $PAGER and the default pager. - .TP - .B \-Fprog - Use ``prog'' as program to pipe output into. Can be used to choose an - alternate pager (e g ``-Fless''). - .TP --.B \-t --\\tt fonts were used (instead of cm) to produce dvi file. (screen.sty --is a powerfull mean to do that with LaTeX). --.TP --.B \-a --Dvi2tty normally tries to output accented characters. With the -a option, --accented characters are output without the accent sign. --.TP - .B \-l --Mark page breaks with the two-character sequence ``^L''. The default is --to mark them with a form-feed character. -+Mark pagebreaks with the two-character sequence ``^L''. The default is -+to mark them with a formfeed character. - .TP --.B \-c --Do not attempt to trnaslate any characters (like the Scandinavion mode) --except when running in tt-font. - .B \-u - Don't make any attempts to find special Scandinavian characters. - If such characters are in the text they will map to ``a'' and ``o''. --This is probably the default outside of Scandinavia. (The installer --makes this decision when the program is installed.) -+This is probably the default outside of Scandinavia. (The SA made -+the decision when the program was installed.) - .TP --.B \-bdelim --Print the name of fonts when switching to it (and ending it). The delim --argument is used to delimit the fontname. - .B \-s - Try to find the special Scandinavian characters that on most (?) - terminals in Scandinavia are mapped to ``{|}[\\]''. -@@ -139,7 +113,7 @@ - the pager to use. - .br - DVI2TTY \ \ \ \ \ \ \ \ \ \ \ --can be set to hold command-line options. -+can be set to hold commandline options. - .SH "SEE ALSO" - TeX, dvi2ps - .SH AUTHOR -@@ -147,10 +121,11 @@ - .br - Improved C version: Marcel Mol - .br --marcel@mesa.nl, MESA Consulting -+{seismo, mcvax}!enea!ttds!zap -+.br -+marcel@duteca.UUCP - .SH BUGS - Blanks between words get lost quite easy. This is less - likely if you are using a wider output than the default 80. - .PP --Only one file may be specified on the command line. -- -+Only one file may be specified on the commandline. -diff -ur dvi2tty-5.3.1.orig/dvi2tty.c dvi2tty-5.3.1/dvi2tty.c ---- dvi2tty-5.3.1.orig/dvi2tty.c 2010-10-24 14:28:11.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.c 2010-02-23 13:42:05.000000000 +0100 -@@ -1,60 +1,18 @@ - /****************************************************************************** -- * Marcel Mol: 22jan2003 (Internet: marcel@mesa.nl) -- * From: jose@monkey.org: clearly state license (GPL). -- * Marcel Mol: 27may1996 (Internet: marcel@mesa.nl) -- * From: mlemos@ua.pt (Manuel Lemos): Port to AMIGA. -- * Marcel Mol: 24mar1996 (Internet: marcel@mesa.nl) -- * From: Alex Viskovatoff <av@mixcom.com>: Port to Macintosh -- * From: Anton vd Repe 1995-6-9 (UUCP: arp@neabbs.uucp): -- * Added option to skip translation of Scandinavian/Finnish -- * and skip the constraint to ASCII characters only. -- * Added option to include font name in output when new font -- * is chosen. -- * Limit line width of 132 expanded to 332. -- * Marcel Mol: 23jun1995 (Internet: marcel@duteca.et.tudelft.nl) -- * Included patch form Hideki ISOZAKI (isozaki@ntt-20.ntt.jp) -- * to allow japanese fonts generated by NTT JTeX (March 1992). -- * Added cleanups (protoize + includes) by D.U. Zoller -- * (1995-07-17 duz@roxi.rz.fht-mannheim.de) -- * Version 5.1 -- * Marcel Mol: 09sep1993 (Internet: marcel@duteca.et.tudelft.nl) -- * In dvistuff.c: added auto detection for 'ttfont'. -- * This make -t flag unneeded, but it is still left in for -- * people who like to force 'verbatim' mode. -- * Thanks to: Diomidis Spinellis <dds@doc.imperial.ac.uk> -- * Marcel Mol: 05sep1993 (Internet: marcel@duteca.et.tudelft.nl) -- * In dvistuff.c: put some extra chars arround the 'ttfont' -- * flag in the 'normchar' function. -- * Marcel Mol: 01oct1991 (Internet: marcel@duteca.et.tudelft.nl) -- * (From Igor Romanenko, igor@d245.icyb.kiev.ua.) -- * Fixed unneccesary * in *envp++. -- * Marcel Mol: 24jul1991 (Internet: marcel@duteca.et.tudelft.nl) -- * Suggestion From: peter@julian.uwo.ca [uwo] -- * vertical bars "|" and the tilde "~" print properly in -- * typewriter font. -- * Marcel Mol: 1990-11-29 (UUCP: marcel@duteca.et.tudelft.nl) -- * Fixed bug in option handling. Cleanup of code. -- * Other minor changes/optimizations. -- * Marcel Mol: 1990-11-13 (UUCP: marcel@duteca.et.tudelft.nl) -- * Included patches of Bernard Gaulle in my version. -- * Version 4.4 -- * Bernard Gaulle: 1990-10-16 (gaulle@murnau.circe.fr) -- * Add -t option (assuming tt fonts were used) -- * (Version 3.3) -- * Marcel Mol: 1990-05-03 (UUCP: marcel@duteca.tudelft.nl) -- * Now displays accents etc. on characters again. Added option -- * (-a) to switch this off. If switched off it now uses proper -- * spacing. -- * Cleaned up and show version number in usage(); -- * Version 4.3 -- * Marcel Mol: 1990-05-02 (UUCP: marcel@duteca.tudelft.nl) -- * Included patches for VAX/VMS VAXC, done by Robert Schneider. -- * Version 4.2 -+ * dvitty - get an ascii representation of a dvi-file, suitable for ttys -+ -+This program was originally written in Pascal by -+Svante Lindahl <svante dot lindahl (at) pantor dot com> -+and then converted to C by Marcel Mol <marcel (at) mesa dot nl>. -+Some changes have been made for TeX Live (see ./ChangeLog). -+ -+It is released under the GNU GPL, version 2 or any later version. -+(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=424018) -+ - * Marcel Mol: 1990-03-27 (UUCP: marcel@duteca.tudelft.nl) - * Fixed bug that causes the program to hang when it finds a - * fontname with an 's' in it not followed by an 'y'. - * Thanks to Paul Orgren (orgren@Stars.Reston.Unisys.COM). -- * Version 4.1 - * Marcel Mol: 1990-02-04 (UUCP: marcel@duteca.tudelft.nl) - * First attempt to recognize symbol fonts, so bullets (in - * itemized lists) are translated to a proper character instead -@@ -84,9 +42,9 @@ - * Fixed a bugs concerning pager programs - * and scanning environment variable DVI2TTY. - * Marcel Mol: 1988-10-25 (UUCP: duteca!marcel) -- * Renamed to dvi2tty and converted to C. -- * Filenames: dvi2tty.c dvi2tty.h dvistuff.c commands.h -- * Improved spacing between words/characters. -+ * dvi2tty.c dvi2tty.h dvistuff.c commands.h -+ * Converted program to C. -+ * improved spacing between words/characters. - * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-08-15 20:24:31, - * Version to be sent to mod.sources ready. - * New option since last version: -@@ -94,6 +52,24 @@ - * pager than the default. - * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-01-13 21:49:31, - * Environment variable DVITTY is read and options can be set from it. -+ * These are the currently implemented options: -+ * -ofile Write output to file, else write to stdout, -+ * possibly piped through a pager if stdout is a tty. -+ * -plist Print pages whos TeX-page-number are in list. -+ * List is on the form 1,3:6,8 to choose pages -+ * 1,3-6 and 8. TeX-nrs can be negative: -p-1:-4,4 -+ * -Plist Print pages whos sequential number are in list. -+ * -wn Print the lines with width n characters, default is -+ * 80. Wider lines gives better results. -+ * -q Don't try to pipe to a pager. -+ * -f Try to pipe to a pager if output is a tty. -+ * -Fname Specify a pager program. -+ * Default of -q and -f is a compile time option, a constant. -+ * -l Write '^L' instead of formfeed between pages. -+ * -u Don't try to find Scandinavian characters (they will -+ * print as a:s and o:s if this option is choosen). -+ * -s Scandinavian characters printed as }{|][\. -+ * Default of -s and -u is a compile time option, a constant. - * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-01-10 18:51:03, - * Argument parsing, and random access functions (external, in C) - * and other OS-dependent stuff (in C). Removed private 'pager' & -@@ -117,58 +93,14 @@ - * VERA::<SVANTE-LINDAHL.DVITTY>DVITTY.PAS.45, 29-Sep-84 18:29:53, - * Edit: Svante Lindahl - * -- * dvitty - get an ascii representation of a dvi-file, suitable for ttys -- * -- * This program, and any documentation for it, is copyrighted by Svante -- * Lindahl. It may be copied for non-commercial use only, provided that -- * any and all copyright notices are preserved. -- * -- * -- * UUCP: {seismo,mcvax,cernvax,diku,ukc,unido}!enea!ttds!zap -- * ARPA: enea!ttds!zap@seismo.CSS.GOV -- * or Svante_Lindahl_NADA%QZCOM.MAILNET@MIT-MULTICS.ARPA -- * EAN: zap@cs.kth.sunet - */ - - --/* -- * dvi2tty -- * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> -- * -- * 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. -- * -- */ -- --/* -- * Include files -- */ -- - #include "dvi2tty.h" - #if defined(VMS) --# include unixio -+#include unixio - #endif --#if defined(THINK_C) --# include <unix.h> --# include "macintosh.h" --#endif -- - -- --/* -- * Constant definitons -- */ - /*-----------------------------------------------------------------------*/ - /* The following constants may be toggled before compilation to */ - /* customize the default behaviour of the program for your site. */ -diff -ur dvi2tty-5.3.1.orig/dvi2tty.h dvi2tty-5.3.1/dvi2tty.h ---- dvi2tty-5.3.1.orig/dvi2tty.h 2010-10-24 14:29:23.000000000 +0200 -+++ dvi2tty-5.3.1/dvi2tty.h 2010-02-23 13:41:58.000000000 +0100 -@@ -1,25 +1,5 @@ --/* -- * dvi2tty -- * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> -- * -- * 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. -- * -- */ -- --#define Copyright "dvi2tty Copyright (C) 1984, 1985, 1986 Svante Lindahl.\n\ --Copyright (C) 1989-1996 M.J.E. Mol" -+#define Copyright "dvi2tty.c Copyright (C) 1984, 1985, 1986 Svante Lindahl.\n\ -+Copyright (C) 1988 M.J.E. Mol 1989, 1990" - - #include <stdio.h> - #include <string.h> -diff -ur dvi2tty-5.3.1.orig/dvistuff.c dvi2tty-5.3.1/dvistuff.c ---- dvi2tty-5.3.1.orig/dvistuff.c 2010-10-24 15:01:30.000000000 +0200 -+++ dvi2tty-5.3.1/dvistuff.c 2009-09-01 14:14:47.000000000 +0200 -@@ -1,26 +1,3 @@ --/* -- * dvi2tty -- * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> -- * -- * 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. -- * -- */ -- --/* -- * Include files -- */ - - #include "dvi2tty.h" - #include <sys/types.h> -@@ -34,12 +11,6 @@ - #endif - #include "commands.h" - -- -- --/* -- * Constant definitions -- */ -- - #if defined(VMS) - #define mseek vmsseek - #define ROUND(a) (a>=0.0 ? (int) (a + 0.5) : (int) (a - 0.5) ) -@@ -78,16 +49,12 @@ - #define sget3() snum(3) - #define sget4() snum(4) - -- -- --/* -- * Structure and variable definitions -- */ -- - #if 0 --char *dvistuff = "@(#) dvistuff.c 5.12 27may1996 M.J.E. Mol (c) 1989-1996"; -+char *dvistuff = "@(#) dvistuff.c 4.1 27/03/90 M.J.E. Mol (c) 1989, 1990"; - #endif - -+/*---------------------------------------------------------------------------*/ -+ - typedef struct { - long hh; - long vv; -@@ -112,6 +79,7 @@ - } font; - - -+/*---------------------------------------------------------------------------*/ - - bool pageswitchon; /* true if user-set pages to print */ - bool sequenceon; /* false if pagesw-nrs refers to TeX-nrs */ -@@ -142,11 +110,7 @@ - font * fonts = NULL; /* List of fontnames defined */ - int symbolfont = FALSE; /* true if font is a symbol font */ - -- -- --/* -- * Function definitions -- */ -+/*---------------------------------------------------------------------------*/ - - #if defined(KPATHSEA) || defined(MSDOS) - void postamble (void); -@@ -205,51 +169,41 @@ - #endif - #endif - -- -+/*---------------------------------------------------------------------------*/ -+/*---------------------------------------------------------------------------*/ - - /* -- * DVIMAIN -- The main function for processing the dvi file. -- * Here we assume there are to file pointers: DVIfile and output. -- * Also we have a list of pages pointed to by 'currentpage', -- * which is only used (in 'inlist()') when a page list is given. -+ * The main function for processing the dvi file. -+ * Here we assume there are to file pointers: DVIfile and output. -+ * Also we have a list of pages pointed to by 'currentpage', -+ * which is only used (in 'inlist()') when a page list is given. - */ - - void dvimain(void) - { - - postamble(); /* seek and process the postamble */ -- preamble(); /* process preamble */ - /* note that walkpages *must* immediately follow preamble */ -+ preamble(); /* process preamble */ - walkpages(); /* time to do the actual work! */ - --- return; --- - } /* dvimain */ - -+/*---------------------------------------------------------------------------*/ - -- /* -- * POSTAMBLE -- Find and process postamble, use random access -- */ -- --void postamble(void) -+void postamble(void) /* find and process postamble, use random access */ - { - register long size; - register int count; --#if !defined (THINK_C) - struct stat st; --#endif - --#if defined (THINK_C) -- size = DVIfile->len; --#else - fstat (fileno(DVIfile), &st); - size = (long) st.st_size; /* get size of file */ --#endif -- - count = -1; - do { /* back file up past signature bytes (223), to id-byte */ -- if (size-- == 0) -+ if (size == 0) - errorexit(nopst); -+ size--; - mseek(DVIfile, size, absolute); - opcode = (int) get1(); - count++; -@@ -261,7 +215,7 @@ - if (opcode != VERSIONID) - errorexit(badid); - mseek(DVIfile, size-4, absolute); /* back up to back-pointer */ -- mseek(DVIfile, sget4(), absolute); /* and to start of postamble */ -+ mseek(DVIfile, sget4(), absolute); /* and to start of postamble */ - if (get1() != POST) - errorexit(nopst); - mseek(DVIfile, 20L, relative); /* lastpageoffset, numerator, denominator */ -@@ -275,17 +229,11 @@ - /* get2() -- totalpages */ - /* fontdefs do fontdefs in flight ... */ - -- return; -- - } /* postamble */ - -+/*---------------------------------------------------------------------------*/ - -- --/* -- * PREAMBLE --process preamble, use random access -- */ -- --void preamble(void) -+void preamble(void) /* process preamble, use random access */ - { - - mseek(DVIfile, 0L, absolute); /* read the dvifile from the start */ -@@ -297,17 +245,11 @@ - mseek(DVIfile, 12L, relative); /* numerator, denominator, magnification */ - mseek(DVIfile, get1(), relative); /* skip job identification */ - -- return; -- - } /* preamble */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * WALKPAGES -- process the pages in the DVI-file -- */ -- --void walkpages(void) -+void walkpages(void) /* process the pages in the DVI-file */ - { - register bool wantpage; - -@@ -339,15 +281,9 @@ - } - } - -- return; -- - } /* walkpages */ - -- -- --/* -- * INITPAGE -- Setup a new, empty page. -- */ -+/*---------------------------------------------------------------------------*/ - - void initpage(void) - { -@@ -361,7 +297,8 @@ - lastline = currentline; - firstcolumn = rightmargin; - if (pageswitchon) { -- if ((sequenceon ? pagecounter : pagenr) != firstpage->pag) { -+ if ((sequenceon && (pagecounter != firstpage->pag)) || -+ (!sequenceon && (pagenr != firstpage->pag))) { - if (noffd) - fprintf(output, "^L\n"); - else -@@ -369,23 +306,16 @@ - } - } - else -- if (backpointer != -1) { /* not FORM at first page */ -+ if (backpointer != -1) { /* not FORM at first page */ - if (noffd) - fprintf(output, "^L\n"); - else - putc(FORM, output); - } - -- return; -- - } /* initpage */ - -- -- --/* -- * DOPAGE -- Process the dvi file until an end-off-page. -- * Build up a page image. -- */ -+/*----------------------------------------------------------------------------*/ - - void dopage(void) - { -@@ -426,8 +356,9 @@ - stack[sptr].zz = z; - sptr++; - break; -- case POP : if (sptr-- == 0) /* pop */ -+ case POP : if (sptr == 0) /* pop */ - errorexit(stkuf); -+ sptr--; - h = stack[sptr].hh; - v = stack[sptr].vv; - w = stack[sptr].ww; -@@ -483,18 +414,11 @@ - } - } - -- return; -- - } /* dopage */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * SKIPPAGE -- Scan the dvi file until an end-off-page. -- * Skip this page. -- */ -- --void skippage(void) -+void skippage(void) /* skip past one page */ - { - register int opcode; - -@@ -556,17 +480,11 @@ - } - } - -- return; -- - } /* skippage */ - -+/*---------------------------------------------------------------------------*/ - -- --/* -- * PRINTPAGE -- 'end of page', writes lines of page to output file -- */ -- --void printpage(void) -+void printpage(void) /* 'end of page', writes lines of page to output file */ - { - register int i, j; - register unsigned char ch; -@@ -607,17 +525,11 @@ - free(currentline); /* free last line */ - currentline = nil; - -- return; -- - } /* printpage */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * INLIST -- return true if pagenr is in the list of pages to be printed. -- */ -- --bool inlist(long pagenr) -+bool inlist(register long pagenr) /* ret true if in list of pages */ - { - - while ((currentpage->pag < 0) && (currentpage->pag != pagenr) && -@@ -632,20 +544,14 @@ - if (currentpage->pag == pagenr) - return TRUE; - } -- - return FALSE; - - } /* inlist */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * RULE -- Output a rule (vertical or horizontal). -- * Increment h if moving is true. -- */ -- - void rule(bool moving, long rulewt, long ruleht) --{ -+{ /* output a rule (vertical or horizontal), increment h if moving is true */ - - register char ch; /* character to set rule with */ - register long saveh = 0, savev; -@@ -668,17 +574,11 @@ - if (!moving) - h = saveh; - -- return; -- - } /* rule */ - - - --/* -- * RULEAUX -- do the actual outtput for the rule recursively. -- */ -- --void ruleaux(long rulewt, long ruleht, char ch) -+void ruleaux(long rulewt, long ruleht, char ch) /* recursive that does the job */ - { - register long wt, lmh, rmh; - -@@ -702,21 +602,15 @@ - h = rmh; /* restore right margin */ - } - -- return; -- - } /* ruleaux */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * HORIZONTALMOVE -- Move the h pointer by amount. -- */ -- --long horizontalmove(long amount) -+long horizontalmove(register long amount) - { - --#if defined(MSDOS) || defined(THINK_C) -- if (labs(amount) > charwidth / 4L) { /* } to make vi happy */ -+#if defined(MSDOS) -+ if (labs(amount) > charwidth / 4L) { - #else - if (abs(amount) > charwidth / 4L) { - #endif -@@ -737,29 +631,20 @@ - - } /* horizontalmove */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * SKIPNOPS -- Return first non NOP opcode. -- */ -- --int skipnops(void) -+int skipnops(void) /* skips by no-op commands */ - { - register int opcode; - - while ((opcode = (int) num(1)) == NOP); -- - return opcode; - - } /* skipnops */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * GETLINE -- Returns an initialized line-object -- */ -- --linetype *texlive_getline(void) -+linetype *texlive_getline(void) /* returns an initialized line-object */ - { - register int i; - register linetype *temp; -@@ -772,20 +657,14 @@ - for (i = 0; i < LINELEN; i++) - temp->text[i] = ' '; - temp->text[i] = '\0'; -- - return temp; - - } /* texlive_getline */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * FINDLINE -- Find best fit line were text should go -- * and generate new line if needed. -- */ -- --linetype *findline(void) --{ -+linetype *findline(void) /* find best fit line were text should go */ -+{ /* and generate new line if needed */ - register linetype *temp; - register long topd, botd; - -@@ -832,35 +711,25 @@ - temp->next->prev = currentline; - temp->next = currentline; - currentline->vv = v; -- - return currentline; - - } /* findline */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * NUM -- -- */ -- --unsigned long num(int size) -+unsigned long num(register int size) - { - register int i; -- register unsigned long x = 0; -+ register long x = 0; - -- for (i = size; i > 0; i--) -+ for (i = 0; i < size; i++) - x = (x << 8) + (unsigned) getc(DVIfile); -- - return x; - - } /* num */ - - --/* -- * SNUM -- -- */ -- --long snum(int size) -+long snum(register int size) - { - register int i; - register long x = 0; -@@ -868,18 +737,13 @@ - x = getc(DVIfile); - if (x & 0x80) - x -= 0x100; -- for (i = size - 1; i > 0; i--) -+ for (i = 1; i < size; i++) - x = (x << 8) + (unsigned) getc(DVIfile); -- - return x; - - } /* snum */ - -- -- --/* -- * DOCHAR -- Process a character opcode. -- */ -+/*----------------------------------------------------------------------------*/ - - void dochar(char ch) - { -@@ -895,11 +759,7 @@ - - - --/* -- * SYMCHAR -- Process a character opcode for a symbol font. -- */ -- --void symchar(char ch) -+void symchar(char ch) /* output ch to appropriate line */ - { - - switch (ch) { /* can do a lot more on MSDOS machines ... */ -@@ -918,7 +778,6 @@ - case 106: ch = '|'; break; - case 110: ch = '\\'; break; - } -- - outchar(ch); - - return; -@@ -927,10 +786,6 @@ - - - --/* -- * NORMCHAR -- Process a character opcode for a normal font. -- */ -- - void normchar(char ch) - { - -@@ -992,18 +847,11 @@ - - return; - --} /* normchar */ -- -+} /*normchar */ - - --/* -- * OUTCHAR -- Here we put the character into the current page. -- * This function includes some code to handle Scandinavian -- * characters. I think that code doesn't belong here. IT -- * SHOULD BE MOVED OUT. -- */ - --void outchar(unsigned char ch) -+void outchar(unsigned char ch) /* output ch to appropriate line */ - { - register int i, j; - -@@ -1024,7 +872,6 @@ - else if (j < leftmargin) - j = leftmargin; - foo = leftmargin - 1; -- - /* - * This code does not really belong here ... - * -@@ -1095,17 +942,11 @@ - h += charwidth; - } - -- return; -- - } /* outchar */ - -+/*----------------------------------------------------------------------------*/ - -- --/* -- * PUTCHARACTER -- Output character, don't change h -- */ -- --void putcharacter(long charnr) -+void putcharacter(register long charnr) /* output character, don't change h */ - { - register long saveh; - -@@ -1116,34 +957,23 @@ - setchar(charnr); - h = saveh; - -- return; -- - } /* putcharacter */ - -- -- --/* -- * SETCHAR -- Should print characters with character code>127 from -- * current font. Note that the parameter is a dummy, since -- * ascii-chars are<=127. -- */ -+/*----------------------------------------------------------------------------*/ - - void setchar(long charnr) --{ -+{ /* should print characters with character code>127 from current font */ -+ /* note that the parameter is a dummy, since ascii-chars are<=127 */ - - outchar((unsigned char)(charnr)); - -- return; -- - } /* setchar */ - - -+/*----------------------------------------------------------------------------*/ - --/* -- * FONTDEF -- Process a font definition. -- */ - --void fontdef(int x) -+void fontdef(register int x) - { - register int i; - char * name; -@@ -1177,7 +1007,7 @@ - - for (i = 0; i < namelen; i++) - name[i] = get1(); -- name[i] = '\0'; /* required */ -+ name[namelen] = '\0'; - fnt->name = name; - if (new) { - fnt->next = fonts; -@@ -1190,13 +1020,6 @@ - - - --/* -- * SETFONT -- Switch to specific font. Try to find out if it is a symbol -- * font. -- * Option -c allchar does not pertain to this portion, so symbols -- * are still translated. -- */ -- - void setfont(long fntnum) - { - font * fnt; -@@ -1227,9 +1050,8 @@ - - - --/* -- * VMS CODE -- */ -+/*----------------------------------------------------------------------------*/ -+ - - #if defined(VMS) - long vmsseek(FILE *fp, long n, long dir) -@@ -1237,9 +1059,9 @@ - long k,m,pos,val,oldpos; - struct stat buffer; - -- for (;;) { /* loops only once or twice */ -+ for (;;) { /*loops only once or twice*/ - switch (dir) { -- case 0: /* from BOF */ -+ case 0: /*from BOF*/ - oldpos = vms_ftell(fp); - k = n & 511; - m = n >> 9; -@@ -1278,8 +1100,6 @@ - } - } - -- /* NOTREACHED */ -- - } /* vmsseek */ - - -@@ -1289,7 +1109,6 @@ - char c; - long pos; - long val; -- - if ((*fp)->_cnt == 0) { - c = fgetc(fp); - val = vms_ungetc(c, fp); -@@ -1299,7 +1118,6 @@ - pos = ftell(fp); - if (pos >= 0) - pos += ((*fp)->_ptr) - ((*fp)->_base); -- - return (pos); - - } /* vms_ftell */ -@@ -1308,18 +1126,16 @@ - - long vms_ungetc(char c, FILE *fp) - { -- - if ((c == EOF) && feof(fp)) - return (EOF); -- -- if ((*fp)->_cnt >= 512) -+ else if ((*fp)->_cnt >= 512) - return (EOF); -- -- (*fp)->_cnt++; -- (*fp)->_ptr--; -- *((*fp)->_ptr) = c; -- -- return (c); -+ else { -+ (*fp)->_cnt++; -+ (*fp)->_ptr--; -+ *((*fp)->_ptr) = c; -+ return (c); -+ } - - } /*vms_ungetc */ - #endif diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.dvi b/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.dvi Binary files differdeleted file mode 100644 index 13769d62f4f..00000000000 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.dvi +++ /dev/null diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/ChangeLog b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/ChangeLog index 8a45b16afa2..9f536416499 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/ChangeLog +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/ChangeLog @@ -1,3 +1,15 @@ +2010-11-06 Peter Breitenlohner <peb@mppmu.mpg.de> + + Import dvi2tty-5.3.3. + + * patch-{02,03,05,06,50,70}-* (removed): Now in distribution. + * patch-01-texk, patch-04-pager: Adapted. + * patch-60-warnings: Adapted (some parts now in distribution). + * patch-81-maybe-scand (removed): Obsoleted by dvi2tty-5.3.3. + * patch-{80,90,91}-* (removed): Obsolete. + + * patch-07-typo (new): Fix a typo. + 2010-10-23 Peter Breitenlohner <peb@mppmu.mpg.de> Import dvi2tty-5.3.1. diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/TL-Changes b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/TL-Changes new file mode 100644 index 00000000000..509190d5224 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/TL-Changes @@ -0,0 +1,3 @@ +Changes applied to the dvi2tty-5.3.3 tree as obtained from: + http://www.mesa.nl/pub/dvi2tty/dvi2tty-5.3.3.tgz. + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-01-texk b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-01-texk index 4639c2823e4..27e25353650 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1-PATCHES/patch-01-texk +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-01-texk @@ -1,6 +1,6 @@ -diff -ur dvi2tty-5.3.1.orig/README.ORG dvi2tty-5.3.1/README.ORG ---- dvi2tty-5.3.1.orig/README.ORG 1990-11-14 23:36:08.000000000 +0100 -+++ dvi2tty-5.3.1/README.ORG 2009-06-15 00:59:36.000000000 +0200 +diff -ur dvi2tty-5.3.3.orig/README.ORG dvi2tty-5.3.3/README.ORG +--- dvi2tty-5.3.3.orig/README.ORG 1990-11-14 23:36:08.000000000 +0100 ++++ dvi2tty-5.3.3/README.ORG 2009-06-15 00:59:36.000000000 +0200 @@ -16,11 +16,8 @@ omization constants" and change them to suit your site. These constants configure default pager and a little more. @@ -17,21 +17,21 @@ diff -ur dvi2tty-5.3.1.orig/README.ORG dvi2tty-5.3.1/README.ORG -The TOPS-20 version of the program can also be obtained from the above -address. + Royal Institute of Technology, Sweden -diff -ur dvi2tty-5.3.1.orig/disdvi.1 dvi2tty-5.3.1/disdvi.1 ---- dvi2tty-5.3.1.orig/disdvi.1 1996-03-23 17:07:21.000000000 +0100 -+++ dvi2tty-5.3.1/disdvi.1 2010-10-20 14:21:13.000000000 +0200 +diff -ur dvi2tty-5.3.3.orig/disdvi.1 dvi2tty-5.3.3/disdvi.1 +--- dvi2tty-5.3.3.orig/disdvi.1 2010-10-27 13:23:03.000000000 +0200 ++++ dvi2tty-5.3.3/disdvi.1 2010-11-06 18:25:49.437938509 +0100 @@ -1,4 +1,4 @@ --.TH DISDVI Local "4 April 1989" -+.TH DISDVI 1 "20 October 2010" "TeX Live" +-.TH DISDVI 1 "27 October 2010" ++.TH DISDVI 1 "27 October 2010" "TeX Live" .SH NAME - disdvi \- `disassemble' a TeX DVI file + disdvi \- `disassemble' a (p)TeX or XeTeX DVI file .SH SYNOPSIS -diff -ur dvi2tty-5.3.1.orig/dvi2tty.1 dvi2tty-5.3.1/dvi2tty.1 ---- dvi2tty-5.3.1.orig/dvi2tty.1 1996-03-23 20:45:03.000000000 +0100 -+++ dvi2tty-5.3.1/dvi2tty.1 2010-10-20 14:21:13.000000000 +0200 +diff -ur dvi2tty-5.3.3.orig/dvi2tty.1 dvi2tty-5.3.3/dvi2tty.1 +--- dvi2tty-5.3.3.orig/dvi2tty.1 2010-10-30 14:14:10.000000000 +0200 ++++ dvi2tty-5.3.3/dvi2tty.1 2010-11-06 18:26:37.452856291 +0100 @@ -1,4 +1,4 @@ --.TH DVI2TTY Local "13 November 1990" -+.TH DVI2TTY 1 "20 October 2010" "TeX Live" +-.TH DVI2TTY 1 "13 November 1990" ++.TH DVI2TTY 1 "13 November 1990" "TeX Live" .SH NAME dvi2tty \- preview a TeX DVI\-file on an ordinary ascii terminal .SH SYNOPSIS diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-04-pager b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-04-pager new file mode 100644 index 00000000000..fca0ba5c831 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-04-pager @@ -0,0 +1,12 @@ +diff -ur dvi2tty-5.3.3.orig/dvi2tty.c dvi2tty-5.3.3/dvi2tty.c +--- dvi2tty-5.3.3.orig/dvi2tty.c 2010-10-30 14:37:14.000000000 +0200 ++++ dvi2tty-5.3.3/dvi2tty.c 2010-11-06 18:33:49.064212708 +0100 +@@ -49,7 +49,7 @@ + /* have terminals with latin1 chars */ + #define WANTPAGER TRUE /* default: try to pipe through a pager (like */ + /* more) if stdout is tty and no -o switch */ +-#define DEFPAGER "/bin/more" /* CHANGE TO YOUR LOCAL PAGER */ ++#define DEFPAGER "more" /* CHANGE TO YOUR LOCAL PAGER */ + + /*------------------ end of customization constants ---------------------*/ + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-07-typo b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-07-typo new file mode 100644 index 00000000000..d8a4b21aad3 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-07-typo @@ -0,0 +1,12 @@ +diff -ur dvi2tty-5.3.3.orig/dvi2tty.1 dvi2tty-5.3.3/dvi2tty.1 +--- dvi2tty-5.3.3.orig/dvi2tty.1 2010-11-06 18:26:37.000000000 +0100 ++++ dvi2tty-5.3.3/dvi2tty.1 2010-11-06 19:38:55.404270272 +0100 +@@ -121,7 +121,7 @@ + .B \-u + Toggle option to process certain latin1 characters. Use this if your output + devices supports latin1 cahracters. +-Note this may interfere with -u. Best not to use -u and -s together. ++Note this may interfere with -s. Best not to use -u and -s together. + .TP + .B \-s + Toggle option to process the special Scandinavian characters that on most (?) diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-60-warnings b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-60-warnings new file mode 100644 index 00000000000..5701a623abd --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3-PATCHES/patch-60-warnings @@ -0,0 +1,63 @@ +diff -ur dvi2tty-5.3.3.orig/disdvi.c dvi2tty-5.3.3/disdvi.c +--- dvi2tty-5.3.3.orig/disdvi.c 2010-10-30 14:39:19.000000000 +0200 ++++ dvi2tty-5.3.3/disdvi.c 2010-11-06 20:09:02.763366429 +0100 +@@ -39,7 +39,7 @@ + * + */ + +-char *disdvi = "@(#) disdvi.c 2.26 20101027 M.J.E. Mol (c) 1989-2010, marcel@mesa.nl"; ++const char *disdvi = "@(#) disdvi.c 2.26 20101027 M.J.E. Mol (c) 1989-2010, marcel@mesa.nl"; + + /* + * Include files +diff -ur dvi2tty-5.3.3.orig/dvi2tty.c dvi2tty-5.3.3/dvi2tty.c +--- dvi2tty-5.3.3.orig/dvi2tty.c 2010-11-06 18:33:49.000000000 +0100 ++++ dvi2tty-5.3.3/dvi2tty.c 2010-11-06 20:09:00.431537476 +0100 +@@ -86,7 +86,7 @@ + * Variable definitions + */ + +-char *dvi2tty = "@(#) dvi2tty.c 5.3.3 20101030 M.J.E. Mol (c) 1989-2010"; ++const char *dvi2tty = "@(#) dvi2tty.c 5.3.3 20101030 M.J.E. Mol (c) 1989-2010"; + #define VERSION 5.3.3 + + +diff -ur dvi2tty-5.3.3.orig/dvistuff.c dvi2tty-5.3.3/dvistuff.c +--- dvi2tty-5.3.3.orig/dvistuff.c 2010-10-30 01:27:02.000000000 +0200 ++++ dvi2tty-5.3.3/dvistuff.c 2010-11-06 20:11:49.963973874 +0100 +@@ -99,7 +99,7 @@ + * Structure and variable definitions + */ + +-char *dvistuff = "@(#) dvistuff.c 5.3.3 20101027 M.J.E. Mol (c) 1989-2010"; ++const char *dvistuff = "@(#) dvistuff.c 5.3.3 20101027 M.J.E. Mol (c) 1989-2010"; + + typedef struct { + long hh; +@@ -1434,7 +1434,7 @@ + + + #define NJSUBS 33 +-char *jsf_names[]={ ++const char *jsf_names[]={ + "sy", "roma", "hira", "kata", "greek", "russian", "keisen", + "ka", "kb", "kc", "kd", "ke", "kf", "kg", "kh", "ki", "kj", + "kk", "kl", "km", "kn", "ko", "kp", "kq", "kr", "ks", "kt", +@@ -1469,7 +1469,7 @@ + void setfont(long fntnum) + { + char * s; +- char * d; ++ const char * d; + + symbolfont = FALSE; + ttfont = FALSE; +@@ -1492,7 +1492,7 @@ + + s = fnt->name; + if (printfont) { +- d = (char *) delim; /* print delim and font name if -b was chosen */ ++ d = delim; /* print delim and font name if -b was chosen */ + while (*d) {putcharacter(*d); d++;} + while (*s) {putcharacter(*s); s++;} + while (d-- > delim) {putcharacter(*d);} diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/COPYING b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/COPYING index 520e7de1d76..520e7de1d76 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/COPYING +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/COPYING diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/Changelog b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/Changelog new file mode 100644 index 00000000000..6f8ccd5abd8 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/Changelog @@ -0,0 +1,150 @@ +/****************************************************************************** + * Marcel Mol: 20101030 (marcel@mesa.nl) + * Version 5.3.3 + * included patches from TexLive and Joerg Prante, and Kenshi Muto + * minor cleanup/readability changes: note changes to -J -u -s options + * Kenshi Muto: 25 Nov, 1999 + * Add auto detect patch. + * Fix NTT JTeX DVI japanese patch. + * Add ASCII pTeX DVI japanese patch. + * From TexLive distribution: october 2010 + * 'KPATHSEA' support + * Fix linspacing calculation bug + * Fix compile time warnings/cosmetics + * Joerg Prante: 30nov2003 (prante@hbz-nrw.de) + * latin1 character handling with option '-u' using code by + * Simo Nikula (nikula@lut.fi) + * Thomas Sefzick (t.sefzick@fz-juelich.de) + * Updated help text according to latin1 patch. + * NOTE: this patch changes -u and -s option meanings! + * Marcel Mol: 22jan2003 (Internet: marcel@mesa.nl) + * From: jose@monkey.org: clearly state license (GPL). + * Marcel Mol: 27may1996 (Internet: marcel@mesa.nl) + * From: mlemos@ua.pt (Manuel Lemos): Port to AMIGA. + * Marcel Mol: 24mar1996 (Internet: marcel@mesa.nl) + * From: Alex Viskovatoff <av@mixcom.com>: Port to Macintosh + * From: Anton vd Repe 1995-6-9 (UUCP: arp@neabbs.uucp): + * Added option to skip translation of Scandinavian/Finnish + * and skip the constraint to ASCII characters only. + * Added option to include font name in output when new font + * is chosen. + * Limit line width of 132 expanded to 332. + * Marcel Mol: 23jun1995 (Internet: marcel@duteca.et.tudelft.nl) + * Included patch form Hideki ISOZAKI (isozaki@ntt-20.ntt.jp) + * to allow japanese fonts generated by NTT JTeX (March 1992). + * Added cleanups (protoize + includes) by D.U. Zoller + * (1995-07-17 duz@roxi.rz.fht-mannheim.de) + * Version 5.1 + * Marcel Mol: 09sep1993 (Internet: marcel@duteca.et.tudelft.nl) + * In dvistuff.c: added auto detection for 'ttfont'. + * This make -t flag unneeded, but it is still left in for + * people who like to force 'verbatim' mode. + * Thanks to: Diomidis Spinellis <dds@doc.imperial.ac.uk> + * Marcel Mol: 05sep1993 (Internet: marcel@duteca.et.tudelft.nl) + * In dvistuff.c: put some extra chars arround the 'ttfont' + * flag in the 'normchar' function. + * Marcel Mol: 01oct1991 (Internet: marcel@duteca.et.tudelft.nl) + * (From Igor Romanenko, igor@d245.icyb.kiev.ua.) + * Fixed unneccesary * in *envp++. + * Marcel Mol: 24jul1991 (Internet: marcel@duteca.et.tudelft.nl) + * Suggestion From: peter@julian.uwo.ca [uwo] + * vertical bars "|" and the tilde "~" print properly in + * typewriter font. + * Marcel Mol: 1990-11-29 (UUCP: marcel@duteca.et.tudelft.nl) + * Fixed bug in option handling. Cleanup of code. + * Other minor changes/optimizations. + * Marcel Mol: 1990-11-13 (UUCP: marcel@duteca.et.tudelft.nl) + * Included patches of Bernard Gaulle in my version. + * Version 4.4 + * Bernard Gaulle: 1990-10-16 (gaulle@murnau.circe.fr) + * Add -t option (assuming tt fonts were used) + * (Version 3.3) + * Marcel Mol: 1990-05-03 (UUCP: marcel@duteca.tudelft.nl) + * Now displays accents etc. on characters again. Added option + * (-a) to switch this off. If switched off it now uses proper + * spacing. + * Cleaned up and show version number in usage(); + * Version 4.3 + * Marcel Mol: 1990-05-02 (UUCP: marcel@duteca.tudelft.nl) + * Included patches for VAX/VMS VAXC, done by Robert Schneider. + * Version 4.2 + * Marcel Mol: 1990-03-27 (UUCP: marcel@duteca.tudelft.nl) + * Fixed bug that causes the program to hang when it finds a + * fontname with an 's' in it not followed by an 'y'. + * Thanks to Paul Orgren (orgren@Stars.Reston.Unisys.COM). + * Version 4.1 + * Marcel Mol: 1990-02-04 (UUCP: marcel@duteca.tudelft.nl) + * First attempt to recognize symbol fonts, so bullets (in + * itemized lists) are translated to a proper character instead + * an awfull ligature. + * Version 4.0. + * Marcel Mol: 1990-02-01 (UUCP: marcel@duteca.tudelft.nl) + * Included port to VMS (off Joseph Vasallo and Seppo Rantala) + * into latest version. Hope things still work, cannot test it ... + * Joseph Vasallo & Seppo Rantala: 1989-09-05 (Internet: rantala@tut.FI) + * Ported to work under VAX/VMS V4.4 & VAXC V2.4 or higher. + * Fixed bugs in using Swedish/Finnish characters. + * Marcel Mol: 1989-02-14 (UUCP: duteca!marcel) + * Fixed check for .dvi extension. + * Allowed more ligatures. + * Fixed side effect bugs (2 gets as function arguments). + * Version 3.2. + * Marcel Mol: 1989-01-19 (UUCP: duteca!marcel) + * Changed in option handling, no change + * in user interface (only the undocumented + * feature -e). + * Version 3.1. + * Marcel Mol: 1989-01-11 (UUCP: duteca!marcel) + * Changed some longs to ints. + * It now also runs on MSDOS Microsoft C 5.1 + * New version: 3.0 + * Marcel Mol: 1989-01-03 (UUCP: duteca!marcel) + * Fixed a bugs concerning pager programs + * and scanning environment variable DVI2TTY. + * Marcel Mol: 1988-10-25 (UUCP: duteca!marcel) + * Renamed to dvi2tty and converted to C. + * Filenames: dvi2tty.c dvi2tty.h dvistuff.c commands.h + * Improved spacing between words/characters. + * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-08-15 20:24:31, + * Version to be sent to mod.sources ready. + * New option since last version: + * -Fprog Pipe output to prog. Can be used to get a different + * pager than the default. + * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-01-13 21:49:31, + * Environment variable DVITTY is read and options can be set from it. + * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-01-10 18:51:03, + * Argument parsing, and random access functions (external, in C) + * and other OS-dependent stuff (in C). Removed private 'pager' & + * tries to pipe through PAGER (environment var) or, if PAGER not + * defined, /usr/ucb/more. Some changes for efficency. + * bogart:/usr/alla/svante/dvitty/dvitty.p 1985-07-15 20:51:00, + * The code for processing dvi-files running on UNIX (UCB-Pascal) + * but no argument parsing. + * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.140, 30-Mar-85 05:43:56, + * Edit: Svante Lindahl + * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.136, 15-Jan-85 13:52:59, + * Edit: Svante Lindahl, final Twenex version !!!?? + * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.121, 14-Jan-85 03:10:22, + * Edit: Svante Lindahl, cleaned up and fixed a lot of little things + * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.25, 15-Dec-84 05:29:56, + * Edit: Svante Lindahl, COMND-interface, including command line scanning + * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.23, 10-Dec-84 21:24:41, + * Edit: Svante Lindahl, added command line scanning with Rscan-JSYS + * VERA::<SVANTE-LINDAHL.DVITTY>DVITTY.PAS.48, 8-Oct-84 13:26:30, + * Edit: Svante Lindahl, fixed switch-parsing, destroyed by earlier patches + * VERA::<SVANTE-LINDAHL.DVITTY>DVITTY.PAS.45, 29-Sep-84 18:29:53, + * Edit: Svante Lindahl + * + * dvitty - get an ascii representation of a dvi-file, suitable for ttys + * + * This program, and any documentation for it, is copyrighted by Svante + * Lindahl. It may be copied for non-commercial use only, provided that + * any and all copyright notices are preserved. + * + * + * UUCP: {seismo,mcvax,cernvax,diku,ukc,unido}!enea!ttds!zap + * ARPA: enea!ttds!zap@seismo.CSS.GOV + * or Svante_Lindahl_NADA%QZCOM.MAILNET@MIT-MULTICS.ARPA + * EAN: zap@cs.kth.sunet + */ + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/DVI.format b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/DVI.format index 4ce5d3936a3..4ce5d3936a3 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/DVI.format +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/DVI.format diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/Makefile b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/Makefile index e1635eaccf7..6f8c5e66f5e 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/Makefile +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/Makefile @@ -12,8 +12,8 @@ CFLAGS = -Wall -O2 # CFLAGS = -Wall -O2 -fomit-frame-pointer LDFLAGS = -s -prefix = /usr/local -mandir = $(prefix)/man/man1 +prefix = ${DESTDIR}/usr +mandir = $(prefix)/share/man/man1 bindir = $(prefix)/bin diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README index b0dbc964fdb..266aa9de1a7 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README @@ -46,6 +46,9 @@ authors, I am just one of the latest maintainers. Thats all, good luck. +If you like this code and want to support is feel free to donate +at Paypal marcel@mesa.nl. Thanks + - Marcel ######################################### # Marcel J.E. Mol # diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README.MAC b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README.MAC index 2aa17b3055b..2aa17b3055b 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README.MAC +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README.MAC diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README.ORG b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README.ORG index 9f8b337b16a..9f8b337b16a 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README.ORG +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README.ORG diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README.VMS b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README.VMS index 1d07f22389c..1d07f22389c 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/README.VMS +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/README.VMS diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/TODO b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/TODO index 56b7facaad0..56b7facaad0 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/TODO +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/TODO diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/UNIXtoMacLib/getopt.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/UNIXtoMacLib/getopt.c index a0db51e2520..a0db51e2520 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/UNIXtoMacLib/getopt.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/UNIXtoMacLib/getopt.c diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/UNIXtoMacLib/macintosh.h b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/UNIXtoMacLib/macintosh.h index 24843f507c7..24843f507c7 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/UNIXtoMacLib/macintosh.h +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/UNIXtoMacLib/macintosh.h diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/UNIXtoMacLib/unix-to-macintosh.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/UNIXtoMacLib/unix-to-macintosh.c index f29b0334256..f29b0334256 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/UNIXtoMacLib/unix-to-macintosh.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/UNIXtoMacLib/unix-to-macintosh.c diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/commands.h b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/commands.h index 9624713ea1f..46bf84530df 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/commands.h +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/commands.h @@ -1,3 +1,23 @@ +/* + * dvi2tty + * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> + * + * 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. + * + */ + /* DVI COMMANDS */ #define SETC_000 0 /* typeset character 0 and move right */ #define SETC_127 127 /* typeset character 127 and move right */ @@ -64,8 +84,6 @@ #define POST_POST 249 /* postamble ending */ #define TRAILER 223 /* trailer bytes in dvi file */ - /* undefined_commands 250,251,252,253,254,255 */ - /* additional DVI commands for XeTeX extensions */ #define PIC_FILE 251 #define NAT_FNT 252 /* define a native font */ @@ -74,3 +92,6 @@ /* additional DVI command for pTeX extensions */ #define DVI_DIR 255 /* set direction */ + + + /* undefined_commands 250 */ diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/README.Debian b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/README.Debian new file mode 100644 index 00000000000..040c15867c1 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/README.Debian @@ -0,0 +1,17 @@ +dvi2tty for Debian +---------------------- + + English DVI: Simply type "dvi2tty file.dvi". + Latin1 DVI: Try 'dvi2tty -u file.dvi". + + NTT JTeX or ASCII pTeX DVI: Challenge autodetect. Type "dvi2tty -J file.dvi". + If automatic detection is failed, specify by hand. + NTT JTeX DVI: type "dvi2tty -N file.dvi". + ASCII pTeX DVI: type "dvi2tty -A file.dvi". + +You can specify option by defining environment variable "DVI2TTY". + +Example: + DVI2TTY=J; export DVI2TTY + + -- Kenshi Muto <kmuto@debian.org>, Thu, 5 Jun 2003 18:41:33 +0900 diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/changelog b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/changelog new file mode 100644 index 00000000000..97488d5927a --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/changelog @@ -0,0 +1,118 @@ +dvi2tty (5.3.3-1) stable; urgency=low + + * New upstream version + + -- Marcel Mol <marcel@mesa.nl> Sat Oct 30 14:11:52 CEST 2010 + +dvi2tty (5.3.1-3) unstable; urgency=low + + * Fix gcc-3.4 FTBFS. (closes: Bug#258634) + + -- Kenshi Muto <kmuto@debian.org> Sun, 11 Jul 2004 09:50:06 +0900 + +dvi2tty (5.3.1-2) unstable; urgency=low + + * Fix copyright file to point to full GPL text. + + -- Kenshi Muto <kmuto@debian.org> Sat, 14 Jun 2003 15:44:37 +0900 + +dvi2tty (5.3.1-1) unstable; urgency=low + + * New upstream (closes: Bug#195508) + * dvi2tty changes its license to GNU GPL! dvi2tty can go main (Thanks your + report, John R Lenton). + * New upstream version looks support latin-1 by -c option (closes: Bug#101533) + * Fix displaying ASCII pTeX DVI (closes: Bug#185982) + + -- Kenshi Muto <kmuto@debian.org> Thu, 5 Jun 2003 18:47:01 +0900 + +dvi2tty (5.1-14) unstable; urgency=low + + * Rebuild with new libc. Thanks your reminder, tbm. + + -- Kenshi Muto <kmuto@debian.org> Sun, 23 Mar 2003 23:06:18 +0900 + +dvi2tty (5.1-13) unstable; urgency=low + + * Fix manual and README.debian (closes: #52832). + + -- Kenshi Muto <kmuto@debian.org> Thu, 16 Dec 1999 13:06:52 +0900 + +dvi2tty (5.1-12) unstable; urgency=low + + * Add auto detect routine for NTT JTeX and ASCII pTeX (closes: #50610). + Thanks, Mr. Kohda. + + -- Kenshi Muto <kmuto@debian.org> Thu, 25 Nov 1999 14:19:33 +0900 + +dvi2tty (5.1-11) unstable; urgency=low + + * Fix control file (This package must be treated as non-free). + + -- Kenshi Muto <kmuto@debian.org> Wed, 17 Nov 1999 10:21:09 +0900 + +dvi2tty (5.1-10) unstable; urgency=low + + * New maintainer. + * Fix NTT JTeX patch. + * Add ASCII pTeX patch. + + -- Kenshi Muto <kmuto@debian.org> Tue, 16 Nov 1999 12:01:20 +0900 + +dvi2tty (5.1-9) non-free; urgency=low + + * Orphaned package + + -- Christian Schwarz <schwarz@debian.org> Tue, 10 Mar 1998 21:07:41 +0100 + +dvi2tty (5.1-8) non-free; urgency=low + + * Recompiled with libc6. + * Upgraded to standards version 2.2.0.0. + + -- Christian Schwarz <schwarz@debian.org> Sun, 13 Jul 1997 21:59:04 +0200 + +dvi2tty (5.1-7) non-free; urgency=low + + * New maintainer. + * Upgraded to new source format. + * Changed distribution to non-free. + + -- Christian Schwarz <schwarz@debian.org> Sat, 22 Mar 1997 13:42:13 +0100 + +Mon Jun 10 12:54:08 1996 Erick Branderhorst <branderh@debian.org> + + * debian.rules (binary): dpkg-name + * debian.rules (binary): gzip manpages + * applied dvi2tty.patch + +Mon Apr 22 15:24:45 1996 root <branderh@debian.org> + + * debian.control (Description): "on" text-only devices (Thanks Dirk) + +Wed Apr 17 10:49:11 1996 Erick Branderhorst <branderh@debian.org> + + * debian.rules: minor changes + * Makefile (INSTALL_PROGRAM): stripped installation + * debian.control (Architecture): added + (Version): changed + (Maintainer): changed to branderh@debian.org + (Section): tex + (Priority): optional + (Recommends): removed + +dvi2tty (5.1-3); + * Elf +dvi2tty (5.1-2); + * No default pager (dvi2tty.c) + * Depends not on less. +dvi2tty (5.1-1); + * Depends on less in stead of recommending less. <edd@qed.econ.queensu.ca> +dvi2tty (5.1-0); + * First release. + * Changed default pager to `/usr/bin/less' (dvi2tty.c). + +Local variables: +mode: debian-changelog +add-log-mailing-address: "schwarz@debian.org" +End: diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/compat b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/compat new file mode 100644 index 00000000000..b8626c4cff2 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/compat @@ -0,0 +1 @@ +4 diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/control b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/control new file mode 100644 index 00000000000..df02fc909ef --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/control @@ -0,0 +1,13 @@ +Source: dvi2tty +Section: tex +Priority: optional +Maintainer: Kenshi Muto <kmuto@debian.org> +Build-Depends: debhelper (>> 4.0.0) +Standards-Version: 3.5.8 + +Package: dvi2tty +Architecture: any +Depends: ${shlibs:Depends} +Description: Previewing dvi-files on text-only devices + If no options are passed output will be send to the pager defined in + PAGER if specified. If no pager specified the output will go to pager. diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/copyright b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/copyright new file mode 100644 index 00000000000..b3277a854cd --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/copyright @@ -0,0 +1,12 @@ +This package was debianized by Kenshi Muto <kmuto@debian.org> on +Thu, 5 Jun 2003 17:06:08 +0900. + +It was downloaded from http://www.mesa.nl/pub/dvi2tty/dvi2tty-5.3.1.tar.gz + +Upstream Author(s): many, including Marcel J.E. Mol <marcel@mesa.nl> + +Copyright: + GNU General Public License. + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL file. diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/dirs b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/dirs new file mode 100644 index 00000000000..98d15831b4c --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/man/man1 diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/docs b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/docs new file mode 100644 index 00000000000..e7473667e8b --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/docs @@ -0,0 +1,9 @@ +Changelog +README +README.ORG +README.VMS +TODO +ligtest.tex +test.tex +test.dvi +debian/jdvi2tty-ascii.patch.header diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/jdvi2tty-ascii.patch.header b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/jdvi2tty-ascii.patch.header new file mode 100644 index 00000000000..a3c9752ba49 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/jdvi2tty-ascii.patch.header @@ -0,0 +1,30 @@ +From: motonori@kutsuda.kuis.kyoto-u.ac.jp (Motonori Nakamura) +Newsgroups: fj.sources +Subject: jdvi2tty (patch to dvi2tty) +Message-ID: <46@boots.kutsuda.kuis.kyoto-u.ac.jp> +Date: 10 May 90 07:45:29 GMT + +$BCfB<!w5~Bg>pJs$G$9!#(B + +$B$b$&!"$I$J$?$+$d$C$F$*$i$l$k$+$bCN$l$^$;$s$,!"0JA0(B +comp.sources.misc $B$KN.$l$F$$$?(B dvi2tty $B$r(B ASCII-JTeX $BBP1~$K(B +$BF|K\8l2=$7$^$7$?!#(BUNIX $B$G(B TeX $B$r;H$*$&$H$$$&?M$O!"(BX $B$G(B preview +$B$9$k$G$7$g$&$7!"(B98 $B>e$GF0$/(B previewer $B$b=P$F$$$k$3$H$G$9$+$i!"(B +$B<{MW$O>/$J$$$H$O;W$$$^$9$,!"(BTTY $BC<Kv$G%A%g%3%A%g%3$H=q$$$F!"(B +$B%A%i%C$H3NG'$9$k$N$K$O!"$J$+$J$+JXMx$@$H$NI>H=$G$9!#(B +($B;d$K!"!V$M!"F|K\8l2=$7$h$&$h!#!W$H!"8@$C$??M$NJ[(B :-) + +$B=jA'(B TTY $B$J$N$GJ#;($J?^$O8+$K$/$$$G$9$7!"I=$bHyL/$K$:$l$^$9!#(B +($B$:$l$k$N$O85$N%W%m%0%i%`$N;EMM$G$9!"G0$N$?$a(B :-p ) + +$B$H$$$&Lu$G!"%Q%C%A$r%]%9%H$7$^$9!#(B + +$B$$$A$*$&!"(BJIS,SJIS,EUC $B$K$OBP1~$7$F$"$j$^$9!#(B +dvistuff.c $B$NCf$N(B JIS, SJIS $B$N(B define $B$rJQ$($k$H(B($B$^$?$O!"(B +Makefile $B$G(B define $B$9$k$H(B)$B$*K>$_$N4A;z%3!<%I$K$J$k$O$:$G$9!#(B + +$B$A$J$_$K!"855-;v$O<!$NDL$j$G$9!#(B +($B>JN,(B) +========= + $BCfB<(B $BAGE5(B $B!w5~ETBg3X(B $B9)3X8&5f2J(B $B>pJs9)3X@l96(B $BDEED8&5f<<(B + motonori@kuis.kyoto-u.ac.jp diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/postinst b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/postinst new file mode 100644 index 00000000000..47877c36f67 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/postinst @@ -0,0 +1,12 @@ +#! /bin/sh +# postinst script for dvi2tty +# +# see: dh_installdeb(1) + +set -e + +#DEBHELPER# + +exit 0 + + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/prerm b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/prerm new file mode 100644 index 00000000000..ff3fbe963de --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/prerm @@ -0,0 +1,12 @@ +#! /bin/sh +# prerm script for dvi2tty +# +# see: dh_installdeb(1) + +set -e + +#DEBHELPER# + +exit 0 + + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/rules b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/rules new file mode 100644 index 00000000000..5c919f9eebd --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/debian/rules @@ -0,0 +1,80 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatability version to use. +export DH_COMPAT=1 + +build: build-stamp +build-stamp: + dh_testdir + + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp. + # $(MAKE) install DESTDIR=`pwd`/debian/tmp + install -o root -g root -m 755 dvi2tty disdvi `pwd`/debian/tmp/usr/bin + install -o root -g root -m 644 dvi2tty.1 disdvi.1 `pwd`/debian/tmp/usr/share/man/man1 + + touch install-stamp + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install +# dh_testversion + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples +# dh_installmenu +# dh_installemacsen +# dh_installpam +# dh_installinit +# dh_installcron + dh_installmanpages + dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + # You may want to make some executables suid here. + dh_suidregister +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/disdvi.1 b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/disdvi.1 index 38bfc278827..4149843375d 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/disdvi.1 +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/disdvi.1 @@ -1,6 +1,6 @@ -.TH DISDVI 1 "23 October 2010" "TeX Live" +.TH DISDVI 1 "27 October 2010" "TeX Live" .SH NAME -disdvi \- `disassemble' a (p)TeX DVI or XeTeX XDV file +disdvi \- `disassemble' a (p)TeX or XeTeX DVI file .SH SYNOPSIS .B disdvi .RB [ \-p ] @@ -15,7 +15,7 @@ disdvi \- `disassemble' a (p)TeX DVI or XeTeX XDV file interprets the contents of .IR dvi_file or -.IR xdv_file , +.IR xdv_file printing the DVI commands and text in a human-readable ASCII format on the standard output. .SH "SEE ALSO" diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/disdvi.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/disdvi.c index fa461f255f4..b6c8743384d 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/disdvi.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/disdvi.c @@ -3,35 +3,75 @@ /* disdvi --- disassembles TeX dvi files. */ /* */ /* */ -/* 2.0 23/01/89 M.J.E. Mol (c) 1989 marcel@duteca.tudelft.nl */ -/* 2.1 19/01/90 M.J.E. Mol Maintain a list of fonts and */ +/* 2.26 23oct2010 TexLivel support pTex and XeTex */ +/* 2.25 23jan2003 M.J.E. Mol fixed bug in copying font name (name[i]) */ +/* 2.24 27may96 M.J.E. Mol A few typecasts added */ +/* 2.23 23jul95 M.J.E. Mol Cleanups from duz@roxi.ez.fht-mannheim.de */ +/* 2.22 13dec90 M.J.E. Mol Fixed bug in num(). Cleaned up code. */ +/* 2.21 03may90 M.J.E. Mol Created usage(). */ +/* 2.2 02may90 M.J.E. Mol Included port to VAX/VMS VAXC by */ +/* Robert Schneider. */ +/* 2.1 19jan90 M.J.E. Mol Maintain a list of fonts and */ /* show fontnames in font changes. */ /* Show character code when printing ligatures */ -/* */ +/* 2.0 23jan89 M.J.E. Mol (c) 1989 */ +/* marcel@mesa.nl */ /* */ /*****************************************************************************/ - -#if 0 -char *disdvi = "@(#) disdvi.c 2.1 19/01/90 M.J.E. Mol (c) 1989, 1990"; -#endif +/* + * dvi2tty + * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> + * + * 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. + * + */ + +const char *disdvi = "@(#) disdvi.c 2.26 20101027 M.J.E. Mol (c) 1989-2010, marcel@mesa.nl"; + +/* + * Include files + */ #include <stdio.h> +#include <stdlib.h> +#if defined(MSDOS) || defined(WIN32) +# include <fcntl.h> +#else +# if !defined(THINK_C) /* Macintosh */ +# include <unistd.h> +# endif +#endif #include <ctype.h> +#include <string.h> #include "commands.h" +#if defined(THINK_C) +# include "macintosh.h" +#endif #if defined(KPATHSEA) -#define NO_DEBUG 1 -#include <kpathsea/config.h> -#include <kpathsea/lib.h> -#else -#if defined(MSDOS) -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#endif +# define NO_DEBUG 1 +# include <kpathsea/config.h> +# include <kpathsea/lib.h> #endif + +/* + * Constant definitions + */ + #define LASTCHAR 127 /* max dvi character, above are commands */ #define get1() num(1) @@ -43,80 +83,95 @@ char *disdvi = "@(#) disdvi.c 2.1 19/01/90 M.J.E. Mol (c) 1989, 1990"; #define sget3() snum(3) #define sget4() snum(4) + + +/* + * Type definitions + */ + typedef struct _font { long num; struct _font * next; char * name; } font; + + +/* + * Variable declarations + */ + font * fonts = NULL; FILE * dvifp; char * dvi_name; long pc = 0; +char * progname; + int is_ptex = 0; int is_xetex = 0; const char * dvi_ext = ".dvi"; -#ifdef KPATHSEA -extern void bop(void); -extern void postamble(void); -extern void preamble(void); -extern void postpostamble(void); -extern void special(int x); -extern void fontdef(int x); -extern const char *fontname(long fntnum); -extern void printnonprint(int ch); -extern unsigned long num(int size); -extern long snum(int size); -extern void picfile(int opcode); -extern void natfontdef(int opcode); -extern void glyphs(int opcode); -extern void dvidir(int opcode); -extern void invalid(int opcode); -#else -char * malloc (); - -int main (); -void bop (); -void preamble (); -void postamble (); -void postpostamble (); -void fontdef (); -char * fontname (); -void special (); -void printnonprint (); -unsigned long num (); -long snum (); -void picfile (); -void natfontdef (); -void glyphs (); -void dvidir (); -void invalid (); -#endif - - - -/*---------------------------------------------------------------------------*/ +/* + * Function declarations + */ +#if defined(VMS) + main (int argc, char ** argv); +#endif +void bop (void); +void preamble (void); +void postamble (void); +void postpostamble (void); +void fontdef (int x); +const char * fontname (unsigned long fntnum); +void special (int x); +void printnonprint (int ch); +unsigned long num (int size); +long snum (int size); +void usage (void); +void picfile (int opcode); +void natfontdef (int opcode); +void glyphs (int opcode); +void dvidir (int opcode); +void invalid (int opcode); + + + + +/* + * MAIN -- + */ + +#if defined(VMS) + main(int argc, char **argv) +#else int main(int argc, char **argv) +#endif { - register int opcode; /* dvi opcode */ + register int opcode; /* dvi opcode */ register int i; - int fontnum; - char * progname; + unsigned long fontnum; - progname = *argv; +#if defined(THINK_C) + argc = process_disdvi_command_line(&argv); +#endif + + progname = *argv++; - if ((argc > 1) && (argv[1][0] == '-')) { - if (!strcmp(argv[1], "-p") || !strcmp(argv[1], "--ptex")) { + if ((argc > 1) && (*argv[0] == '-')) { + if (!strcmp(*argv, "-h")) { + usage(); + exit(0); + } + if (!strcmp(*argv, "-p")) is_ptex = 1; - } else if (!strcmp(argv[1], "-x") || !strcmp(argv[1], "--xetex")) { + else if (!strcmp(*argv, "-x")) { is_xetex = 1; dvi_ext = ".xdv"; } else { - fprintf(stderr, "Invalid option `%s'\n", argv[1]); - fprintf(stderr, "Usage: %s [-p|--ptex|-x|--xetex] [dvi-file]\n", progname); + fprintf(stderr, "Invalid option `%s'\n", *argv); + usage(); exit(3); } argv++; @@ -125,21 +180,21 @@ int main(int argc, char **argv) if (argc > 2) { fprintf(stderr, "To many arguments\n"); - fprintf(stderr, "Usage: %s [-p|--ptex|-x|--xetex] [dvi-file]\n", progname); + usage(); exit(1); } if (argc == 2) { - if ((i = strlen(argv[1])) == 0) { + if ((i = strlen(*argv)) == 0) { fprintf(stderr, "Illegal empty filename\n"); - fprintf(stderr, "Usage: %s [-p|--ptex|-x|--xetex] [dvi-file]\n", progname); + usage(); exit(2); } - if ((i >= 5) && !strcmp(argv[1]+(i-4), dvi_ext)) - dvi_name = argv[1]; + if ((i >= 5) && (!strcmp(*argv+i-4, dvi_ext))) + dvi_name = *argv; else { dvi_name = malloc((i+5) * sizeof(char)); - strcpy(dvi_name, argv[1]); + strcpy(dvi_name, *argv); strcat(dvi_name, dvi_ext); } if ((dvifp = fopen(dvi_name, "r")) == NULL) { @@ -170,7 +225,7 @@ int main(int argc, char **argv) printnonprint(opcode); /* it must be a non-printable */ else if ((opcode >= FONT_00) && (opcode <= FONT_63)) printf("FONT_%02d /* %s */\n", opcode - FONT_00, - fontname(opcode - FONT_00)); + fontname((unsigned long) opcode - FONT_00)); else switch (opcode) { case SET1 : @@ -242,7 +297,7 @@ int main(int argc, char **argv) case FNT2 : case FNT3 : case FNT4 : fontnum = num(opcode -FNT1 + 1); - printf("FNT%d: %d /* %s */\n", + printf("FNT%d: %ld /* %s */\n", opcode - FNT1 + 1, fontnum, fontname(fontnum)); break; @@ -266,19 +321,22 @@ int main(int argc, char **argv) } } - return 0; + exit(0); + } /* main */ -/*----------------------------------------------------------------------------*/ +/* + * BOP -- Process beginning of page. + */ void bop(void) { int i; printf("BOP page number : %ld", sget4()); - for (i=0; i < 9; i++) { + for (i=9; i > 0; i--) { if (i % 3 == 0) printf("\n%06ld: ", pc); printf(" %6ld", sget4()); @@ -286,10 +344,15 @@ void bop(void) printf("\n%06ld: ", pc); printf(" prev page offset : %06ld\n", sget4()); + return; + } /* bop */ -/*---------------------------------------------------------------------------*/ + +/* + * POSTAMBLE -- Process post amble. + */ void postamble(void) { @@ -310,8 +373,16 @@ void postamble(void) printf("%06ld: ", pc); printf(" number of pages : %d\n", (int) get2()); + return; + } /* postamble */ + + +/* + * PREAMBLE -- Process pre amble. + */ + void preamble(void) { register int i; @@ -330,9 +401,16 @@ void preamble(void) putchar((int) get1()); putchar('\n'); + return; + } /* preamble */ + +/* + * POSTPOSTAMBLE -- Process post post amble. + */ + void postpostamble(void) { register int i; @@ -350,33 +428,44 @@ void postpostamble(void) i = (int) get1(); } + return; + } /* postpostamble */ -void special(register int x) +/* + * SPECIAL -- Process special opcode. + */ + +void special(int x) { register long len; - register long i; len = num(x); printf("XXX%d: %ld bytes\n", x, len); printf("%06ld: ", pc); - for (i = 0; i < len; i++) /* a bit dangerous ... */ + for (; len>0; len--) /* a bit dangerous ... */ putchar((int) get1()); /* can be non-printables */ putchar('\n'); + return; + } /* special */ -void fontdef(register int x) +/* + * FONTDEF -- Process a font definition. + */ + +void fontdef(int x) { register int i; char * name; font * fnt; int namelen; - long fntnum; + unsigned long fntnum; int new = 0; fntnum = num(x); @@ -410,7 +499,7 @@ void fontdef(register int x) for (i = 0; i < namelen; i++) name[i] = get1(); - name[namelen] = '\0'; + name[i] = '\0'; fnt->name = name; if (new) { fnt->next = fonts; @@ -419,12 +508,17 @@ void fontdef(register int x) printf("%s\n", name); + return; + } /* fontdef */ -const char * -fontname(long fntnum) +/* + * FONTNAME -- Return font name. + */ + +const char * fontname(unsigned long fntnum) { font * fnt; @@ -433,14 +527,18 @@ fontname(long fntnum) fnt = fnt->next; if (fnt != NULL) return fnt->name; - else - return "unknown fontname"; + + return "unknown fontname"; } /* fontname */ -void printnonprint(register int ch) +/* + * PRINTNONPRINT -- Translate non-printable characters. + */ + +void printnonprint(int ch) { printf("Char: "); @@ -466,63 +564,95 @@ void printnonprint(register int ch) break; case 25 : printf("ss /* german (non-printing) 0x%02X */", ch); break; - case 26 : printf("ae /* scadinavian (non-printing) 0x%02X */", + case 26 : printf("ae /* scandinavian (non-printing) 0x%02X */", ch); break; - case 27 : printf("oe /* scadinavian (non-printing) 0x%02X */", + case 27 : printf("oe /* scandinavian (non-printing) 0x%02X */", ch); break; - case 28 : printf("o /* scadinavian (non-printing) 0x%02X */", + case 28 : printf("o /* scandinavian (non-printing) 0x%02X */", ch); break; - case 29 : printf("AE /* scadinavian (non-printing) 0x%02X */", + case 29 : printf("AE /* scandinavian (non-printing) 0x%02X */", ch); break; - case 30 : printf("OE /* scadinavian (non-printing) 0x%02X */", + case 30 : printf("OE /* scandinavian (non-printing) 0x%02X */", ch); break; - case 31 : printf("O /* scadinavian (non-printing) 0x%02X */", + case 31 : printf("O /* scandinavian (non-printing) 0x%02X */", ch); break; default : printf("0x%02X", ch); break; } putchar('\n'); -} + return; + +} /* printnonprint */ + +/* + * NUM -- + */ -unsigned long num(register int size) +unsigned long num(int size) { register int i; - register long x = 0; + register unsigned long x = 0; pc += size; - for (i = 0; i < size; i++) + for (i = size; i > 0; i--) x = (x << 8) + (unsigned) getc(dvifp); + return x; } /* num */ -long snum(register int size) +/* + * SNUM -- + */ + +long snum(int size) { register int i; - register long x = 0; + register long x; pc += size; x = getc(dvifp); if (x & 0x80) x -= 0x100; - for (i = 1; i < size; i++) + for (i = size - 1; i > 0; i--) x = (x << 8) + (unsigned) getc(dvifp); + return x; } /* snum */ +/* + * USAGE -- + */ + +void usage(void) +{ + + fprintf(stderr, "\n%s\n\n", disdvi); + fprintf(stderr, " disassembles (p)TeX dvi and XeTeX xdv files\n"); + fprintf(stderr, "Usage: %s [-h | [-p] [dvi_file[.dvi]]\n", progname); + fprintf(stderr, " | -x [xdv_file[.xdv]]]\n"); + fprintf(stderr, "\n If you like this code and want to support is feel free\n to donate at Paypal marcel@mesa.nl. Thanks.\n\n"); + + + return; + +} /* usage */ + + + void picfile(int opcode) { int i; diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.1 b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.1 index 168a073373d..85b6bab3ae2 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.1 +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.1 @@ -1,36 +1,38 @@ -.TH DVI2TTY Local "7 June 1986" +.TH DVI2TTY 1 "13 November 1990" "TeX Live" .SH NAME -dvi2tty \- preview a dvi\-file on an ordinary ascii terminal +dvi2tty \- preview a TeX DVI\-file on an ordinary ascii terminal .SH SYNOPSIS .B dvi2tty [ options ] dvi\-file .SH DESCRIPTION .I dvi2tty -converts a TeX DVI\-file to a format that is apprporiate for terminals -and lineprinters. The program is intended to be used for +converts a TeX DVI\-file to a format that is appropriate for terminals +and line printers. The program is intended to be used for preliminary proofreading of TeX-ed documents. By default the output is directed to the terminal, possibly through a pager (depending on how the program was installed), but it can be directed to a file or a pipe. .PP The output leaves much to be desired, but is still -usefull if you want to avoid walking to the -laserprinter (or whatever) for each iteration of your +useful if you want to avoid walking to the +laser printer (or whatever) for each iteration of your document. .br Since .I dvi2tty -produces output for terminals and lineprinters the +produces output for terminals and line printers the representation of documents is naturally quite primitive. -Fontchanges are totally ignored, which implies that -special symbols, such as mathematical symbols, get mapped into the -characters at the corresponding positions in the "standard" fonts. +In principle Font Changes are totally ignored, but +.I dvi2tty +recognizes +a few mathematical and special symbols that can be be displayed on an +ordinary ascii terminal, such as the '+' and '-' symbol. .PP If the width of the output text requires more columns than fits in one line (c.f. the \-w option) it is broken into several lines by .I dvi2tty although they will be printed as one line on regular TeX output -devices (e.g. laserprinters). To show that a broken line is really +devices (e.g. laser printers). To show that a broken line is really just one logical line an asterisk (``*'') in the last position means that the logical line is continued on the next physical line output by @@ -39,7 +41,7 @@ Such a continuation line is started with a a space and an asterisk in the first two columns. .PP Options may be specified in the environment variable DVI2TTY. -Any option on the commandline, conflicting with one in the +Any option on the command line, conflicting with one in the environment, will override the one from the environment. .PP .B Options: @@ -54,7 +56,7 @@ Numbers refer to TeX\-page numbers (known as \\count0). An example of format for list is ``1,3:6,8'' to choose pages 1, 3 through 6 and 8. Negative numbers can be used exactly as in TeX, -e g \-1 comes before \-4 as in ``\-p-1:-4,17''. +e g \-1 comes before \-4 as in ``\-p\-1:\-4,17''. .TP .B \-P list Like \-p except that page numbers refer to @@ -71,61 +73,93 @@ be a good idea to use \-w132 and toggle the terminal into this mode as output will probably look somewhat better. .TP +.B \-v +Specify height of lines. Default value 450000. Allows to adjust linespacing. +.TP .B \-q Don't pipe the output through a pager. This may be the default on some systems -(depending on the whims of the SA installing the program). +(depending on the whims of the person installing the program). +.TP +.B \-e n +This option can be used to influence the spacing between words. +With a negative value the number of spaces +between words becomes less, with a positive value it becomes more. +\-e\-11 seems to worked well. .TP .B \-f -Pipe through a pager, $PAGER if defined, or whatever your SA compiled +Pipe through a pager, $PAGER if defined, or whatever the installer of +the program compiled in (often ``more''). This may be the default, but it is still okay to redirect output with ``>'', the pager will not be used if output is not going to a terminal. .TP .B \-F Specify the pager program to be used. -This overides the $PAGER and the default pager. +This overrides the $PAGER and the default pager. .TP .B \-Fprog Use ``prog'' as program to pipe output into. Can be used to choose an alternate pager (e g ``-Fless''). .TP +.B \-t +\\tt fonts were used (instead of cm) to produce dvi file. (screen.sty +is a powerfull mean to do that with LaTeX). +.TP +.B \-a +Dvi2tty normally tries to output accented characters. With the -a option, +accented characters are output without the accent sign. +.TP .B \-l -Mark pagebreaks with the two-character sequence ``^L''. The default is -to mark them with a formfeed character. +Mark page breaks with the two-character sequence ``^L''. The default is +to mark them with a form-feed character. +.TP +.B \-c +Do not attempt to translate any characters (like the Scandinavion/latin1 mode) +except when running in tt-font. .TP .B \-u -Don't make any attempts to find special Scandinavian characters. -If such characters are in the text they will map to ``a'' and ``o''. -This is probably the default outside of Scandinavia. (The SA made -the decision when the program was installed.) +Toggle option to process certain latin1 characters. Use this if your output +devices supports latin1 cahracters. +Note this may interfere with -s. Best not to use -u and -s together. .TP .B \-s -Try to find the special Scandinavian characters that on most (?) +Toggle option to process the special Scandinavian characters that on most (?) terminals in Scandinavia are mapped to ``{|}[\\]''. -This can be the default, and output from files not containing these -special characters will be identical regardless of this option. +Note this may interfere with -u. Best not to use -u and -s together. +.TP +.B \-J +Auto detect NTT JTeX and ASCII pTeX dvi format. +.TP +.B \-N +Display NTT JTeX dvi. +.TP +.B \-A +Display ASCII pTeX dvi. +.TP +.B \-bdelim +Print the name of fonts when switching to it (and ending it). The delim +argument is used to delimit the fontname. .SH FILES -/usr/ucb/more \ \ \ \ +/bin/more \ \ \ \ probably the default pager. .SH ENVIRONMENT PAGER \ \ \ \ \ \ \ \ \ \ \ \ the pager to use. .br DVI2TTY \ \ \ \ \ \ \ \ \ \ \ -can be set to hold commandline options. +can be set to hold command-line options. .SH "SEE ALSO" TeX, dvi2ps .SH AUTHOR -Svante Lindahl, Royal Institute of Technology, Stockholm +Original Pascal verion: Svante Lindahl, Royal Institute of Technology, Stockholm .br Improved C version: Marcel Mol .br -{seismo, mcvax}!enea!ttds!zap -.br -marcel@duteca.UUCP +marcel@mesa.nl, MESA Consulting .SH BUGS Blanks between words get lost quite easy. This is less likely if you are using a wider output than the default 80. .PP -Only one file may be specified on the commandline. +Only one file may be specified on the command line. + diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.DCL b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.DCL index 637a9c2000d..637a9c2000d 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.DCL +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.DCL diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.c index ede91b9e637..55196246275 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.c @@ -1,106 +1,41 @@ -/****************************************************************************** - * dvitty - get an ascii representation of a dvi-file, suitable for ttys - -This program was originally written in Pascal by -Svante Lindahl <svante dot lindahl (at) pantor dot com> -and then converted to C by Marcel Mol <marcel (at) mesa dot nl>. -Some changes have been made for TeX Live (see ./ChangeLog). - -It is released under the GNU GPL, version 2 or any later version. -(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=424018) - - * Marcel Mol: 1990-03-27 (UUCP: marcel@duteca.tudelft.nl) - * Fixed bug that causes the program to hang when it finds a - * fontname with an 's' in it not followed by an 'y'. - * Thanks to Paul Orgren (orgren@Stars.Reston.Unisys.COM). - * Marcel Mol: 1990-02-04 (UUCP: marcel@duteca.tudelft.nl) - * First attempt to recognize symbol fonts, so bullets (in - * itemized lists) are translated to a proper character instead - * an awfull ligature. - * Version 4.0. - * Marcel Mol: 1990-02-01 (UUCP: marcel@duteca.tudelft.nl) - * Included port to VMS (off Joseph Vasallo and Seppo Rantala) - * into latest version. Hope things still work, cannot test it ... - * Joseph Vasallo & Seppo Rantala: 1989-09-05 (Internet: rantala@tut.FI) - * Ported to work under VAX/VMS V4.4 & VAXC V2.4 or higher. - * Fixed bugs in using Swedish/Finnish characters. - * Marcel Mol: 1989-02-14 (UUCP: duteca!marcel) - * Fixed check for .dvi extension. - * Allowed more ligatures. - * Fixed side effect bugs (2 gets as function arguments). - * Version 3.2. - * Marcel Mol: 1989-01-19 (UUCP: duteca!marcel) - * Changed in option handling, no change - * in user interface (only the undocumented - * feature -e). - * Version 3.1. - * Marcel Mol: 1989-01-11 (UUCP: duteca!marcel) - * Changed some longs to ints. - * It now also runs on MSDOS Microsoft C 5.1 - * New version: 3.0 - * Marcel Mol: 1989-01-03 (UUCP: duteca!marcel) - * Fixed a bugs concerning pager programs - * and scanning environment variable DVI2TTY. - * Marcel Mol: 1988-10-25 (UUCP: duteca!marcel) - * dvi2tty.c dvi2tty.h dvistuff.c commands.h - * Converted program to C. - * improved spacing between words/characters. - * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-08-15 20:24:31, - * Version to be sent to mod.sources ready. - * New option since last version: - * -Fprog Pipe output to prog. Can be used to get a different - * pager than the default. - * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-01-13 21:49:31, - * Environment variable DVITTY is read and options can be set from it. - * These are the currently implemented options: - * -ofile Write output to file, else write to stdout, - * possibly piped through a pager if stdout is a tty. - * -plist Print pages whos TeX-page-number are in list. - * List is on the form 1,3:6,8 to choose pages - * 1,3-6 and 8. TeX-nrs can be negative: -p-1:-4,4 - * -Plist Print pages whos sequential number are in list. - * -wn Print the lines with width n characters, default is - * 80. Wider lines gives better results. - * -q Don't try to pipe to a pager. - * -f Try to pipe to a pager if output is a tty. - * -Fname Specify a pager program. - * Default of -q and -f is a compile time option, a constant. - * -l Write '^L' instead of formfeed between pages. - * -u Don't try to find Scandinavian characters (they will - * print as a:s and o:s if this option is choosen). - * -s Scandinavian characters printed as }{|][\. - * Default of -s and -u is a compile time option, a constant. - * bogart:/usr/alla/zap/dvitty/dvitty.p 1986-01-10 18:51:03, - * Argument parsing, and random access functions (external, in C) - * and other OS-dependent stuff (in C). Removed private 'pager' & - * tries to pipe through PAGER (environment var) or, if PAGER not - * defined, /usr/ucb/more. Some changes for efficency. - * bogart:/usr/alla/svante/dvitty/dvitty.p 1985-07-15 20:51:00, - * The code for processing dvi-files running on UNIX (UCB-Pascal) - * but no argument parsing. - * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.140, 30-Mar-85 05:43:56, - * Edit: Svante Lindahl - * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.136, 15-Jan-85 13:52:59, - * Edit: Svante Lindahl, final Twenex version !!!?? - * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.121, 14-Jan-85 03:10:22, - * Edit: Svante Lindahl, cleaned up and fixed a lot of little things - * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.25, 15-Dec-84 05:29:56, - * Edit: Svante Lindahl, COMND-interface, including command line scanning - * VERA::SS:<SVANTE-LINDAHL.WORK>DVITTY.PAS.23, 10-Dec-84 21:24:41, - * Edit: Svante Lindahl, added command line scanning with Rscan-JSYS - * VERA::<SVANTE-LINDAHL.DVITTY>DVITTY.PAS.48, 8-Oct-84 13:26:30, - * Edit: Svante Lindahl, fixed switch-parsing, destroyed by earlier patches - * VERA::<SVANTE-LINDAHL.DVITTY>DVITTY.PAS.45, 29-Sep-84 18:29:53, - * Edit: Svante Lindahl +/* + * dvi2tty + * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> + * + * 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. * */ +/* + * Include files + */ #include "dvi2tty.h" #if defined(VMS) -#include unixio +# include unixio #endif +#if defined(THINK_C) +# include <unix.h> +# include "macintosh.h" +#endif + + +/* + * Constant definitons + */ /*-----------------------------------------------------------------------*/ /* The following constants may be toggled before compilation to */ /* customize the default behaviour of the program for your site. */ @@ -108,21 +43,23 @@ It is released under the GNU GPL, version 2 or any later version. /* runtime. */ /*-----------------------------------------------------------------------*/ -#define DEFSCAND FALSE /* default is Scandinavian, toggle this if you */ - /* don't have terminals with Scand. nat. chars */ +#define DEFSCAND FALSE /* default is not Scandinavian, toggle this if */ + /* you have terminals with Scand. nat. chars */ +#define DEFLATIN1 FALSE /* default is no latin1, toggle this if you */ + /* have terminals with latin1 chars */ #define WANTPAGER TRUE /* default: try to pipe through a pager (like */ /* more) if stdout is tty and no -o switch */ -#define DEFPAGER "more" /* CHANGE TO YOUR LOCAL PAGER */ +#define DEFPAGER "more" /* CHANGE TO YOUR LOCAL PAGER */ /*------------------ end of customization constants ---------------------*/ #define MAXLEN 100 /* size of char-arrays for strings */ -#if defined(MSDOS) || defined(VMS) -#define OPTSET "wepPousl" /* legal options */ -#define OPTWARG "wepPo" /* options with argument */ +#if defined(MSDOS) || defined(VMS) || defined(AMIGA) +#define OPTSET "haJwepPousltvbcAN" /* legal options */ +#define OPTWARG "wepPovb" /* options with argument */ #else -#define OPTSET "wepPousqlfF"/* legal options */ -#define OPTWARG "wepPoF" /* options with argument */ +#define OPTSET "haJwepPousqlfFtvbcAN"/* legal options */ +#define OPTWARG "wepPoFvb" /* options with argument */ #endif /* @@ -138,12 +75,20 @@ It is released under the GNU GPL, version 2 or any later version. #define bdopt 7 /* bad option */ #define onepp 8 /* only one page list allowed */ #define noarg 9 /* argument expected */ - -#if 0 -char *dvi2tty = "@(#) dvi2tty.c 4.1 27/03/90 M.J.E. Mol (c) 1989, 1990"; +#define confl 10 /* -N and -A conflict */ +#define confj 11 /* -J conflicts -N or -A */ +#if defined(THINK_C) +#define nored 12 /* if no input file, redirect stdin */ #endif -/*---------------------------------------------------------------------------*/ + +/* + * Variable definitions + */ + +const char *dvi2tty = "@(#) dvi2tty.c 5.3.3 20101030 M.J.E. Mol (c) 1989-2010"; +#define VERSION 5.3.3 + printlisttype * currentpage; /* current page to print */ printlisttype * firstpage; /* first page selected */ @@ -152,11 +97,14 @@ printlisttype * lastpage; /* last page selected */ FILE * DVIfile; FILE * output; bool outputtofile; /* tells if output goes to file or stdout */ +#if defined(THINK_C) +bool inputfromfile; /* tells if input comes from file or stdin */ +#endif int ttywidth; /* max nr of chars per printed line */ int espace; /* to fake calcs with ttywidth */ long foo; /* utility variable, "register" */ -#if !defined(MSDOS) && !defined(VMS) +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) bool pager; /* tells if output is piped to a pager */ const char * path; /* name of the pager to run */ #endif @@ -167,67 +115,94 @@ char DVIfilename[MAXLEN]; const char * OUTfilename; char optch; /* for option handling */ -/*---------------------------------------------------------------------------*/ - -#if defined(KPATHSEA) || defined(MSDOS) -int main (int, char **); -void setoption (const char *); -void getargs (void); -void getpages (int, const char *); -void plcnxt (int); -void getfname (const char *); -int getinteger (int *, int *, const char *); -void usage (int); + + +/* + * Function declarations + */ + +#if defined(MSDOS) +void setoption (const char *); +void getargs (void); +void getpages (int, const char *); +void plcnxt (int); +void getfname (const char *); +int getinteger(int *, int *, const char *); +int getlong (long *, int *, const char *); +void usage (int); #else -char * getenv (); -FILE * popen (); -int main (); -void setoption (); -void getargs (); -void getpages (); -void plcnxt (); -void getfname (); -int getinteger(); -void usage (); +# if defined(VMS) + main (int argc, char ** argv); +# endif +void setoption (const char * optarg); +void getargs (void); +void getpages (int j, const char * str); +void plcnxt (int pagnr); +void getfname (const char * str); +int getinteger(int * dest, int * j, const char * str); +int getlong (long * dest, int * j, const char * str); +void usage (int uerr); #endif + /****************************************************************************/ /* */ /* M A I N */ /* */ /****************************************************************************/ +#if defined(VMS) +main(int argc, char **argv) +#else int main(int argc, char **argv) +#endif { +#if defined(THINK_C) + argc = process_dvi_command_line(&argv); +#endif + progname = *argv; Argc = argc; Argv = argv; getargs(); /* read command line arguments */ -#if defined(DOSISH) - if ((DVIfile = fopen(DVIfilename, "rb")) == NULL) -#else -#if defined(VMS) - if ((DVIfile = fopen(DVIfilename, "r","ctx=rec")) == NULL) +#if defined(THINK_C) + if (inputfromfile) { +#endif +#if defined(MSDOS) || defined(WIN32) + if ((DVIfile = fopen(DVIfilename, "rb")) == NULL) #else - if ((DVIfile = fopen(DVIfilename, "r")) == NULL) +# if defined(VMS) + if ((DVIfile = fopen(DVIfilename, "r","ctx=rec")) == NULL) +# else + if ((DVIfile = fopen(DVIfilename, "r")) == NULL) +# endif #endif + errorexit(filop); /* can't open dvifile */ +#if defined(THINK_C) + } + else + DVIfile = stdin; #endif - errorexit(filop); /* can't open dvifile */ if (outputtofile) { /* open the outfile, if needed */ if ((output = fopen(OUTfilename, "w")) == NULL) errorexit(filcr); -#if !defined(MSDOS) && !defined(VMS) +#if defined(THINK_C) + else + set_creator((unsigned char*) OUTfilename); +#endif + +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) pager = FALSE; #endif } else { output = stdout; -#if !defined(MSDOS) && !defined(VMS) - if (isatty(fileno(output)) && pager) { /* try to pipe to a pager */ +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) + if (pager && isatty(fileno(output))) { /* try to pipe to a pager */ if ((output = popen(path, "w")) == NULL) /* get pipe to pager */ errorexit(pipcr); /* make output to output */ } @@ -238,79 +213,20 @@ int main(int argc, char **argv) dvimain(); -#if !defined(MSDOS) && !defined(VMS) +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) if (pager) pclose(output); /* close pipe to pager */ #endif - return 0; + exit(0); } /* main */ -/*----------------------------------------------------------------------------*/ -void setoption(const char *optarg) -{ - int j = 0; - - while (strchr(OPTSET, optch) != NULL) { - switch (optch) { -#if !defined(MSDOS) && !defined(VMS) - case 'q' : pager = FALSE; break; - case 'f' : pager = TRUE; break; -#endif - case 'l' : noffd = TRUE; break; - case 's' : scascii = TRUE; break; - case 'u' : scascii = FALSE; break; - case 'P' : - sequenceon = TRUE; /* fall through */ - case 'p' : - if (pageswitchon) - usage(onepp); - getpages(j, optarg); - break; - case 'w' : - if (getinteger(&ttywidth, &j, optarg)) - usage(nan); - if (optarg[j] != '\0') - usage(gae); - if ((ttywidth < 16) || (ttywidth > 132)) - usage(wrnge); - break; - case 'e' : - if (getinteger(&espace, &j, optarg)) - usage(nan); - if (optarg[j] != '\0') - usage(gae); - break; - case 'o' : - OUTfilename = optarg; - outputtofile = TRUE; - j = strlen(optarg); - break; -#if !defined(MSDOS) && !defined(VMS) - case 'F' : - pager = TRUE; - path = optarg; - j = strlen(optarg); - break; -#endif - default : - usage(bdopt); - } - if ((optch = optarg[j]) == '\0') - break; - j++; - if ((strchr(OPTWARG, optch) != NULL) && (optarg[j]=='\0')) { - if (--Argc <= 0) - usage(noarg); - optarg = *++Argv; - j = 0; - } - } -} /* setoption */ -/*----------------------------------------------------------------------------*/ +/* + * GETARGS -- Process options from command line and from environment. + */ void getargs(void) { @@ -318,33 +234,68 @@ void getargs(void) char *envp; bool DVIfound; /* if a dvi filename found */ +#if !defined(THINK_C) if (Argc <= 1) usage(ign); +#endif pageswitchon = FALSE; /* show all pages */ sequenceon = FALSE; /* selected pages are TeX-numbered */ outputtofile = FALSE; /* write to stdout */ -#if !defined(MSDOS) && !defined(VMS) +#if defined(THINK_C) + inputfromfile = FALSE; /* read from stdin */ +#endif +#if !defined(MSDOS) && !defined(VMS) && !defined (THINK_C) && !defined(AMIGA) pager = WANTPAGER; /* want paging, compile time option */ #endif + accent = TRUE; /* show all accent etc. as extra char */ + ttfont = FALSE; /* assume tt font (verbatim mode) */ noffd = FALSE; /* print formfeed between pages */ scascii = DEFSCAND; /* scandinavian, compile time option */ + latin1 = DEFLATIN1; /* latin1 support, compile time option */ ttywidth = 80; /* default terminal width */ espace = 0; /* to fake ttywith calcs */ DVIfound = FALSE; + printfont = FALSE; /* do not print font switches */ + allchar = FALSE; /* do not put out all characters */ -#if !defined(MSDOS) && !defined(VMS) +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) if ((path = getenv("PAGER")) == NULL) /* find default pathname of page */ path = DEFPAGER; /* program in case paging is wanted */ #endif - if ((envp = getenv("DVI2TTY")) != NULL) { + /* + * + * With VAX-C under VMS getenv normally searches the environment array + * looking for the variables HOME, TERM, PATH, and USER. In certain + * situations getenv attempts to first perform a logical name translation + * if none of the environment array strings are matched and then trying + * to translate a CLI symbol. Unfortunately we need a CLI symbol defined + * as; + * + * dvi2tty :== $path:dvi2tty.exe + * + * to invoke dvi2tty with command line arguments as it would be invoked + * under Unix. So we use the logical DVI$DVI2TYY as the environment + * variable from which options may be set. + * + */ + + /* + * First process environment variable. + */ + +#if defined(VMS) + if ((envp = getenv("DVI$DVI2TTY")) != NULL) { +#else + if ((envp = getenv("DVI2TTY")) != NULL) { /* } keep vi happy */ +#endif while (*envp == ' ') envp++; while (*envp) { /* environment var args */ if (strchr(OPTSET, optch = *envp++) != NULL) { /* - * we always pass one option, and arrange for optarg ourselfves, + * we always pass one option, and arrange for optarg ourselfes, * so setoption does not mesh up Argv */ if (strchr(OPTWARG, optch) != NULL) { @@ -369,12 +320,19 @@ void getargs(void) } } + /* + * Now process command line options. + */ + while (--Argc > 0) { /* command line args */ str = *++Argv; if (*str != '-') { /* argument is not an option */ if (DVIfound) /* only one dvi file allowed */ usage(onef); getfname(str); +#if defined(THINK_C) + inputfromfile = +#endif DVIfound = TRUE; } else if (strchr(OPTSET, optch = *++str) != NULL) { @@ -391,11 +349,111 @@ void getargs(void) } if (!DVIfound) +#if defined(THINK_C) /* Allow use of stdin for */ + if (isatty(fileno(stdin))) + usage(nored); /* Mac, if redirected */ +#else usage(ign); +#endif + + return; } /* getargs */ -/*---------------------------------------------------------------------------*/ + + +/* + * SETOPTION -- Process an option. + */ + +void setoption(const char *optarg) +{ + int j = 0; + + while (strchr(OPTSET, optch) != NULL) { + switch (optch) { + case 'h' : usage(ign); break; +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) + case 'q' : pager = FALSE; break; + case 'f' : pager = TRUE; break; + case 'F' : pager = TRUE; + path = optarg; + j = strlen(optarg); + break; +#endif + /* case 'J' : japan = TRUE; break; */ + case 'J' : jautodetect = TRUE; break; + case 'A' : asciip = TRUE; break; /* ASCII pTeX */ + case 'N' : japan = TRUE; break; /* NTT jTeX */ + case 't' : ttfont = TRUE; break; + case 'l' : noffd = TRUE; break; + case 's' : scascii ^= 1; break; + case 'u' : latin1 ^= 1; break; + case 'a' : accent = FALSE; break; + case 'c' : allchar = TRUE; break; + case 'P' : sequenceon = TRUE; /* fall through */ + case 'p' : if (pageswitchon) + usage(onepp); + getpages(j, optarg); + break; + case 'w' : if (getinteger(&ttywidth, &j, optarg)) + usage(nan); + if (optarg[j] != '\0') + usage(gae); + if ((ttywidth < 16) || (ttywidth > MAXTERMWIDTH)) + usage(wrnge); + break; + case 'e' : if (getinteger(&espace, &j, optarg)) + usage(nan); + if (optarg[j] != '\0') + usage(gae); + break; + case 'v' : if (getlong(&lineheight, &j, optarg)) + usage(nan); + if (optarg[j] != '\0') + usage(gae); + /* lineheight *= 65536L; */ + /* want to specify in pt, but have no getfloat */ + break; + case 'o' : OUTfilename = optarg; + outputtofile = TRUE; + j = strlen(optarg); + break; + case 'b' : printfont = TRUE; + delim = optarg; + if (!strlen(optarg)) + printfont = FALSE; + break; + default : usage(bdopt); + } + if ((optch = optarg[j++]) == '\0') + break; + if ( (optarg[j] == '\0') && (strchr(OPTWARG, optch) != NULL) ) { + if (--Argc <= 0) + usage(noarg); + optarg = *++Argv; + j = 0; + } + } + + /* Option conflict */ + if (japan && asciip) { + usage(confl); + } + + if (jautodetect && (japan || asciip)) { + usage(confj); + } + + return; + +} /* setoption */ + + + +/* + * GETPAGES -- Getr a list of pages to print. + */ void getpages(int j, const char *str) { @@ -448,11 +506,19 @@ void getpages(int j, const char *str) } currentpage = firstpage; + return; + } /* getpages */ -void plcnxt(int pagnr) /* place page-nr next in list */ + +/* + * PLCNXT -- Place page-nr next in list. + */ + +void plcnxt(int pagnr) { + currentpage = lastpage; currentpage->pag = pagnr; lastpage = (printlisttype *) malloc(sizeof(printlisttype)); @@ -461,53 +527,55 @@ void plcnxt(int pagnr) /* place page-nr next in list */ lastpage->pag = 0; currentpage->nxt = lastpage; + return; + } /* plcnxt */ -/*----------------------------------------------------------------------------*/ + #ifdef KPATHSEA -#ifdef __DJGPP__ -/* `stat' is way too expensive for such a simple job. */ -#define READABLE(fn, st) \ - (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) +# ifdef __DJGPP__ + /* `stat' is way too expensive for such a simple job. */ +# define READABLE(fn, st) \ + (access (fn, R_OK) == 0 && access (fn, D_OK) == -1) #else -#define READABLE(fn, st) \ - (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) +# define READABLE(fn, st) \ + (access (fn, R_OK) == 0 && stat (fn, &(st)) == 0 && !S_ISDIR (st.st_mode)) #endif static char * readable_file(char *name) { - char *ret; + char *ret; #ifdef WIN32 - unsigned int fa; - - fa = GetFileAttributes(name); - if (fa == 0xFFFFFFFF) { - ret = NULL; - } - else if ((fa & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) { - ret = NULL; - } - else { - ret = (string) name; - } + unsigned int fa; + + fa = GetFileAttributes(name); + if (fa == 0xFFFFFFFF) + ret = NULL; + else if ((fa & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY) + ret = NULL; + else + ret = name; #else /* ! WIN32 */ - struct stat st; + struct stat st; - if (READABLE (name, st)) { - ret = (string) name; - - } else { /* Some other error. */ - ret = NULL; - } + if (READABLE (name, st)) + ret = name; + else /* Some other error. */ + ret = NULL; #endif - return ret; - + return ret; } #endif + + +/* + * GETFNAME -- {Make sure we have a .dvi filename. + */ + void getfname(const char *str) { int i; @@ -517,21 +585,23 @@ void getfname(const char *str) usage(ign); strcpy(DVIfilename, str); #ifdef KPATHSEA - if (readable_file(DVIfilename)) - return; - - strcat(DVIfilename, ".dvi"); - + if (!readable_file(DVIfilename)) #else - if (!((i >= 5) && (str[i-1] == 'i') && (str[i-2] == 'v') && - (str[i-3] == 'd') && (str[i-4] == '.'))) { + if ((i < 5) || strcmp(str+i-4, ".dvi")) strcat(DVIfilename, ".dvi"); - } #endif + return; + } /* getfname */ -/*----------------------------------------------------------------------------*/ + + + +/* + * GETINTEGER -- Convert ascii to an integer. I'm sure there is a library + * call for it. + */ int getinteger(int *dest, int *j, const char *str) { @@ -546,6 +616,7 @@ int getinteger(int *dest, int *j, const char *str) } else sgn = 1; + if ((ch >= '0') && (ch <= '9')) { cum = 0; while ((ch >= '0') && (ch <= '9')) { @@ -553,13 +624,55 @@ int getinteger(int *dest, int *j, const char *str) ch = str[++(*j)]; } *dest = sgn * cum; + return 0; /* return ok */ } + return 1; /* return error */ } /* getinteger */ -/*----------------------------------------------------------------------------*/ + + +/* + * GETLONG -- Convert ascii to a long. I'm sure there is a library + * call for it. + */ + +int getlong(long *dest, int *j, const char *str) +{ + long cum; + int sgn; + char ch; + + ch = str[*j]; + if (ch == '-') { + sgn = -1; + ch = str[++(*j)]; + } + else + sgn = 1; + + if ((ch >= '0') && (ch <= '9')) { + cum = 0; + while ((ch >= '0') && (ch <= '9')) { + cum = cum*10L + ch - '0'; + ch = str[++(*j)]; + } + *dest = (long) sgn * cum; + + return 0; /* return ok */ + } + + return 1; /* return error */ + +} /* getinteger */ + + + +/* + * ERROREXIT -- Exit program with an erro message. + */ void errorexit(int errorcode) { @@ -606,7 +719,7 @@ void errorexit(int errorcode) break; case filcr : fprintf(stderr, "Cannot create outfile\n"); break; -#if !defined(MSDOS) && !defined(VMS) +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) case pipcr : fprintf(stderr, "Cannot create pipe to pager\n"); break; #endif @@ -619,23 +732,31 @@ void errorexit(int errorcode) #else unlink(OUTfilename); #endif + exit(errorcode); } /* errorexit */ -/*----------------------------------------------------------------------------*/ + + +/* + * USAGE -- Print the usage info. Also print a warning/error message + * if needed. + */ void usage(int uerr) { + fprintf(stderr, "%s", Copyright); + if (uerr != ign) { - fprintf(stderr,"%s: ", progname); + fprintf(stderr,"\n%s: ", progname); switch (uerr) { - case ign : fprintf(stderr, "%s", Copyright); - break; - case wrnge : fprintf(stderr, "width arg out of range:16-132"); + case wrnge : fprintf(stderr, "width arg out of range:16-%d", + MAXTERMWIDTH); break; - case nan : fprintf(stderr, "numeric argument expected for option %c", + case nan : fprintf(stderr, + "numeric argument expected for option %c", optch); break; case gae : fprintf(stderr, "garbage in argument for option %c", @@ -645,29 +766,51 @@ void usage(int uerr) break; case onef : fprintf(stderr, "only one infile argument allowed"); break; - case noarg : fprintf(stderr, "option argument expected for option %c", + case noarg : fprintf(stderr, + "option argument expected for option %c", optch); break; case bdopt : fprintf(stderr, "bad option %c", optch); break; case onepp : fprintf(stderr, "only one pagelist allowed"); break; + case confl : fprintf(stderr, "-N and -A are conflicting"); + break; + case confj : fprintf(stderr, "-J conflicts -N or -A"); + break; +#if defined(THINK_C) + case nored : fprintf(stderr, "\nIf no input file is given in\ + command string,\n\Standard Input must be redirected with the radio button."); + break; +#endif default : fprintf(stderr, "unknown usage error"); break; } fprintf(stderr, "\n"); } - fprintf(stderr, "Usage: %s [ options ] dvifile[.dvi]\n", progname); + + fprintf(stderr, "\n%s\n\n", dvi2tty); +#if defined(THINK_C) + fprintf(stderr, "Usage: %s [ options ] [<dvi-file>[.dvi]]\n", progname); + fprintf(stderr, "Read input from <dvi-file>, else read from Standard Input,\ +\nwhich must be redirected by means of the radio button.\n"); +#else + fprintf(stderr, "Usage: %s [ options ] <dvi-file>[.dvi]\n", progname); +#endif fprintf(stderr, "Options are:\n"); fprintf(stderr, " -ofile Write output to file, else write to stdout.\n"); fprintf(stderr, - " -plist Print pages whos TeX-page-number are in list.\n"); + " -plist Print pages whose TeX-page-number are in list.\n"); fprintf(stderr, - " -Plist Print pages whos sequential number are in list.\n"); + " -Plist Print pages whose sequential number are in list.\n"); fprintf(stderr, " -wn Print the lines with width n characters, default 80.\n"); -#if !defined(MSDOS) && !defined(VMS) + fprintf(stderr, + " -vn Use n for vertical line height, default 450000.\n"); + fprintf(stderr, + " -evalue Add/Substract this value for spacing (-20..20)\n"); +#if !defined(MSDOS) && !defined(VMS) && !defined(THINK_C) && !defined(AMIGA) fprintf(stderr, " -f Try to pipe to a pager if output is a tty"); if (WANTPAGER) fprintf(stderr, " (default).\n"); @@ -681,19 +824,29 @@ void usage(int uerr) fprintf(stderr, " -Fprog Pipe output to pager prog.\n"); #endif fprintf(stderr, + " -a Remove accents grave etc. from output: \\'{e} -> e.\n"); + fprintf(stderr, + " -t Assuming that document was made with tt fonts\n"); + fprintf(stderr, " -l Write ''^L'' instead of formfeed between pages.\n"); fprintf(stderr, - " -u National Swedish/Finnish characters printed as aaoAAO"); - if (DEFSCAND) - fprintf(stderr, ".\n"); - else - fprintf(stderr, " (default).\n"); + " -s Toggle National Swedish/Finnish characters printed as aaoAAO (default %s).\n", DEFSCAND ? "off" : "on"); fprintf(stderr, - " -s National Swedish/Finnish characters printed as }{|][\\"); - if (DEFSCAND) - fprintf(stderr, " (default).\n"); - else - fprintf(stderr, ".\n"); + " -u Toggle latin1 support (default %s).\n", DEFLATIN1 ? "on" : "off"); + fprintf(stderr, + " -J Enable auto detect for NTT JTeX and ASCII pTeX (japanese fonts).\n"); + fprintf(stderr, + " -N Support NTT JTeX dvi.\n"); + fprintf(stderr, + " -A Support ASCII pTeX dvi.\n"); + fprintf(stderr, + " -c Override -a -u -s and print all characters 0-255.\n"); + fprintf(stderr, + " -bdelim Print font switch as text: delimcmr10miled\n"); + fprintf(stderr, " -h This help message.\n"); + fprintf(stderr, "\n If you like this code and want to support is feel free\n to donate at Paypal marcel@mesa.nl. Thanks.\n\n"); + + exit(uerr); } /* usage */ diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.h b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.h index 0dae38fce63..b3ad8146c32 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.h +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.h @@ -1,30 +1,56 @@ -#define Copyright "dvi2tty.c Copyright (C) 1984, 1985, 1986 Svante Lindahl.\n\ -Copyright (C) 1988 M.J.E. Mol 1989, 1990" +/* + * dvi2tty + * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> + * + * 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. + * + */ + +#define Copyright "dvi2tty Copyright (C) 1984, 1985, 1986 Svante Lindahl.\n\ +Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V." #include <stdio.h> #include <string.h> - -#include <sys/types.h> -#include <sys/stat.h> - -#if defined(MSDOS) -#define DOSISH #include <stdlib.h> -#include <malloc.h> +#if defined(MSDOS) +# include <malloc.h> +#else +# if !defined(THINK_C) +# include <unistd.h> +# endif #endif #if defined(KPATHSEA) -#define NO_DEBUG 1 -#include <kpathsea/config.h> +# define NO_DEBUG 1 +# include <kpathsea/config.h> +# include <sys/types.h> +# include <sys/stat.h> +#else +# define TRUE 1 +# define FALSE 0 #endif -#ifndef KPATHSEA -#define TRUE 1 -#define FALSE 0 -#endif #define nil NULL /* + * Define the maximum width of the terminal + * (this is also used to define the with of the line structure in dvistuff.c) + */ +#define MAXTERMWIDTH 332 + +/* * ERROR CODES , don't start with 0 */ @@ -51,7 +77,11 @@ Copyright (C) 1988 M.J.E. Mol 1989, 1990" #define pipcr 20 /* cannot creat pipe */ #endif -/*---------------------------------------------------------------------------*/ + + +/* + * Type definitions + */ typedef char bool; @@ -62,13 +92,25 @@ typedef struct prlistptr { /* list of pages selected for output */ struct prlistptr *nxt; /* next item in list */ } printlisttype; -/*---------------------------------------------------------------------------*/ + + +/* + * Variable definitions + */ extern bool outputtofile; /* output to file or stdout(dvi2tty.c)*/ extern bool pageswitchon; /* user-set pages to print(dvistuff.c)*/ extern bool sequenceon; /* not TeX pagenrs (dvistuff.c) */ extern bool scascii; /* Scand. nat. chars (dvistuff.c) */ +extern bool latin1; /* latin1 chars (dvistuff.c) */ +extern bool accent; /* Output accent stuff(dvistuff.c) */ +extern bool ttfont; /* tt font assumed (dvistuff.c) */ +extern bool japan; /* NTT jTeX font support (dvistuff.c) */ +extern bool asciip; /* ASCII pTeX font support (dvistuff.c) */ +extern bool jautodetect; /* Autodetect NTT jTex and ASCII pTeX (dvistuff.c) */ extern bool noffd; /* output ^L or formfeed (dvistuff.c) */ +extern bool printfont; /* include font switches (dvistuff.c) */ +extern bool allchar; /* output all characters (dvistuff.c */ extern printlisttype *currentpage; /* current page to print (dvi2tty.c) */ extern printlisttype *firstpage; /* first page selected (dvi2tty.c) */ @@ -77,15 +119,29 @@ extern printlisttype *lastpage; /* last page selected (dvi2tty.c) */ extern int ttywidth; /* screen width (dvi2tty.c) */ extern int espace; /* extra screen width (dvi2tty.c) */ extern long foo; /* temporary 'register' (dvi2tty.c) */ +extern long lineheight; /* height of a line (dvistuff.c) */ extern int opcode; /* dvi opcode (dvistuff.c) */ +extern const char * delim; /* printer font delim (dvistuff.c) */ extern FILE *DVIfile; /* dvi file (dvi2tty.c) */ extern FILE *output; /* output file (dvi2tty.c) */ -/*---------------------------------------------------------------------------*/ + + +/* + * Funtion declarations + */ /* dvi2tty.c */ +#if defined(MSDOS) void errorexit(int); +#else +void errorexit(int errorcode); +#endif /* dvistuff.c */ +#if defined(MSDOS) +void dvimain(void); +#else void dvimain(void); +#endif diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.lsm b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.lsm index a4b968a7ee7..1fe3c431d07 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.lsm +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.lsm @@ -4,7 +4,7 @@ Author = Svante Lindahl / Marcel Mol Maintainer = Marcel Mol Site1 = ftp.mesa.nl Location = /pub/dvi2tty/... -File1 = dvi2tty53.tgz +File1 = dvi2tty-5.3.3.tgz FileSize1 = CopyPolicy1 = Permision to distribute archive only CopyPolicy2 = with (c) notice intact diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.tex b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.tex index fc4eaceeaab..b33e48858fa 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvi2tty.tex +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvi2tty.tex @@ -180,19 +180,23 @@ to mark them with a form feed character. \item[{{\bf -c}}] Do not attempt to trnaslate any characters (like the Scandinavion mode) except when running in tt-font. -\item[{{\bf -u}}] -Don't make any attempts to find special Scandinavian characters. -If such characters are in the text they will map to ``a'' and ``o''. -This is probably the default outside of Scandinavia. (The SA made -the decision when the program was installed.) \item[{{\bf -bdelim}}] Print the name of fonts when switching to it (and ending it). The delim argument is used to delimit the fontname. +\item[{{\bf -u}}] +Toggle option to process certain latin1 characters. Use this if your output +devices supports latin1 cahracters. +Note this may interfere with -u. Best not to use -u and -s together. \item[{{\bf -s}}] -Try to find the special Scandinavian characters that on most (?) +Toggle option to process the special Scandinavian characters that on most (?) terminals in Scandinavia are mapped to ``\{$|$\}[\bs ]''. -This can be the default, and output from files not containing these -special characters will be identical regardless of this option. +Note this may interfere with -u. Best not to use -u and -s together. +\item[{{\bf -J}}] +Auto detect NTT JTeX and ASCII pTeX dvi format. +\item[{{\bf -N}}] +Display NTT JTeX dvi. +\item[{{\bf -A}}] +Display ASCII pTeX dvi. \end{list} % % NOTE --- No other files are used under VMS. diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvistuff.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvistuff.c index a7f2ef10a3b..f40e2a48bf2 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/dvistuff.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/dvistuff.c @@ -1,16 +1,53 @@ +/* + * dvi2tty + * Copyright (C) 2003 Marcel J.E. Mol <marcel@mesa.nl> + * + * 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. + * + */ + +/* + * Include files + */ #include "dvi2tty.h" -#include <sys/types.h> -#include <sys/stat.h> + #if defined(VMS) -#include types.h -#include stat +# include types.h +# include stat +#else +# if defined(THINK_C) +# include <unix.h> +# else +# include <sys/types.h> +# include <sys/stat.h> +# endif #endif -#if defined(MSDOS) -#include <math.h> + +#if defined(MSDOS) || defined(THINK_C) +# include <math.h> #endif + #include "commands.h" + + +/* + * Constant definitions + */ + #if defined(VMS) #define mseek vmsseek #define ROUND(a) (a>=0.0 ? (int) (a + 0.5) : (int) (a - 0.5) ) @@ -21,9 +58,10 @@ #define VERSIONID 2 /* dvi version number that pgm handles */ #define VERTICALEPSILON 450000L /* crlf when increasing v more than this */ -#define rightmargin 152 /* nr of columns allowed to the right of h=0*/ +#define rightmargin MAXTERMWIDTH+20 + /* nr of columns allowed to the right of h=0*/ #define leftmargin -50 /* give some room for negative h-coordinate */ -#define LINELEN 203 /* rightmargin - leftmargin + 1 */ +#define LINELEN rightmargin - leftmargin + 1 #define MOVE TRUE /* if advancing h when outputing a rule */ #define STAY FALSE /* if not advancing h when outputing a rule */ @@ -49,11 +87,19 @@ #define sget3() snum(3) #define sget4() snum(4) -#if 0 -char *dvistuff = "@(#) dvistuff.c 4.1 27/03/90 M.J.E. Mol (c) 1989, 1990"; +#if !defined(JIS) +# define JIS 1 /* if 0 then EUC or SJIS */ +#endif +#if !defined(SJIS) +# define SJIS 0 /* if !JIS, 0 then EUC */ #endif -/*---------------------------------------------------------------------------*/ + +/* + * Structure and variable definitions + */ + +const char *dvistuff = "@(#) dvistuff.c 5.3.3 20101027 M.J.E. Mol (c) 1989-2010"; typedef struct { long hh; @@ -69,22 +115,41 @@ typedef struct lineptr { /* the lines of text to be output to outfile */ int charactercount; /* pos of last char on line */ struct lineptr *prev; /* preceding line */ struct lineptr *next; /* succeeding line */ - char text[LINELEN+1]; /* leftmargin...rightmargin */ + unsigned char text[LINELEN+1]; /* leftmargin...rightmargin */ } linetype; typedef struct _font { long num; struct _font * next; char * name; + char flags; /* to store font types, to get rid of japan/asciip/ttfont/symbolfon/mifont vars */ + int fontnum; /* helper for japanese fonts */ } font; +#define SYMFONT 0x01 +#define TTFONT 0x02 +#define MIFONT 0x04 +#define JAPFONT 0x08 +#define JASCFONT 0x10 -/*---------------------------------------------------------------------------*/ bool pageswitchon; /* true if user-set pages to print */ bool sequenceon; /* false if pagesw-nrs refers to TeX-nrs */ bool scascii; /* if true make Scand. nat. chars right */ +bool latin1; /* if true make latin1 chars right */ +bool accent; /* if true output accents etc: \'{e} etc. */ +bool ttfont = FALSE; /* if true we assumed ttfonts, not cmr */ +bool symbolfont = FALSE; /* true if font is a symbol font */ +bool japan = FALSE; /* switch to NTT japanese fonts ... */ +bool asciip = FALSE; /* switch to ASCII japanese fonts ... */ +bool jautodetect = FALSE; /* switch if do auto detection of Japanese TeX */ +bool jdetect = FALSE; /* switch if Japanese TeX detection is done */ +bool mifont = FALSE; /* ASCII japanese font ??? */ bool noffd; /* if true output ^L instead of formfeed */ +const char *delim; /* -bdelim for font switch printing */ +bool printfont; /* true if user wants font switches printed */ +bool allchar; /* true if user sets all characters */ + /* overrides sscasci, accent */ int opcode; /* dvi-opcodes */ @@ -98,6 +163,8 @@ int stackmax; /* stacksize required */ long maxpagewidth; /* width of widest page in file */ long charwidth; /* aprox width of character */ +long lineheight = VERTICALEPSILON; + /* aprox height of a line */ linetype * currentline; /* pointer to current line on current page */ linetype * firstline; /* pointer to first line on current page */ @@ -108,11 +175,24 @@ stackitem * stack; /* stack for dvi-pushes */ int sptr; /* stack pointer */ font * fonts = NULL; /* List of fontnames defined */ -int symbolfont = FALSE; /* true if font is a symbol font */ +font * fnt = NULL; /* Current font */ + +#if JIS +# define SJIS 0 +int inkanji = 0; /* is in kanji sequence */ +# define KANJIIN "\033$B" /* was $@ in debian 5.1-13 patch.. */ +# define KANJIOUT "\033(J" +#endif +int kanji1 = 0; /* is first kanji character */ +int kanji2 = 0; /* is second kanji character */ + -/*---------------------------------------------------------------------------*/ -#if defined(KPATHSEA) || defined(MSDOS) +/* + * Function definitions + */ + +#if defined(MSDOS) void postamble (void); void preamble (void); void walkpages (void); @@ -125,43 +205,52 @@ void rule (bool, long, long); void ruleaux (long, long, char); long horizontalmove (long); int skipnops (void); -linetype * texlive_getline (void); +linetype * my_getline (void); linetype * findline (void); unsigned long num (int); long snum (int); -void dochar (char); -void symchar (char); -void normchar (char); +void dochar (unsigned char); +void symchar (unsigned char); +void normchar (unsigned char); void outchar (unsigned char); void putcharacter (long); void setchar (long); void fontdef (int); void setfont (long); +void jischar (unsigned long); +int compute_jis (int, unsigned int, unsigned int *, unsigned int *); +void dokanji (unsigned long); +int getjsubfont (char *); + #else -void postamble (); -void preamble (); -void walkpages (); -void initpage (); -void dopage (); -void skippage (); -void printpage (); -bool inlist (); -void rule (); -void ruleaux (); -long horizontalmove (); -int skipnops (); -linetype * texlive_getline (); -linetype * findline (); -unsigned long num (); -long snum (); -void dochar (); -void symchar (); -void normchar (); -void outchar (); -void putcharacter (); -void setchar (); -void fontdef (); -void setfont (); +void postamble (void); +void preamble (void); +void walkpages (void); +void initpage (void); +void dopage (void); +void skippage (void); +void printpage (void); +bool inlist (long pagenr); +void rule (bool moving, long rulewt, long ruleht); +void ruleaux (long rulewt, long ruleht, char ch); +long horizontalmove (long amount); +int skipnops (void); +linetype * my_getline (void); +linetype * findline (void); +unsigned long num (int size); +long snum (int size); +void dochar (unsigned char ch); +void symchar (unsigned char ch); +void normchar (unsigned char ch); +void outchar (unsigned char ch); +void putcharacter (long charnr); +void setchar (long charnr); +void fontdef (int x); +void setfont (long fntnum); +void jischar (unsigned long ch); +void compute_jis (int f, unsigned int c, unsigned int * ku, unsigned int * ten); +void dokanji (unsigned long ch); +int getjsubfont (char * s); #if defined(VMS) long vmsseek (); long vms_ftell (); @@ -169,41 +258,51 @@ long vms_ungetc (); #endif #endif -/*---------------------------------------------------------------------------*/ -/*---------------------------------------------------------------------------*/ + /* - * The main function for processing the dvi file. - * Here we assume there are to file pointers: DVIfile and output. - * Also we have a list of pages pointed to by 'currentpage', - * which is only used (in 'inlist()') when a page list is given. + * DVIMAIN -- The main function for processing the dvi file. + * Here we assume there are to file pointers: DVIfile and output. + * Also we have a list of pages pointed to by 'currentpage', + * which is only used (in 'inlist()') when a page list is given. */ void dvimain(void) { postamble(); /* seek and process the postamble */ - /* note that walkpages *must* immediately follow preamble */ preamble(); /* process preamble */ + /* note that walkpages *must* immediately follow preamble */ walkpages(); /* time to do the actual work! */ + return; + } /* dvimain */ -/*---------------------------------------------------------------------------*/ -void postamble(void) /* find and process postamble, use random access */ + /* + * POSTAMBLE -- Find and process postamble, use random access + */ + +void postamble(void) { register long size; register int count; +#if !defined (THINK_C) struct stat st; +#endif +#if defined (THINK_C) + size = DVIfile->len; +#else fstat (fileno(DVIfile), &st); size = (long) st.st_size; /* get size of file */ +#endif + count = -1; do { /* back file up past signature bytes (223), to id-byte */ - if (size == 0) + if (size-- == 0) errorexit(nopst); - size--; mseek(DVIfile, size, absolute); opcode = (int) get1(); count++; @@ -215,7 +314,7 @@ void postamble(void) /* find and process postamble, use random access */ if (opcode != VERSIONID) errorexit(badid); mseek(DVIfile, size-4, absolute); /* back up to back-pointer */ - mseek(DVIfile, sget4(), absolute); /* and to start of postamble */ + mseek(DVIfile, sget4(), absolute); /* and to start of postamble */ if (get1() != POST) errorexit(nopst); mseek(DVIfile, 20L, relative); /* lastpageoffset, numerator, denominator */ @@ -229,11 +328,17 @@ void postamble(void) /* find and process postamble, use random access */ /* get2() -- totalpages */ /* fontdefs do fontdefs in flight ... */ + return; + } /* postamble */ -/*---------------------------------------------------------------------------*/ -void preamble(void) /* process preamble, use random access */ + +/* + * PREAMBLE --process preamble, use random access + */ + +void preamble(void) { mseek(DVIfile, 0L, absolute); /* read the dvifile from the start */ @@ -245,45 +350,53 @@ void preamble(void) /* process preamble, use random access */ mseek(DVIfile, 12L, relative); /* numerator, denominator, magnification */ mseek(DVIfile, get1(), relative); /* skip job identification */ + return; + } /* preamble */ -/*----------------------------------------------------------------------------*/ -void walkpages(void) /* process the pages in the DVI-file */ + +/* + * WALKPAGES -- process the pages in the DVI-file + */ + +void walkpages(void) { register bool wantpage; pagecounter = 0L; while ((opcode = skipnops()) != POST) { + if (opcode != BOP) /* should be at start of page now */ errorexit(nobop); - else { - pagecounter++; - pagenr = sget4(); /* get TeX page number */ - mseek(DVIfile, 36L, relative); /* skip page header */ - backpointer = sget4(); /* get previous page offset */ - if (pageswitchon) - if (sequenceon) - wantpage = inlist(pagecounter); - else - wantpage = inlist(pagenr); - else - wantpage = TRUE; - if (wantpage) { - initpage(); - dopage(); - printpage(); - } - else { - skippage(); - } + pagecounter++; + pagenr = sget4(); /* get TeX page number */ + mseek(DVIfile, 36L, relative); /* skip page header */ + backpointer = sget4(); /* get previous page offset */ + if (pageswitchon) + wantpage = inlist(sequenceon ? pagecounter : pagenr); + else + wantpage = TRUE; + + if (wantpage) { + initpage(); + dopage(); + printpage(); } + else + skippage(); } + return; + } /* walkpages */ -/*---------------------------------------------------------------------------*/ + + +/* + * INITPAGE -- Setup a new, empty page. + */ void initpage(void) { @@ -291,14 +404,13 @@ void initpage(void) h = 0L; v = 0L; /* initialize coordinates */ x = 0L; w = 0L; y = 0L; z = 0L; /* initialize amounts */ sptr = 0; /* initialize stack */ - currentline = texlive_getline(); /* initialize list of lines */ + currentline = my_getline(); /* initialize list of lines */ currentline->vv = 0L; firstline = currentline; lastline = currentline; firstcolumn = rightmargin; if (pageswitchon) { - if ((sequenceon && (pagecounter != firstpage->pag)) || - (!sequenceon && (pagenr != firstpage->pag))) { + if ((sequenceon ? pagecounter : pagenr) != firstpage->pag) { if (noffd) fprintf(output, "^L\n"); else @@ -313,9 +425,16 @@ void initpage(void) putc(FORM, output); } + return; + } /* initpage */ -/*----------------------------------------------------------------------------*/ + + +/* + * DOPAGE -- Process the dvi file until an end-off-page. + * Build up a page image. + */ void dopage(void) { @@ -324,13 +443,13 @@ void dopage(void) if (opcode <= LASTCHAR) dochar((char) opcode); else if ((opcode >= FONT_00) && (opcode <= FONT_63)) - setfont(opcode - FONT_00); + setfont((long) opcode - FONT_00); else if (opcode > POST_POST) errorexit(illop); else switch (opcode) { - case SET1 : setchar(get1()); break; - case SET2 : setchar(get2()); break; + case SET1 : japan ? jischar(get1()) : setchar(get1());break; + case SET2 : asciip ? dokanji(get2()) : setchar(get2()); break; case SET3 : setchar(get3()); break; case SET4 : setchar(get4()); break; case SET_RULE : { long height = sget4(); @@ -356,9 +475,8 @@ void dopage(void) stack[sptr].zz = z; sptr++; break; - case POP : if (sptr == 0) /* pop */ + case POP : if (sptr-- == 0) /* pop */ errorexit(stkuf); - sptr--; h = stack[sptr].hh; v = stack[sptr].vv; w = stack[sptr].ww; @@ -414,11 +532,18 @@ void dopage(void) } } + return; + } /* dopage */ -/*----------------------------------------------------------------------------*/ -void skippage(void) /* skip past one page */ + +/* + * SKIPPAGE -- Scan the dvi file until an end-off-page. + * Skip this page. + */ + +void skippage(void) { register int opcode; @@ -480,11 +605,17 @@ void skippage(void) /* skip past one page */ } } + return; + } /* skippage */ -/*---------------------------------------------------------------------------*/ -void printpage(void) /* 'end of page', writes lines of page to output file */ + +/* + * PRINTPAGE -- 'end of page', writes lines of page to output file + */ + +void printpage(void) { register int i, j; register unsigned char ch; @@ -494,9 +625,9 @@ void printpage(void) /* 'end of page', writes lines of page to output file */ for (currentline = firstline; currentline != nil; currentline = currentline->next) { if (currentline != firstline) { - foo = ((currentline->vv - currentline->prev->vv)/VERTICALEPSILON)-1; + foo = ((currentline->vv - currentline->prev->vv)/lineheight)-1; if (foo > 3) - foo = 3; /* linespacings not too large */ + foo = 3; /* linespacings not too large */ for (i = 1; i <= (int) foo; i++) putc('\n', output); } @@ -505,18 +636,76 @@ void printpage(void) /* 'end of page', writes lines of page to output file */ for (i = firstcolumn, j = 1; i <= currentline->charactercount; i++, j++) { ch = currentline->text[i - leftmargin]; - if (ch >= SPACE) + + if (asciip) { + if (kanji1) { +#if !JIS && !SJIS + ch |= 0x80; +#endif + kanji2 = 1; + kanji1 = 0; + } + if (!kanji2 && ch > 127) { + kanji1 = 1; +#if JIS + if (!inkanji) { + inkanji = 1; + fprintf(output, KANJIIN); + } + ch &= 0x7f; +#endif + } +#if JIS + if (!kanji1 && !kanji2 && inkanji) { + fprintf(output, KANJIOUT); + inkanji = 0; + } +#endif + if (kanji1 && (j >= (int) foo) && + (currentline->charactercount > i+1)) { +#if JIS + if (inkanji) + fprintf(output, KANJIOUT); +#endif + fprintf(output, "*\n"); /* if line to large */ + fprintf(output, " *"); /* mark output */ +#if JIS + if (inkanji) + fprintf(output, KANJIIN); +#endif + j = 2; + } + } + + if (ch >= SPACE || allchar) putc(ch, output); if ((j > (int) foo) && (currentline->charactercount > i+1)) { +#if JIS + if (asciip && inkanji) + fprintf(output,KANJIOUT); +#endif fprintf(output, "*\n"); /* if line to large */ fprintf(output, " *"); /* mark output */ +#if JIS + if (asciip && inkanji) + fprintf(output, KANJIIN); +#endif j = 2; - } + } + if (asciip) + kanji2 = 0; } } putc('\n', output); } +#if JIS + if (asciip && !kanji1 && !kanji2 && inkanji) { + fprintf(output, KANJIOUT); + inkanji = 0; + } +#endif + currentline = firstline; while (currentline->next != nil) { currentline = currentline->next; @@ -525,11 +714,17 @@ void printpage(void) /* 'end of page', writes lines of page to output file */ free(currentline); /* free last line */ currentline = nil; + return; + } /* printpage */ -/*----------------------------------------------------------------------------*/ -bool inlist(register long pagenr) /* ret true if in list of pages */ + +/* + * INLIST -- return true if pagenr is in the list of pages to be printed. + */ + +bool inlist(long pagenr) { while ((currentpage->pag < 0) && (currentpage->pag != pagenr) && @@ -544,14 +739,20 @@ bool inlist(register long pagenr) /* ret true if in list if (currentpage->pag == pagenr) return TRUE; } + return FALSE; } /* inlist */ -/*----------------------------------------------------------------------------*/ + +/* + * RULE -- Output a rule (vertical or horizontal). + * Increment h if moving is true. + */ + void rule(bool moving, long rulewt, long ruleht) -{ /* output a rule (vertical or horizontal), increment h if moving is true */ +{ register char ch; /* character to set rule with */ register long saveh = 0, savev; @@ -564,7 +765,7 @@ void rule(bool moving, long rulewt, long ruleht) savev = v; if ((ruleht / rulewt) > 0) /* value < 1 truncates to 0 */ ch = '|'; - else if (ruleht > (VERTICALEPSILON / 2)) + else if (ruleht > (lineheight / 2)) ch = '='; else ch = '_'; @@ -574,11 +775,17 @@ void rule(bool moving, long rulewt, long ruleht) if (!moving) h = saveh; + return; + } /* rule */ -void ruleaux(long rulewt, long ruleht, char ch) /* recursive that does the job */ +/* + * RULEAUX -- do the actual output for the rule recursively. + */ + +void ruleaux(long rulewt, long ruleht, char ch) { register long wt, lmh, rmh; @@ -593,24 +800,30 @@ void ruleaux(long rulewt, long ruleht, char ch) /* recursive that does the outchar(ch); wt -= (h-rmh); /* decrease the width left on line */ } - ruleht -= VERTICALEPSILON; /* decrease the height */ - if (ruleht > VERTICALEPSILON) { /* still more vertical? */ + ruleht -= lineheight; /* decrease the height */ + if (ruleht > lineheight) { /* still more vertical? */ rmh = h; /* save current h (right margin) */ h = lmh; /* restore left margin */ - v -= (VERTICALEPSILON + VERTICALEPSILON / 10); + v -= (lineheight + lineheight / 10); ruleaux(rulewt, ruleht, ch); h = rmh; /* restore right margin */ } + return; + } /* ruleaux */ -/*----------------------------------------------------------------------------*/ -long horizontalmove(register long amount) + +/* + * HORIZONTALMOVE -- Move the h pointer by amount. + */ + +long horizontalmove(long amount) { -#if defined(MSDOS) - if (labs(amount) > charwidth / 4L) { +#if defined(MSDOS) || defined(THINK_C) + if (labs(amount) > charwidth / 4L) { /* } to make vi happy */ #else if (abs(amount) > charwidth / 4L) { #endif @@ -631,20 +844,29 @@ long horizontalmove(register long amount) } /* horizontalmove */ -/*----------------------------------------------------------------------------*/ -int skipnops(void) /* skips by no-op commands */ + +/* + * SKIPNOPS -- Return first non NOP opcode. + */ + +int skipnops(void) { register int opcode; while ((opcode = (int) num(1)) == NOP); + return opcode; } /* skipnops */ -/*----------------------------------------------------------------------------*/ -linetype *texlive_getline(void) /* returns an initialized line-object */ + +/* + * GETLINE -- Returns an initialized line-object + */ + +linetype *my_getline(void) { register int i; register linetype *temp; @@ -657,20 +879,26 @@ linetype *texlive_getline(void) /* returns an initialized line-object */ for (i = 0; i < LINELEN; i++) temp->text[i] = ' '; temp->text[i] = '\0'; + return temp; -} /* texlive_getline */ +} /* my_getline */ + + -/*----------------------------------------------------------------------------*/ +/* + * FINDLINE -- Find best fit line were text should go + * and generate new line if needed. + */ -linetype *findline(void) /* find best fit line were text should go */ -{ /* and generate new line if needed */ +linetype *findline(void) +{ register linetype *temp; register long topd, botd; if (v <= firstline->vv) { /* above first line */ - if (firstline->vv - v > VERTICALEPSILON) { - temp = texlive_getline(); + if (firstline->vv - v > lineheight) { + temp = my_getline(); temp->next = firstline; firstline->prev = temp; temp->vv = v; @@ -680,8 +908,8 @@ linetype *findline(void) /* find best fit line were text should go */ } if (v >= lastline->vv) { /* below last line */ - if (v - lastline->vv > VERTICALEPSILON) { - temp = texlive_getline(); + if (v - lastline->vv > lineheight) { + temp = my_getline(); temp->prev = lastline; lastline->next = temp; temp->vv = v; @@ -697,7 +925,7 @@ linetype *findline(void) /* find best fit line were text should go */ /* temp->vv < v < temp->next->vv --- temp is above, temp->next is below */ topd = v - temp->vv; botd = temp->next->vv - v; - if ((topd < VERTICALEPSILON) || (botd < VERTICALEPSILON)) { + if ((topd < lineheight) || (botd < lineheight)) { if (topd < botd) /* take best fit */ return temp; else @@ -705,50 +933,95 @@ linetype *findline(void) /* find best fit line were text should go */ } /* no line fits suitable, generate a new one */ - currentline = texlive_getline(); + currentline = my_getline(); currentline->next = temp->next; currentline->prev = temp; temp->next->prev = currentline; temp->next = currentline; currentline->vv = v; + return currentline; } /* findline */ -/*----------------------------------------------------------------------------*/ -unsigned long num(register int size) + +/* + * NUM -- + */ + +unsigned long num(int size) { register int i; - register long x = 0; + register unsigned long x = 0; - for (i = 0; i < size; i++) + for (i = size; i > 0; i--) x = (x << 8) + (unsigned) getc(DVIfile); + return x; } /* num */ -long snum(register int size) +/* + * SNUM -- + */ + +long snum(int size) { register int i; - register long x = 0; + register long x; x = getc(DVIfile); if (x & 0x80) x -= 0x100; - for (i = 1; i < size; i++) + for (i = size - 1; i > 0; i--) x = (x << 8) + (unsigned) getc(DVIfile); + return x; } /* snum */ -/*----------------------------------------------------------------------------*/ -void dochar(char ch) + +/* + * DOKANJI -- Process a kanji character opcode. + */ + +void dokanji(unsigned long ch) +{ +#if SJIS + register int c1, c2; + + c1 = (ch >> 8) & 0xff; + c2 = ch & 0xff; + kanji1 = 1; + outchar((((c1 - 1) >> 1) + ((c1 <= 0x5e) ? 0x71 : 0xb1))); + kanji1 = 0; + outchar((c2 + ((c1 & 1) ? ((c2 < 0x60) ? 0x1f : 0x20) : 0x7e))); +#else + kanji1 = 1; + outchar(0x80 | ( ch >> 8 )); + kanji1 = 0; + outchar(ch & 0xff); +#endif + + return; + +} /* dokanji */ + + + +/* + * DOCHAR -- Process a character opcode. + */ + +void dochar(unsigned char ch) { - if (symbolfont == TRUE) + if (japan && fnt->fontnum) + jischar((long) ch); + else if (symbolfont == TRUE) symchar(ch); else normchar(ch); @@ -759,10 +1032,14 @@ void dochar(char ch) -void symchar(char ch) /* output ch to appropriate line */ +/* + * SYMCHAR -- Process a character opcode for a symbol font. + */ + +void symchar(unsigned char ch) { - switch (ch) { /* can do a lot more on MSDOS machines ... */ + switch (ch) { /* can do a lot more on MSDOS/latin1/unicode machines ... */ case 0: ch = '-'; break; case 1: ch = '.'; break; case 2: ch = 'x'; break; @@ -771,6 +1048,8 @@ void symchar(char ch) /* output ch to appropriate line */ case 14: ch = 'O'; break; case 15: ch = 'o'; break; case 24: ch = '~'; break; + case 32: ch = japan ? '<' : 32; break; /* really only for japan? */ + case 33: ch = japan ? '>' : 33; break; /* really only for japan? */ case 102: ch = '{'; break; case 103: ch = '}'; break; case 104: ch = '<'; break; @@ -778,6 +1057,7 @@ void symchar(char ch) /* output ch to appropriate line */ case 106: ch = '|'; break; case 110: ch = '\\'; break; } + outchar(ch); return; @@ -786,79 +1066,158 @@ void symchar(char ch) /* output ch to appropriate line */ -void normchar(char ch) +/* + * NORMCHAR -- Process a character opcode for a normal font. + */ + +void normchar(unsigned char ch) { switch (ch) { - case 11 : outchar('f'); ch = 'f'; break; /* ligature */ - case 12 : outchar('f'); ch = 'i'; break; /* ligature */ - case 13 : outchar('f'); ch = 'l'; break; /* ligature */ - case 14 : outchar('f'); outchar('f'); - ch = 'i'; break; /* ligature */ - case 15 : outchar('f'); outchar('f'); - ch = 'l'; break; /* ligature */ - case 16 : ch = 'i'; break; - case 17 : ch = 'j'; break; - case 25 : if (scascii) /* German sz ligature */ - ch = 0xdf; - else - {outchar('s'); ch = 's';} + case 11 : if (ttfont) + ch = '^'; /* up symbol */ + else if (!allchar) { + outchar('f'); ch = 'f'; /* ligature */ + } break; - case 26 : if (scascii) /* Dane/Norw ae */ - ch = 0xe6; - else - {outchar('a'); ch = 'e';} + case 12 : if (ttfont) + ch = 'v'; /* low symbol */ + else if (!allchar) { + outchar('f'); ch = 'i'; /* ligature */ + } break; - case 27 : outchar('o'); ch = 'e'; break; /* Dane/Norw oe */ - case 28 : if (scascii) /* Dane/Norw /o */ - ch = 0xf8; - else - ch = 'o'; + case 13 : if (ttfont) + ch = '`'; + else if (!allchar) { + outchar('f'); ch = 'l'; /* ligature */ + } break; - case 29 : if (scascii) /* Dane/Norw AE */ - ch = 0xc6; - else - {outchar('A'); ch = 'E';} + case 14 : if (ttfont) + ch = 'i'; /* spanish ! */ + else if (!allchar) { + outchar('f'); outchar('f'); + ch = 'i'; /* ligature */ + } break; - case 30 : outchar('O'); ch = 'E'; break; /* Dane/Norw OE */ - case 31 : if (scascii) - ch = 0xd8; /* Dane/Norw /O */ - else - ch = 'O'; + case 15 : if (ttfont) + ch = '.'; /* spanish ? */ + else if (!allchar) { + outchar('f'); outchar('f'); + ch = 'l'; /* ligature */ + } break; - case 92 : ch = '"'; break; /* \ from `` */ - case 123 : ch = '-'; break; /* { from -- */ - case 124 : ch = '_'; break; /* | from --- */ - case 125 : ch = '"'; break; /* } from \H */ - case 126 : ch = '"'; break; /* ~ from \~ */ - case 127 : ch = '"'; break; /* DEL from \" */ -#if 0 - case 18 : ch = '`'; break /* from \` */ - case 19 : ch = ''''; break /* from \' */ - case 20 : ch = '~'; break /* from \v */ - case 21 : ch = '~'; break /* from \u */ - case 22 : ch = '~'; break /* from \= */ - case 24 : ch = ','; break /* from \c */ - case 94 : ch = '^'; break /* ^ from \^ */ - case 95 : ch = '`'; break /* _ from \. */ -#endif + case 16 : if (!allchar) ch = 'i'; break; + case 17 : if (!allchar) ch = 'j'; break; + case 25 : if (!allchar) { + if (latin1) { + ch = 0xdf; + } + else { + outchar('s'); + ch = 's'; + } + } + break; /* German double s */ + case 26 : if (!allchar) { + if (latin1) { + ch = 0xe6; + } + else { + outchar('a'); + ch = 'e'; + } + } + break; /* Dane/Norw ae */ + case 27 : if (!allchar) { + outchar('o'); + ch = 'e'; + } + break; /* Dane/Norw oe */ + case 28 : if (!allchar) { + if (scascii) + ch = '|'; + else if (latin1) + ch = 0xf8; + else + ch = 'o'; + } + break; /* Dane/Norw /o */ + case 29 : if (!allchar) { + if (latin1) { + ch = 0xc6; + } + else { + outchar('A'); + ch = 'E'; + } + } + break; /* Dane/Norw AE */ + case 30 : if (!allchar) { + outchar('O'); + ch = 'E'; + } + break; /* Dane/Norw OE */ + case 31 : if (!allchar) { + if (scascii) + ch = '\\'; + else if (latin1) + ch = 0xd8; + else + ch = 'O'; + } + break; /* Dane/Norw /O */ + case 32 : ch = allchar || ttfont ? ch : '_'; break; + /* underlined blank */ + case 58 : ch = allchar || !mifont ? ch : '.'; break; /* if japan */ + case 59 : ch = allchar || !mifont ? ch : ','; break; /* if japan */ + case 92 : ch = allchar || ttfont ? ch : '"'; break; /* \ from `` */ + case 123 : ch = allchar || ttfont ? ch : '-'; break; /* { from -- */ + case 124 : ch = allchar || ttfont ? ch : '_'; break; /* | from --- */ + case 125 : ch = allchar || ttfont ? ch : '"'; break; /* } from \H */ + case 126 : ch = allchar || ttfont ? ch : '"'; break; /* ~ from \~ */ + case 127 : if (!allchar) ch = '"'; break; /* DEL from \" */ + + /* + * Should SPACE be useed for non-accents ??? + * This seems to work ... + */ + case 18 : ch = !allchar && accent ? '`' : ch; break; /* from \` */ + case 19 : ch = !allchar && accent ? 0x27 : ch; break; /* from \' */ + case 20 : ch = !allchar && accent ? '~' : ch; break; /* from \v */ + case 21 : ch = !allchar && accent ? '~' : ch; break; /* from \u */ + case 22 : ch = !allchar && accent ? '~' : ch; break; /* from \= */ + case 24 : ch = !allchar && accent ? ',' : ch; break; /* from \c */ + case 94 : ch = (!allchar && accent && !ttfont) ? '^' : ch; break; + /* ^ from \^ */ + case 95 : ch = (!allchar && accent && !ttfont) ? '`' : ch; break; + /* _ from \. */ } outchar(ch); return; -} /*normchar */ +} /* normchar */ + +/* + * OUTCHAR -- Here we put the character into the current page. + * + * This function includes some code to handle Latin1/Scandinavian + * characters. I think that code doesn't belong here. IT + * SHOULD BE MOVED OUT. + */ -void outchar(unsigned char ch) /* output ch to appropriate line */ +void outchar(unsigned char ch) { register int i, j; -#if defined(MSDOS) - if (labs(v - currentline->vv) > VERTICALEPSILON / 2L) +/* fprintf(stderr, "hor: %ld, ver: %ld\n", h, v); */ + +#if defined(MSDOS) || defined(THINK_C) + if (labs(v - currentline->vv) > lineheight / 2L) #else - if (abs(v - currentline->vv) > VERTICALEPSILON / 2L) + if (abs(v - currentline->vv) > lineheight / 2L) #endif currentline = findline(); @@ -872,65 +1231,70 @@ void outchar(unsigned char ch) /* output ch to appropriate l else if (j < leftmargin) j = leftmargin; foo = leftmargin - 1; + /* * This code does not really belong here ... * - *-------------------------------------------------------------* - * The following is very specialized code, it handles some eu- * - * ropean characters. These are: a, o, u with two dots ("a & * - * "o & "u), and a with a circle (Oa). TeX outputs these by * + * The following is very specialized code, it handles national * + * Swe/Fin characters. They are respectively: a and o with two * + * dots ("a & "o) and a with a circle (Oa). In Swe/Fin "ASCII" * + * these characters replace {}|[] and \. TeX outputs these by * * first issuing the dots or circle and then backspace and set * - * the a, o, or u. When dvitty finds an a, o, or u it sear- * - * ches in the near vicinity for the character codes that re- * - * present circle or dots and if one is found the correspon- * - * ding Latin-1 character replaces the special character code. * - *-------------------------------------------------------------*/ - if (scascii) { - if ((ch == 'a') || (ch == 'A') || (ch == 'o') || (ch == 'O') || - (ch == 'u') || (ch == 'U')) { + * the a or o. When dvi2tty finds an a or o it searches in the * + * near vicinity for the character codes that represent circle * + * or dots and if one is found the corresponding national char * + * replaces the special character codes. * + */ + if (!allchar && (scascii || latin1)) { + if ((ch == 'a') || (ch == 'A') || (ch == 'o') || (ch == 'O') || (ch == 'u') || (ch == 'U')) { for (i = IMAX(leftmargin, j-2); i <= IMIN(rightmargin, j+2); i++) - if ((currentline->text[i - leftmargin] == 127) || - (currentline->text[i - leftmargin] == 34) || + if ((currentline->text[i - leftmargin] == 127) || /* DEL */ + (currentline->text[i - leftmargin] == 34) || /* " */ (currentline->text[i - leftmargin] == 23)) foo = i; if (foo >= leftmargin) { j = (int) foo; switch (currentline->text[j - leftmargin]) { - case 127 : case 34: + case 127 : + case 34 : /* DEL or " */ if (ch == 'a') - ch = 0xe4; + ch = latin1 ? 0xe4 : '{'; /* } vi */ else if (ch == 'A') /* dots ... */ - ch = 0xc4; + ch = latin1 ? 0xc4 : '['; else if (ch == 'o') - ch = 0xf6; + ch = latin1 ? 0xf6 : '|'; else if (ch == 'O') - ch = 0xd6; + ch = latin1 ? 0xd6 : '\\'; else if (ch == 'u') - ch = 0xfc; + ch = latin1 ? 0xfc : 'u'; else if (ch == 'U') - ch = 0xdc; + ch = latin1 ? 0xdc : 'U'; break; case 23 : if (ch == 'a') - ch = 0xe5; + ch = latin1 ? 0xe5 : '}'; /* { vi */ else if (ch == 'A') /* circle */ - ch = 0xc5; + ch = latin1 ? 0xc5 : ']'; break; } } } } - /*----------------- end of 'Scandinavian code' ----------------*/ - if (foo == leftmargin-1) - while ((currentline->text[j - leftmargin] != SPACE) - && (j < rightmargin)) { + /*----------------- end of 'latin1 / Scandinavian code' ----------------*/ + + if (foo == leftmargin-1) { + while (j < rightmargin && + ( (currentline->text[j - leftmargin] != SPACE) || + (kanji1 && (currentline->text[j+1 - leftmargin] != SPACE)) + ) ) { j++; h += charwidth; } - if ( ((ch >= SPACE) && (ch != DEL)) || - (scascii && (ch == 23)) ) { - /* (scascii && (ch == DEL)) ) { if VMS ??? */ + } + if ( allchar || ((ch >= SPACE) && (ch != DEL)) || + ((latin1 || scascii) && (ch == 23)) ) { + /* ((latin1 || scascii) && (ch == DEL)) ) if VMS ??? */ if (j < rightmargin) currentline->text[j - leftmargin] = ch; else @@ -939,41 +1303,60 @@ void outchar(unsigned char ch) /* output ch to appropriate l currentline->charactercount = j; if (j < firstcolumn) firstcolumn = j; - h += charwidth; } + h += charwidth; + + return; } /* outchar */ -/*----------------------------------------------------------------------------*/ -void putcharacter(register long charnr) /* output character, don't change h */ + +/* + * PUTCHARACTER -- Output character, don't change h + */ + +void putcharacter(long charnr) { register long saveh; saveh = h; - if ((charnr >= 0) && (charnr <= LASTCHAR)) - outchar((char) charnr); + if (japan) + dochar((unsigned char) charnr); + else if (allchar || ((charnr >= 0) && (charnr <= LASTCHAR))) + outchar((unsigned char) charnr); else setchar(charnr); h = saveh; + return; + } /* putcharacter */ -/*----------------------------------------------------------------------------*/ + + +/* + * SETCHAR -- Should print characters with character code>127 from + * current font. Note that the parameter is a dummy, since + * ascii-chars are<=127. + */ void setchar(long charnr) -{ /* should print characters with character code>127 from current font */ - /* note that the parameter is a dummy, since ascii-chars are<=127 */ +{ - outchar((unsigned char)(charnr)); + outchar(allchar ? (unsigned char) charnr : '#'); + + return; } /* setchar */ -/*----------------------------------------------------------------------------*/ +/* + * FONTDEF -- Process a font definition. + */ -void fontdef(register int x) +void fontdef(int x) { register int i; char * name; @@ -1007,61 +1390,192 @@ void fontdef(register int x) for (i = 0; i < namelen; i++) name[i] = get1(); - name[namelen] = '\0'; + name[i] = '\0'; /* properly end string */ fnt->name = name; if (new) { fnt->next = fonts; fonts = fnt; } + /* + * some magic to learn about font types... + */ + fonts->flags = 0; + + if (jautodetect && asciip == FALSE && japan == FALSE && !jdetect) { + if (!strncmp("min", name, 3) || !strncmp("got", name, 3)) { + /* Detect as ASCII TeX */ + asciip = TRUE; + japan = FALSE; + jdetect = TRUE; + fonts->flags |= MIFONT; + } else if (!strncmp("dmj", name, 3) || !strncmp("dgj", name, 3)) { + /* Detect as NTT JTeX */ + asciip = FALSE; + japan = TRUE; + jdetect = TRUE; + fonts->flags |= JAPFONT; + } + } + if (japan) + fonts->fontnum = getjsubfont(name); + + if ((strstr(name, "sy")) != NULL) + fonts->flags |= SYMFONT; + if ((strstr(name, "tt")) != NULL) + fonts->flags |= TTFONT; + if ((strstr(name, "mi")) != NULL) + fonts->flags |= MIFONT; + return; } /* fontdef */ +#define NJSUBS 33 +const char *jsf_names[]={ + "sy", "roma", "hira", "kata", "greek", "russian", "keisen", + "ka", "kb", "kc", "kd", "ke", "kf", "kg", "kh", "ki", "kj", + "kk", "kl", "km", "kn", "ko", "kp", "kq", "kr", "ks", "kt", + "ku", "kv", "kw", "kx", "ky", "kz" +}; + + +int getjsubfont(char *s) +{ + int jf; + + if (strlen(s) > 3 && s[0] == 'd' && (s[1] == 'm' || s[1] == 'g') && s[2] == 'j') { + for (jf = 0; jf < NJSUBS; jf++) { + if (strncmp(&s[3], jsf_names[jf], strlen(jsf_names[jf])) == 0) + return jf+1; + } + } + + return 0; + +} /* getjsubfont */ + + + +/* + * SETFONT -- Switch to specific font. Try to find out if it is a symbol + * font. + * Option -c allchar does not pertain to this portion, so symbols + * are still translated. + */ + void setfont(long fntnum) { - font * fnt; char * s; + const char * d; + symbolfont = FALSE; + ttfont = FALSE; + mifont = FALSE; fnt = fonts; + while (fnt != NULL && fnt->num != fntnum) fnt = fnt->next; + if (fnt == NULL) { /* error : font not found */ - symbolfont = FALSE; return; } - s = fnt->name; - while ((s = strchr(s, 's')) != NULL) { - if (strncmp("sy", s, 2) == 0) { - symbolfont = TRUE; - return; - } - s++; /* New line to fix bug; font names with 's' would hang */ + if (fnt->fontnum == 0) { + symbolfont = fnt->flags & SYMFONT; + ttfont = fnt->flags & TTFONT; + mifont = fnt->flags & MIFONT; } - - symbolfont = FALSE; + + s = fnt->name; + if (printfont) { + d = delim; /* print delim and font name if -b was chosen */ + while (*d) {putcharacter(*d); d++;} + while (*s) {putcharacter(*s); s++;} + while (d-- > delim) {putcharacter(*d);} + } + return; } /* setfont */ - -/*----------------------------------------------------------------------------*/ +void jischar(unsigned long ch) +{ + unsigned int Ku, Ten; + + compute_jis(fnt->fontnum, (unsigned int) ch, &Ku, &Ten); + outchar(Ku+128); + outchar(Ten+128); + + return; + +} /* jischar */ + +#define kushift(c) c+0x20 +#define tenshift(c) c+0x20 + +void compute_jis(int f, unsigned int c, unsigned int *ku, unsigned int *ten) +{ + int n; + + if (f <= 7) { + if (f == 1) { + if (c >= 100) { + *ku = kushift(2); + *ten = tenshift(c-100); + } + else { + *ku = kushift(1); + *ten = tenshift(c); + } + } + else if (f == 2) { + *ku = kushift(3); + *ten = tenshift(c-32); + } + else { + *ku = kushift(f+1); + *ten = tenshift(c); + } + } + else if (f <= 19) { /* Daiichi Suijun */ + n = (f-8)*256+c; + *ku = kushift((n/94)+16); + *ten = tenshift((n%94)+1); + } + else { /* Daini Suijun */ + n = (f-20)*256+c; + *ku = kushift((n/94)+48); + *ten = tenshift((n%94)+1); + } + + return; + +} /* compute_jis */ + + + +/* + * VMS CODE + */ #if defined(VMS) -long vmsseek(FILE *fp, long n, long dir) +long vmsseek(fp,n,dir) +FILE *fp; +long n; +long dir; { long k,m,pos,val,oldpos; struct stat buffer; - for (;;) { /*loops only once or twice*/ + for (;;) { /* loops only once or twice */ switch (dir) { - case 0: /*from BOF*/ + case 0: /* from BOF */ oldpos = vms_ftell(fp); k = n & 511; m = n >> 9; @@ -1100,15 +1614,19 @@ long vmsseek(FILE *fp, long n, long dir) } } + /* NOTREACHED */ + } /* vmsseek */ -long vms_ftell(FILE *fp) +long vms_ftell(fp) +FILE *fp; { char c; long pos; long val; + if ((*fp)->_cnt == 0) { c = fgetc(fp); val = vms_ungetc(c, fp); @@ -1118,24 +1636,29 @@ long vms_ftell(FILE *fp) pos = ftell(fp); if (pos >= 0) pos += ((*fp)->_ptr) - ((*fp)->_base); + return (pos); } /* vms_ftell */ -long vms_ungetc(char c, FILE *fp) +long vms_ungetc(c,fp) +char c; +FILE *fp; { + if ((c == EOF) && feof(fp)) return (EOF); - else if ((*fp)->_cnt >= 512) + + if ((*fp)->_cnt >= 512) return (EOF); - else { - (*fp)->_cnt++; - (*fp)->_ptr--; - *((*fp)->_ptr) = c; - return (c); - } + + (*fp)->_cnt++; + (*fp)->_ptr--; + *((*fp)->_ptr) = c; + + return (c); } /*vms_ungetc */ #endif diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/ligtest.dvi b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/ligtest.dvi Binary files differnew file mode 100644 index 00000000000..b715d670d8e --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/ligtest.dvi diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/ligtest.tex b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/ligtest.tex index 22bf91dafd9..22bf91dafd9 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/ligtest.tex +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/ligtest.tex diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test.dvi b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test.dvi Binary files differnew file mode 100644 index 00000000000..b1c0c097ab4 --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test.dvi diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.tex b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test.tex index d234606850a..a282f0a8fe7 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.tex +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test.tex @@ -23,7 +23,7 @@ horizontal 3 - is --- ligatures: ffl fi fl Yp -what about vertikal bars | +what about vertical bars | horizontal bar - @@ -31,6 +31,72 @@ and tildes ~ < funny carrots > +copyright \copyright + +pounds \pounds + +euro \Euro +$ +diamond \Diamond +$ +scandinavian ae \ae AE {\AE} o {\o} O {\O} AA {\AA} aa {\aa} Z {\v z} + + +$ +alpha \alpha +$ +eta \eta + +nu \nu + +tau \tau + +beta \beta + +theta \theta + +xi \xi + +upsilon \upsilon + +gamma \gamma + +iota \iota + +phi \phi + +delta \delta + +kappa \kappa + +pi \pi + +chi \chi + +epsilon \epsilon + +lambda \lambda + +rho \rho + +psi \psi + +zeta \zeta + +mu \mu + +sigma \sigma + +omega \omega + + +\begin{tabular}{ l | c || r | } +\hline + 1 & 2 & 3 \\ + 4 & 5 & 6 \\ + 7 & 8 & 9 \\ +\hline +\end{tabular} so far not in verbatim (tt font) @@ -46,7 +112,7 @@ tildes accent \~o horizontal 2 - is -- horizontal 3 - is --- ligatures: ffl fi fl Yp -what about vertikal bars | +what about vertical bars | horizontal bar - and tildes ~ < funny carrots > diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.org.dvi b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test_org.dvi Binary files differindex 072ec09acf4..072ec09acf4 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.1/test.org.dvi +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.3/test/test_org.dvi diff --git a/Build/source/texk/dvi2tty/dvi2tty.test b/Build/source/texk/dvi2tty/dvi2tty.test new file mode 100755 index 00000000000..7699be4fbcc --- /dev/null +++ b/Build/source/texk/dvi2tty/dvi2tty.test @@ -0,0 +1,12 @@ +#! /bin/sh + +test_src=$srcdir/$DVI2TTY_TREE/test + +./dvi2tty $test_src/test.dvi >test.out && diff $srcdir/test.tty test.out || exit 1 + +./dvi2tty -s $test_src/test.dvi >tests.out && diff $srcdir/tests.tty tests.out || exit 1 + +./dvi2tty -u $test_src/test.dvi >testu.out && diff $srcdir/testu.tty testu.out || exit 1 + +./dvi2tty $test_src/ligtest.dvi >ligtest.out && diff $srcdir/ligtest.tty ligtest.out || exit 1 + diff --git a/Build/source/texk/dvi2tty/ligtest.tty b/Build/source/texk/dvi2tty/ligtest.tty new file mode 100644 index 00000000000..b5ea6c398ef --- /dev/null +++ b/Build/source/texk/dvi2tty/ligtest.tty @@ -0,0 +1,22 @@ + + + + + hello. + dollar $ ampersand & procent % matje # leftbrace { rightbrace } underscore +_ + dagger yddagger zsection xparagraph {copyright cOpound $ + + + o item 1 + + o - item 2.1 + + +bye. + maths: + 1 + 2 = 5=3 * 1 - 1 + + + + 1 diff --git a/Build/source/texk/dvi2tty/test.tty b/Build/source/texk/dvi2tty/test.tty new file mode 100644 index 00000000000..b86e2d3c06f --- /dev/null +++ b/Build/source/texk/dvi2tty/test.tty @@ -0,0 +1,75 @@ + + + + +accents: 'e +LATEX +now inline: bla'e test +now inline: bla 'etest +now inline: bla 'e test +real spaces xxx +tildes accent "o +horizontal 2 - is - +horizontal 3 - is _ +ligatures: ffl fi fl Yp +what about vertical bars _ +horizontal bar - +and tildes +< funny carrots > +copyright cO +pounds $ +euro diamond3 scandinavian ae aeAE AE o o O O AA A aa a Z ~z +alphaff eta j +nu +tau o +beta fi +theta ` +xi , +upsilon AE +gamma fl +iota ' +phi OE +delta ffi +kappa ~ +pi ss +chi O +epsilon ffl +lambda ~ +rho ae +psi _ +zeta i +mu ~ +sigma oe +omega_!____ + 1 | 2 |3|| + 4 | 5 |6|| +_7_|_8_|9||_ +so far not in verbatim (tt font) + + + + 1 + + + + +now in verbatim (tt font) +accents: "'-e" +"LaTeX +now inline: bla"'-e" test +now inline: bla "'-e"test +now inline: bla "'-e" test +real spaces"""xxx +tildes accent ""o +horizontal 2 - is -- +horizontal 3 - is --- +ligatures: ffl fi fl Yp +what about vertical bars _ +horizontal bar - +and tildes " +< funny carrots > +or other symbols: "" - " [ ] ` ^ ? = ; / . , + * ( ) ' & % $ # " ! + + + + 2 diff --git a/Build/source/texk/dvi2tty/tests.tty b/Build/source/texk/dvi2tty/tests.tty new file mode 100644 index 00000000000..7c6e186f3e2 --- /dev/null +++ b/Build/source/texk/dvi2tty/tests.tty @@ -0,0 +1,75 @@ + + + + +accents: 'e +LATEX +now inline: bla'e test +now inline: bla 'etest +now inline: bla 'e test +real spaces xxx +tildes accent | +horizontal 2 - is - +horizontal 3 - is _ +ligatures: ffl fi fl Yp +what about vertical bars _ +horizontal bar - +and tildes +< funny carrots > +copyright cO +pounds $ +euro diamond3 scandinavian ae aeAE AE o | O \ AA ] aa } Z ~z +alphaff eta j +nu +tau | +beta fi +theta ` +xi , +upsilon AE +gamma fl +iota ' +phi OE +delta ffi +kappa ~ +pi ss +chi \ +epsilon ffl +lambda ~ +rho ae +psi _ +zeta i +mu ~ +sigma oe +omega_!____ + 1 | 2 |3|| + 4 | 5 |6|| +_7_|_8_|9||_ +so far not in verbatim (tt font) + + + + 1 + + + + +now in verbatim (tt font) +accents: "'-e" +{L TeX +now inline: bla"'-e" test +now inline: bla "'-e"test +now inline: bla "'-e" test +real spaces"""xxx +tildes accent "| +horizontal 2 - is -- +horizontal 3 - is --- +ligatures: ffl fi fl Yp +what about vertical bars _ +horizontal bar - +and tildes " +< funny carrots > +or other symbols: "" - " [ ] ` ^ ? = ; / . , + * ( ) ' & % $ # " ! + + + + 2 diff --git a/Build/source/texk/dvi2tty/testu.tty b/Build/source/texk/dvi2tty/testu.tty new file mode 100644 index 00000000000..ce9f9c4d5dc --- /dev/null +++ b/Build/source/texk/dvi2tty/testu.tty @@ -0,0 +1,75 @@ + + + + +accents: 'e +LATEX +now inline: bla'e test +now inline: bla 'etest +now inline: bla 'e test +real spaces xxx +tildes accent ö +horizontal 2 - is - +horizontal 3 - is _ +ligatures: ffl fi fl Yp +what about vertical bars _ +horizontal bar - +and tildes +< funny carrots > +copyright cO +pounds $ +euro diamond3 scandinavian ae æAE Æ o ø O Ø AA Å aa å Z ~z +alphaff eta j +nu +tau ø +beta fi +theta ` +xi , +upsilon Æ +gamma fl +iota ' +phi OE +delta ffi +kappa ~ +pi ß +chi Ø +epsilon ffl +lambda ~ +rho æ +psi _ +zeta i +mu ~ +sigma oe +omega_!____ + 1 | 2 |3|| + 4 | 5 |6|| +_7_|_8_|9||_ +so far not in verbatim (tt font) + + + + 1 + + + + +now in verbatim (tt font) +accents: "'-e" +äL TeX +now inline: bla"'-e" test +now inline: bla "'-e"test +now inline: bla "'-e" test +real spaces"""xxx +tildes accent "ö +horizontal 2 - is -- +horizontal 3 - is --- +ligatures: ffl fi fl Yp +what about vertical bars _ +horizontal bar - +and tildes " +< funny carrots > +or other symbols: "" - " [ ] ` ^ ? = ; / . , + * ( ) ' & % $ # " ! + + + + 2 |