diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-03-09 08:29:33 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-03-09 08:29:33 +0000 |
commit | 734546e6ec6e3d5a90fb56827a8d7a52e4802237 (patch) | |
tree | 62e5ea36c5a41a051d06061549858a100dc098e8 /Build/source/texk/web2c/tiedir | |
parent | cab478a1b0d6da13fc4671a526f6a74cb2f82853 (diff) |
let tie respect WEBINPUTS
git-svn-id: svn://tug.org/texlive/trunk@12347 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tiedir')
-rw-r--r-- | Build/source/texk/web2c/tiedir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/tiedir/tie-w2c.ch | 18 | ||||
-rw-r--r-- | Build/source/texk/web2c/tiedir/tie.w | 36 |
3 files changed, 40 insertions, 20 deletions
diff --git a/Build/source/texk/web2c/tiedir/ChangeLog b/Build/source/texk/web2c/tiedir/ChangeLog new file mode 100644 index 00000000000..b15b32cac5f --- /dev/null +++ b/Build/source/texk/web2c/tiedir/ChangeLog @@ -0,0 +1,6 @@ +2009-03-07 Peter Breitenlohner <peb@mppmu.mpg.de> + + * tie-w2c.ch, tie.w: remove trailing whitespace. + + * tie-w2c.ch: use kpse_open_file to locate input files, + in order to respect WEBINPUTS (ported from tangle.ch). diff --git a/Build/source/texk/web2c/tiedir/tie-w2c.ch b/Build/source/texk/web2c/tiedir/tie-w2c.ch index 6dfa043b38b..55c5a64c624 100644 --- a/Build/source/texk/web2c/tiedir/tie-w2c.ch +++ b/Build/source/texk/web2c/tiedir/tie-w2c.ch @@ -33,6 +33,7 @@ typedef char* string; @y #include "cpascal.h" #include <stdio.h> +#include <kpathsea/kpathsea.h> /* Also redefine usage to avoid clash with function from lib. */ #define usage tieusage @z @@ -52,10 +53,22 @@ void err_loc P1C(int, i) /* prints location of error */ @z @x -boolean lines_dont_match(i,j) + fopen(input_organization[0]->name_of_file,"r"); +@y + kpse_open_file(input_organization[0]->name_of_file, kpse_web_format); +@z + +@x + fopen(input_organization[i]->name_of_file,"r"); +@y + kpse_open_file(input_organization[i]->name_of_file, kpse_web_format); +@z + +@x +boolean lines_dont_match(i,j) file_index i,j; @y -boolean lines_dont_match P2C(file_index, i, file_index, j) +boolean lines_dont_match P2C(file_index, i, file_index, j) @z @x @@ -103,6 +116,7 @@ int main P2C(int, argc, string *, argv) print_ln(banner); /* print a ``banner line'' */ print_ln(copyright); /* include the copyright notice */ @y + kpse_set_program_name(argv[0], "tie"); print(banner); /* print a ``banner line'' */ print_ln(versionstring); /* Web2C version */ print_ln(copyright); /* include the copyright notice */ diff --git a/Build/source/texk/web2c/tiedir/tie.w b/Build/source/texk/web2c/tiedir/tie.w index 5aa6abf87d1..227328b729e 100644 --- a/Build/source/texk/web2c/tiedir/tie.w +++ b/Build/source/texk/web2c/tiedir/tie.w @@ -23,7 +23,7 @@ % Version 2.3 was slightly modified to be processed with the % cweb by Levy&Knuth. % also repaired loop control for end of changes test (92-09-24) -% Version 2.4 included <stdlib.h> instead of <malloc.h> when +% Version 2.4 included <stdlib.h> instead of <malloc.h> when % used with ANSI-C (92-12-17) % @@ -91,7 +91,7 @@ for each input file. Thus the storage requirement of \.{TIE} does not depend on the input data. The program is written in \Cl\ and uses only few features of a -particular environment that may need to be changed in other +particular environment that may need to be changed in other installations. E.g.\ it will not use the |enum| type declarations. The changes needed may refer to the access of the command line @@ -103,7 +103,7 @@ domain. Nevertheless the copyright notice must not be replaced or modified. @d banner "This is TIE, CWEB Version 2.4." -@d copyright +@d copyright "Copyright (c) 1989,1992 by THD/ITI. All rights reserved." @@ -176,7 +176,7 @@ internal seven-bit code that is essentially standard \ASCII{}, the is done immediately when each character is read in. Conversely, characters are converted from \ASCII{} to the user's external representation just before they are output. But the algorithm is -prepared for the usage of eight-bit data. +prepared for the usage of eight-bit data. \noindent Here is a table of the standard visible \ASCII{} codes: $$\def\:{\char\count255\global\advance\count255 by 1} @@ -223,7 +223,7 @@ should define |ASCII_Code| as \&{short}. @<Global types@>= #define max_ASCII (@'~'+1) -typedef unsigned char ASCII_Code; +typedef unsigned char ASCII_Code; /* eight-bit numbers, a subrange of the integers */ @@ -468,7 +468,7 @@ for terminating an output line and writing strings to the user. @d print_ln(v) {fprintf(term_out,v);term_new_line;} /* `|print|' and then start new line */ @d print2_ln(a,b) {print2(a,b);term_new_line;} /* same with two arguments */ -@d print3_ln(a,b,c) {print3(a,b,c);term_new_line;} +@d print3_ln(a,b,c) {print3(a,b,c);term_new_line;} /* same with three arguments */ @d print_nl(v) {term_new_line; print(v);} /* print information starting on a new line */ @@ -561,7 +561,7 @@ typedef int file_index; /* |-1..max_file_index+1| */ @ The following data structure joins all informations needed to use these input files. -%`line' is a normal identifier throughout this program +%`line' is a normal identifier throughout this program @f line dummy @<Global types@>= typedef struct _idsc{ @@ -607,7 +607,7 @@ end of the file is reached |mode| is set to |ignore|. On some systems it might be useful to replace tab characters by a proper number of spaces since several editors used to create change files insert tab characters into a source file not under control of the user. So it -might be a problem to create a matching change file. +might be a problem to create a matching change file. @^tab character expansion@> We define |get_line| to read a line from a file specified by @@ -736,7 +736,7 @@ message because it is appended by |err_print|. This function is implemented as a macro. It gives a message and an indication of the offending file. The actions to determine the error -location are provided by a function called |err_loc|. +location are provided by a function called |err_loc|. @d error_loc(m) err_loc(m); history=troublesome; @+ } @d err_print(m) { @+ print_nl(m); error_loc @@ -755,7 +755,7 @@ void err_loc(i) /* prints location of error */ outputs a message and then calls `|jump_out|'. |err_print| will print the error message followed by an indication of where the error was spotted in the source files. |fatal_error| cannot state any files -because the problem is usually to access these. +because the problem is usually to access these. @d fatal_error(m) { print(m); print_c('.'); history=fatal; @@ -766,7 +766,7 @@ because the problem is usually to access these. @ |jump_out| just cuts across all active procedure levels and jumps out of the program. It is used when no recovery from a particular error has been provided. The return code from this program should be -regarded by the caller. +regarded by the caller. @d jump_out() exit(1) @@ -848,7 +848,7 @@ This is done by |init_change_file|. are different. @<Internal functions@>= -boolean lines_dont_match(i,j) +boolean lines_dont_match(i,j) file_index i,j; { buffer_index k,lmt; @@ -1038,7 +1038,7 @@ while (test_input==none && test_file<no_ch-1){ file or a new master file. The change file creation needs some closer inspection because we may be before a change, in the pattern part or in the replacement part. For a master file we have to write the line -from the current actual input. +from the current actual input. @<Handle output@>= if (prod_chf==chf) { @@ -1152,7 +1152,7 @@ for (i=1;i<no_ch;i++) {/* all change files */ @ We want to tell the user about our command line options. This is done by the |usage()| function. It contains merely the necessary -print statement and exits afterwards. +print statement and exits afterwards. @<Intern...@>= void usage() @@ -1172,7 +1172,7 @@ indicates the output file. When we allow flags at any position, we must find out which name is for what purpose. The master file is already part of the |input_organization| structure (index~0). As long as the number of files found (counted in |no_ch|) is |-1| we have not -yet found the output file name. +yet found the output file name. @<Scan the parameters@>= {int act_arg; @@ -1200,7 +1200,7 @@ else case 'C': prod_chf=chf; break; case 'm': case 'M': prod_chf=master; break; - default: usage(); + default: usage(); } @@ -1252,10 +1252,10 @@ main(argc,argv) } @ We want to pass the |history| value to the operating system so that -it can be used to govern whether or not other programs are started. +it can be used to govern whether or not other programs are started. Additionaly we report the history to the user, although this may not be ``{\mc UNIX}'' style---but we are in best companion: \.{WEB} and -\TeX{} do the same. +\TeX{} do the same. @^system dependencies@> @<Print the job |history|@>= |