1 % Changes to adapt tie to web2c.
2 % Copyright 2001 by Olaf Weber
3 % This file is in the Public Domain.
5 @x Already in cpascal.h.
6 @d incr(v) v+=1 /* increase a variable by unity */
7 @d decr(v) v-=1 /* decrease a variable by unity */
12 @ Furthermore we include the additional types |boolean| and |string|.
19 @ Furthermore we include the additional types |boolean| and |string|.
20 /* boolean, false, true; string; all from cpascal.h */
23 @x -- we need more input files.
24 #define max_file_index 9
25 /* we don't think that anyone needs more than 9 change files,
27 #define max_file_index 32
28 /* we don't think that anyone needs more than 32 change files,
31 @x -- add to global includes.
36 #include <kpathsea/kpathsea.h>
37 /* Also redefine usage to avoid clash with function from lib. */
38 #define usage tieusage
46 get_line (file_index i)
50 replacement part of a change file, or in an incomplerte check if the
52 replacement part of a change file, or in an incomplete check if the
56 if (c!=@' ' && c!=tab_mark)
58 if (c!=@' ' && c!=tab_mark && c!=@'\r')
62 void err_loc(i) /* prints location of error */
66 err_loc (int i) /* prints location of error */
69 @x l.790 Use binary mode for output files
70 out_file=fopen(out_name,"w");
72 out_file=fopen(out_name,"wb");
76 fopen(input_organization[0]->name_of_file,"r");
78 kpse_open_file(input_organization[0]->name_of_file, kpse_web_format);
82 fopen(input_organization[i]->name_of_file,"r");
84 kpse_open_file(input_organization[i]->name_of_file, kpse_web_format);
88 boolean lines_dont_match(i,j)
92 lines_dont_match (file_index i, file_index j)
96 void init_change_file(i,b)
97 file_index i; boolean b;
100 init_change_file (file_index i, boolean b)
108 put_line (file_index j)
112 boolean e_of_ch_module(i)
116 e_of_ch_module (file_index i)
120 boolean e_of_ch_preamble(i)
124 e_of_ch_preamble (file_index i)
130 print("Usage: tie -[mc] outfile master changefile(s)");
135 print("Usage: tie -m|-c outfile master changefile(s)");
140 int argc; string *argv;
142 int main (int argc, string *argv)
146 print_ln(banner); /* print a ``banner line'' */
147 print_ln(copyright); /* include the copyright notice */
149 kpse_set_program_name(argv[0], "tie");
150 print(banner); /* print a ``banner line'' */
151 print_ln(versionstring); /* Web2C version */
152 print_ln(copyright); /* include the copyright notice */
161 @x -- silence unitialized warning
162 case fatal: msg="That was a fatal error, my friend"; break;
164 default: /* Anything except spotless, troublesome, or fatal is a bug. */
165 case fatal: msg="That was a fatal error, my friend"; break;