OSDN Git Service

updating codes.
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Thu, 1 May 2014 12:37:15 +0000 (20:37 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Thu, 1 May 2014 12:37:15 +0000 (20:37 +0800)
25 files changed:
src/texsourc/itex.c
src/texsourc/libtoua/export_ptexenc.bat [new file with mode: 0644]
src/texsourc/libtoua/kanji.c [deleted file]
src/texsourc/libtoua/kanji.h [deleted file]
src/texsourc/libtoua/make-clean.bat [new file with mode: 0644]
src/texsourc/libtoua/make-obj.bat [new file with mode: 0644]
src/texsourc/libtoua/ptexenc/ChangeLog
src/texsourc/libtoua/ptexenc/Makefile.am
src/texsourc/libtoua/ptexenc/Makefile.in
src/texsourc/libtoua/ptexenc/aclocal.m4
src/texsourc/libtoua/ptexenc/c-auto.in
src/texsourc/libtoua/ptexenc/configure
src/texsourc/libtoua/ptexenc/configure.ac
src/texsourc/libtoua/ptexenc/kanjicnv.c
src/texsourc/libtoua/ptexenc/ptexenc.c
src/texsourc/libtoua/ptexenc/ptexenc/c-auto.h [new file with mode: 0644]
src/texsourc/libtoua/ptexenc/ptexenc/unicode.h
src/texsourc/libtoua/ptexenc/version.ac
src/texsourc/local.c
src/texsourc/subroute.c
src/texsourc/tex0.c
src/texsourc/tex4.c
src/texsourc/tex9.c
src/texsourc/texd.h
src/texsourc/texmf.c

index 4808243..934d678 100644 (file)
@@ -51,7 +51,7 @@ extern clock_t start_time, main_time, finish_time; /* in local.c */
 /* localized here to avoid conflict with io.h in other code */
 
 #define read(f, b) ((b) = getc (f))
-#define readln(f) { register int c; while ((c = getc (f)) != '\n' && c != EOF); }
+
 
 #ifdef INITEX
   void do_initex (void); /* later in this file */
@@ -2450,10 +2450,11 @@ int texbody (void)
     init_pool_ptr = pool_ptr;
     fix_date_and_time();
   }
-#endif /* INITEX */
+#endif
+
   ready_already = 314159L;      /* magic number */
 
-lab1:     /* get here directly if ready_already already set ... */
+lab1:
   selector = term_only;
   tally = 0;
   term_offset = 0;
@@ -2489,14 +2490,12 @@ lab1:     /* get here directly if ready_already already set ... */
       max_param_stack = 0;
 
 #ifdef ALLOCATEBUFFER
-/*    first = current_buf_size; */
-      memset (buffer, 0, current_buf_size); /* redundant */
+      memset (buffer, 0, current_buf_size);
 #else
-/*    first = buf_size; */
-      memset (buffer, 0, buf_size);     /* redundant ? */
+      memset (buffer, 0, buf_size);
 #endif
-      first = 0;              /* 1999/Jan/22 */
 
+      first = 0;              /* 1999/Jan/22 */
       scanner_status = 0;
       warning_index = 0; /* warning_index:=null; l.7068 */
       first = 1;
@@ -2514,7 +2513,7 @@ lab1:     /* get here directly if ready_already already set ... */
       cur_input.limit_field = last;
       first = last + 1;
     }
-/*    if ((format_ident == 0)||(buffer[cur_input.loc_field]== 38)) */
+
 /*    For Windows NT, lets allow + instead of & for format specification */
     if ((format_ident == 0) ||
         (buffer[cur_input.loc_field] == '&') ||
@@ -2539,10 +2538,6 @@ lab1:     /* get here directly if ready_already already set ... */
         incr(cur_input.loc_field);
     }
 
-#ifdef CHECKEQTB
-    if (debug_flag)
-      check_eqtb("after format"); /* debugging 94/Apr/5 */
-#endif
     if ((end_line_char < 0) || (end_line_char > 255))
       decr(cur_input.limit_field);
     else
@@ -2597,11 +2592,10 @@ lab9999:
       code = 1;
     else
       code = 0;
-//    now return instead of exit to allow cleanup in local.c
+
     return code;
-//    uexit(code);
   }
-} /* end of texbody */
+}
 
 #ifdef ALLOCATEMAIN
 /* add a block of variable size node space below mem_bot */
@@ -2618,11 +2612,12 @@ void add_variable_space(int size)
     t = mem_min + 1;
 
   mem_min = t - (size + 1);     /* first word in new block - 1 */
-/*  mem_min = mem_start; */     /* allocate all of it at once */
+
   if (mem_min < mem_start)      /* sanity test */
   {
     if (trace_flag)
       show_line("WARNING: mem_min < mem_start!\n", 0);
+
     mem_min = mem_start;
   }
 
diff --git a/src/texsourc/libtoua/export_ptexenc.bat b/src/texsourc/libtoua/export_ptexenc.bat
new file mode 100644 (file)
index 0000000..48c62f9
--- /dev/null
@@ -0,0 +1 @@
+svn export svn://tug.org/texlive/trunk/Build/source/texk/ptexenc/ ptexenc
diff --git a/src/texsourc/libtoua/kanji.c b/src/texsourc/libtoua/kanji.c
deleted file mode 100644 (file)
index 899a5ee..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *  KANJI Code conversion routines.
- *  (for pTeX and e-pTeX)
- */
-
-#include "kanji.h"
-
-#if !defined(WIN32)
-  int sjisterminal;
-#endif
-
-/* TOKEN */
-boolean check_kanji(integer c)
-{
-  return is_char_kanji(c);
-}
-
-boolean is_char_ascii(integer c)
-{
-  return (0 <= c && c < 0x100);
-}
-
-boolean is_char_kanji(integer c)
-{
-  return (iskanji1(Hi(c)) && iskanji2(Lo(c)));
-}
-
-boolean ismultiprn(integer c)
-{
-  if (iskanji1(c) || iskanji2(c))
-    return true;
-
-  return false;
-}
-
-#ifdef OLDSTYLE
-integer calc_pos(integer c)
-{
-  int c1, c2;
-
-  if (c < 256)
-    return (c << 1);
-
-  c1 = c >> 8;
-  c2 = c & 0xff;
-
-  if (c1)
-  {
-    if (is_internalSJIS())
-      return ((c2 + (c2 << (c1 - 0x81)) & 0xff) << 1);
-    else
-      return ((c2 + (c2 << (c1 - 0xa1)) & 0xff) << 1);
-  }
-  else
-    return (((c2 + c2 + 1) & 0xff) << 1);
-}
-#else /* OLDSTYLE */
-integer calc_pos(integer c)
-{
-  unsigned char c1, c2;
-
-  if(c >= 0 && c <= 255)
-    return (c);
-
-  c1 = (c >> 8) & 0xff;
-  c2 = c & 0xff;
-
-  if(iskanji1(c1))
-  {
-    if (is_internalSJIS())
-    {
-      c1 = ((c1 - 0x81) % 4) * 64;  /* c1 = 0, 64, 128, 192 */
-      c2 = c2 % 64;                 /* c2 = 0..63 */
-    }
-    else
-    {
-      c1 = ((c1 - 0xa1) % 4) * 64;  /* c1 = 0, 64, 128, 192 */
-      c2 = c2 % 64;                 /* c2 = 0..63 */
-    }
-    return (c1 + c2);              /* ret = 0..255 */
-  }
-  else
-    return (c2);
-}
-#endif /* OLDSTYLE */
-
-integer kcatcodekey(integer c)
-{
-  return Hi(toDVI(c));
-}
-
-void init_default_kanji (const_string file_str, const_string internal_str)
-{
-  char *p;
-
-  enable_UPTEX (false); /* disable */
-
-  if (!set_enc_string (file_str, internal_str))
-  {
-    fprintf (stderr, "Bad kanji encoding \"%s\" or \"%s\".\n",
-        file_str ? file_str  : "NULL",
-        internal_str ? internal_str : "NULL");
-    uexit(1);
-  }
-
-  p = getenv ("PTEX_KANJI_ENC");
-
-  if (p)
-  {
-    if (!set_enc_string (p, NULL))
-      fprintf (stderr, "Ignoring bad kanji encoding \"%s\".\n", p);
-  }
-
-#ifdef WIN32
-  p = kpse_var_value ("guess_input_kanji_encoding");
-
-  if (p)
-  {
-    if (*p == '1' || *p == 'y' || *p == 't')
-      infile_enc_auto = 1;
-
-    free(p);
-  }
-#endif
-}
diff --git a/src/texsourc/libtoua/kanji.h b/src/texsourc/libtoua/kanji.h
deleted file mode 100644 (file)
index e4fd2f0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-   kanji.h: Handling 2byte char, and so on.
-*/
-#ifndef KANJI_H
-#define KANJI_H
-#include "cpascal.h"
-#include <ptexenc/ptexenc.h>
-#ifdef epTeX
-#include <ptexenc/unicode.h>
-#define getintone(w) ((w).cint1)
-#define setintone(w,a) ((w).cint1=(a))
-#endif
-
-#define KANJI
-
-#if !defined(WIN32)
-extern int sjisterminal;
-#endif
-
-/* functions */
-#define Hi(x) (((x) >> 8) & 0xff)
-#define Lo(x) ((x) & 0xff)
-
-extern int check_kanji (integer c);
-#define checkkanji check_kanji
-extern boolean is_char_ascii (integer c);
-#define ischarascii is_char_ascii
-extern boolean is_char_kanji (integer c);
-#define ischarkanji is_char_kanji
-extern boolean ismultiprn (integer c);
-extern integer calc_pos (integer c);
-#define calcpos calc_pos
-extern integer kcatcodekey (integer c);
-
-extern void init_default_kanji (const_string file_str, const_string internal_str);
-#ifdef PBIBTEX
-/* pBibTeX is EUC only */
-#define initkanji() init_default_kanji(NULL, "euc")
-#elif defined(WIN32)
-/* for pTeX, e-pTeX, pDVItype, pPLtoTF, and pTFtoPL */
-#define initkanji() init_default_kanji(NULL, "sjis")
-#else
-#define initkanji() init_default_kanji(NULL, "euc")
-#endif
-/* for pDVItype */
-#define setpriorfileenc() set_prior_file_enc()
-
-#ifndef PRESERVE_PUTC
-#undef putc
-#define putc(c,fp) putc2(c,fp)
-#endif /* !PRESERVE_PUTC */
-
-#ifdef PBIBTEX
-#define inputline2(fp,buff,pos,size,ptr) input_line2(fp,buff,pos,size,ptr)
-#else
-#define inputline2(fp,buff,pos,size) input_line2(fp,buff,pos,size,NULL)
-#endif
-
-#endif /* not KANJI_H */
diff --git a/src/texsourc/libtoua/make-clean.bat b/src/texsourc/libtoua/make-clean.bat
new file mode 100644 (file)
index 0000000..5979293
--- /dev/null
@@ -0,0 +1,2 @@
+del *.exe
+del *.obj
diff --git a/src/texsourc/libtoua/make-obj.bat b/src/texsourc/libtoua/make-obj.bat
new file mode 100644 (file)
index 0000000..8ac058e
--- /dev/null
@@ -0,0 +1,5 @@
+cl -nologo -c -I"ptexenc" -I"../kpathsea" ptexenc/kanjicnv.c
+cl -nologo -c -I"ptexenc" -I"../kpathsea" ptexenc/ptexenc.c
+cl -nologo -c -I"ptexenc" -I"../kpathsea" ptexenc/unicode.c
+cl -nologo -c -I"ptexenc" -I"../kpathsea" ptexenc/unicode-jp.c
+
index 06ad1b8..5cd1a05 100644 (file)
@@ -1,3 +1,53 @@
+2014-04-28  TANAKA Takuji  <KXD02663@nifty.ne.jp>
+
+       * ptexenc.c: Accept Ctrl+Z as EOF in console (keyboard)
+       in upTeX on Windows.
+
+2014-04-17  Karl Berry  <karl@tug.org>
+
+       * version.ac: 1.3.2 (without the dev) for 2014 pretest.
+
+2014-01-25  TANAKA Takuji  <KXD02663@nifty.ne.jp>
+
+       * ptexenc.c: Return replacement character U+FFFD
+       for illegal surrogate pair in console (keyboard) input
+       in upTeX on Windows.
+
+2014-01-03  TANAKA Takuji  <KXD02663@nifty.ne.jp>
+
+       * ptexenc.c, ptexenc/unicode.h: Enable console (keyboard) input
+       of Unicode characters in upTeX on Windows.
+
+2013-08-17  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+       * configure.ac (AH_TOP): Simplify the generation of c-auto.h.
+
+2013-07-06  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+       * Makefile.am: Use ../../am/rebuild.am.
+
+2013-06-29  Akira Kakuto  <kakuto@fuk.kindai.ac.jp>
+
+       * ptexenc.c: Provide right console output on windows for both
+       ptex and uptex if --sjis-terminal option is given. (from T. Tanaka).
+
+2013-06-25  Akira Kakuto  <kakuto@fuk.kindai.ac.jp>
+
+       * ptexenc.c: Remove redundant lines in input_line2(), which are
+       inconsistent with those lines in texmfmp.c.
+
+2013-06-24  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+       * version.ac: Update version number 1.3.1 => 1.3.2dev.
+
+2013-06-05  Peter Breitenlohner  <peb@mppmu.mpg.de>
+
+       * Makefile.am (*_la_LDFLAGS): Add -bindir for MinGW DLL.
+
+2013-05-30  Karl Berry  <karl@tug.org>
+       
+       * TeX Live 2013.
+
 2013-04-05  Karl Berry  <karl@tug.org>
 
        * version.ac: 1.3.1 to prepare for TL'13 pretest.
index 3c0adc3..c017b5a 100644 (file)
@@ -1,14 +1,10 @@
 ## Makefile.am for the TeX Live subdirectory texk/ptexenc/
 ##
-## Copyright (C) 2010-2012 Peter Breitenlohner <tex-live@tug.org>
+## Copyright (C) 2010-2013 Peter Breitenlohner <tex-live@tug.org>
 ## You may freely use, modify and/or distribute this file.
 ##
 ACLOCAL_AMFLAGS = -I ../../m4
 
-# Rebuild
-.PHONY: rebuild
-rebuild: all
-
 AM_CPPFLAGS = $(KPATHSEA_INCLUDES)
 AM_CFLAGS = $(WARNING_CFLAGS)
 
@@ -16,7 +12,7 @@ lib_LTLIBRARIES = libptexenc.la
 
 libptexenc_la_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_PTENC_DLL
 
-libptexenc_la_LDFLAGS = -no-undefined -version-info $(PTEXENC_LT_VERSINFO)
+libptexenc_la_LDFLAGS = -bindir @bindir@ -no-undefined -version-info $(PTEXENC_LT_VERSINFO)
 
 # Note: jisx0208.h is a copy of ../../libs/gd/gd-2.0.35/jisx0208.h.
 #
@@ -42,3 +38,10 @@ nobase_include_HEADERS = \
 
 EXTRA_DIST = COPYRIGHT ChangeLog.jp
 
+# Rebuild
+rebuild_prereq =
+rebuild_target = all
+CLEANFILES =
+
+include $(srcdir)/../../am/rebuild.am
+
index 9273d20..c02144e 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.13.1 from Makefile.am.
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 
 VPATH = @srcdir@
-am__make_dryrun = \
-  { \
-    am__dry=no; \
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
     case $$MAKEFLAGS in \
       *\\[\ \  ]*) \
-        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
-          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
-      *) \
-        for am__flg in $$MAKEFLAGS; do \
-          case $$am__flg in \
-            *=*|--*) ;; \
-            *n*) am__dry=yes; break;; \
-          esac; \
-        done;; \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
     esac; \
-    test $$am__dry = yes; \
-  }
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -51,20 +79,23 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-       $(top_srcdir)/configure $(am__configure_deps) \
-       $(srcdir)/c-auto.in $(top_srcdir)/../../build-aux/depcomp \
+DIST_COMMON = $(srcdir)/../../am/rebuild.am $(srcdir)/Makefile.in \
+       $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(srcdir)/c-auto.in \
+       $(top_srcdir)/../../build-aux/depcomp \
        $(nobase_include_HEADERS) ChangeLog README \
-       ../../build-aux/config.guess ../../build-aux/config.sub \
-       ../../build-aux/depcomp ../../build-aux/install-sh \
-       ../../build-aux/missing ../../build-aux/texinfo.tex \
-       ../../build-aux/ylwrap ../../build-aux/ltmain.sh \
+       ../../build-aux/compile ../../build-aux/config.guess \
+       ../../build-aux/config.sub ../../build-aux/depcomp \
+       ../../build-aux/install-sh ../../build-aux/missing \
+       ../../build-aux/texinfo.tex ../../build-aux/ylwrap \
+       ../../build-aux/ltmain.sh \
+       $(top_srcdir)/../../build-aux/compile \
        $(top_srcdir)/../../build-aux/config.guess \
        $(top_srcdir)/../../build-aux/config.sub \
        $(top_srcdir)/../../build-aux/install-sh \
        $(top_srcdir)/../../build-aux/ltmain.sh \
        $(top_srcdir)/../../build-aux/missing
+subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
        $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \
@@ -334,7 +365,7 @@ AM_CPPFLAGS = $(KPATHSEA_INCLUDES)
 AM_CFLAGS = $(WARNING_CFLAGS)
 lib_LTLIBRARIES = libptexenc.la
 libptexenc_la_CPPFLAGS = $(AM_CPPFLAGS) -DMAKE_PTENC_DLL
-libptexenc_la_LDFLAGS = -no-undefined -version-info $(PTEXENC_LT_VERSINFO)
+libptexenc_la_LDFLAGS = -bindir @bindir@ -no-undefined -version-info $(PTEXENC_LT_VERSINFO)
 
 # Note: jisx0208.h is a copy of ../../libs/gd/gd-2.0.35/jisx0208.h.
 #
@@ -353,13 +384,18 @@ nobase_include_HEADERS = \
        ptexenc/unicode.h
 
 EXTRA_DIST = COPYRIGHT ChangeLog.jp
+
+# Rebuild
+rebuild_prereq = 
+rebuild_target = all
+CLEANFILES = rebuild.stamp
 all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
 am--refresh: Makefile
        @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../am/rebuild.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -382,6 +418,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
        esac;
+$(srcdir)/../../am/rebuild.am:
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
        $(SHELL) ./config.status --recheck
@@ -393,8 +430,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 ptexenc/c-auto.h: ptexenc/stamp-h1
-       @if test ! -f $@; then rm -f ptexenc/stamp-h1; else :; fi
-       @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) ptexenc/stamp-h1; else :; fi
+       @test -f $@ || rm -f ptexenc/stamp-h1
+       @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) ptexenc/stamp-h1
 
 ptexenc/stamp-h1: $(srcdir)/c-auto.in $(top_builddir)/config.status
        @rm -f ptexenc/stamp-h1
@@ -441,6 +478,7 @@ clean-libLTLIBRARIES:
          echo rm -f $${locs}; \
          rm -f $${locs}; \
        }
+
 libptexenc.la: $(libptexenc_la_OBJECTS) $(libptexenc_la_DEPENDENCIES) $(EXTRA_libptexenc_la_DEPENDENCIES) 
        $(AM_V_CCLD)$(libptexenc_la_LINK) -rpath $(libdir) $(libptexenc_la_OBJECTS) $(libptexenc_la_LIBADD) $(LIBS)
 
@@ -655,10 +693,16 @@ dist-xz: distdir
        $(am__post_remove_distdir)
 
 dist-tarZ: distdir
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
        tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
        $(am__post_remove_distdir)
 
 dist-shar: distdir
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
        shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
        $(am__post_remove_distdir)
 
@@ -700,9 +744,10 @@ distcheck: dist
          && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
          && am__cwd=`pwd` \
          && $(am__cd) $(distdir)/_build \
-         && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+         && ../configure \
            $(AM_DISTCHECK_CONFIGURE_FLAGS) \
            $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=.. --prefix="$$dc_install_base" \
          && $(MAKE) $(AM_MAKEFLAGS) \
          && $(MAKE) $(AM_MAKEFLAGS) dvi \
          && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -784,6 +829,7 @@ install-strip:
 mostlyclean-generic:
 
 clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -888,13 +934,30 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS
        uninstall-nobase_includeHEADERS
 
 
-# Rebuild
-.PHONY: rebuild
-rebuild: all
-
 $(libptexenc_la_OBJECTS): $(KPATHSEA_DEPEND)
 
 @KPATHSEA_RULE@
+rebuild.stamp: $(rebuild_target)
+       echo timestamp >$@
+
+.PHONY: rebuild
+rebuild: $(rebuild_prereq)
+       @dry=; for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=*|--*);; \
+           *n*) dry=:;; \
+         esac; \
+       done; \
+       if test -f rebuild.stamp; then :; else \
+         $$dry trap 'rm -rf rebuild.lock' 1 2 13 15; \
+         if $$dry mkdir rebuild.lock 2>/dev/null; then \
+           $(MAKE) $(AM_MAKEFLAGS) rebuild.stamp; \
+           $$dry rmdir rebuild.lock; \
+         else \
+           while test -d rebuild.lock && test -z "$$dry"; do sleep 1; done; \
+         fi; \
+         $$dry test -f rebuild.stamp; exit $$?; \
+       fi
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
index 3caf7f6..01a5710 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.13.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
+[am__api_version='1.14'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.13.1], [],
+m4_if([$1], [1.14.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.1])dnl
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -373,7 +373,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
@@ -418,6 +418,12 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
 
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
 # -----------------------------------------------
@@ -526,7 +532,48 @@ dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -534,7 +581,6 @@ dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
 
-
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
 # that is generated.  The stamp files are numbered to have different names.
@@ -752,6 +798,70 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
@@ -961,76 +1071,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # Substitute a variable $(am__untar) that extract such
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
+#
 AC_DEFUN([_AM_PROG_TAR],
 [# Always define AMTAR for backward compatibility.  Yes, it's still used
 # in the wild :-(  We should find a proper way to deprecate it ...
 AC_SUBST([AMTAR], ['$${TAR-tar}'])
-m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+
+# We'll loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of '-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
 
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
 
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
   rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
 
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
 AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
index 5130081..612fdd6 100644 (file)
@@ -6,7 +6,7 @@
 #define PTEXENC_C_AUTO_H
 
 /* ptexenc: the version string. */
-#define PTEXENCVERSION "REPLACE-WITH-PTEXENCVERSION"
+#define PTEXENCVERSION "ptexenc version 1.3.2"
 
 /* Define to 1 if the `closedir' function returns void instead of `int'. */
 #undef CLOSEDIR_VOID
 /* Define to 1 if you have the `atexit' function. */
 #undef HAVE_ATEXIT
 
-/* Define to 1 if you have the `bcmp' function. */
-#undef HAVE_BCMP
-
-/* Define to 1 if you have the `bcopy' function. */
-#undef HAVE_BCOPY
-
-/* Define to 1 if you have the `bzero' function. */
-#undef HAVE_BZERO
-
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
 #undef HAVE_DIRENT_H
@@ -51,9 +42,6 @@
 /* Define to 1 if you have the <iconv.h> header file. */
 #undef HAVE_ICONV_H
 
-/* Define to 1 if you have the `index' function. */
-#undef HAVE_INDEX
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
@@ -90,9 +78,6 @@
 /* Define to 1 if you have the <pwd.h> header file. */
 #undef HAVE_PWD_H
 
-/* Define to 1 if you have the `rindex' function. */
-#undef HAVE_RINDEX
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
index 479915f..bb55b10 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ptexenc 1.3.1.
+# Generated by GNU Autoconf 2.69 for ptexenc 1.3.2.
 #
 # Report bugs to <tex-k@tug.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ptexenc'
 PACKAGE_TARNAME='ptexenc'
-PACKAGE_VERSION='1.3.1'
-PACKAGE_STRING='ptexenc 1.3.1'
+PACKAGE_VERSION='1.3.2'
+PACKAGE_STRING='ptexenc 1.3.2'
 PACKAGE_BUGREPORT='tex-k@tug.org'
 PACKAGE_URL=''
 
@@ -1328,7 +1328,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 ptexenc 1.3.1 to adapt to many kinds of systems.
+\`configure' configures ptexenc 1.3.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1398,7 +1398,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ptexenc 1.3.1:";;
+     short | recursive ) echo "Configuration of ptexenc 1.3.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1516,7 +1516,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ptexenc configure 1.3.1
+ptexenc configure 1.3.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2126,7 +2126,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 ptexenc $as_me 1.3.1, which was
+It was created by ptexenc $as_me 1.3.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2507,15 +2507,13 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
 
-PTEXENCVERSION=1.3.1
+PTEXENCVERSION=1.3.2
 
-$as_echo "#define PTEXENCVERSION \"ptexenc version 1.3.1\"" >>confdefs.h
 
+PTEXENC_LT_VERSINFO=4:2:3
 
-PTEXENC_LT_VERSINFO=4:1:3
 
-
-am__api_version='1.13'
+am__api_version='1.14'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -3831,6 +3829,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -7565,7 +7622,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='ptexenc'
- VERSION='1.3.1'
+ VERSION='1.3.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7605,6 +7662,10 @@ mkdir_p='$(MKDIR_P)'
 # in the wild :-(  We should find a proper way to deprecate it ...
 AMTAR='$${TAR-tar}'
 
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
 am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
@@ -7612,6 +7673,48 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
     # Check whether --enable-maintainer-mode was given.
@@ -12630,7 +12733,7 @@ _ACEOF
 fi
 done
 
-for ac_func in bcmp bcopy bzero getcwd getwd index memcmp memcpy mkstemp mktemp rindex strchr strrchr
+for ac_func in getcwd getwd memcmp memcpy mkstemp mktemp strchr strrchr
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -13233,7 +13336,7 @@ Usage: $0 [OPTIONS]
 Report bugs to <bug-libtool@gnu.org>."
 
 lt_cl_version="\
-ptexenc config.lt 1.3.1
+ptexenc config.lt 1.3.2
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -14960,7 +15063,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 ptexenc $as_me 1.3.1, which was
+This file was extended by ptexenc $as_me 1.3.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15026,7 +15129,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="\\
-ptexenc config.status 1.3.1
+ptexenc config.status 1.3.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -16086,7 +16189,7 @@ $as_echo X"$mf" |
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
+    test -z "$am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
index feef29b..cea7b00 100644 (file)
@@ -14,7 +14,6 @@ AC_CONFIG_AUX_DIR([../../build-aux])
 AC_CONFIG_MACRO_DIR([../../m4])
 
 AC_SUBST([PTEXENCVERSION], [ptexenc_version])
-AC_DEFINE([PTEXENCVERSION], ["ptexenc version ptexenc_version"])
 KPSE_LT_VERSION([ptexenc])
 
 dnl Common code for all programs (or libraries) using libkpathsea.
@@ -48,7 +47,7 @@ AH_TOP([/* ptexenc/c-auto.h: defines for ptexenc, as determined by configure. */
 #define PTEXENC_C_AUTO_H
 
 /* ptexenc: the version string. */
-#define PTEXENCVERSION "REPLACE-WITH-PTEXENCVERSION"])
+#define PTEXENCVERSION "ptexenc version] ptexenc_version["])
 AH_BOTTOM([#endif /* !PTEXENC_C_AUTO_H */])
 
 AC_CONFIG_FILES([Makefile])
index 08be179..7579386 100644 (file)
@@ -2,18 +2,6 @@
  *  KANJI Code conversion routines.
  */
 
-/*
-     enccode     byte1       byte2
-   1 EUC-JP 0208 0xA1 - 0xFE 0xA1 - 0xFE
-   2 EUC-CN      0xA1 - 0xF7 0xA1 - 0xFE
-   3 EUC-KR      0xA1 - 0xFE 0xA1 - 0xFE
-   4 EUC-TW      0xA1 - 0xFE 0xA1 - 0xFE
-   5 big-5       0x80 - 0xFE 0x40 - 0x7E
-                             0xA1 - 0xFE
-   6 SJIS        
- */
-
 #include <ptexenc/c-auto.h>
 #include <ptexenc/kanjicnv.h>
 
index 4c1d6ac..ddf2a86 100644 (file)
@@ -424,6 +424,7 @@ static int put_multibyte(long c, FILE *fp) {
         if ((fd == fileno(stdout) || fd == fileno(stderr)) && _isatty(fd)) {
             HANDLE hStdout;
             DWORD ret, wclen;
+            UINT cp;
             wchar_t buff[2];
             char str[4];
             int mblen;
@@ -440,8 +441,13 @@ static int put_multibyte(long c, FILE *fp) {
             /* always */       str[mblen++]=BYTE4(c);
 
 #define CP_932     932
+#define CP_UTF8    65001
 
-            if (MultiByteToWideChar(CP_932, 0, str, mblen, buff, 2) == 0)
+            if (is_internalUPTEX())
+                cp = CP_UTF8;
+            else
+                cp = CP_932;
+            if (MultiByteToWideChar(cp, 0, str, mblen, buff, 2) == 0)
                 return EOF;
 
             wclen = mblen > 3 ? 2 : 1;
@@ -449,7 +455,7 @@ static int put_multibyte(long c, FILE *fp) {
                 return EOF;
 
             return BYTE4(c);
-      }
+        }
     }
 #endif
 
@@ -484,9 +490,12 @@ int putc2(int c, FILE *fp)
 
 #ifdef WIN32
     if ((fp == stdout || fp == stderr) && (_isatty(fd) || !prior_file_enc)) {
-        if (sjisterminal)
-            output_enc = ENC_SJIS;
-        else
+        if (sjisterminal) {
+            if (is_internalUPTEX())
+                output_enc = ENC_UTF8;
+            else
+                output_enc = ENC_SJIS;
+        } else
 #else
     if ((fp == stdout || fp == stderr) && !prior_file_enc) {
 #endif
@@ -548,7 +557,49 @@ static int getc4(FILE *fp)
 {
     struct unget_st *p = &ungetbuff[fileno(fp)];
 
-    if (p->size == 0) return getc(fp);
+    if (p->size == 0)
+#ifdef WIN32
+    {
+        const int fd = fileno(fp);
+        HANDLE hStdin;
+        DWORD ret;
+        wchar_t wc[2];
+        long c;
+        static wchar_t wcbuf = L'\0';
+
+        if (!(fd == fileno(stdin) && _isatty(fd) && is_internalUPTEX()))
+            return getc(fp);
+
+        hStdin = GetStdHandle(STD_INPUT_HANDLE);
+        if (wcbuf) {
+            wc[0] = wcbuf;
+            wcbuf = L'\0';
+        }
+        else if (ReadConsoleW(hStdin, wc, 1, &ret, NULL) == 0)
+            return EOF;
+        if (0xd800<=wc[0] && wc[0]<0xdc00) {
+            if (ReadConsoleW(hStdin, wc+1, 1, &ret, NULL) == 0)
+                return EOF;
+            if (0xdc00<=wc[1] && wc[1]<0xe000) {
+                c = UTF16StoUTF32(wc[0], wc[1]);
+            } else {
+                wcbuf = wc[1];
+                c = U_REPLACEMENT_CHARACTER;  /* illegal upper surrogate pair */
+            }
+        } else if (0xdc00<=wc[0] && wc[0]<0xe000) {
+            c = U_REPLACEMENT_CHARACTER;      /* illegal lower surrogate pair */
+        } else {
+            c = wc[0];
+        }
+        c = UCStoUTF8(c);
+        /* always */       p->buff[p->size++]=BYTE4(c);
+        if (BYTE3(c) != 0) p->buff[p->size++]=BYTE3(c);
+        if (BYTE2(c) != 0) p->buff[p->size++]=BYTE2(c);
+        if (BYTE1(c) != 0) p->buff[p->size++]=BYTE1(c);
+    }
+#else
+        return getc(fp);
+#endif
     return p->buff[--p->size];
 }
 
@@ -711,6 +762,7 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
     const int fd = fileno(fp);
 
     if (infile_enc[fd] == ENC_UNKNOWN) { /* just after opened */
+        ungetbuff[fd].size = 0;
         if (isUTF8Nstream(fp)) infile_enc[fd] = ENC_UTF8;
         else                   infile_enc[fd] = get_file_enc();
     }
@@ -720,6 +772,13 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
     while (last < buffsize-30 && (i=getc4(fp)) != EOF && i!='\n' && i!='\r') {
         /* 30 is enough large size for one char */
         /* attention: 4 times of write_hex() eats 16byte */
+#ifdef WIN32
+        if (i == 0x1a && first == last &&
+            fd == fileno(stdin) && _isatty(fd)) { /* Ctrl+Z on console */
+                i = EOF;
+                break;
+        } else
+#endif
         if (i == ESC) {
             if ((i=getc4(fp)) == '$') { /* ESC '$' (Kanji-in) */
                 i = getc4(fp);
@@ -776,14 +835,6 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
     if (i == EOF || i == '\n' || i == '\r') injis = false;
     if (lastchar != NULL) *lastchar = i;
 
-    if (i == '\r' && !isatty(fd)) {
-       int ii;
-       while ((ii = getc4(fp)) == EOF && errno == EINTR)
-          ;
-       if (ii != '\n')
-          ungetc4(ii, fp);
-    }
-
     return last;
 }
 
diff --git a/src/texsourc/libtoua/ptexenc/ptexenc/c-auto.h b/src/texsourc/libtoua/ptexenc/ptexenc/c-auto.h
new file mode 100644 (file)
index 0000000..753b4c0
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef PTEXENC_C_AUTO_H
+#define PTEXENC_C_AUTO_H
+
+#define NO_PTENC_DLL 1
+
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
+
+#ifndef PTEXENCVERSION
+#define PTEXENCVERSION "ptexenc version 1.3.1"
+#endif
+
+#undef KANJI_ICONV
+
+/* Define if you have the atexit function.  */
+#undef HAVE_ATEXIT
+
+/* Define if you have the iconv function.  */
+#undef HAVE_ICONV
+
+/* Define if you have the on_exit function.  */
+#undef HAVE_ON_EXIT
+
+/* Define if you have the <iconv.h> header file.  */
+#undef HAVE_ICONV_H
+
+/* Define if you have the <limits.h> header file.  */
+#define HAVE_LIMITS_H 1
+
+/* Define if you have the <stdlib.h> header file.  */
+#define HAVE_STDLIB_H 1
+
+/* Define if you have the <sys/param.h> header file.  */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the iconv library (-liconv).  */
+#undef HAVE_LIBICONV
+
+#endif /* !PTEXENC_C_AUTO_H */
index 13e1567..9e4c91f 100644 (file)
@@ -51,4 +51,7 @@ extern long UPTEXtoUCS(long uptex);
 #define UTF32toUTF16HS(x)  (0xd800 + ((((x)-0x10000) >> 10) & 0x3ff))
 #define UTF32toUTF16LS(x)  (0xdc00 + (  (x)                 & 0x3ff))
 
+/* UTF-16 surrogate pair -> UTF-32 over U+FFFF */
+#define UTF16StoUTF32(x,y) ((((x) & 0x3ff) << 10) + ((y) & 0x3ff) + 0x10000)
+
 #endif /* PTEXENC_UNICODE_H */
index 6379b2e..6840a63 100644 (file)
@@ -1,5 +1,4 @@
-dnl
-dnl   Copyright (C) 2011-2013 Peter Breitenlohner <tex-live@tug.org>
+dnl   Copyright 2011-2014 Peter Breitenlohner <tex-live@tug.org>
 dnl
 dnl   This file is free software; the copyright holder
 dnl   gives unlimited permission to copy and/or distribute it,
@@ -19,4 +18,4 @@ dnl     append "dev", to distinguish binaries built between releases.
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current ptexenc version
-m4_define([ptexenc_version], [1.3.1])
+m4_define([ptexenc_version], [1.3.2])
index a3c635f..b063d4a 100644 (file)
 #pragma warning(disable:4135) // conversion between different integral types 
 #pragma warning(disable:4127) // conditional expression is constant
 
+#include <kpathsea/config.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/line.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/variable.h>
+#include <kpathsea/absolute.h>
+
 #include <setjmp.h>
 
 #define EXTERN extern
@@ -2016,21 +2023,16 @@ int free_memory (void)
 
   if (trace_flag) show_line("free_memory ", 0);
 
-#ifdef CHECKEQTB
-  if (debug_flag) check_eqtb("free_memory");
-#endif
-  if (verbose_flag || trace_flag) show_maximums(stdout); 
-#ifdef HEAPWALK
-  if (heap_flag) (void) heap_dump(stdout, 1);
-#endif
-  if (trace_flag) {
-#ifdef HEAPWALK
-    heaptotal = (void) heap_dump(stdout, 0);
-#endif
+  if (verbose_flag || trace_flag)
+    show_maximums(stdout); 
+
+  if (trace_flag)
+  {
     sprintf(log_line, "Heap total: %u bytes --- max address %u\n", 
         heaptotal, max_address);
     show_line(log_line, 0);
   }
+
   if (trace_flag) {
     sprintf(log_line, "Main Memory: variable node %d (%d - %d) one word %d (%d - %d)\n",
       lo_mem_max - mem_min, mem_min, lo_mem_max, mem_end  - hi_mem_min, hi_mem_min, mem_end);
@@ -2058,7 +2060,8 @@ int free_memory (void)
 #endif
 /*  only free memory if safe ... additional check */
 #ifdef ALLOCATEINI
-  if (is_initex) {
+  if (is_initex)
+  {
     if (trie_taken != NULL) free(trie_taken);
     if (trie_hash  != NULL) free(trie_hash);
     if (trie_r     != NULL) free(trie_r);
@@ -3154,23 +3157,18 @@ int init_commands (int ac, char **av)
   programpath = xstrdup(av[0]); /* extract path executable */
   strip_name(programpath); /* strip off yandytex.exe */
 
-  //format_name = "yandytex";
   format_name = "plain"; /* format name if specified on command line */
 
   encoding_name = "";
 
-  if (read_commands(yytexcmd) < 0)   /* read yandytex.cmd 1994/July/12 */
-    return -1;            // in case of error
-
   if (read_command_line(ac, av) < 0)  /* move out to subr 94/Apr/10 */
     return -1;            // in case of error
 
-  if (optind == 0) optind = ac;   /* no arg case paranoia 94/Apr/10 */
+  if (optind == 0)
+    optind = ac;
 
-/*  Print version *after* banner ? */ /* does this get in log file ? */
-  if (want_version) {
-//  showversion (stdout);
-//  showversion (log_line);
+  if (want_version)
+  {
     stamp_it(log_line);
     strcat(log_line, "\n");
     show_line(log_line, 0);
@@ -3178,14 +3176,14 @@ int init_commands (int ac, char **av)
     strcat(log_line, "\n");
     show_line(log_line, 0);
   }
-/*  if (show_use) show_usage();   */  /* show usage and quit */
 
 /*  if we aren't including current directory in any directory lists */
 /*  then makes no sense to avoid them separately for TFM files ... */
 /*  (that is, the ./ is already omitted from the dir list in that case */
   if (!current_flag && !current_tfm)
     current_tfm = true; /* 94/Jan/24 */
-  return 0;               // success
+
+  return 0;
 }
 
 /* E sets environment variable ? */
@@ -3195,10 +3193,13 @@ void initial_memory (void)
   /* set initial memory allocations */
   if (mem_extra_high < 0)
     mem_extra_high = 0;
+
   if (mem_extra_low < 0)
     mem_extra_low = 0;
+
   if (mem_initex < 0)
     mem_initex = 0;
+
   if (is_initex)
   {
  #if defined(ALLOCATEHIGH) || defined(ALLOCATELOW)
@@ -3216,6 +3217,7 @@ void initial_memory (void)
       show_line("ERROR: Can only set initial main memory size in iniTeX\n", 1);
       mem_initex = 0;
     }
+
     if (trie_size != 0)
     {
       show_line("ERROR: Need only set hyphenation trie size in iniTeX\n", 1);
@@ -3310,29 +3312,6 @@ void checkpause (int flag)
   }
 }
 
-void check_enter (int argc, char *argv[])
-{/* 95/Oct/28 */
-  int m;
-  char current[FILENAME_MAX];
-  if (grabenv("DEBUGPAUSE") != NULL) {
-    (void) _getcwd(current, sizeof(current));
-    sprintf(log_line, "Current directory: `%s'\n", current);
-    show_line(log_line, 0);
-    for (m = 0; m < argc; m++) {
-      sprintf(log_line, "%2d: `%s'\n", m, argv[m]); 
-      show_line(log_line, 0);
-    }
-    checkpause(-1);
-  }
-}
-
-#ifdef IGNORED
-void checkexit (int n)
-{              /* 95/Oct/28 */
-  checkpause(1);
-  exit(n);
-}
-#endif
 
 /*************************************************************************/
 
@@ -3344,15 +3323,18 @@ void checkexit (int n)
 
 void hidetwiddle (char *name)
 {
-  char *s=name;
+  char *s = name;
+
 #ifdef DEBUGTWIDDLE
-  if (trace_flag) {
+  if (trace_flag)
+  {
     sprintf(log_line, "Hidetwiddle %s", name);
     show_line(log_line, 0);
   }
 #endif
 /*  while (*s != '\0' && *s != ' ') { */
-  while (*s != '\0')  {
+  while (*s != '\0')
+  {
     if (*s == '~' && pseudo_tilde != 0)
       *s = (char) pseudo_tilde;  /* typically 254 */
     else if (*s == ' ' && pseudo_space != 0)
@@ -3360,7 +3342,8 @@ void hidetwiddle (char *name)
     s++;
   }
 #ifdef DEBUGTWIDDLE
-  if (trace_flag) {
+  if (trace_flag)
+  {
     sprintf(log_line, "=> %s\n", name);
     show_line(log_line, 0);
   }
@@ -3372,11 +3355,6 @@ void deslash_all (int ac, char **av)
   char buffer[PATH_MAX];  
   char *s;
 
-  if ((s = getenv("USEDVIWINDOINI")) != NULL) 
-    sscanf(s, "%d", &usedviwindo);      /* 94/June/14 */
-
-  check_enter(ac, av);           /* 95/Oct/28 */
-
 /* environment variables for output directories (as in PC TeX) */
 
   if ((s = grabenv("TEXDVI")) != NULL) dvi_directory = s;
@@ -3386,6 +3364,7 @@ void deslash_all (int ac, char **av)
   if ((s = grabenv("TEXPDF")) != NULL) pdf_directory = s;
 
   strcpy(buffer, av[0]);            /* get path to executable */
+
   if ((s = strrchr(buffer, '\\')) != NULL) *(s+1) = '\0';
   else if ((s = strrchr(buffer, '/')) != NULL) *(s+1) = '\0';
   else if ((s = strrchr(buffer, ':')) != NULL) *(s+1) = '\0';
@@ -3463,23 +3442,12 @@ void deslash_all (int ac, char **av)
 /* note: those optarg == 0 test don't really work ... */
 /* note: optarg starts at = in case of x=... */
 
-int init (int ac, char **av)
+int main_init (int ac, char **av)
 {
   char initbuffer[PATH_MAX];
   int k;
-  
-  debugfile = getenv("TEXDEBUG");     /* 94/March/28 */
 
-  if (debugfile)
-    debug_flag = 1;
-  else
-    debug_flag = 0;
-
-  if (debug_flag)
-  {
-    show_line("TEXDEBUG\n", 0);
-    trace_flag = 1;            /* 94/April/14 */
-  }
+  kpse_set_program_name(av[0], NULL);
 
   if (sizeof(memory_word) != 8) /* compile time test */
   {
@@ -3497,26 +3465,21 @@ int init (int ac, char **av)
   font_info = NULL;
   str_pool = NULL;
   str_start = NULL;
-#ifdef ALLOCATEZEQTB
-  zeqtb = NULL;
-#endif
-#ifdef ALLOCATEHASH
-  zzzae = NULL;
-#endif
+
 #ifdef ALLOCATESAVESTACK
   save_stack = NULL; 
 #endif
-#ifdef ALLOCATEDVIBUF
-  zdvibuf = NULL; 
-#endif
+
 #ifdef ALLOCATEBUFFER
   buffer = NULL;        /* new 1999/Jan/7 need to do early */
   current_buf_size = 0;
   buffer = realloc_buffer (initial_buf_size);
-/*  sprintf(log_line, "buffer %x, current_buf_size %d\n", buffer, current_buf_size); */
 #endif
-  hyph_list = NULL; hyph_word = NULL;
-  trie_taken = NULL; trie_hash = NULL;
+
+  hyph_list = NULL;
+  hyph_word = NULL;
+  trie_taken = NULL;
+  trie_hash = NULL;
   trie_r = NULL;
   trie_c = NULL;
   trie_o = NULL;
@@ -3526,17 +3489,18 @@ int init (int ac, char **av)
   trie_trl = NULL;
 
   log_opened = false;       /* so can tell whether opened */
-  interaction = -1;       /* default state => 3 */
-  missing_characters = 0;      /* none yet! */
-  workingdirectory = false;   /* set from dviwindo.ini & command line */
-  font_dimen_zero = true;     /* \fontdimen0 for checksum 98/Oct/5 */
-  ignore_frozen = false;     /* default is not to ignore 98/Oct/5 */
-  suppress_f_ligs = false;      /* default is not to ignore f-ligs */
+  interaction = -1;         /* default state => 3 */
+  missing_characters = 0;   /* none yet! */
+  workingdirectory = false; /* set from dviwindo.ini & command line */
+  font_dimen_zero = true;   /* \fontdimen0 for checksum 98/Oct/5 */
+  ignore_frozen = false;    /* default is not to ignore 98/Oct/5 */
+  suppress_f_ligs = false;  /* default is not to ignore f-ligs */
 
   if (ac > 1 && !strncmp(av[1], "-Y", 2))
     reorder_arg_flag = false;
 
-  if (reorder_arg_flag) reorderargs(ac, av);  
+  if (reorder_arg_flag)
+    reorderargs(ac, av);  
 
   if (init_commands(ac, av))
     return -1;          // failure
@@ -3572,17 +3536,10 @@ int init (int ac, char **av)
   if (trace_flag)
     show_maximums(stdout);
 
-#ifdef HEAPWALK
-  if (heap_flag)
-    (void) heap_dump(stdout, 1);
-#endif
-
   initial_memory();
 
   deslash_all(ac, av);    /* deslash and note if format specified */
 
-/*  sprintf(log_line, "%s\n", initbuffer); */    /* debugging, remove later */
-
   no_interrupts = 0;
 
   if (format_spec && mem_spec_flag)
@@ -3590,26 +3547,20 @@ int init (int ac, char **av)
     show_line("WARNING: Cannot change initial main memory size when format specified", 1);
   }
 
-   if (allocate_memory() != 0)   /* NOW, try and ALLOCATE MEMORY if needed */
-     return -1;         // if failed to allocate
+  if (allocate_memory() != 0)   /* NOW, try and ALLOCATE MEMORY if needed */
+    return -1;         // if failed to allocate
 
 /*   following is more or less useless since most all things not yet alloc */
    check_alloc_align(trace_flag);    /* sanity check 1994/Jan/8 */
 
-#ifdef HEAPSHOW
-   if (trace_flag) showaddresses();  /* debugging only 1996/Jan/20 */
-#endif
-
-#ifdef HEAPWALK
-/*   if (heap_flag) heap_dump(stdout, 1); */  /* redundant ? */
-#endif
+  if (trace_flag)
+    show_line("Leaving init (local)\n", 0);
 
-   if (trace_flag)
-     show_line("Leaving init (local)\n", 0);
-   return 0;         // success
+  return 0;         // success
 }
 
-/* #define CLOCKS_PER_SEC 1000 */ /* #define CLK_TCK  CLOCKS_PER_SEC */
+/* #define CLOCKS_PER_SEC 1000 */
+#define CLK_TCK  CLOCKS_PER_SEC
 
 /* void show_inter_val (clock_t start, clock_t end) { */
 void show_inter_val (clock_t interval)
@@ -4082,300 +4033,6 @@ void show_font_info (void)
   free((void *)fnumtable);
 }
 
-////////////////////////////////////////////////////////////////////////////
-
-// Here follows the new stuff for the DLL version
-
-#ifdef _WINDOWS
-
-int showlineinx=0;
-
-#define SHOWLINEBUFLEN 256
-
-char showlinebuf[SHOWLINEBUFLEN];
-
-// char log_line[MAXLINE];
-
-#define WHITESPACE " \t\n\r"
-
-HINSTANCE hInstanceDLL=NULL;    /* remember for this DLL */
-
-/* This is the callback function for the EDITTEXT Control in CONSOLETEXT */
-
-#define GET_WM_COMMAND_CMD(wParam, lParam)  (HIWORD(wParam))
-#define GET_WM_COMMAND_ID(wParam, lParam) (LOWORD(wParam))
-#define GET_WM_COMMAND_HWND(wParam, lParam) ((HWND)lParam)
-
-HWND hConsoleWnd=NULL;    /* Console Text Window Handle passed from DVIWindo */
-
-void ClearShowBuffer (void)
-{
-  showlinebuf[showlineinx++] = '\0';    // clear out accumulated stuff
-  if (hConsoleWnd != NULL)
-    SendMessage(hConsoleWnd, ICN_ADDTEXT, (WPARAM) showlinebuf, 0L);
-  showlineinx = 0;
-}
-
-// communicate with DVIWindo (for yandytex.dll)
-
-void show_line (char *line, int errflag) {     /* 99/June/11 */
-  int ret;
-
-  if (IsWindow(hConsoleWnd) == 0) {   // in case the other end died
-    sprintf(line, "NO CONSOLE WINDOW? %08X %s", hConsoleWnd, line);
-    ret = MessageBox(NULL, line, "YandYTeX", MB_ICONSTOP | MB_OKCANCEL | MB_TASKMODAL);
-    hConsoleWnd = NULL;
-//    abort_flag++;            // kill job in this case ???
-    return;
-  }
-
-  if (showlineinx > 0) ClearShowBuffer();
-
-  if (hConsoleWnd != NULL)
-    SendMessage(hConsoleWnd, ICN_ADDTEXT, (WPARAM) line, 0L);
-
-  if (errflag) {
-    err_level++;
-    ret =  MessageBox(NULL, line, "YandYTeX", MB_ICONSTOP | MB_OKCANCEL | MB_TASKMODAL);
-    if (ret == IDCANCEL) {
-//      abort_flag++;
-      uexit(1);   // dangerous reentry possibility ?
-    }
-  }
-}
-
-//  Provide means for buffering up individual characters
-
-void show_char (int chr) {
-  if (showlineinx +2 >= SHOWLINEBUFLEN) ClearShowBuffer();
-  showlinebuf[showlineinx++] = (char) chr;
-  if (chr == '\n') ClearShowBuffer();
-}
-
-void winshow(char *line) {
-  (void) MessageBox(NULL, line, "YandYTeX", MB_ICONINFORMATION | MB_OK | MB_TASKMODAL);
-}
-
-void winerror (char *line) {
-  int ret;
-  ret = MessageBox(NULL, line, "YandYTeX", MB_ICONSTOP | MB_OKCANCEL | MB_TASKMODAL);
-  if (ret == IDCANCEL) abort_flag++;
-}
-
-// argument info constructed from command line 
-
-int xargc;
-
-char **xargv=NULL;
-
-// need to be careful here because of quoted args with spaces in them
-// e.g. -d="G:\Program Files\Adobe\Acrobat\*.pdf"
-
-int makecommandargs (char *line)
-{
-  int xargc;
-//  char *s, *t;
-  unsigned char *s, *t;       // fix 2000 June 18
-
-  if (line == NULL) return -1;    /* sanity check */
-
-//  winerror(line);           // debugging only
-
-//  s = strtok(line, WHITESPACE);
-//  while (s != NULL) {         /* count arguments */
-//    xargc++;
-//    s = strtok(NULL, WHITESPACE);
-//  }
-
-  xargc = 0;
-  s = line;
-  while (*s != '\0') {
-    while (*s <= 32 && *s > 0) s++;
-    if (*s == '\0') break;
-    t = s;
-    while (*t > 32 && *t != '\"') t++;
-    if (*t == '\"') {
-      t++;
-      while (*t > 0 && *t != '\"') t++;
-      if (*t == '\0') break;
-      t++;
-    }
-//    xargv[xargc] = s;
-    xargc++;
-    if (*t == '\0') break;
-//    *t = '\0';
-    s = t+1;
-  }
-
-  if (xargc == 0) return -1;      /* nothing to do */
-
-  xargv = (char **) malloc(xargc * sizeof(char *));
-  if (xargv == NULL) {
-    sprintf(log_line, "ERROR: Unable to allocate memory for %s\n", "arguments");
-    winerror(log_line);
-    return -1;
-  }
-
-  xargc = 0;
-  s = line;
-  while (*s != '\0') {
-    while (*s <= ' ' && *s > '\0') s++; /* eat white space */
-    if (*s == '\0') break;
-    t = s;
-    while (*t > ' ' && *t != '\"') t++;
-    if (*t == '\"') {
-      t++;
-      while (*t > 0 && *t != '\"') t++;
-      if (*t == '\0') break;
-      t++;
-    }
-//    winerror(s);    // debugging only
-    xargv[xargc] = s;
-    xargc++;
-    if (*t == '\0') break;
-    *t = '\0';
-    s = t+1;
-  }
-
-//  s = line;
-//  for (k = 0; k < xargc; k++) { /* create pointers to args */
-//    while (*s > '\0' && *s <= ' ') s++; /* eat white space */
-//    xargv[k] = s;
-//    s += strlen(s) +1;
-//  }
-
-#ifdef DEBUGGING
-  s = log_line;
-  *s = '\0';
-  for (k = 0; k < xargc; k++) {
-    sprintf(s, "%d\t%s\n", k, xargv[k]);
-    s += strlen(s);
-  }
-  winshow(log_line);
-#endif
-  return xargc;
-}
-
-// refers to TeXAsk in dviwindo.c
-
-// int (* AskUserCall) (char *, char *) = NULL; // callback for user questions
-int (* AskUserCall) (char *, char *, char *) = NULL;  // callback for user questions
-
-// called from tex0.c only  ---  by initterm and term_input
-
-//int ConsoleInput (char *question, char *buffer) 
-int ConsoleInput (char *question, char *help, char *buffer)
-{
-  int ret=0;
-//  char *s;
-  if (AskUserCall == NULL) return 0;
-//  sprintf(log_line, "str_start %x %x\n", str_start, str_start [831]);
-//  show_line(log_line, 1);
-
-  *buffer = '\0';
-  ret = AskUserCall (question, help, buffer);   // value returned by dialogbox
-//  strcpy(buffer, "x");
-//  strcat(buffer, " ");      // ???
-//  sprintf(log_line, "str_start %x %x\n", str_start, str_start[831]);
-//  show_line(log_line, 1);
-//  input_line_finish();      // ???
-//  s = buffer + strlen(buffer);
-//  *s++ = ' ';           // space terminate
-//  *s++ = '\0';          // and null terminate
-//  returning != 0 means EOF or ^Z
-  return ret;
-}
-
-//  This is the new entry point of DLL called from DVIWindo 
-//  ARGS: console window to send messages to, command line, callback fun
-//  no console window output if hConsole is NULL
-//  returns -1 if it fails --- returns 0 if it succeeds
-
-// MYLIBAPI int yandytex (HWND hConsole, char *line, int (* AskUser) (char *, char *)) {
-MYLIBAPI int yandytex (HWND hConsole, char *line, int (* AskUser) (char *, char *, char *))
-{
-  int flag;
-
-  abort_flag = 0;            // redundant
-  hConsoleWnd = NULL;         // redundant
-
-  AskUserCall = AskUser;        // remember callback
-
-  hConsoleWnd = hConsole;       // remember console window handle
-
-//  can't getenv("DEBUGPAUSE") cause setupdviwindo not called yet
-//  if (grabenv("DEBUGPAUSE") != NULL) {
-//    show_line(line, 0);          // debugging - show command line
-//    show_line("\n", 0);
-//  }
-
-  xargc = makecommandargs(line);      // sets up global *xargv[]
-
-  if (xargc < 0) return -1;       // sanity check
-
-  if (hConsoleWnd != NULL) 
-    SendMessage(hConsoleWnd, ICN_SETTITLE, (WPARAM) "YandYTeX", 0L);
-//  SendMessage(hConsoleWnd, ICN_RESET, 0, 0L); // if want to clear window
-
-
-  (void) main(xargc, xargv);  // now run YandYTeX proper in texmf.c 
-
-  if (err_level > 0 || abort_flag > 0) {
-//    sprintf(log_line, "ERRORS in Processing (err %d abort %d)\n",
-//        err_level, abort_flag);
-//    winerror(log_line);
-  }
-
-//  if (psbufpos > 0) sendpsbuffer(output);   // empty out PS buffer
-//  if (psbufpos > 0) PSputs("", output);   // output already closed
-
-  if (hConsoleWnd != NULL) {
-    if (err_level > 0 || abort_flag > 0) flag = 1;
-    else flag = 0;              // pass along error indication
-    SendMessage(hConsoleWnd, ICN_DONE, flag, 0);  // flush out console buffer
-  }
-//  PScallback = NULL;
-  hConsoleWnd = NULL;
-
-  if (xargv != NULL) free(xargv);
-  if (abort_flag) return -1;
-  else return 0;
-}
-
-BOOL WINAPI DllMain (HINSTANCE hInstDll, DWORD fdwReason, LPVOID fImpLoad)
-{
-
-  switch (fdwReason) {
-    case DLL_PROCESS_ATTACH:
-      // The DLL is being mapped into the process's address space
-      // place to allocate memory ???
-      // return FALSE if this fails
-      hInstanceDLL = hInstDll;    /* remember it */
-      break;
-
-    case DLL_THREAD_ATTACH:
-      // A thread is being created
-      break;
-
-    case DLL_THREAD_DETACH:
-      // A thread is exiting cleanly
-      break;
-
-    case DLL_PROCESS_DETACH:
-      // The DLL is being unmapped from the process's address space
-      // place to free any memory allocated
-      // but make sure it in fact *was* allocated
-      hInstanceDLL = NULL;    /* forget it */
-      break;
-  }
-  return(TRUE); // used only for DLL_PROCESS_ATTACH
-}
-#endif  // end of new stuff for DLL version
-
-//////////////////////////////////////////////////////////////////////////////
-
-
-
 /*  NOTE: current_tfm = false (-c)
   not checking for TFM in current directory saves 0.1 sec
   (0.2 if file_method = false (-G) */
index d0aef99..a9d097e 100644 (file)
@@ -76,7 +76,6 @@ bool absolute_p (string filename);
 string readable (string name);
 string truncate_pathname (string name);
 char * file_p(string fn);
-bool dir_p(string fn);
 string *find_dir_list (string path);
 void add_directory (string **dir_list_ptr, unsigned *dir_count_ptr, string dir);
 void expand_subdir (string **dir_list_ptr, unsigned *dir_count_ptr, string dirname, struct _finddata_t findt, integer recurseflag);
@@ -131,31 +130,13 @@ integer zround (double r)
   else if (r < -2147483647.0)
     i = -2147483647;
   else if (r >= 0.0)
-    i = (integer)(r + 0.5);
+    i = (integer) (r + 0.5);
   else
-    i = (integer)(r - 0.5);
+    i = (integer) (r - 0.5);
 
   return i;
 }
 /* texk/web2c/lib/eofeoln.c */
-bool test_eof (FILE * file)
-{
-  int c;
-/* Maybe we're already at the end?  */
-  if (!file)
-    return true;
-
-  if (feof (file))
-    return true;
-
-  if ((c = getc (file)) == EOF)
-    return true;
-/* We weren't at the end.  Back up.  */
-  (void) ungetc (c, file);
-
-  return false;
-}
-/* texk/web2c/lib/eofeoln.c */
 bool eoln (FILE * file)
 {
   register int c;
@@ -168,8 +149,7 @@ bool eoln (FILE * file)
   if (c != EOF)
     (void) ungetc (c, file);
 
-  return c == '\n' || c == '\r' || c == EOF; // ???
-/* Type mismatch (return) (int/enum) ? */
+  return c == '\n' || c == '\r' || c == EOF;
 }
 
 char * read_a_line (FILE *f,  char *line, int limit)
index c35928e..d67a48e 100644 (file)
@@ -844,7 +844,6 @@ void confusion_(char * s)
 /* sec 0037 */
 bool init_terminal (void)
 {
-  register bool Result;
   int flag;
 
   t_open_in();
@@ -857,10 +856,7 @@ bool init_terminal (void)
       incr(cur_input.loc_field);    // step over initial white space
 
     if (cur_input.loc_field < last)
-    {
-      Result = true;
-      return Result;    // there is an input file name
-    }
+      return true;
   }
 
 // failed to find input file name
@@ -880,8 +876,7 @@ bool init_terminal (void)
     {
       show_char('\n');
       show_line("! End of file on the terminal... why?\n", 1);
-      Result = false;
-      return Result;
+      return false;
     }
 
     cur_input.loc_field = first;
@@ -890,10 +885,7 @@ bool init_terminal (void)
       incr(cur_input.loc_field);    // step over intial white space
 
     if (cur_input.loc_field < last)
-    {
-      Result = true;
-      return Result;    // there is an input file name
-    }
+      return true;
 
     sprintf(log_line, "%s\n", "Please type the name of your input file.");
     show_line(log_line, 1);
index f5452b1..2ba50fe 100644 (file)
@@ -87,7 +87,7 @@ halfword new_character_(internal_font_number f, eight_bits c)
 
   if (font_bc[f] <= c)
     if (font_ec[f] >= c)
-      if ((font_info[char_base[f] + c].qqqq.b0 > 0))
+      if (char_exists(char_info(f, c)))
       {
         p = get_avail();
         font(p) = f;
@@ -95,10 +95,9 @@ halfword new_character_(internal_font_number f, eight_bits c)
         return p;
       }
 
-  char_warning(f, c); /* char_warning(f,c); l.11283 */
+  char_warning(f, c);
   return 0;
 }
-/* following needs access to dvi_buf=zdvibuf see coerce.h */
 /* sec 0598 */
 void dvi_swap (void)
 { 
@@ -124,31 +123,24 @@ void dvi_swap (void)
 
   dvi_gone = dvi_gone + half_buf;
 }
-/* following needs access to dvi_buf=zdvibuf see coerce.h */
 /* attempt at speeding up bkph - is compiler smart ? */
 /* sec 0600 */
 void dvi_four_(integer x)
 { 
   if (x >= 0)
-    // dvi_out(x % 16777216L);
-    dvi_out((x >> 24));
+    dvi_out(x / 0100000000); // dvi_out((x >> 24));
   else
   {
-    x = x + 1073741824L;    /* 2^30 40000000 hex */
-    x = x + 1073741824L;
-    //dvi_out((x / 16777216L) + 128);
-    dvi_out((x >> 24) + 128);
+    x = x + 010000000000;
+    x = x + 010000000000;
+    dvi_out((x / 0100000000) + 128); // dvi_out((x >> 24) + 128);
   }
-/*  x = x % 16777216L;  */  /* % 2^24 */
-  x = x & 16777215L;
-  //dvi_out(x / 65536L);
-  dvi_out((x >> 16));
-/*  x = x % 65536L;  */ /* % 2^16 */
-  x = x & 65535L;
-  //dvi_out(x / 256);
-  dvi_out((x >> 8));
-  //dvi_out(x % 256);
-  dvi_out(x & 255);
+
+  x = x % 0100000000; // x = x & 16777215L;
+  dvi_out(x / 0200000); // dvi_out((x >> 16));
+  x = x % 0200000; // x = x & 65535L;
+  dvi_out(x / 0400); // dvi_out((x >> 8));
+  dvi_out(x % 0400); // dvi_out(x & 255);
 }
 /* following needs access to dvi_buf=zdvibuf see coerce.h */
 /* sec 0601 */
@@ -161,11 +153,6 @@ void zdvipop(integer l)
 }
 /* following needs access to dvi_buf=zdvibuf see coerce.h */
 /* sec 0602 */
-/*
-void pdf_font_def_(internal_font_number f)
-{
-}
-*/
 void dvi_font_def_(internal_font_number f)
 {
   pool_pointer k;
@@ -186,8 +173,7 @@ void dvi_font_def_(internal_font_number f)
   dvi_out(fnt_def1);
   dvi_out(f - 1);
 #endif
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/* spit out the font checksum now */
+
   dvi_out(font_check[f].b0);
   dvi_out(font_check[f].b1);
   dvi_out(font_check[f].b2);
@@ -203,7 +189,6 @@ void dvi_font_def_(internal_font_number f)
   for (k = str_start[font_name[f]]; k <= str_start[font_name[f] + 1] - 1; k++)
     dvi_out(str_pool[k]);
 }
-/* following needs access to dvi_buf=zdvibuf see coerce.h */
 /* sec 0607 */
 void zmovement(scaled w, eight_bits o)
 {
@@ -412,6 +397,7 @@ void prune_movements_(integer l)
     down_ptr = link(p);
     free_node(p, movement_node_size);
   }
+
 lab30:
   while (right_ptr != 0)
   {
@@ -476,46 +462,6 @@ void special_out_(halfword p)
     dvi_four(cur_length); 
   } 
 
-#ifdef IGNORED
-/*  debugging code for \special{src: ... } 98/Nov/11 */
-  {
-    int k = str_start[str_ptr];
-    int kend = pool_ptr;
-    /* \special{src: ... } */
-    if (kend > k + 4)
-    {
-      if (str_pool [k] == 's' && str_pool [k + 1] == 'r' && str_pool [k + 2] == 'c' && str_pool [k + 3] == ':')
-      {
-        show_char('\n');
-        s = log_line;
-
-        while (k < kend)
-        {
-          *s++ = str_pool[k++];
-        }
-
-        *s++ = ' ';
-        *s++ = '\0';
-        show_line(log_line, 0)
-#ifndef _WINDOWS
-        fflush(stdout);
-#endif
-        if (cur_input.name_field > 17) /* redundant ? */
-        {
-          print(cur_input.name_field);          
-          print_char('(');
-          print_int(line);      /* line number */
-          print_char(')');
-          print_char(' ');
-          print_char(':');
-        }
-#ifndef _WINDOWS
-        fflush(stdout);
-#endif
-      }
-    }
-  }
-#endif
   for (k = str_start[str_ptr]; k <= pool_ptr - 1; k++)
     dvi_out(str_pool[k]);
 
@@ -1201,7 +1147,7 @@ lab15:
 /*
 void error_handler (HPDF_STATUS error_no, HPDF_STATUS detail_no, void * user_data)
 {
-  printf ("ERROR: error_no=%04X, detail_no=%u\n", (HPDF_UINT)error_no, (HPDF_UINT)detail_no);
+  printf ("YANDYTEX ERROR: error_no=%04X, detail_no=%u\n", (HPDF_UINT)error_no, (HPDF_UINT)detail_no);
   longjmp(jumpbuffer, 1);
 }
 */
index 4797157..1c4a45c 100644 (file)
@@ -50,9 +50,8 @@ bool open_fmt_file (void)
     pack_buffered_name(0, cur_input.loc_field, j - 1);
 
     if (w_open_in(fmt_file))
-      goto lab40;  /* format file opened OK */
+      goto lab40;
   
-/* format file open failed */
     if (knuth_flag)
     {
       (void) sprintf(log_line, "%s;%s\n", "Sorry, I can't find that format",
index b1f0295..65eb061 100644 (file)
@@ -804,7 +804,9 @@ EXTERN dvi_index dvi_ptr;
 EXTERN integer dvi_offset; 
 EXTERN integer dvi_gone; 
 EXTERN halfword down_ptr, right_ptr; 
-EXTERN scaled dvi_h, dvi_v; 
+EXTERN scaled dvi_h, dvi_v;
+EXTERN scaled pdf_h, pdf_v;
+EXTERN scaled pdf_x, pdf_y;
 EXTERN scaled cur_h, cur_v; 
 EXTERN internal_font_number dvi_f; 
 EXTERN integer cur_s; 
@@ -2050,6 +2052,7 @@ EXTERN int tfm_temp;        /* only used in tex3.c 95/Jan/7 */
 /* sec 0554 */
 #define char_info(a, b)   font_info[char_base[a] + b].qqqq
 #define char_width(a, b)  font_info[width_base[a] + b.b0].cint
+#define char_exists(a)    (a.b0 > min_quarterword)
 #define char_italic(a, b) font_info[italic_base[a] + (b.b2) / 4].cint
 #define height_depth(a)   (a.b1)
 #define char_height(a, b) font_info[height_base[a] + (b) / 16].cint
index 7110428..eab366b 100644 (file)
   #include <windows.h>
   #define MYLIBAPI __declspec(dllexport)
 #endif
+#pragma warning(disable:4996)
+#include <kpathsea/config.h>
+#include <kpathsea/c-ctype.h>
+#include <kpathsea/line.h>
+#include <kpathsea/readable.h>
+#include <kpathsea/variable.h>
+#include <kpathsea/absolute.h>
 
-#include <kpathsea/kpathsea.h>
 
-#pragma warning(disable:4996)
 #pragma warning(disable:4131) // old style declarator
 #pragma warning(disable:4135) // conversion between different integral types
 #pragma warning(disable:4127) // conditional expression is constant
@@ -84,11 +89,6 @@ extern char * replacement[];    /* pointers to replacement strings */
   void funny_core_dump (void);
 #endif
 
-/* ridderbusch.pad@nixdorf.com says this is necessary.  */
-#ifdef ATARI_ST
-  int _stksize = -1L;
-#endif
-
 /* The main program, etc.  */
 
 /* What we were invoked as and with.  */
@@ -100,31 +100,13 @@ char **gargv;   /* char *gargv[] -- bkph ? */
    happen in `t_open_in', then call the main body.  */
 
 #ifdef MSDOS
-  int init(int, char **);     /* in local.c */
-#endif /* INIVIR */ 
-
-/* bkph */
-char * set_program_name (char *comm)
-{
-  char *s;
-  if ((s = strrchr (comm, '\\')) != NULL)
-    s++;
-  else if ((s = strrchr (comm, '/')) != NULL)
-    s++;
-  else if ((s = strrchr (comm, ':')) != NULL)
-    s++;
-  else
-    s = comm;
-
-  return s;
-}
+  int main_init(int, char **);     /* in local.c */
+#endif /* INIVIR */
 
 int jump_used = 0;
 
 jmp_buf jumpbuffer;   // for non-local jumps
 
-void kpse_set_program_name (const char * argv0, const char * progname);
-
 int main (int ac, char *av[])
 {
   int flag = 0, ret = 0;
@@ -133,24 +115,20 @@ int main (int ac, char *av[])
   char custom_default[PATH_MAX];
 #endif
 
-  kpse_set_program_name(av[0], NULL);
+#ifdef WIN32
+  _setmaxstdio(2048);
+#endif
 
   gargc = ac;         /* make available globally */
   gargv = av;         /* make available globally */
 
-  program_name = set_program_name(av[0]);   /* rewritten 1994/Mar/1 - bkph */
 
-#ifdef MSDOS
-  if (init(gargc, gargv))   /* in local.c */
+  if (main_init(gargc, gargv))   /* in local.c */
     return -1;        // failure
-#endif /* INIVIR */
 
   dump_default_var = dump_default;
   dump_default_length = strlen (dump_default_var + 1);  /* 93/Nov/20 */
 
-//  call main_program = texbody in itex.c
-//  now creates jump buffer for non-local goto's  99/Nov/7
-
   jump_used = 0;
 
   ret = setjmp(jumpbuffer);
@@ -220,9 +198,11 @@ void t_open_in (void)
       }
       else
         (void) strcat ((char *) &buffer[first], gargv[i]);
+
       (void) strcat ((char *) &buffer[first], " ");
     }
-    gargc = 0;  /* Don't do this again.  */
+
+      gargc = 0;  /* Don't do this again.  */
   }
 
   /* Find the end of the buffer.  */
@@ -266,7 +246,10 @@ static void catch_interrupt (int err)
    ``Get the first line of input and prepare to start''), this is as
    good a place as any.  */
 
-void get_date_and_time (integer *sys_minutes, integer *sys_day, integer *sys_month, integer *sys_year)
+void get_date_and_time (integer *sys_minutes,
+                        integer *sys_day,
+                        integer *sys_month,
+                        integer *sys_year)
 {
   time_t clock;
   struct tm *tmptr;
@@ -994,6 +977,7 @@ int do_dump (char *p, int item_size, int nitems, FILE *out_file)
 #if !defined (WORDS_BIGENDIAN) && !defined (NO_FMTBASE_SWAP)
   swap_items (p, nitems, item_size);
 #endif
+
   return 0;
 }