home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 182.lha / Calls / Calls.1u < prev    next >
Text File  |  1988-04-28  |  4KB  |  157 lines

  1. .EV
  2. .T1 CALLS 1EXP
  3. .SH "calls \- print out calling pattern of a C program"
  4. .SH SYNOPSIS
  5. calls [-aeitv] [-w n] [-f function] [-F function[/file.c]] [-D name[=def]] [-U name] [-I dir] [filenames]
  6. .SH DESCRIPTION
  7. .I Calls
  8. is intended to help analyze the flow of a program by laying out the
  9. functions called in a hierarchical manner.
  10. .I Calls
  11. invokes the C preprocessor on the named C source files, and outputs
  12. the analyzed calling pattern to standard output.
  13. All filenames given will have their calling sequences combined into
  14. one hierarchy.
  15. If a filename of \- is seen, standard input will be read.
  16. .P
  17. Functions called but not defined within the source file are shown as:
  18. .br
  19. .RS
  20. function
  21. .RE
  22. .P
  23. While functions defined in the source files are listed with the file they
  24. are declared in in brackets, as shown:
  25. .br
  26. .RS
  27. function [main.c] , or
  28. .br
  29. function [static in main.c]
  30. .RE
  31. or if the function is not being described
  32. .RS
  33. function [see also %d] , or
  34. .br
  35. function [see below]
  36. .RE
  37. .P
  38. Recursive references are shown as:
  39. .br
  40. .RS
  41. function <<< recursive >>>
  42. .RE
  43. .P
  44. For example, given the file
  45. .B prog.c
  46. .br
  47. .RS
  48. .nf
  49. main() {
  50.     abc();
  51.     def();
  52. }
  53. abc() {
  54.     ghi();
  55.     jkl();
  56. }
  57. static mno() { }
  58. ghi() {
  59.     abc();
  60.     def();
  61.     mno();
  62. }
  63. .fi
  64. .RE
  65. .sp
  66. Executing "calls prog.c" will produce:
  67. .sp
  68. .RS
  69. .nf
  70.     1    main [prog.c]
  71.     2        abc [prog.c]
  72.     3            ghi [prog.c]
  73.     4                abc <<< recursive >>>
  74.     5                def
  75.     6                mno [static in prog.c]
  76.     7            jkl
  77.     8        def
  78. .fi
  79. .RE
  80. .SH FLAGS
  81. .TP
  82. .BI -a
  83. Normally only the first call to a function is recorded for any
  84. given function, under this option all calls are recorded. This may
  85. make the output for some large programs very verbose and these are
  86. normally not needed to show the calling structure of a program.
  87. .TP
  88. .BI -e
  89. Normally an index listing (-i below) does not contain the external
  90. functions called in the program, under this option these are also listed.
  91. Note this option also turns on the indexing option, -i.
  92. .TP
  93. .BI -f function
  94. The named function will be printed as the root of a calling tree.
  95. .TP
  96. .BI -F function\[/file\]
  97. The named static function (in the given file) is used as the base of a
  98. calling tree, as above.  This allows closer examination of sources such
  99. as that of dbx(1) that have many functions with the same name.
  100. .TP
  101. .BI -h
  102. Display a brief help message.
  103. .TP
  104. .BI -i
  105. This option produces an index of all the functions declared in the
  106. processed files. Optionally all functions mentioned can be output;
  107. see -e above.
  108. .TP
  109. .BI -t
  110. This option instructs
  111. .I calls
  112. not to display calling trees that were
  113. not explicitly asked for on the command line. Using this option as
  114. well as the index option one can produce just a list of the functions
  115. declared in a file.
  116. .TP
  117. .BI -v
  118. Be less verbose in the index output, do not output any defined functions
  119. that were not present in any of the output trees.
  120. Note this also turns on the index option.
  121. For a list of all functions called
  122. by 'missle' one might examine the index output of "calls -vt -f missle *.c".
  123. .TP
  124. .BI -w n
  125. Set the max indentation width to n.  The default is 96 columns.
  126. .TP
  127. .BI -D name
  128. .TP
  129. .BI -D name=def
  130. Define the
  131. .I name
  132. for the preprocessor, as if by #define.
  133. If no definition is given, the name is defined as 1.
  134. .TP
  135. .BI -U name
  136. Remove any initial definition of
  137. .I name
  138. in the preprocessor.
  139. .TP
  140. .BI -I dir
  141. Change the path for searching for #include files whose names do not
  142. begin with / to look in
  143. .I dir
  144. before looking in the directories on the standard list.
  145. .br
  146. .RE
  147. .SH BUGS
  148. Static functions must be declared (in full) 
  149. .I before
  150. used to work properly.
  151. .br
  152. Output width checking is only done on the first character on a new line.
  153. .SH AUTHOR
  154. Originally from the net. Major revisions by Kevin Braunsdorf, PUCC.
  155. .SH SEE ALSO
  156. cpp(1), cc(1), ctags(1)
  157.