summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tiedir/tie-w2c.ch
blob: fcf2a987e61223c3a6573008f0ca068b6ccb5210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
% Changes to adapt tie to web2c.
% Copyright 2001 by Olaf Weber
% This file is in the Public Domain.

@x Already in cpascal.h.
@d incr(v) v+=1 /* increase a variable by unity */
@d decr(v) v-=1 /* decrease a variable by unity */
@y
@z

@x
@ Furthermore we include the additional types |boolean| and |string|.
@d false 0
@d true 1
@<Global types@>=
typedef int boolean;
typedef char* string;
@y
@ Furthermore we include the additional types |boolean| and |string|.
/* boolean, false, true; string; all from cpascal.h */
@z

@x -- we need more input files.
#define max_file_index 9
/* we don't think that anyone needs more than 9 change files,
@y
#define max_file_index 32
/* we don't think that anyone needs more than 32 change files,
@z

@x -- add to global includes.
#include <stdio.h>
@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

@x
void get_line(i)
	file_index i;
@y
static void
get_line (file_index i)
@z

@x
void err_loc(i) /* prints location of error */
        int i;
@y
static void
err_loc (int i) /* prints location of error */
@z

@x
	  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
static boolean
lines_dont_match (file_index i, file_index j)
@z

@x
void init_change_file(i,b)
	file_index i; boolean b;
@y
static void
init_change_file (file_index i, boolean b)
@z

@x
void put_line(j)
	file_index j;
@y
static void
put_line (file_index j)
@z

@x
boolean e_of_ch_module(i)
	file_index i;
@y
static boolean
e_of_ch_module (file_index i)
@z

@x
boolean e_of_ch_preamble(i)
	file_index i;
@y
static boolean
e_of_ch_preamble (file_index i)
@z

@x
void usage()
@y
static
void usage (void)
@z

@x
main(argc,argv)
        int argc; string *argv;
@y
int main (int argc, string *argv)
@z

@x
  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 */
@z

@x
{string msg;
@y
{const_string msg;
@z

@x -- silence unitialized warning
      case fatal: msg="That was a fatal error, my friend";  break;
@y
      default: /* Anything except spotless, troublesome, or fatal is a bug. */
      case fatal: msg="That was a fatal error, my friend";  break;
@z