diff -udrN web2c.orig//Makefile.in web2c/Makefile.in --- web2c.orig//Makefile.in 2011-03-18 10:59:46.176000004 +0900 +++ web2c/Makefile.in 2011-03-18 11:01:03.056000004 +0900 @@ -1786,6 +1786,7 @@ etexdir/tex.ech eptex_ch_srcs = \ + eptexdir/etex-lrstat.ch \ eptexdir/eptex-base.ch \ eptexdir/etex.ch0 \ ptexdir/ptex-base.ch \ @@ -1793,6 +1794,7 @@ eptexdir/etex.ch1 \ eptexdir/fam256.ch \ eptexdir/pdfstrcmp.ch \ + eptexdir/pdfsavepos.ch \ tex-binpool.ch pdftex_cppflags = $(AM_CPPFLAGS) $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) \ diff -udrN web2c.orig//eptexdir/am/eptex.am web2c/eptexdir/am/eptex.am --- web2c.orig//eptexdir/am/eptex.am 2011-03-18 10:28:59.883999954 +0900 +++ web2c/eptexdir/am/eptex.am 2011-03-18 10:41:16.212000004 +0900 @@ -71,6 +71,7 @@ eptex.ch: tie$(EXEEXT) eptex.web $(eptex_ch_srcs) $(tie) -c eptex.ch eptex.web $(eptex_ch_srcs) eptex_ch_srcs = \ + eptexdir/etex-lrstat.ch \ eptexdir/eptex-base.ch \ eptexdir/etex.ch0 \ ptexdir/ptex-base.ch \ @@ -78,6 +79,7 @@ eptexdir/etex.ch1 \ eptexdir/fam256.ch \ eptexdir/pdfstrcmp.ch \ + eptexdir/pdfsavepos.ch \ tex-binpool.ch EXTRA_DIST += $(eptex_web_srcs) $(eptex_ch_srcs) eptexdir/eptex.defines diff -udrN web2c.orig//eptexdir/eptex-base.ch web2c/eptexdir/eptex-base.ch --- web2c.orig//eptexdir/eptex-base.ch 2011-03-18 10:28:59.883999954 +0900 +++ web2c/eptexdir/eptex-base.ch 2011-03-18 13:20:46.656000002 +0900 @@ -17,12 +17,14 @@ % + etexdir/tex.ech e-TeX+Web2C changes % % and eptex.ch from: +% + eptexdir/etex-lrstat.ch glue % + eptexdir/etex.ch0 glue % + ptexdir/ptex-base.ch pTeX changes % + eptexdir/eptex.ech e-TeX+pTeX changes % + eptexdir/etex.ch1 glue % + eptexdir/fam256.ch borrowed from Omega % + eptexdir/pdfstrcmp.ch borrowed from pdfTeX +% + eptexdir/pdfsavepos.ch borrowed from pdfTeX % + tex-binpool.ch compiled pool file % % where the three small files denoted as glue resolve incompatibilities diff -udrN web2c.orig//eptexdir/eptex.ech web2c/eptexdir/eptex.ech --- web2c.orig//eptexdir/eptex.ech 2011-03-18 10:28:59.887999933 +0900 +++ web2c/eptexdir/eptex.ech 2011-03-18 13:18:52.184000002 +0900 @@ -11,7 +11,7 @@ @x [1.2] l.200 - pTeX: @d pTeX_version_string=='-p3.1.11' {current p\TeX\ version} @y -@d pTeX_version_string=='-p3.1.11-110102' {current \epTeX\ version} +@d pTeX_version_string=='-p3.1.11-110315' {current \epTeX\ version} @z @x e-pTeX: banner @@ -20,7 +20,7 @@ {printed when p\TeX\ starts} @# @d epTeX_version==pTeX_version_string,eTeX_version_string -@d epTeX_banner=='This is epTeX, Version 3.1415926',epTeX_version +@d epTeX_banner=='This is e-pTeX, Version 3.1415926',epTeX_version @d epTeX_banner_k==epTeX_banner {printed when \epTeX\ starts} @z diff -udrN web2c.orig//eptexdir/etex-lrstat.ch web2c/eptexdir/etex-lrstat.ch --- web2c.orig//eptexdir/etex-lrstat.ch 1970-01-01 09:00:00.000000000 +0900 +++ web2c/eptexdir/etex-lrstat.ch 2011-03-18 10:40:55.532000003 +0900 @@ -0,0 +1,76 @@ + +@x +@d reversed=min_quarterword+1 {subtype for an |hlist_node| whose hlist + has been reversed} +@d dlist=min_quarterword+2 {subtype for an |hlist_node| from display math mode} +@y +@d reversed=1 {subtype for an |hlist_node| whose hlist + has been reversed} +@d dlist=2 {subtype for an |hlist_node| from display math mode} +@d box_lrstat(#) == (subtype(#)div 8) {direction mode of a box} +@d set_box_lrstat(#) == subtype(#):= (subtype(#) mod 8)+8*set_box_lrstat_end +@d set_box_lrstat_end(#) == (#) +@z + +@x + if nest[nest_ptr-1].mode_field=mmode then subtype(q):=dlist; {for |ship_out|} +@y + if nest[nest_ptr-1].mode_field=mmode then set_box_lrstat(q)(dlist); {for |ship_out|} +@z + +@x +subtype(r):=min_quarterword; {for |ship_out|} +@y +set_box_lrstat(r)(0); {for |ship_out|} +@z + + +@x + subtype(a):=dlist; +@y + set_box_lrstat(a)(dlist); +@z + +@x +subtype(b):=dlist; +@y +set_box_lrstat(b)(dlist); +@z + +@x +if (type(p)=hlist_node)and(subtype(p)=dlist) then print(", display") +@y +if (type(p)=hlist_node)and(box_lrstat(p)=dlist) then print(", display") +@z + +@x + if subtype(this_box)=dlist then +@y + if box_lrstat(this_box)=dlist then +@z + +@x + else subtype(this_box):=min_quarterword; + if (cur_dir=right_to_left)and(subtype(this_box)<>reversed) then +@y + else set_box_lrstat(this_box)(0); + if (cur_dir=right_to_left)and(box_lrstat(this_box)<>reversed) then +@z + +@x + if subtype(this_box)=dlist then cur_dir:=right_to_left; +@y + if box_lrstat(this_box)=dlist then cur_dir:=right_to_left; +@z + +@x +cur_h:=save_h; subtype(this_box):=reversed; +@y +cur_h:=save_h; set_box_lrstat(this_box)(reversed); +@z + +@x +if subtype(p)=dlist then q:=p {display or equation number} +@y +if box_lrstat(p)=dlist then q:=p {display or equation number} +@z diff -udrN web2c.orig//eptexdir/etex.ch1 web2c/eptexdir/etex.ch1 --- web2c.orig//eptexdir/etex.ch1 2011-03-18 10:28:59.883999954 +0900 +++ web2c/eptexdir/etex.ch1 2011-03-18 13:15:26.056000002 +0900 @@ -36,14 +36,16 @@ begin q:=box(cur_val); while (q<>null)and(box_dir(q)<>abs(direction)) do q:=link(q); if q=null then - begin q:=new_dir_node(box(cur_val),abs(direction)); + begin r:=link(box(cur_val)); link(box(cur_val)):=null; + q:=new_dir_node(box(cur_val),abs(direction)); link(box(cur_val)):=r; @y if q=null then cur_val:=0 else begin qx:=q; while (q<>null)and(box_dir(q)<>abs(direction)) do q:=link(q); if q=null then - begin q:=new_dir_node(qx,abs(direction)); + begin r:=link(qx); link(qx):=null; + q:=new_dir_node(qx,abs(direction)); link(qx):=r; @z @x [27.468] @@ -113,12 +115,12 @@ q:=prune_page_top(q); p:=list_ptr(v); if q=null then box(n):=null {the |eq_level| of the box stays the same} else begin - box(n):=vpack(q,natural); box_dir(box(n)):=box_dir(v); + box(n):=vpack(q,natural); set_box_dir(box(n))(box_dir(v)); end; @y q:=prune_page_top(q,saving_vdiscards>0); p:=list_ptr(v); if q<>null then begin - q:=vpack(q,natural); box_dir(q):=box_dir(v); + q:=vpack(q,natural); set_box_dir(q)(box_dir(v)); end; change_box(q); @z @@ -152,11 +154,9 @@ if type(tail)=cur_chr then @z @x [47.1105] - begin prev_node:=tail; prev_disp:=disp; tail_append(d) - end + begin if d<>null then tail_append(d); return; end; @y - begin prev_node:=tail; prev_disp:=disp; tail_append(d) - end; + begin if d<>null then tail_append(d); return; end; if LR_temp<>null then insert_end_M; end; @z @@ -192,9 +192,14 @@ begin q:=b; p:=link(q); @z @x [49.1247] - link(q):=link(box(b)); link(box(b)):=q; + begin p:=link(box(b)); link(box(b)):=null; @y - link(q):=link(b); link(b):=q; + begin p:=link(b); link(b):=null; +@z +@x [49.1247] + link(q):=p; link(box(b)):=q; +@y + link(q):=p; link(b):=q; @z @x [49.1291] diff -udrN web2c.orig//eptexdir/pdfsavepos.ch web2c/eptexdir/pdfsavepos.ch --- web2c.orig//eptexdir/pdfsavepos.ch 1970-01-01 09:00:00.000000000 +0900 +++ web2c/eptexdir/pdfsavepos.ch 2011-03-18 11:21:01.988000003 +0900 @@ -0,0 +1,283 @@ +% last update: 2011/3/15 + +@x +@d dimen_pars=23 {total number of dimension parameters} +@y +@d pdf_page_width_code=23 {page width} +@d pdf_page_height_code=24 {page height} +@d dimen_pars=25 {total number of dimension parameters} +@z + +@x +@d emergency_stretch==dimen_par(emergency_stretch_code) +@y +@d emergency_stretch==dimen_par(emergency_stretch_code) +@d pdf_page_width==dimen_par(pdf_page_width_code) +@d pdf_page_height==dimen_par(pdf_page_height_code) +@z + +@x +emergency_stretch_code:print_esc("emergencystretch"); +@y +emergency_stretch_code:print_esc("emergencystretch"); +pdf_page_width_code: print_esc("pdfpagewidth"); +pdf_page_height_code: print_esc("pdfpageheight"); +@z + +@x +@d badness_code=input_line_no_code+1 {code for \.{\\badness}} +@y +@d badness_code=input_line_no_code+1 {code for \.{\\badness}} +@d pdf_last_x_pos_code=badness_code+1 {code for \.{\\pdflastxpos}} +@d pdf_last_y_pos_code=pdf_last_x_pos_code+1 {code for \.{\\pdflastypos}} +@z + +@x +@d eTeX_int=badness_code+1 {first of \eTeX\ codes for integers} +@y +@d eTeX_int=pdf_last_y_pos_code+1 {first of \eTeX\ codes for integers} +@z + +@x +@d etex_convert_codes=etex_convert_base+2 {end of \eTeX's command codes} +@y +@d etex_convert_codes=etex_convert_base+3 {end of \eTeX's command codes} +@z + +@x +@ @= +@y +@ @= +@; +@z + +@x +@!old_setting:0..max_selector; {saved |selector| setting} +begin if tracing_output>0 then +@y +@!old_setting:0..max_selector; {saved |selector| setting} +@!t: scaled; +begin if tracing_output>0 then +@z + +@x +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@y +@d set_language_code=5 {command modifier for \.{\\setlanguage}} +@d TeX_extension_end=5 +@d pdf_save_pos_node=TeX_extension_end+1 +@z + +@x + set_language_code:print_esc("setlanguage"); +@y + set_language_code:print_esc("setlanguage"); + pdf_save_pos_node: print_esc("pdfsavepos"); +@z + +@x +set_language_code:@; +@y +set_language_code:@; +pdf_save_pos_node: @; +@z + +@x + print_int(what_lhm(p)); print_char(","); + print_int(what_rhm(p)); print_char(")"); + end; +@y + print_int(what_lhm(p)); print_char(","); + print_int(what_rhm(p)); print_char(")"); + end; +pdf_save_pos_node: print_esc("pdfsavepos"); +@z + +@x +close_node,language_node: begin r:=get_node(small_node_size); + words:=small_node_size; + end; +@y +close_node,language_node: begin r:=get_node(small_node_size); + words:=small_node_size; + end; +pdf_save_pos_node: + r := get_node(small_node_size); +@z + +@x +close_node,language_node: free_node(p,small_node_size); +@y +close_node,language_node: free_node(p,small_node_size); +pdf_save_pos_node: free_node(p, small_node_size); +@z + +@x +procedure special_out(@!p:pointer); +var old_setting:0..max_selector; {holds print |selector|} +@!k:pool_pointer; {index into |str_pool|} +@y +procedure special_out(@!p:pointer); +label done; +var old_setting:0..max_selector; {holds print |selector|} +@!k:pool_pointer; {index into |str_pool|} +@!s,@!t,@!cw: scaled; +@!bl: boolean; +@!i: small_number; +@z + +@x +pool_ptr:=str_start[str_ptr]; {erase the string} +@y +@; +done: pool_ptr:=str_start[str_ptr]; {erase the string} +@z + +@x +language_node:do_nothing; +@y +language_node:do_nothing; +pdf_save_pos_node: + @; +@z + +@x +primitive("pdfstrcmp",convert,pdf_strcmp_code);@/ +@!@:pdf_strcmp_}{\.{\\pdfstrcmp} primitive@> +@y +primitive("pdfstrcmp",convert,pdf_strcmp_code);@/ +@!@:pdf_strcmp_}{\.{\\pdfstrcmp} primitive@> +primitive("pdfsavepos",extension,pdf_save_pos_node);@/ +@!@:pdf_save_pos_}{\.{\\pdfsavepos} primitive@> +primitive("pdfpagewidth",assign_dimen,dimen_base+pdf_page_width_code);@/ +@!@:pdf_page_width_}{\.{\\pdfpagewidth} primitive@> +primitive("pdfpageheight",assign_dimen,dimen_base+pdf_page_height_code);@/ +@!@:pdf_page_height_}{\.{\\pdfpageheight} primitive@> +primitive("pdflastxpos",last_item,pdf_last_x_pos_code);@/ +@!@:pdf_last_x_pos_}{\.{\\pdflastxpos} primitive@> +primitive("pdflastypos",last_item,pdf_last_y_pos_code);@/ +@!@:pdf_last_y_pos_}{\.{\\pdflastypos} primitive@> +@z + +@x +eTeX_version_code: print_esc("eTeXversion"); +@y +eTeX_version_code: print_esc("eTeXversion"); +pdf_last_x_pos_code: print_esc("pdflastxpos"); +pdf_last_y_pos_code: print_esc("pdflastypos"); +@z + +@x +eTeX_version_code: cur_val:=eTeX_version; +@y +eTeX_version_code: cur_val:=eTeX_version; +pdf_last_x_pos_code: cur_val := pdf_last_x_pos; +pdf_last_y_pos_code: cur_val := pdf_last_y_pos; +@z + + +@x +@* \[54] System-dependent changes. +@y +@ Next, we implement \.{\\pdfsavepos} and its related primitives. + +@= +@!cur_page_width: scaled; {width of page being shipped} +@!cur_page_height: scaled; {height of page being shipped} +@!pdf_last_x_pos: integer; +@!pdf_last_y_pos: integer; + +@ @= +begin + new_whatsit(pdf_save_pos_node, small_node_size); +end + +@ @= +begin + case dvi_dir of + dir_yoko: begin pdf_last_x_pos := cur_h; pdf_last_y_pos := cur_v; end; + dir_tate: begin pdf_last_x_pos := -cur_v; pdf_last_y_pos := cur_h; end; + dir_dtou: begin pdf_last_x_pos := cur_v; pdf_last_y_pos := -cur_h; end; + endcases; + pdf_last_x_pos := pdf_last_x_pos + 4736286; + case dvi_dir of + dir_tate,dir_dtou: + pdf_last_y_pos := cur_page_width - pdf_last_y_pos - 4736286; + dir_yoko: + pdf_last_y_pos := cur_page_height - pdf_last_y_pos - 4736286; + endcases; + {4736286 = 1in, the funny DVI origin offset} +end + +@ @= + if pdf_page_height <> 0 then + cur_page_height := pdf_page_height + else + cur_page_height := height(p) + depth(p) + 2*v_offset + 2*4736286; + if pdf_page_width <> 0 then + cur_page_width := pdf_page_width + else + cur_page_width := width(p) + 2*h_offset + 2*4736286; + if (type(p)=dir_node) then + if (box_dir(list_ptr(p))=dir_tate)or(box_dir(list_ptr(p))=dir_dtou) then begin + t:=cur_page_height; cur_page_height:=cur_page_width; + cur_page_width:=t; end; + + +@ Of course \epTeX\ can produce a \.{DVI} file only, not a PDF file. +A \.{DVI} file does not have the information of the page height, +which is needed to implement \.{\\pdflastypos} correctly. +To keep the information of the page height, I (H.~Kitagawa) +adopted \.{\\pdfpageheight} primitive from pdf\TeX. However, in \pTeX (and \epTeX), +the papersize special \.{\\special\{papersize=|width|,|height|\}} is commonly used +for specifying page width/height. Hence, I decided that the papersize special also +changes the value of \.{\\pdfpagewidth} and \.{\\pdfpageheight}. +The following routine does this. + +In present implementation, the ``valid'' papersize special, which can be interpreted by +this routine, is in the following form: +$$\hbox{.{\\special\{papersize=$x$pt,$y$pt\}}}$$ +where $x$\,pt and $y$\, pt are positive dimensions which \TeX\ can comprehend. +No spaces are allowed in the above form, and only ``pt'' is allowed for unit, for simplicity. + +@d ifps==if k=pool_ptr then goto done else if +@d sop(#)==so(str_pool[(#)]) + +@= +if pool_ptr-str_start[str_ptr]<=10 then goto done; +k:=str_start[str_ptr]; +if (sop(k+0)<>'p')or(sop(k+1)<>'a')or(sop(k+2)<>'p')or + (sop(k+3)<>'e')or(sop(k+4)<>'r')or(sop(k+5)<>'s')or + (sop(k+6)<>'i')or(sop(k+7)<>'z')or(sop(k+8)<>'e') then goto done; +k:=k+9; ifps sop(k)='=' then incr(k); +@; +incr(k); ifps sop(k)<>',' then goto done else incr(k); cw:=t; +@; +geq_word_define(dimen_base+pdf_page_width_code,cw); +geq_word_define(dimen_base+pdf_page_height_code,t); +cur_page_height := t; cur_page_width := cw; +if (dvi_dir=dir_tate)or(dvi_dir=dir_dtou) then begin + t:=cur_page_height; cur_page_height:=cur_page_width; + cur_page_width:=t; end; + +@ @= +s:=1; t:=0; bl:=true; +while (k='0')and (sop(k)<='9') then begin t:=10*t+sop(k)-'0'; incr(k); end + else begin bl:=false; end; +end; +t:=t*unity; +ifps sop(k)='.' then begin incr(k); bl:=true; i:=0; + while (k='0')and (sop(k)<='9') then begin + dig[i]:=sop(k)-'0'; incr(k); incr(i); end + else begin bl:=false; incr(k); incr(i); end; + end; + t:=s*(t+round_decimals(i-1)); +end +else if (sop(k)>='0')and(sop(k)<='9') then goto done +else begin t:=s*t; incr(k); end; +ifps sop(k-1)<>'p' then goto done; ifps sop(k)<>'t' then goto done; + +@* \[54] System-dependent changes. +@z diff -udrN web2c.orig//ptexdir/ptex-base.ch web2c/ptexdir/ptex-base.ch --- web2c.orig//ptexdir/ptex-base.ch 2011-03-18 10:28:59.919999984 +0900 +++ web2c/ptexdir/ptex-base.ch 2011-03-18 10:40:21.724000004 +0900 @@ -337,7 +337,9 @@ @d hlist_node=0 {|type| of hlist nodes} @d box_node_size=8 {number of words to allocate for a box node} @# -@d box_dir(#) == subtype(#) {direction mode of a box} +@d box_dir(#) == (subtype(#)mod 8) {direction mode of a box} +@d set_box_dir(#) == subtype(#):= (subtype(#) div 8)*8+ set_box_dir_end +@d set_box_dir_end(#) == # @d dir_default = 0 {direction of the box, default Left to Right} @d dir_dtou = 1 {direction of the box, Bottom to Top} @d dir_tate = 3 {direction of the box, Top to Bottom} @@ -388,7 +390,7 @@ @p function new_dir_node(b:pointer; dir:eight_bits):pointer; var p:pointer; {the new node} begin if type(b)>vlist_node then confusion("new_dir_node:not box"); -p:=new_null_box; type(p):=dir_node; box_dir(p):=dir; +p:=new_null_box; type(p):=dir_node; set_box_dir(p)(dir); case box_dir(b) of dir_yoko: @; dir_tate: @; @@ -1924,7 +1926,7 @@ toks_register,assign_toks,def_family,set_font,def_font: @; @y -@!q:pointer; +@!q,r:pointer; begin m:=cur_chr; case cur_cmd of assign_kinsoku: @; @@ -1957,7 +1959,8 @@ begin q:=box(cur_val); while (q<>null)and(box_dir(q)<>abs(direction)) do q:=link(q); if q=null then - begin q:=new_dir_node(box(cur_val),abs(direction)); + begin r:=link(box(cur_val)); link(box(cur_val)):=null; + q:=new_dir_node(box(cur_val),abs(direction)); link(box(cur_val)):=r; cur_val:=mem[q+m].sc; delete_glue_ref(space_ptr(q)); delete_glue_ref(xspace_ptr(q)); free_node(q,box_node_size); @@ -3236,6 +3239,18 @@ @d math_text_jchar=6 @z +@x [34.683] radical with japanese char +@d left_delimiter(#)==#+4 {first delimiter field of a noad} +@d right_delimiter(#)==#+5 {second delimiter field of a fraction noad} +@d radical_noad=inner_noad+1 {|type| of a noad for square roots} +@d radical_noad_size=5 {number of |mem| words in a radical noad} +@y +@d left_delimiter(#)==#+5 {first delimiter field of a noad} +@d right_delimiter(#)==#+4 {second delimiter field of a fraction noad} +@d radical_noad=inner_noad+1 {|type| of a noad for square roots} +@d radical_noad_size=6 {number of |mem| words in a radical noad} +@z + @x [34.686] l.14129 - pTeX: new_noad mem[supscr(p)].hh:=empty_field; new_noad:=p; @@ -3705,7 +3720,7 @@ glue_set(q):=glue_set(p); shift_amount(q):=o; r:=link(list_ptr(q)); s:=link(list_ptr(p)); @y -box_dir(q):=abs(direction); +set_box_dir(q)(abs(direction)); glue_order(q):=glue_order(p); glue_sign(q):=glue_sign(p); glue_set(q):=glue_set(p); shift_amount(q):=o; r:=link(list_ptr(q)); s:=link(list_ptr(p)); @@ -3721,7 +3736,7 @@ if mode=-vmode then width(u):=width(s)@+else begin type(u):=vlist_node; height(u):=width(s); end; -box_dir(u):=abs(direction) +set_box_dir(u)(abs(direction)) @z @x [37.810] l.16564 - pTeX: unset box -> BOX @@ -3729,7 +3744,7 @@ end @y width(r):=w; type(r):=hlist_node; -box_dir(r):=abs(direction); +set_box_dir(r)(abs(direction)); end @z @@ -3737,7 +3752,7 @@ height(r):=w; type(r):=vlist_node; @y height(r):=w; type(r):=vlist_node; -box_dir(r):=abs(direction); +set_box_dir(r)(abs(direction)); @z @x [38.816] l.16687 - pTeX: init chain, delete disp_node @@ -4141,10 +4156,10 @@ q:=prune_page_top(q); p:=list_ptr(v); if q=null then box(n):=null {the |eq_level| of the box stays the same} else begin - box(n):=vpack(q,natural); box_dir(box(n)):=box_dir(v); + box(n):=vpack(q,natural); set_box_dir(box(n))(box_dir(v)); end; q:=vpackage(p,h,exactly,split_max_depth); -box_dir(q):=box_dir(v); +set_box_dir(q)(box_dir(v)); delete_glue_ref(space_ptr(v)); delete_glue_ref(xspace_ptr(v)); free_node(v,box_node_size); vsplit:=q; @@ -4227,7 +4242,7 @@ box(255):=vpackage(link(page_head),best_size,exactly,page_max_depth); @y box(255):=vpackage(link(page_head),best_size,exactly,page_max_depth); -box_dir(box(255)):=page_dir; +set_box_dir(box(255))(page_dir); @z @x [45.1020] l.20513 - pTeX: check ins_dir @@ -4249,7 +4264,7 @@ box(n):=new_null_box; last_ins_ptr(r):=box(n)+list_offset; end; othercases - box_dir(box(n)):=ins_dir(p); + set_box_dir(box(n))(ins_dir(p)); endcases; s:=last_ins_ptr(r); link(s):=ins_ptr(p); @z @@ -4270,7 +4285,7 @@ delete_glue_ref(xspace_ptr(box(n))); flush_node_list(link(box(n))); free_node(box(n),box_node_size); -box(n):=vpack(temp_ptr,natural); box_dir(box(n)):=ins_dir(p); +box(n):=vpack(temp_ptr,natural); set_box_dir(box(n))(ins_dir(p)); @z @x [46.1030] l.20687 - pTeX:main_control @@ -4677,7 +4692,7 @@ list_ptr(link(cur_box)):=null; end else - if box_dir(cur_box)=dir_default then box_dir(cur_box):=abs(direction); + if box_dir(cur_box)=dir_default then set_box_dir(cur_box)(abs(direction)); done:end @z @@ -4739,10 +4754,10 @@ unsave; save_ptr:=save_ptr-3; if mode=-hmode then begin cur_box:=hpack(link(head),saved(2),saved(1)); - box_dir(cur_box):=abs(direction); pop_nest; + set_box_dir(cur_box)(abs(direction)); pop_nest; end else begin cur_box:=vpackage(link(head),saved(2),saved(1),d); - box_dir(cur_box):=abs(direction); pop_nest; + set_box_dir(cur_box)(abs(direction)); pop_nest; if c=vtop_code then @; end; @@ -4814,7 +4829,7 @@ insert_group: begin end_graf; q:=split_top_skip; add_glue_ref(q); d:=split_max_depth; f:=floating_penalty; unsave; decr(save_ptr); {now |saved(0)| is the insertion number, or 255 for |vadjust|} - p:=vpack(link(head),natural); box_dir(p):=abs(direction); pop_nest; + p:=vpack(link(head),natural); set_box_dir(p)(abs(direction)); pop_nest; if saved(0)<255 then begin r:=get_node(ins_node_size); type(r):=ins_node; subtype(r):=qi(saved(0)); @@ -5383,7 +5398,7 @@ @y vcenter_group: begin end_graf; unsave; save_ptr:=save_ptr-2; p:=vpack(link(head),saved(1),saved(0)); - box_dir(p):=abs(direction); pop_nest; + set_box_dir(p)(abs(direction)); pop_nest; if box_dir(p)<>abs(direction) then p:=new_dir_node(p,abs(direction)); tail_append(new_noad); type(tail):=vcenter_noad; math_type(nucleus(tail)):=sub_box; info(nucleus(tail)):=p; @@ -5646,8 +5661,9 @@ p:=link(p); end; if box_dir(q)<>abs(direction) then - begin q:=new_dir_node(q,abs(direction)); list_ptr(q):=null; - link(q):=link(box(b)); link(box(b)):=q; + begin p:=link(box(b)); link(box(b)):=null; + q:=new_dir_node(q,abs(direction)); list_ptr(q):=null; + link(q):=p; link(box(b)):=q; end; mem[q+c].sc:=cur_val; end; diff -udrN web2c.orig//web2c/configure web2c/web2c/configure --- web2c.orig//web2c/configure 2011-03-18 10:28:59.876000052 +0900 +++ web2c/web2c/configure 2011-03-18 10:59:50.196000004 +0900 @@ -757,7 +757,6 @@ LIBS CPPFLAGS CPP -CPPFLAGS YACC YFLAGS'