f2p 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. .TH F2P 1
  2. .SH NAME
  3. argsused, badexterns, badglobals, enum2sw, f2p, ifs, mkdeps, mktypedefs, p2f, psort, rep \- tiny source code tools
  4. .SH SYNOPSIS
  5. .B s/argsused
  6. [
  7. .I file ...
  8. ]
  9. .PP
  10. .B s/badexterns
  11. .I files ...
  12. .PP
  13. .B s/badglobals
  14. .I files ...
  15. .PP
  16. .B s/enum2sw
  17. .PP
  18. .B s/f2p
  19. [
  20. .I file ...
  21. ]
  22. .PP
  23. .B s/ifs
  24. [
  25. .I file ...
  26. ]
  27. .PP
  28. .B s/mkdeps
  29. [
  30. .I file ...
  31. ]
  32. .PP
  33. .B s/mktypedefs
  34. [
  35. .I file ...
  36. ]
  37. .PP
  38. .B s/p2f
  39. [
  40. .I file ...
  41. ]
  42. .PP
  43. .B s/psort
  44. .PP
  45. .B s/rep
  46. .I from
  47. .I to...
  48. .SH DESCRIPTION
  49. These are some tools to help write C programs in Plan 9. They are all installed
  50. under
  51. .BR /bin/c .
  52. Many of them use standard input if no file is given as an argument, and are suitable
  53. for use within
  54. .IR acme (1).
  55. .TF s/mktypedefs
  56. .TP
  57. .B s/argsused
  58. generates a
  59. .I USED(x)
  60. sentence for each argument in the functions found in the input files or standard input.
  61. .TP
  62. .B s/badexterns
  63. receives a series of object files as arguments and locates external symbols
  64. used in just one file. Those should perhaps be declared as static symbols.
  65. .TP
  66. .B s/badglobals
  67. receives a series of object tiles as arguments and locates global symbols that
  68. appear to be unused. They could probably go.
  69. .TP
  70. .B s/enum2sw
  71. receives as input a declaration of values (e.g., part of declarations within a
  72. .IR enum )
  73. and generates a
  74. .I switch
  75. statement for them.
  76. .TP
  77. .B s/f2p
  78. generates a prototype declaration for each non-static function found in the input.
  79. .TP
  80. .B s/p2f
  81. does the opposite, and writes an empty function definition for each prototype found in the input.
  82. .TP
  83. .B s/ifs
  84. gets rid of spaces that should not be there according to the Plan 9 C style.
  85. .TP
  86. .B s/mkdeps
  87. generates dependencies for
  88. .I mk (1)
  89. according to
  90. .I include
  91. directives found in the input.
  92. .TP
  93. .B s/mktypedefs
  94. generates
  95. .I typedef
  96. declarations for each
  97. .I struct
  98. definition found in the input.
  99. .TP
  100. .B s/psort
  101. sorts prototypes by name.
  102. .TP
  103. .B s/rep
  104. repeats the text found in the input so that
  105. .I from
  106. is replaced each time by one of the values given as
  107. .I to .
  108. .SH SOURCE
  109. .B /rs/bin/s
  110. .SH BUGS
  111. Many. All these tools are tiny shell scripts and do not perform much error
  112. checking. Also, they assume code is written using the style of
  113. Plan 9 from Bell Labs source code.