Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

acc(1)

as(1)

cc(1)

cpp(1)

lex(1)

lint(1)

nm(1)

yacc(1)

pr(1)



  cflow(1)                            CLIX                            cflow(1)



  NAME

    cflow - Generates C flowgraph

  SYNOPSIS

    cflow [-r] [-x] [-i_] [-dnum] file ...

  FLAGS

    In addition to the -D, -I, and -U flags (interpreted as they are by the
    commands cc and cpp), the following flags are interpreted by cflow:

    -r      Reverses the ``caller:callee'' relationship, producing an inverted
            listing showing the callers of each function.  The listing is
            sorted in lexicographical order by callee.

    -ix     Includes external and static data symbols.  The default is to
            include only functions in the flowgraph.

    -i_     Includes names beginning with underscore.  The default is to
            exclude these functions, and also data if -ix is used.

    -dnum   Indicates the cutoff depth of the flowgraph.  The num is a decimal
            integer.  By default, this is a very large number.  Attempts to
            set cutoff depth to a nonpositive integer are ignored.

  DESCRIPTION

    The cflow command analyzes a collection of C, yacc, lex, assembler, and
    object files, and builds a graph charting external references.  Files
    suffixed with .y, .l, and .c are given to yacc, lex, and the C-
    preprocessor as appropriate.  The results of the preprocessed files and
    files suffixed with .i, are run through the first pass of lint.  Files
    suffixed with .s are assembled.  Assembled files and files suffixed with
    .o have information extracted from their symbol tables.  The results are
    collected and turned into a graph of external references which is
    displayed upon stdout.

    Each line of output begins with a reference number, followed by a suitable
    number of tabs indicating the level, then the name of the global symbol
    followed by a colon and its definition.  Normally, only function names
    that do not begin with an underscore are listed (see the -ix and -i_
    flags).  For information extracted from C source, the definition consists
    of an abstract type declaration (for example, char *), and, delimited by
    angle brackets, the name of the source file and the line number where the
    definition was found.  Definitions extracted from object files indicate
    the filename and location counter under which the symbol appeared (for
    example, text).  Leading underscores in C-style external names are
    deleted.




  2/94 - Intergraph Corporation                                              1






  cflow(1)                            CLIX                            cflow(1)



    Once a definition of a name has been displayed, subsequent references to
    that name contain only the reference number of the line where the
    definition may be found.  For undefined references, only <> is displayed.

    When the nesting level is too deep, the output of cflow can be piped to pr
    using the -e flag to compress the tab expansion to something less than
    every eight spaces.

  EXAMPLES

    1.  As an example, the following code appears in file.c:

        int  i;

        main()
        {
             f();
             g();
             f();
        }

        f()
        {
             i = h();
        }


    2.  The following command may then be used (the output occurs after the
        command):

        cflow -ix file.c


        1    main: int(), <file.c 4>
        2    f: int(), <file.c 11>
        3    h: <>
        4    i: int, <file.c 1>
        5    g: <>


  FILES

    /usr/tmp/cf.$$         Temporary files.

    /usr/tmp/cf.$$.[gqo]   Temporary files.

    lex.yy.c               Temporary lex output file.

    y.tab.c                Temporary yacc output file.

  NOTES



  2                                              Intergraph Corporation - 2/94






  cflow(1)                            CLIX                            cflow(1)



    Files produced by lex and yacc cause reordering of line number
    declarations which can confuse cflow.  For proper results give cflow the
    yacc input or the lex input.

  DIAGNOSTICS

    Gives error messages when invalid flags are specified.  If multiple
    definitions are given, an error message appears and only the first
    definition is used.  Other messages may come from the various programs
    used (such as the C-preprocessor).

  EXIT VALUES

    Not valid.

  RELATED INFORMATION

    Commands:  acc(1), as(1), cc(1), cpp(1), lex(1), lint(1), nm(1), yacc(1),
    pr(1)



































  2/94 - Intergraph Corporation                                              3




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026