diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-08-23 10:17:01 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-08-23 10:17:01 +0000 |
commit | 82e002633513b0b73099d293aba30fb14360fa9a (patch) | |
tree | 06d3e4ce4cde2988646b6967ca11598d22278cbe /Build/source/texk/web2c/ptexdir/pbibtex.ch | |
parent | 16c57cd409df0f406fc2710bcadadbd790cab70b (diff) |
more upTeX and e-upTeX
git-svn-id: svn://tug.org/texlive/trunk@23652 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/ptexdir/pbibtex.ch')
-rw-r--r-- | Build/source/texk/web2c/ptexdir/pbibtex.ch | 61 |
1 files changed, 16 insertions, 45 deletions
diff --git a/Build/source/texk/web2c/ptexdir/pbibtex.ch b/Build/source/texk/web2c/ptexdir/pbibtex.ch index fd55579304b..95ec3d47b91 100644 --- a/Build/source/texk/web2c/ptexdir/pbibtex.ch +++ b/Build/source/texk/web2c/ptexdir/pbibtex.ch @@ -52,9 +52,7 @@ print (banner); @y print (banner); - print (' ('); - print (conststringcast(get_enc_string)); - print (')'); + print (' (', conststringcast(get_enc_string), ')'); @z @x Changes for JBibTeX by Shouichi Matsui [27] @@ -229,7 +227,7 @@ begin @x parse_arguments; @y -init_default_kanji; +init_kanji; parse_arguments; @z @@ -335,11 +333,11 @@ if (ex_buf_ptr < ex_buf_length) then {remove the ``and''} ex_buf_ptr := ex_buf_ptr - 4; @y if (ex_buf_ptr < ex_buf_length) then {remove the ``and'', or Zenkau comma} - begin + begin if( (ex_buf[ex_buf_ptr-1]=zen_comma) or (ex_buf[ex_buf_ptr-1]=zen_kuten) ) then ex_buf_ptr := ex_buf_ptr - 2 else ex_buf_ptr := ex_buf_ptr - 4; - end; + end; @z @x Changes for JBibTeX by Shouichi Matsui for Zenkaku comma @@ -456,12 +454,13 @@ while (sp_ptr < sp_end) do {shift the substring} @y { 2 bytes Kanji code break check } tps:=str_start[pop_lit3]; -while (tps < sp_ptr ) do +while (tps < sp_ptr) do begin if str_pool[tps] > 127 then tps := tps + 2 else incr(tps); +end; tpe:=tps; -while (tpe < sp_end ) do begin +while (tpe < sp_end) do begin if str_pool[tpe] > 127 then tpe := tpe+2 else incr(tpe); @@ -485,7 +484,8 @@ while (sp_ptr < sp_end) do {shift the substring} append_char (str_pool[sp_ptr]); incr(sp_ptr); end else begin - append_char (str_pool[sp_ptr]); incr(sp_ptr); end; + append_char (str_pool[sp_ptr]); incr(sp_ptr); + end; end; @z @@ -504,9 +504,10 @@ while (sp_ptr < sp_end) do {shift the substring} if (sp_brace_level > 0) then decr(sp_brace_level); end - else if (str_pool[sp_xptr1-1]>127) then begin {kanji char} + else if (str_pool[sp_xptr1-1]>127) then + begin {kanji char} incr(sp_xptr1); num_text_chars:=num_text_chars+2; - end + end else incr(num_text_chars); end; @@ -514,22 +515,8 @@ while (sp_ptr < sp_end) do {shift the substring} @x const n_options = 4; {Pascal won't count array lengths for us.} -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; -begin - @<Initialize the option variables@>; @y const n_options = 6; {Pascal won't count array lengths for us.} -var @!long_options: array[0..n_options] of getopt_struct; - @!getopt_return_val: integer; - @!option_index: c_int_type; - @!current_option: 0..n_options; - @!version_switch: boolean; -begin - @<Initialize the option variables@>; - version_switch := false; @z @x @@ -545,28 +532,19 @@ begin @z @x - print_version_and_exit (banner, 'Oren Patashnik', nil, nil); + end; {Else it was a flag; |getopt| has already done the assignment.} @y - version_switch := true; - end else if argument_is ('kanji') then begin - @<Set process kanji code@>; -@z + if (not set_enc_string(optarg, 0)) then + write_ln('Bad kanji encoding "', stringcast(optarg), '".'); -@x - until getopt_return_val = -1; -@y - until getopt_return_val = -1; - if (version_switch) then - print_version_and_exit (banner, 'Oren Patashnik', nil, nil); + end; {Else it was a flag; |getopt| has already done the assignment.} @z @x - if (optind + 1 <> argc) then begin write_ln (stderr, 'bibtex: Need exactly one file argument.'); usage ('bibtex'); @y - if (optind + 1 <> argc) then begin write_ln (stderr, 'pbibtex: Need exactly one file argument.'); usage ('pbibtex'); @z @@ -577,7 +555,6 @@ long_options[current_option].has_arg := 0; long_options[current_option].flag := 0; long_options[current_option].val := 0; incr (current_option); - @y long_options[current_option].name := 'version'; long_options[current_option].has_arg := 0; @@ -612,7 +589,6 @@ begin kpse_set_program_name (argv[0], 'bibtex'); begin kpse_set_program_name (argv[0], 'pbibtex'); @z - @x until j_prime; incr (k); @@ -653,9 +629,4 @@ begin push_lit_stk(0,stk_int); end; exit:end; - -@ @<Set process kanji code@>= - if (not set_enc_string(optarg, 0)) then begin - write_ln('Bad kanjicode encoding "', stringcast(optarg), '".'); - end; @z |