blob: 67aed817b4e4fffc6f1f9121b5e0617014c966f8 [file] [log] [blame]
rsc5cedca12004-05-15 23:24:00 +00001# The awk program cvt will convert the relatively sterotyped ansi c
2# in this troff distribution into older-style c, by munging function
3# declarations.
4
5# You will also have to edit fns.h, by
6# sed 's/(.*)/()/g' fns.h >foo; mv foo fns.h
7# check this before doing the move!
8
9# you will also have to make some editing changes in
10# tdef.h in the Contab structure: s/(void)/()/
11# you may have to fix up some function declarations
12# in n4.c, the ones with (*f)(Tchar).
13
14# you will surely also have header files to deal with.
15
16# the most obvious cases are dealt with by the following
17# commands. make sure you do this stuff on a copy!
18
19# function prototypes in n8.c probably belong in fns.h. readpats(void) must
20# be readpats() before cvt runs.
21
22sed \
23 -e 's/(void)/()/' \
24 -e 's/(Tchar[^)]*);/();/' \
25 -e 's/(char[^)]*);/();/' \
26 -e 's/(int[^)]*);/();/' \
27n8.c >foo
28mv foo n8.c
29
30for i in *.c
31do
32 cvt $i >foo
33 mv foo $i
34done
35
36sed 's/(.*)/()/g' fns.h >foo
37mv foo fns.h
38
39sed -e 's/(void)/()/g' -e '/stdlib/d' tdef.h >foo
40mv foo tdef.h
41
42# Compliers may not approve of void *setbrk() in fns.h and n3.c.
43
44sed 's/^void\*[ ]setbrk/char* setbrk/' fns.h >foo
45mv foo fns.h
46
47sed 's/^void \*setbrk/char *setbrk/' n3.c >foo
48mv foo n3.c
49