diff options
author | rsc <devnull@localhost> | 2004-05-15 23:24:00 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-05-15 23:24:00 +0000 |
commit | 5cedca1b69d020c32466f70843a11767773d7e3b (patch) | |
tree | a15a3d84e92aa262543b0010763a5e6920c9ba24 /src/cmd/troff/unansi | |
parent | 76e6aca867e3e48ea04fbcf7284c45369a69829e (diff) | |
download | plan9port-5cedca1b69d020c32466f70843a11767773d7e3b.tar.gz plan9port-5cedca1b69d020c32466f70843a11767773d7e3b.tar.bz2 plan9port-5cedca1b69d020c32466f70843a11767773d7e3b.zip |
Let's try this. It's BUGGERED.
Diffstat (limited to 'src/cmd/troff/unansi')
-rw-r--r-- | src/cmd/troff/unansi | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/cmd/troff/unansi b/src/cmd/troff/unansi new file mode 100644 index 00000000..67aed817 --- /dev/null +++ b/src/cmd/troff/unansi @@ -0,0 +1,49 @@ +# The awk program cvt will convert the relatively sterotyped ansi c +# in this troff distribution into older-style c, by munging function +# declarations. + +# You will also have to edit fns.h, by +# sed 's/(.*)/()/g' fns.h >foo; mv foo fns.h +# check this before doing the move! + +# you will also have to make some editing changes in +# tdef.h in the Contab structure: s/(void)/()/ +# you may have to fix up some function declarations +# in n4.c, the ones with (*f)(Tchar). + +# you will surely also have header files to deal with. + +# the most obvious cases are dealt with by the following +# commands. make sure you do this stuff on a copy! + +# function prototypes in n8.c probably belong in fns.h. readpats(void) must +# be readpats() before cvt runs. + +sed \ + -e 's/(void)/()/' \ + -e 's/(Tchar[^)]*);/();/' \ + -e 's/(char[^)]*);/();/' \ + -e 's/(int[^)]*);/();/' \ +n8.c >foo +mv foo n8.c + +for i in *.c +do + cvt $i >foo + mv foo $i +done + +sed 's/(.*)/()/g' fns.h >foo +mv foo fns.h + +sed -e 's/(void)/()/g' -e '/stdlib/d' tdef.h >foo +mv foo tdef.h + +# Compliers may not approve of void *setbrk() in fns.h and n3.c. + +sed 's/^void\*[ ]setbrk/char* setbrk/' fns.h >foo +mv foo fns.h + +sed 's/^void \*setbrk/char *setbrk/' n3.c >foo +mv foo n3.c + |