beta-0.89.2
[luatex.git] / source / texk / web2c / tiedir / tie-w2c.ch
blob37d5bd7b21d7b8c0b6a5075abb2be3885d856369
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 */
8 @y
9 @z
12 @ Furthermore we include the additional types |boolean| and |string|.
13 @d false 0
14 @d true 1
15 @<Global types@>=
16 typedef int boolean;
17 typedef char* 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.
32 #include <stdio.h>
34 #include "cpascal.h"
35 #include <stdio.h>
36 #include <kpathsea/kpathsea.h>
37 /* Also redefine usage to avoid clash with function from lib. */
38 #define usage tieusage
41 @x l.617
42 void get_line(i)
43         file_index i;
45 static void
46 get_line (file_index i)
49 @x l.650
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
55 @x l.667
56    if (c!=@' ' && c!=tab_mark)
58    if (c!=@' ' && c!=tab_mark && c!=@'\r')
61 @x l.745
62 void err_loc(i) /* prints location of error */
63         int i;
65 static void
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");
75 @x l.811
76           fopen(input_organization[0]->name_of_file,"r");
78           kpse_open_file(input_organization[0]->name_of_file, kpse_web_format);
81 @x l.830
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)
89         file_index i,j;
91 static boolean
92 lines_dont_match (file_index i, file_index j)
96 void init_change_file(i,b)
97         file_index i; boolean b;
99 static void
100 init_change_file (file_index i, boolean b)
104 void put_line(j)
105         file_index j;
107 static void
108 put_line (file_index j)
112 boolean e_of_ch_module(i)
113         file_index i;
115 static boolean
116 e_of_ch_module (file_index i)
120 boolean e_of_ch_preamble(i)
121         file_index i;
123 static boolean
124 e_of_ch_preamble (file_index i)
128 void usage()
130    print("Usage: tie -[mc] outfile master changefile(s)");
132 static
133 void usage (void)
135    print("Usage: tie -m|-c outfile master changefile(s)");
139 main(argc,argv)
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 */
156 {string msg;
158 {const_string msg;
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;