CFLOW(1P)
π PROLOG
okay bestie, real talk before we even start: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may just not be implemented on Linux at all. π no cap.
β¨ NAME β¨
cflow β generate a C-language flowgraph (DEVELOPMENT) π¦
πΈ SYNOPSIS πΈ
cflow [-r] [-d num] [-D name[=def]]... [-i incl] [-I dir]...
[-U dir]... file...
π DESCRIPTION π
So cflow shall analyze a whole collection of object files, or assembler, C-language, lex, or yacc source files, and it attempts to build a graph. That graph gets written to standard output, and it charts the external references. it's giving β¨map of your whole codebaseβ¨, fr fr.
π OPTIONS π
cflow shall conform to the Base Definitions volume of POSIX.1β2017, 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. like, order matters here, bestie, do not shuffle them π
The following options shall be supported:
-d numβ this one tells you 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 than32000, iconic). Attempts to set the cut-off depth to a non-positive integer shall be ignored β so don't even try it, it's not gonna happen π«Ά-i inclβ increase the number of included symbols. The incl option-argument is one of the following characters:xβ include external and static data symbols. The default shall be to include only functions in the flowgraph. (so like, data symbols are opt-in, okay?)_β (underscore) include names that begin with an<underscore>. The default shall be to exclude these functions (and data if-i xis used). lowkey they're hiding from you unless you ask π
-rβ 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. it's giving "who's calling me??" energy π
π§ OPERANDS π§
The following operand is supported:
- file β the pathname of a file for which a graph is to be generated. Filenames suffixed by
.lshall shall be taken to be lex input,.yas yacc input,.casc99input, and.ias the output ofc99 -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. π like, you'll get something, but don't expect the full tea.
π STDIN π
Not used. periodt. π
π INPUT FILES π
The input files shall be object files or assembler, C-language, lex, or yacc source files.
β ENVIRONMENT VARIABLES β
The following environment variables shall affect the execution of cflow:
LANGβ provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ if set to a non-empty string value, override the values of all the other internationalization variables. she's the main character, she overrides everyone πLC_COLLATEβ determine the locale for the ordering of the output when the-roption is used.LC_CTYPEβ 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).LC_MESSAGESβ determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.NLSPATHβ determine the location of message catalogs for the processing ofLC_MESSAGES.
π¦ ASYNCHRONOUS EVENTS π¦
Default. nothing spicy here bestie.
π STDOUT π
The 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. π iconic shorthand fr.
πΈ STDERR πΈ
The standard error shall be used only for diagnostic messages.
π OUTPUT FILES π
None.
β¨ EXTENDED DESCRIPTION β¨
None.
π₯ EXIT STATUS π₯
The following exit values shall be returned:
0β successful completion. slay π>0β an error occurred.
π CONSEQUENCES OF ERRORS π
Default.
The following sections are informative. (iykyk β informative means it's the extra lore, not the rules π«Ά)
π§ APPLICATION USAGE π§
Files 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. no cap, this one actually matters.
β EXAMPLES β
Given the following in file.c:
int i;
int f();
int g();
int h();
int
main()
{
f();
g();
f();
}
int
f()
{
i = h();
}
The command:
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: <>
look at that beautiful little tree ππ¦
π RATIONALE π
None.
π FUTURE DIRECTIONS π
None.
π«Ά SEE ALSO π«Ά
c99, lex, yacc
The Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 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 .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole thing bestie, no notes π this page is brought to you by IEEE/The Open Group, dated 2017, filed under CFLOW(1P) β go off, read your flowgraphs, and remember: the vibe is immaculate but the facts are untouched. bye bestie π β¨π
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms