diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2012-05-06 10:04:12 +0000 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2012-05-06 10:04:12 +0000 |
commit | 3c6cdccdf8a900337b27e6c4099aeea5dbc86dcb (patch) | |
tree | 991c14d902840adda89a24ffd601d5565ad9bfa0 /Build/source/texk/web2c/xetexdir | |
parent | 8d0b4468c07b64f83f7ccc240ec9ee2fd6766fc0 (diff) |
Use makecpool instead of XeTeX specific pool2c.pl.
git-svn-id: svn://tug.org/texlive/trunk@26228 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/xetexdir')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/XeTeX_ext.h | 1 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/am/xetex.am | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/pool2c.pl | 74 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.ch | 97 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/xetex.defines | 1 |
6 files changed, 8 insertions, 178 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index 68c577b0f5d..6aa65185d53 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,6 +1,8 @@ -2012-04-30 Khaled Hosny <khaledhosny@eglug.org> +2012-05-05 Khaled Hosny <khaledhosny@eglug.org> - * xetex.ch: Merge changes from XeTeX repository. + * xetex.ch, xetex.defines, XeTeX_ext.h, am/xetex.am: Use makecpool + instead of out pool2c.pl. + * pool2c.pl: Removed. 2012-04-24 Khaled Hosny <khaledhosny@eglug.org> diff --git a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h index 10b60139990..d3bd8db7582 100644 --- a/Build/source/texk/web2c/xetexdir/XeTeX_ext.h +++ b/Build/source/texk/web2c/xetexdir/XeTeX_ext.h @@ -291,7 +291,6 @@ extern "C" { int input_line(UFILE* f); void makeutf16name(); - int initpool(); void terminatefontmanager(); int maketexstring(const char* s); diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am index db2960f187d..6edfcb4a262 100644 --- a/Build/source/texk/web2c/xetexdir/am/xetex.am +++ b/Build/source/texk/web2c/xetexdir/am/xetex.am @@ -68,7 +68,7 @@ $(xetex_OBJECTS): $(xetex_prereq) ## XeTeX C sources xetex_c_h = xetexini.c xetex0.c xetexcoerce.h xetexd.h -nodist_xetex_SOURCES = $(xetex_c_h) xetex_pool.c \ +nodist_xetex_SOURCES = $(xetex_c_h) xetex-pool.c \ xetexdir/etex_version.h xetexdir/xetex_version.h dist_xetex_SOURCES = xetexdir/xetexextra.c xetexdir/xetexextra.h @@ -77,8 +77,8 @@ $(xetex_c_h): xetex-web2c xetex-web2c: xetex.p $(web2c_texmf) xetexdir/xetex.defines @$(web2c) xetex -xetex_pool.c: xetex.pool xetexd.h - perl $(srcdir)/xetexdir/pool2c.pl $< $@ +xetex-pool.c: xetex.pool xetexd.h $(makecpool_stamp) + $(makecpool) xetex >$@ || rm -f $@ ## Tangling XeTeX xetex.p xetex.pool: xetex-tangle @@ -110,6 +110,7 @@ xetex_web_srcs = \ enctex.ch \ etexdir/tex.ch1 \ etexdir/tex.ech \ + tex-binpool.ch \ $(xetex_ch_synctex) \ xetexdir/xetex.ch \ xetexdir/xetex-latex3.ch \ diff --git a/Build/source/texk/web2c/xetexdir/pool2c.pl b/Build/source/texk/web2c/xetexdir/pool2c.pl deleted file mode 100644 index c2628deab46..00000000000 --- a/Build/source/texk/web2c/xetexdir/pool2c.pl +++ /dev/null @@ -1,74 +0,0 @@ -#! /usr/bin/perl - -# Convert web .pool file into C source -# Result is an array of chars (bytes) containing the strings, -# each prefixed by a length byte. -# The function initpool() loads this data into TeX's pool. - -# usage: perl pool2c.pl NAME.pool -# writes output to ${NAME}_pool.c if only one arg provided - -die "expected pool name as argument" unless $#ARGV >= 0; -die "too many arguments" if $#ARGV > 1; - -$prog = `basename $ARGV[0] .pool`; -chomp($prog); - -$outfile = ($#ARGV == 1) ? $ARGV[1] : "${prog}_pool.c"; - -open IN, "< $ARGV[0]" or die "can't open input $ARGV[0]"; -open OUT, "> $outfile" or die "can't open output $outfile"; - -print OUT <<__EOT__; -/* This file is auto-generated from $ARGV[0] by pool2c.pl */ -#define EXTERN extern -#include "${prog}d.h" - -#include <stdio.h> - -static unsigned char POOL[] = -__EOT__ -$pool_len = 0; -while (<IN>) { - chomp; - if (m/^([0-9]{2})(.*)$/) { - ($len, $str) = ($1, $2); - if (length($str) != $len) { - die "*** pool string length error:\n$_\n"; - } - $str =~ s/(["\\])/\\$1/g; - $str =~ s/\?\?\?/\\?\\?\\?/g; - printf OUT "\t\"\\x%02X\" \"%s\"\n", $len, $str; - $pool_len += $len + 1; - } - elsif (m/^\*[0-9]+$/) { - last; - } - else { - die "*** unexpected line in pool file:\n$_\n"; - } -} - -close IN; - -print OUT <<__EOT__; - ; - -#define POOL_LEN $pool_len - -int initpool(int limit) { - int g = 0; - unsigned char *s = POOL; - while (s < POOL + POOL_LEN) { - int len = *s++; - if (poolptr + len >= limit) - return 0; - while (len-- > 0) - strpool[poolptr++] = *s++; - g = makestring(); - } - return g; -} -__EOT__ - -close OUT; diff --git a/Build/source/texk/web2c/xetexdir/xetex.ch b/Build/source/texk/web2c/xetexdir/xetex.ch index d90c3fd5a5b..1e82951c242 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.ch +++ b/Build/source/texk/web2c/xetexdir/xetex.ch @@ -526,22 +526,6 @@ else begin @z @x -@!init function get_strings_started:boolean; {initializes the string pool, - but returns |false| if something goes wrong} -label done,exit; -var k,@!l:0..255; {small indices or counters} -@!m,@!n:text_char; {characters input from |pool_file|} -@!g:str_number; {garbage} -@!a:integer; {accumulator for check sum} -@!c:boolean; {check sum has been checked} -begin pool_ptr:=0; str_ptr:=0; str_start[0]:=0; -@y -@!init function get_strings_started:boolean; {initializes the string pool, - but returns |false| if something goes wrong} -begin pool_ptr:=0; str_ptr:=0; -@z - -@x @ @d app_lc_hex(#)==l:=#; if l<10 then append_char(l+"0")@+else append_char(l-10+"a") @y @@ -577,87 +561,6 @@ end @z @x -@ When the \.{WEB} system program called \.{TANGLE} processes the \.{TEX.WEB} -description that you are now reading, it outputs the \PASCAL\ program -\.{TEX.PAS} and also a string pool file called \.{TEX.POOL}. The \.{INITEX} -@.WEB@>@.INITEX@> -program reads the latter file, where each string appears as a two-digit decimal -length followed by the string itself, and the information is recorded in -\TeX's string memory. - -@<Glob...@>= -@!init @!pool_file:alpha_file; {the string-pool file output by \.{TANGLE}} -tini - -@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#); - a_close(pool_file); get_strings_started:=false; return; - end -@<Read the other strings...@>= -name_length := strlen (pool_name); -name_of_file := xmalloc_array (ASCII_code, name_length + 1); -strcpy (stringcast(name_of_file+1), pool_name); {copy the string} -if a_open_in (pool_file, kpse_texpool_format) then - begin c:=false; - repeat @<Read one string, but return |false| if the - string memory space is getting too tight for comfort@>; - until c; - a_close(pool_file); get_strings_started:=true; - end -else bad_pool('! I can''t read ', pool_name, '; bad path?') -@.I can't read TEX.POOL@> - -@ @<Read one string...@>= -begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.'); -@.TEX.POOL has no check sum@> -read(pool_file,m); read(pool_file,n); {read two digits of string length} -if m='*' then @<Check the pool check sum@> -else begin if (xord[m]<"0")or(xord[m]>"9")or@| - (xord[n]<"0")or(xord[n]>"9") then - bad_pool('! ', pool_name, ' line doesn''t begin with two digits.'); -@.TEX.POOL line doesn't...@> - l:=xord[m]*10+xord[n]-"0"*11; {compute the length} - if pool_ptr+l+string_vacancies>pool_size then - bad_pool('! You have to increase POOLSIZE.'); -@.You have to increase POOLSIZE@> - for k:=1 to l do - begin if eoln(pool_file) then m:=' '@+else read(pool_file,m); - append_char(xord[m]); - end; - read_ln(pool_file); g:=make_string; - end; -end - -@ The \.{WEB} operation \.{@@\$} denotes the value that should be at the -end of this \.{TEX.POOL} file; any other value means that the wrong pool -file has been loaded. -@^check sum@> - -@<Check the pool check sum@>= -begin a:=0; k:=1; -loop@+ begin if (xord[n]<"0")or(xord[n]>"9") then - bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.'); -@.TEX.POOL check sum...@> - a:=10*a+xord[n]-"0"; - if k=9 then goto done; - incr(k); read(pool_file,n); - end; -done: if a<>@$ then - bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).'); -@.TEX.POOL doesn't match@> -c:=true; -end -@y -@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#); - get_strings_started:=false; return; - end -@<Read the other strings...@>= -if init_pool(pool_size-string_vacancies) = 0 then begin - bad_pool('! You have to increase POOLSIZE.'); -end else - get_strings_started := true; -@z - -@x @* \[5] On-line and off-line printing. @y @* \[5] On-line and off-line printing. diff --git a/Build/source/texk/web2c/xetexdir/xetex.defines b/Build/source/texk/web2c/xetexdir/xetex.defines index 2c1a3b4b9a3..4f15814a3a3 100644 --- a/Build/source/texk/web2c/xetexdir/xetex.defines +++ b/Build/source/texk/web2c/xetexdir/xetex.defines @@ -64,7 +64,6 @@ authorization from the copyright holders. @define procedure printutf8str(); @define procedure setinputfileencoding(); @define procedure terminatefontmanager; -@define function initpool(); @define type gzFile; @define procedure checkfortfmfontmapping; @define function loadtfmfontmapping; |