unansi 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # 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. # You will also have to edit fns.h, by
  5. # sed 's/(.*)/()/g' fns.h >foo; mv foo fns.h
  6. # check this before doing the move!
  7. # you will also have to make some editing changes in
  8. # tdef.h in the Contab structure: s/(void)/()/
  9. # you may have to fix up some function declarations
  10. # in n4.c, the ones with (*f)(Tchar).
  11. # you will surely also have header files to deal with.
  12. # the most obvious cases are dealt with by the following
  13. # commands. make sure you do this stuff on a copy!
  14. # function prototypes in n8.c probably belong in fns.h. readpats(void) must
  15. # be readpats() before cvt runs.
  16. sed \
  17. -e 's/(void)/()/' \
  18. -e 's/(Tchar[^)]*);/();/' \
  19. -e 's/(char[^)]*);/();/' \
  20. -e 's/(int[^)]*);/();/' \
  21. n8.c >foo
  22. mv foo n8.c
  23. for i in *.c
  24. do
  25. cvt $i >foo
  26. mv foo $i
  27. done
  28. sed 's/(.*)/()/g' fns.h >foo
  29. mv foo fns.h
  30. sed -e 's/(void)/()/g' -e '/stdlib/d' tdef.h >foo
  31. mv foo tdef.h
  32. # Compliers may not approve of void *setbrk() in fns.h and n3.c.
  33. sed 's/^void\*[ ]setbrk/char* setbrk/' fns.h >foo
  34. mv foo fns.h
  35. sed 's/^void \*setbrk/char *setbrk/' n3.c >foo
  36. mv foo n3.c