From ad547a6b5986815fda458221149728d9d9ab1d87 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 25 Feb 2021 19:22:25 +0000 Subject: restore Build,TODO from r57911 git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/mf-binpool.ch | 83 +++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Build/source/texk/web2c/mf-binpool.ch (limited to 'Build/source/texk/web2c/mf-binpool.ch') diff --git a/Build/source/texk/web2c/mf-binpool.ch b/Build/source/texk/web2c/mf-binpool.ch new file mode 100644 index 00000000000..a406cd8ea44 --- /dev/null +++ b/Build/source/texk/web2c/mf-binpool.ch @@ -0,0 +1,83 @@ +% +% pool in binary +% +@x +@!m,@!n:text_char; {characters input from |pool_file|} +@!g:str_number; {the string just created} +@!a:integer; {accumulator for check sum} +@!c:boolean; {check sum has been checked} +@y +@!g:str_number; {the string just created} +@z +@x +@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#); + a_close(pool_file); get_strings_started:=false; return; + end +@= +name_length := strlen (pool_name); +name_of_file := xmalloc_array (ASCII_code, 1 + name_length); +strcpy (stringcast(name_of_file+1), pool_name); {copy the string} +if a_open_in (pool_file, kpse_mfpool_format) then + begin c:=false; + repeat @; + 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 MF.POOL@> + +@ @= +begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.'); +@.MF.POOL has no check sum@> +read(pool_file,m); read(pool_file,n); {read two digits of string length} +if m='*' then @ +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.'); +@.MF.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; str_ref[g]:=max_str_ref; + end; +end + +@ The \.{WEB} operation \.{@@\$} denotes the value that should be at the +end of this \.{MF.POOL} file; any other value means that the wrong pool +file has been loaded. +@^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.'); +@.MF.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).'); +@.MF.POOL doesn't match@> +c:=true; +end +@y +@ @= + g := loadpoolstrings((pool_size-string_vacancies)); + if g=0 then begin + wake_up_terminal; write_ln(term_out,'! You have to increase POOLSIZE.'); + get_strings_started:=false; + return; + end; + get_strings_started:=true; + +@ Empty module + +@ Empty module +@z -- cgit v1.2.3