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

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