/* 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 */
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;
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;
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] == '&') ||
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
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 */
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;
}
--- /dev/null
+svn export svn://tug.org/texlive/trunk/Build/source/texk/ptexenc/ ptexenc
+++ /dev/null
-/*
- * 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
-}
+++ /dev/null
-/*
- 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 */
--- /dev/null
+del *.exe
+del *.obj
--- /dev/null
+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
+
+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.
## 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)
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.
#
EXTRA_DIST = COPYRIGHT ChangeLog.jp
+# Rebuild
+rebuild_prereq =
+rebuild_target = all
+CLEANFILES =
+
+include $(srcdir)/../../am/rebuild.am
+
-# 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@
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 \
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.
#
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*) \
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
$(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
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)
$(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)
&& 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 \
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
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.
-# 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,
# 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
])
# 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]))])
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
# 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])
# -----------------------------------------------
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
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.
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.
# 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
#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
/* 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
/* 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
#! /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>.
#
# 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=''
# 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]...
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
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.
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 $@
-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
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
# Define the identity of the package.
PACKAGE='ptexenc'
- VERSION='1.3.1'
+ VERSION='1.3.2'
cat >>confdefs.h <<_ACEOF
# 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 -'
+# 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.
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"
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.
# 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
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\\"
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
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.
#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])
* 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>
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;
/* 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;
return EOF;
return BYTE4(c);
- }
+ }
}
#endif
#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
{
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];
}
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();
}
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);
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;
}
--- /dev/null
+#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 */
#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 */
-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,
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])
#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
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);
#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);
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);
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 ? */
/* 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)
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);
}
}
-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
/*************************************************************************/
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)
s++;
}
#ifdef DEBUGTWIDDLE
- if (trace_flag) {
+ if (trace_flag)
+ {
sprintf(log_line, "=> %s\n", name);
show_line(log_line, 0);
}
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;
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';
/* 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 */
{
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;
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
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)
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)
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) */
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);
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;
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)
/* sec 0037 */
bool init_terminal (void)
{
- register bool Result;
int flag;
t_open_in();
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
{
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;
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);
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;
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)
{
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 */
}
/* 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;
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);
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)
{
down_ptr = link(p);
free_node(p, movement_node_size);
}
+
lab30:
while (right_ptr != 0)
{
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]);
/*
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);
}
*/
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",
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;
/* 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
#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
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. */
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;
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);
}
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. */
``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;
#if !defined (WORDS_BIGENDIAN) && !defined (NO_FMTBASE_SWAP)
swap_items (p, nitems, item_size);
#endif
+
return 0;
}