summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/euptexdir
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-08-14 14:23:26 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-08-14 14:23:26 +0000
commiteeefc6bc7d0b3af828a0c623ff63020b19d3bdcd (patch)
treebba70e0540f6b6149b1e29c5c5ff9615a6924636 /Build/source/texk/web2c/euptexdir
parent9ab7c0f8a5cfedd0f440ee28479755646a521f3f (diff)
upTeX and e-upTeX (preliminary)
git-svn-id: svn://tug.org/texlive/trunk@23549 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/euptexdir')
-rw-r--r--Build/source/texk/web2c/euptexdir/am/euptex.am111
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.ch037
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.ch127
-rw-r--r--Build/source/texk/web2c/euptexdir/euptex.defines49
-rw-r--r--Build/source/texk/web2c/euptexdir/euptexextra.c11
-rw-r--r--Build/source/texk/web2c/euptexdir/euptexextra.h27
-rw-r--r--Build/source/texk/web2c/euptexdir/fam256-eup.ch5
-rw-r--r--Build/source/texk/web2c/euptexdir/pdfsavepos-eup.ch5
-rw-r--r--Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch26
-rw-r--r--Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-pre.ch17
10 files changed, 315 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/euptexdir/am/euptex.am b/Build/source/texk/web2c/euptexdir/am/euptex.am
new file mode 100644
index 00000000000..5fafa60045e
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/am/euptex.am
@@ -0,0 +1,111 @@
+## texk/web2c/euptexdir/am/euptex.am: Makefile fragment for e-upTeX.
+##
+## Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org>
+## You may freely use, modify and/or distribute this file.
+
+## e-upTeX
+##
+if EUPTEX
+bin_PROGRAMS += euptex
+endif EUPTEX
+EXTRA_PROGRAMS += euptex
+
+euptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS)
+
+# With --enable-ipc, e-upTeX may need to link with -lsocket.
+euptex_LDADD = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ipc_socketlibs)
+
+# e-upTeX C sources
+euptex_c_h = euptexini.c euptex0.c euptexcoerce.h euptexd.h
+nodist_euptex_SOURCES = $(euptex_c_h) euptex-pool.c euptexdir/etex_version.h \
+ euptexdir/eptex_version.h euptexdir/ptex_version.h euptexdir/uptex_version.h
+dist_euptex_SOURCES = euptexdir/euptexextra.c euptexdir/euptexextra.h
+
+# We must create euptexd.h and euptexdir/*tex_version.h before building the euptex_OBJECTS.
+euptex_prereq = euptexd.h euptexdir/etex_version.h euptexdir/eptex_version.h \
+ euptexdir/ptex_version.h euptexdir/uptex_version.h
+$(euptex_OBJECTS): $(euptex_prereq)
+
+$(euptex_c_h): euptex-web2c
+ @$(web2c) euptex
+euptex-web2c: euptex.p $(web2c_texmf) euptexdir/euptex.defines
+ @$(web2c) euptex
+
+euptex-pool.c: euptex.pool euptexd.h $(makecpool_stamp)
+ $(makecpool) euptex >$@ || rm -f $@
+
+# Tangling e-upTeX
+euptex.p euptex.pool: euptex-tangle
+ @$(texmf_tangle) euptex euptex
+euptex-tangle: tangle$(EXEEXT) euptex.web euptex.ch tangle-sh
+ @$(texmf_tangle) euptex euptex
+
+# Extract etex version
+euptexdir/etex_version.h: etexdir/etex.ch
+ $(MKDIR_P) euptexdir
+ grep '^@d eTeX_version_string==' $(srcdir)/etexdir/etex.ch \
+ | sed "s/^.*'-/#define ETEX_VERSION \"/;s/'.*$$/\"/" >$@
+
+# Extract eptex version
+euptexdir/eptex_version.h: eptexdir/eptex.ech
+ $(MKDIR_P) euptexdir
+ grep '^@d epTeX_version_string==' $(srcdir)/eptexdir/eptex.ech \
+ | sed "s/^.*'-/#define EPTEX_VERSION \"/;s/'.*$$/\"/" >$@
+
+# Extract ptex version
+euptexdir/ptex_version.h: ptexdir/ptex-base.ch
+ $(MKDIR_P) euptexdir
+ grep '^@d pTeX_version_string==' $(srcdir)/ptexdir/ptex-base.ch \
+ | sed "s/^.*'-/#define PTEX_VERSION \"/;s/'.*$$/\"/" >$@
+
+# Extract uptex version
+euptexdir/uptex_version.h: uptexdir/uptex-m.ch
+ $(MKDIR_P) euptexdir
+ grep '^@d upTeX_version_string==' $(srcdir)/uptexdir/uptex-m.ch \
+ | sed "s/^.*'-/#define UPTEX_VERSION \"/;s/'.*$$/\"/" >$@
+
+# Generate euptex.web
+euptex.web: tie$(EXEEXT) $(euptex_web_srcs)
+ $(tie) -m euptex.web $(euptex_web_srcs)
+euptex_web_srcs = \
+ tex.web \
+ etexdir/etex.ch \
+ etexdir/tex.ch0 \
+ tex.ch \
+ etexdir/tex.ech
+
+# Generate euptex.ch
+euptex.ch: tie$(EXEEXT) euptex.web $(euptex_ch_srcs)
+ $(tie) -c euptex.ch euptex.web $(euptex_ch_srcs)
+euptex_ch_srcs = \
+ eptexdir/etex.ch0 \
+ ptexdir/ptex-base.ch \
+ uptexdir/uptex-m.ch \
+ euptexdir/euptex.ch0 \
+ eptexdir/eptex.ech \
+ euptexdir/euptex.ch1 \
+ eptexdir/etex.ch1 \
+ $(euptex_ch_synctex) \
+ eptexdir/fam256.ch \
+ euptexdir/fam256-eup.ch \
+ euptexdir/pdfstrcmp-eup-pre.ch \
+ eptexdir/pdfstrcmp.ch \
+ euptexdir/pdfstrcmp-eup-post.ch \
+ eptexdir/pdfsavepos.ch \
+ euptexdir/pdfsavepos-eup.ch \
+ tex-binpool.ch
+
+EXTRA_DIST += $(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines
+
+DISTCLEANFILES += $(nodist_euptex_SOURCES) euptex.web euptex.ch euptex-web2c \
+ euptex.p euptex.pool euptex-tangle
+
+## =============
+
+e-upTeX.w: euptex.p
+ $(tie) -m e-upTeX.w euptex.web euptex.ch
+
+e-pTeX.w: eptex.p
+ $(tie) -m e-pTeX.w eptex.web eptex.ch
+
+foo: e-pTeX.w e-upTeX.w upTeX.w
diff --git a/Build/source/texk/web2c/euptexdir/euptex.ch0 b/Build/source/texk/web2c/euptexdir/euptex.ch0
new file mode 100644
index 00000000000..e35be327ffb
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/euptex.ch0
@@ -0,0 +1,37 @@
+@x e-upTeX: logo
+\def\eTeX{$\varepsilon$-\TeX}
+@y
+\def\eTeX{$\varepsilon$-\TeX}
+\def\eupTeX{$\varepsilon$-up\TeX}
+@z
+
+@x e-upTeX: banner
+ {printed when up\TeX\ starts}
+@y
+ {printed when up\TeX\ starts}
+@#
+@d eupTeX_version==pTeX_version_string,upTeX_version_string,epTeX_version_string,eTeX_version_string
+@d eupTeX_banner=='This is e-upTeX, Version 3.1415926',eupTeX_version
+@d eupTeX_banner_k==eupTeX_banner
+ {printed when \eupTeX\ starts}
+@z
+
+@x [1.2]
+@d banner==upTeX_banner
+@d banner_k==upTeX_banner_k
+@y
+@d banner==pTeX_banner
+@d banner_k==pTeX_banner_k
+@z
+
+@x
+@d max_quarterword=@"FFFF {largest allowable value in a |quarterword|}
+@y
+@d max_quarterword=255 {largest allowable value in a |quarterword|}
+@z
+
+@x
+@d protected_token=@'7001 {$2^8\cdot|end_match|+1$}
+@y
+@d protected_token=@"E01 {$2^8\cdot|end_match|+1$}
+@z
diff --git a/Build/source/texk/web2c/euptexdir/euptex.ch1 b/Build/source/texk/web2c/euptexdir/euptex.ch1
new file mode 100644
index 00000000000..1a2039cb62d
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/euptex.ch1
@@ -0,0 +1,27 @@
+@x [1.2]
+@d banner==epTeX_banner
+@d banner_k==epTeX_banner_k
+@y
+@d banner==eupTeX_banner
+@d banner_k==eupTeX_banner_k
+@z
+
+@x e-pTeX: ifcsname l.28620
+ if check_kanji(info(p)) then {|wchar_token|}
+ begin buffer[m]:=Hi(info(p)); incr(m);
+ end;
+ buffer[m]:=Lo(info(p)); incr(m); p:=link(p);
+@y
+ if check_kanji(info(p),4)=2 then {|wchar_token|}
+ begin
+ if BYTE1(toBUFF(info(p) mod max_cjk_val))<>0 then begin buffer[m]:=BYTE1(toBUFF(info(p) mod max_cjk_val)); incr(m); end;
+ if BYTE2(toBUFF(info(p) mod max_cjk_val))<>0 then begin buffer[m]:=BYTE2(toBUFF(info(p) mod max_cjk_val)); incr(m); end;
+ if BYTE3(toBUFF(info(p) mod max_cjk_val))<>0 then begin buffer[m]:=BYTE3(toBUFF(info(p) mod max_cjk_val)); incr(m); end;
+ buffer[m]:=BYTE4(toBUFF(info(p) mod max_cjk_val)); incr(m);
+ p:=link(p);
+ end
+ else
+ begin buffer[m]:=info(p) mod max_char_val; incr(m); p:=link(p);
+ end;
+@z
+
diff --git a/Build/source/texk/web2c/euptexdir/euptex.defines b/Build/source/texk/web2c/euptexdir/euptex.defines
new file mode 100644
index 00000000000..5c76fc01af1
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/euptex.defines
@@ -0,0 +1,49 @@
+{ defined at kanji.c, kanji.h, ptexenc/ptexenc.h, ptexenc/unicode.h }
+@define function BYTE1 ();
+@define function BYTE2 ();
+@define function BYTE3 ();
+@define function BYTE4 ();
+@define function Hi ();
+@define function Lo ();
+@define procedure initdefaultkanji;
+@define procedure forcesjisterm ();
+
+@define function getencstring;
+@define function setencstring ();
+@define procedure setpriorfileenc;
+@define function isinternalUPTEX;
+@define procedure setptexencuptex;
+
+@define function iskanji1 ();
+@define function is1stchr ();
+@define function ismultichr ();
+
+@define function multistrlen ();
+@define function fromBUFF ();
+@define function toBUFF ();
+
+@define function fromDVI ();
+@define function toDVI ();
+@define function putc2 ();
+@define function inputline2 ();
+
+@define function fromJIS ();
+@define function fromEUC ();
+@define function fromSJIS ();
+@define function fromKUTEN ();
+@define function fromUCS ();
+@define function UCStoUTF8 ();
+@define function toUCS ();
+
+@define function checkkanji ();
+@define function iskanji ();
+@define function ischarascii ();
+@define function iswcharascii ();
+@define function ismultiprn ();
+@define function calcpos ();
+@define function kcatcodekey ();
+@define function multilenbuffchar ();
+@define function nrestmultichr ();
+
+@define function getintone();
+@define procedure setintone();
diff --git a/Build/source/texk/web2c/euptexdir/euptexextra.c b/Build/source/texk/web2c/euptexdir/euptexextra.c
new file mode 100644
index 00000000000..f710b584d5c
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/euptexextra.c
@@ -0,0 +1,11 @@
+/* euptexextra.c: Hand-coded routines for e-upTeX.
+
+ This file is public domain. */
+
+#define EXTERN /* Instantiate data from euptexd.h here. */
+
+/* This file defines TeX and eupTeX. */
+#include <euptexd.h>
+
+/* Hand-coded routines for TeX or Metafont in C. */
+#include <lib/texmfmp.c>
diff --git a/Build/source/texk/web2c/euptexdir/euptexextra.h b/Build/source/texk/web2c/euptexdir/euptexextra.h
new file mode 100644
index 00000000000..6e9d4071c13
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/euptexextra.h
@@ -0,0 +1,27 @@
+/* euptexextra.h: banner etc. for e-upTeX.
+
+ This is included by e-upTeX, from euptexextra.c
+*/
+
+#include <euptexdir/eptex_version.h> /* for EPTEX_VERSION */
+#include <euptexdir/etex_version.h> /* for ETEX_VERSION */
+#include <euptexdir/ptex_version.h> /* for PTEX_VERSION */
+#include <euptexdir/uptex_version.h> /* for UPTEX_VERSION */
+
+#define BANNER "This is e-upTeX, Version 3.1415926-" PTEX_VERSION "-" UPTEX_VERSION "-" EPTEX_VERSION "-" ETEX_VERSION
+#define COPYRIGHT_HOLDER "D.E. Knuth"
+#define AUTHOR NULL
+#define PROGRAM_HELP EUPTEXHELP
+#define BUG_ADDRESS "ptex-staff@ml.asciimw.jp"
+#define DUMP_VAR TEXformatdefault
+#define DUMP_LENGTH_VAR formatdefaultlength
+#define DUMP_OPTION "fmt"
+#define DUMP_EXT ".fmt"
+#define INPUT_FORMAT kpse_tex_format
+#define INI_PROGRAM "inieuptex"
+#define VIR_PROGRAM "vireuptex"
+
+#ifdef Xchr
+#undef Xchr
+#define Xchr(x) (x)
+#endif /* Xchr */
diff --git a/Build/source/texk/web2c/euptexdir/fam256-eup.ch b/Build/source/texk/web2c/euptexdir/fam256-eup.ch
new file mode 100644
index 00000000000..b69bf067c8c
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/fam256-eup.ch
@@ -0,0 +1,5 @@
+@x
+@d kchar_def_code=8 {|shorthand_def| for \.{\\kchardef}}
+@y
+@d kchar_def_code=9 {|shorthand_def| for \.{\\kchardef}}
+@z
diff --git a/Build/source/texk/web2c/euptexdir/pdfsavepos-eup.ch b/Build/source/texk/web2c/euptexdir/pdfsavepos-eup.ch
new file mode 100644
index 00000000000..a650c822694
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/pdfsavepos-eup.ch
@@ -0,0 +1,5 @@
+@x
+@* \[54] System-dependent changes.
+@y
+@* \[56] System-dependent changes.
+@z
diff --git a/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch b/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch
new file mode 100644
index 00000000000..939ccb12a74
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-post.ch
@@ -0,0 +1,26 @@
+@x
+procedure print_kanji(@!s:integer); {prints a single character}
+begin
+if s>255 then begin
+ if isprint_utf8 then begin
+ s:=UCStoUTF8(toUCS(s));
+ if BYTE1(s)<>0 then print_char(BYTE1(s));
+ if BYTE2(s)<>0 then print_char(BYTE2(s));
+ if BYTE3(s)<>0 then print_char(BYTE3(s));
+ print_char(BYTE4(s));
+ end
+ else begin print_char(Hi(s)); print_char(Lo(s)); end;
+end
+else print_char(s);
+end;
+@y
+procedure print_kanji(@!s:KANJI_code); {prints a single character}
+begin
+if isprint_utf8 then s:=UCStoUTF8(toUCS(s mod max_cjk_val))
+else s:=toBUFF(s mod max_cjk_val);
+if BYTE1(s)<>0 then print_char(BYTE1(s));
+if BYTE2(s)<>0 then print_char(BYTE2(s));
+if BYTE3(s)<>0 then print_char(BYTE3(s));
+ print_char(BYTE4(s));
+end;
+@z
diff --git a/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-pre.ch b/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-pre.ch
new file mode 100644
index 00000000000..80c1a7dd555
--- /dev/null
+++ b/Build/source/texk/web2c/euptexdir/pdfstrcmp-eup-pre.ch
@@ -0,0 +1,17 @@
+@x
+procedure print_kanji(@!s:KANJI_code); {prints a single character}
+begin
+s:=toBUFF(s mod max_cjk_val);
+if BYTE1(s)<>0 then print_char(BYTE1(s));
+if BYTE2(s)<>0 then print_char(BYTE2(s));
+if BYTE3(s)<>0 then print_char(BYTE3(s));
+ print_char(BYTE4(s));
+end;
+@y
+procedure print_kanji(@!s:KANJI_code); {prints a single character}
+begin
+if s>255 then
+ begin print_char(Hi(s)); print_char(Lo(s));
+ end else print_char(s);
+end;
+@z