Blame


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