diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-16 07:27:23 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-07-16 07:27:23 +0000 |
commit | 2f6e1cc9e4c3f899a4142cbdf44e6fc10af0d32b (patch) | |
tree | 6ca7032c7cce84a2826dc9105b9aaf479800b561 /Build/source/texk/web2c/omegaware | |
parent | 41e050122555719daad3bc3da47e3d559e39c42f (diff) |
texk/*: Pass known program names as arg2 to kpse_set_program_name()
git-svn-id: svn://tug.org/texlive/trunk@27073 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/omegaware')
-rw-r--r-- | Build/source/texk/web2c/omegaware/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/odvicopy.ch | 21 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/odvitype.ch | 19 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/ofm2opl.ch | 15 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/opl2ofm.ch | 15 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/otangle.ch | 15 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/ovf2ovp.ch | 15 | ||||
-rw-r--r-- | Build/source/texk/web2c/omegaware/ovp2ovf.ch | 15 |
8 files changed, 87 insertions, 33 deletions
diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog index 3355c20aeb1..9010f9d7bad 100644 --- a/Build/source/texk/web2c/omegaware/ChangeLog +++ b/Build/source/texk/web2c/omegaware/ChangeLog @@ -1,3 +1,8 @@ +2012-07-15 Peter Breitenlohner <peb@mppmu.mpg.de> + + * odvicopy.ch, odvitype.ch, ofm2opl.ch, opl2ofm.ch, otangle.ch, + ovf2ovp.ch, ovp2ovf.ch: Define and use my_name. + 2012-05-15 Peter Breitenlohner <peb@mppmu.mpg.de> * am/omegaware.am: Add rule to build wovp2ovf. diff --git a/Build/source/texk/web2c/omegaware/odvicopy.ch b/Build/source/texk/web2c/omegaware/odvicopy.ch index 57f73b00071..762751acde5 100644 --- a/Build/source/texk/web2c/omegaware/odvicopy.ch +++ b/Build/source/texk/web2c/omegaware/odvicopy.ch @@ -24,7 +24,14 @@ \let\maybe=\iffalse @z -@x [1] No random reading on stdin, may be not seekable. +@x [1] Define my_name +@d banner=='This is ODVIcopy, Version 1.6' {printed when the program starts} +@y +@d my_name=='odvicopy' +@d banner=='This is ODVIcopy, Version 1.6' {printed when the program starts} +@z + +@x [2] No random reading on stdin, may be not seekable. @d random_reading==true {should we skip around in the file?} @y @<Globals in the outer block@>= @@ -40,7 +47,7 @@ procedure initialize; {this procedure gets things started properly} procedure initialize; {this procedure gets things started properly} var @<Local variables for initialization@>@/ begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); parse_arguments; print (banner); print_ln (version_string); @z @@ -629,7 +636,7 @@ begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('odvicopy'); + usage (my_name); end else if argument_is ('help') then begin usage_help (ODVICOPY_HELP, nil); @@ -653,8 +660,8 @@ begin {Now |optind| is the index of first non-option on the command line. We can have zero, one, or two remaining arguments.} if (optind > argc) or (optind + 2 < argc) then begin - write_ln (stderr, 'odvicopy: Need at most two file arguments.'); - usage ('odvicopy'); + write_ln (stderr, my_name, ': Need at most two file arguments.'); + usage (my_name); end; if optind = argc then begin @@ -741,7 +748,7 @@ while optarg[m] do begin end else if optarg[m] = "." then begin incr (k); if k >= 10 then begin - write_ln (stderr, 'odvicopy: More than ten count registers specified.'); + write_ln (stderr, my_name, ': More than ten count registers specified.'); uexit (1); end; incr (m); @@ -749,7 +756,7 @@ while optarg[m] do begin end else begin start_count[k] := strtol (optarg + m, address_of (end_num), 10); if end_num = optarg + m then begin - write_ln (stderr, 'odvicopy: -page-start values must be numeric or *.'); + write_ln (stderr, my_name, ': -page-start values must be numeric or *.'); uexit (1); end; start_there[k] := true; diff --git a/Build/source/texk/web2c/omegaware/odvitype.ch b/Build/source/texk/web2c/omegaware/odvitype.ch index 02cd626cddf..7af82f33c8a 100644 --- a/Build/source/texk/web2c/omegaware/odvitype.ch +++ b/Build/source/texk/web2c/omegaware/odvitype.ch @@ -36,6 +36,13 @@ \def\title{DVI$\,$\lowercase{type} changes for C} @z +@x [1] Define my_name +@d banner=='This is ODVItype, Version 1.5' {printed when the program starts} +@y +@d my_name=='odvitype' +@d banner=='This is ODVItype, Version 1.5' {printed when the program starts} +@z + % [3] Specify the output file to simplify web2c, and don't print the % banner until later. @x @@ -55,7 +62,7 @@ procedure initialize; {this procedure gets things started properly} procedure initialize; {this procedure gets things started properly} var i:integer; {loop index for initializations} begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); parse_arguments; print (banner); print_ln (version_string); @@ -616,7 +623,7 @@ begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('odvitype'); + usage (my_name); end else if argument_is ('help') then begin usage_help (ODVITYPE_HELP, nil); @@ -649,8 +656,8 @@ begin {Now |optind| is the index of first non-option on the command line.} if (optind + 1 <> argc) then begin - write_ln (stderr, 'odvitype: Need exactly one file argument.'); - usage ('odvitype'); + write_ln (stderr, my_name, ': Need exactly one file argument.'); + usage (my_name); end; dvi_name := extend_filename (cmdline (optind), 'dvi'); end; @@ -710,7 +717,7 @@ while optarg[m] do begin end else if optarg[m] = "." then begin incr (k); if k >= 10 then begin - write_ln (stderr, 'odvitype: More than ten count registers specified.'); + write_ln (stderr, my_name, ': More than ten count registers specified.'); uexit (1); end; incr (m); @@ -718,7 +725,7 @@ while optarg[m] do begin end else begin start_count[k] := strtol (optarg + m, address_of (end_num), 10); if end_num = optarg + m then begin - write_ln (stderr, 'odvitype: -page-start values must be numeric or *.'); + write_ln (stderr, my_name, ': -page-start values must be numeric or *.'); uexit (1); end; start_there[k] := true; diff --git a/Build/source/texk/web2c/omegaware/ofm2opl.ch b/Build/source/texk/web2c/omegaware/ofm2opl.ch index cde0495cd88..fc71e983c9b 100644 --- a/Build/source/texk/web2c/omegaware/ofm2opl.ch +++ b/Build/source/texk/web2c/omegaware/ofm2opl.ch @@ -30,6 +30,13 @@ %\def\title{TF\lowercase{to}PL changes for C} @z +@x [1] Define my_name +@d banner=='This is OFM2OPL, Version 1.12' +@y +@d my_name=='ofm2opl' +@d banner=='This is OFM2OPL, Version 1.12' +@z + % [2] Fix files in program statement. We need to tell web2c about one % special variable. Perhaps it would be better to allow @define's % anywhere in a source file, but that seemed just as painful as this. @@ -49,7 +56,7 @@ procedure initialize; {this procedure gets things started properly} @<Define |parse_arguments|@> procedure initialize; {this procedure gets things started properly} begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); kpse_init_prog ('OFM2OPL', 0, nil, nil); {We |xrealloc| when we know how big the file is. The 1000 comes from the negative lower bound.} @@ -341,7 +348,7 @@ begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('ofm2opl'); + usage (my_name); end else if argument_is ('help') then begin usage_help (OFM2OPL_HELP, nil); @@ -363,8 +370,8 @@ begin {Now |optind| is the index of first non-option on the command line.} if (optind + 1 <> argc) and (optind + 2 <> argc) then begin - write_ln (stderr, 'ofm2opl: Need one or two file arguments.'); - usage ('ofm2opl'); + write_ln (stderr, my_name, ': Need one or two file arguments.'); + usage (my_name); end; tfm_name := cmdline (optind); diff --git a/Build/source/texk/web2c/omegaware/opl2ofm.ch b/Build/source/texk/web2c/omegaware/opl2ofm.ch index 72ebcf928e3..d44734533a5 100644 --- a/Build/source/texk/web2c/omegaware/opl2ofm.ch +++ b/Build/source/texk/web2c/omegaware/opl2ofm.ch @@ -26,6 +26,13 @@ %\def\title{OPL2OFM changes for C} @z +@x [1] Define my_name +@d banner=='This is OPL2OFM, Version 1.12' +@y +@d my_name=='opl2ofm' +@d banner=='This is OPL2OFM, Version 1.12' +@z + @x [still 2] No banner unless verbose. procedure initialize; {this procedure gets things started properly} var @<Local variables for initialization@>@/ @@ -35,7 +42,7 @@ procedure initialize; {this procedure gets things started properly} procedure initialize; {this procedure gets things started properly} var @<Local variables for initialization@>@/ begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); parse_arguments; @z @@ -299,7 +306,7 @@ begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('opl2ofm'); + usage (my_name); end else if argument_is ('help') then begin usage_help (OPL2OFM_HELP, nil); @@ -314,8 +321,8 @@ begin {Now |optind| is the index of first non-option on the command line. We must have one or two remaining arguments.} if (optind + 1 <> argc) and (optind + 2 <> argc) then begin - write_ln (stderr, 'opl2ofm: Need one or two file arguments.'); - usage ('opl2ofm'); + write_ln (stderr, my_name, ': Need one or two file arguments.'); + usage (my_name); end; pl_name := extend_filename (cmdline (optind), 'opl'); diff --git a/Build/source/texk/web2c/omegaware/otangle.ch b/Build/source/texk/web2c/omegaware/otangle.ch index 6dc54623d97..0baf8628e73 100644 --- a/Build/source/texk/web2c/omegaware/otangle.ch +++ b/Build/source/texk/web2c/omegaware/otangle.ch @@ -52,6 +52,13 @@ \def\title{TANGLE changes for C} @z +@x [1] Define my_name +@d banner=='This is OTANGLE, Version 4.4' +@y +@d my_name=='otangle' +@d banner=='This is OTANGLE, Version 4.4' +@z + @x [2] Eliminate the |end_of_TANGLE| label. @d end_of_TANGLE = 9999 {go here to wrap it up} @@ -71,7 +78,7 @@ procedure initialize; procedure initialize; var @<Local variables for initialization@>@/ begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); parse_arguments; @<Set initial values@>@/ @z @@ -425,7 +432,7 @@ begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('otangle'); + usage (my_name); end else if argument_is ('help') then begin usage_help (OTANGLE_HELP, nil); @@ -439,8 +446,8 @@ begin {Now |optind| is the index of first non-option on the command line.} if (optind + 1 <> argc) and (optind + 2 <> argc) then begin - write_ln (stderr, 'otangle: Need one or two file arguments.'); - usage ('otangle'); + write_ln (stderr, my_name, ': Need one or two file arguments.'); + usage (my_name); end; {Supply |".web"| and |".ch"| extensions if necessary.} diff --git a/Build/source/texk/web2c/omegaware/ovf2ovp.ch b/Build/source/texk/web2c/omegaware/ovf2ovp.ch index 70523958741..2251354ce1b 100644 --- a/Build/source/texk/web2c/omegaware/ovf2ovp.ch +++ b/Build/source/texk/web2c/omegaware/ovf2ovp.ch @@ -17,6 +17,13 @@ %\def\title{VF$\,$\lowercase{to}$\,$VP changes for C} @z +@x [1] Define my_name +@d banner=='This is OVF2OVP, Version 1.12' {printed when the program starts} +@y +@d my_name=='ovf2ovp' +@d banner=='This is OVF2OVP, Version 1.12' {printed when the program starts} +@z + % [2] We need to tell web2c about one special variable. % Perhaps it would be better to allow @define's % anywhere in a source file, but that seemed just as painful as this. @@ -38,7 +45,7 @@ procedure initialize; {this procedure gets things started properly} procedure initialize; {this procedure gets things started properly} var @!k:integer; {all-purpose index for initialization} begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); kpse_init_prog ('VFTOVP', 0, nil, nil); {We |xrealloc| when we know how big the file is. The 1000 comes from the negative lower bound.} @@ -521,7 +528,7 @@ begin if getopt_return_val = -1 then begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('ovf2ovp'); + usage (my_name); end else if argument_is ('help') then begin usage_help (OVF2OVP_HELP, nil); @@ -545,8 +552,8 @@ begin We must have one two three remaining arguments.} if (optind + 1 <> argc) and (optind + 2 <> argc) and (optind + 3 <> argc) then begin - write_ln (stderr, 'ovf2ovp: Need one to three file arguments.'); - usage ('ovf2ovp'); + write_ln (stderr, my_name, ': Need one to three file arguments.'); + usage (my_name); end; vf_name := cmdline (optind); diff --git a/Build/source/texk/web2c/omegaware/ovp2ovf.ch b/Build/source/texk/web2c/omegaware/ovp2ovf.ch index f390a4780ec..759ae090d58 100644 --- a/Build/source/texk/web2c/omegaware/ovp2ovf.ch +++ b/Build/source/texk/web2c/omegaware/ovp2ovf.ch @@ -15,6 +15,13 @@ %\def\title{OVP2OVF changes for C} @z +@x [1] Define my_name +@d banner=='This is OVP2OVF, Version 1.12' +@y +@d my_name=='ovp2ovf' +@d banner=='This is OVP2OVF, Version 1.12' +@z + @x [2] Print the banner later. procedure initialize; {this procedure gets things started properly} var @<Local variables for initialization@>@/ @@ -24,7 +31,7 @@ procedure initialize; {this procedure gets things started properly} procedure initialize; {this procedure gets things started properly} var @<Local variables for initialization@>@/ begin - kpse_set_program_name (argv[0], nil); + kpse_set_program_name (argv[0], my_name); parse_arguments; @z @@ -265,7 +272,7 @@ begin {End of arguments; we exit the loop below.} ; end else if getopt_return_val = "?" then begin - usage ('ovp2ovf'); {|getopt| has already given an error message.} + usage (my_name); {|getopt| has already given an error message.} end else if argument_is ('help') then begin usage_help (OVP2OVF_HELP, nil); @@ -281,8 +288,8 @@ begin We must have one to three remaining arguments.} if (optind + 1 <> argc) and (optind + 2 <> argc) and (optind + 3 <> argc) then begin - write_ln (stderr, 'ovp2ovf: Need one to three file arguments.'); - usage ('ovp2ovf'); + write_ln (stderr, my_name, ': Need one to three file arguments.'); + usage (my_name); end; vpl_name := extend_filename (cmdline (optind), 'ovp'); |