|CFLOW(1P)||POSIX Programmer's Manual||CFLOW(1P)|
PROLOGThis manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAMEcflow - generate a C-language flowgraph ( DEVELOPMENT)
SYNOPSIScflow [ -r ][ -d num ][ -D name [ = def ]] ... [ -i incl ][ -I dir ] ...
DESCRIPTIONThe cflow utility shall analyze a collection of object files or assembler, C-language, lex, or yacc source files, and attempt to build a graph, written to standard output, charting the external references.
OPTIONSThe cflow utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, except that the order of the -D, -I, and -U options (which are identical to their interpretation by c99) is significant.
The following options shall be supported:
- -d num
- Indicate the depth at which the flowgraph is cut off. The application shall ensure that the argument num is a decimal integer. By default this is a very large number (typically greater than 32000). Attempts to set the cut-off depth to a non-positive integer shall be ignored.
- -i incl
- Increase the number of included symbols. The incl option-argument is one of the following characters:
Reverse the caller:callee relationship, producing an inverted listing showing the callers of each function. The listing shall also be sorted in lexicographical order by callee.
OPERANDSThe following operand is supported:
- The pathname of a file for which a graph is to be generated. Filenames suffixed by .l shall shall be taken to be lex input, .y as yacc input, .c as c99 input, and .i as the output of c99 -E. Such files shall be processed as appropriate, determined by their suffix.
Files suffixed by .s (conventionally assembler source) may have more limited information extracted from them.
INPUT FILESThe input files shall be object files or assembler, C-language, lex, or yacc source files.
ENVIRONMENT VARIABLESThe following environment variables shall affect the execution of cflow:
- Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
- If set to a non-empty string value, override the values of all the other internationalization variables.
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files).
- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
Determine the location of message catalogs for the processing of
STDOUTThe flowgraph written to standard output shall be formatted as follows:
"%d %s:%s\n", <reference number>, <global>, <definition>
Each line of output begins with a reference (that is, line) number, followed by indentation of at least one column position per level. This is followed by the name of the global, a colon, and its definition. Normally globals are only functions not defined as an external or beginning with an underscore; see the OPTIONS section for the -i inclusion option. For information extracted from C-language 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).
Once a definition of a name has been written, subsequent references to that name contain only the reference number of the line where the definition can be found. For undefined references, only "<>" shall be written.
STDERRThe standard error shall be used only for diagnostic messages.
EXIT STATUSThe following exit values shall be returned:
- Successful completion.
An error occurred.
CONSEQUENCES OF ERRORSDefault.
The following sections are informative.
APPLICATION USAGEFiles produced by lex and yacc cause the reordering of line number declarations, and this can confuse cflow. To obtain proper results, the input of yacc or lex must be directed to cflow.
EXAMPLESGiven the following in file.c:
i = h();
cflow -i x file.c
produces the output:
1 main: int(), <file.c 6>
2 f: int(), <file.c 13>
3 h: <>
4 i: int, <file.c 1>
5 g: <>
SEE ALSOc99, lex, yacc
COPYRIGHTPortions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
|2003||IEEE/The Open Group|