protify.awk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/awk -f
  2. #######################################################################
  3. #
  4. # Because of awk problems on the sgi, this file is converted to perl
  5. # via 'a2p' to yield 'protify'. Do not edit the perl version!!!!
  6. #
  7. #######################################################################
  8. BEGIN {
  9. printf("\n");
  10. printf("/****************************************************** \n");
  11. printf(" * WARNING: This file automatically generated. * \n");
  12. printf(" ****************************************************** \n");
  13. printf(" */ \n");
  14. printf("\n\n\n\n");
  15. }
  16. /[ \t]*extern/ { next }
  17. /main\(/ { next }
  18. /FORT_NAME/ {next}
  19. # Ignore doctext comments
  20. /\/\*[DMN@]/ { while (!match($0,/[DMN@]\*\//)) getline; next; }
  21. /^[^ \t{}/*#].*[^ \t]+\(.*[^;]*$/ \
  22. {
  23. if ($1=="static")
  24. next; #continue;
  25. printf("extern %s",$0);
  26. while (!match($0,"\)"))
  27. {
  28. getline;
  29. gsub("\t"," ");
  30. printf("\n %s",$0);
  31. }
  32. printf(";\n");
  33. }