Skip to main content

pycflow2dot

Summary

Draw call graphs for C source code using dot and cflow. Typeset PDF with a page per source file and clickable cross-file function references.

cflow2dot -i hello_simple.c -f png produces:

from hello_simple.c.

Description

Draw the call graph of C source code using cflow and dot. Output to LaTeX, dot, PDF, SVG, PNG, and from dot to all formats supported from it. The LaTeX output is obtained by including the SVG via Inkscape's LaTeX export functionality.

Multi-file sources are converted to multiple SVG files, one for each source. These contain links using the LaTeX package hyperref, so that after compilation one can click on the name of a function call and be taken to its definition, even if that definition is in another page of the PDF, because the function is defined in another source file than the one corresponding to the current PDF page.

Note that if a file containing the definition is missing, then the hyperref link is omitted, so that no dead links result after compiling with LaTeX. This might be the case of for example the file with the definitions is available, but is not passed to pycflow2dot, e.g., for the purpose of focusing on a subset of the sources.

For now the LaTeX result has to be manually compiled, though this extra step will be automated in the future. Multi-SVG export will still be available, so that the results can be included in a larger document, e.g., a report.

pycflow2dot is a Python port of the Perl script cflow2dot.

Installation

From the Python Package Index (PyPI) using the package installer pip:

pip install pycflow2dot

You also need to install the following non-Python dependencies:

  • GNU cflow:
    • apt install cflow on Debian GNU/Linux
    • port install cflow with MacPorts
  • dot:
    • apt install graphviz
    • port install graphviz

Optionally, cpp too.

License

pycflow2dot is licensed under the GNU GPL v3.

Release files for pycflow2dot 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycflow2dot 0.2.3
File Size Uploaded
pycflow2dot-0.2.3.tar.gz 26.4 kB Details

Release files / pycflow2dot-0.2.3.tar.gz

Download URL pycflow2dot-0.2.3.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a59822e8a185302760452b516cb0b46ef98dc34b0f1eee80fadf60d0aee8a8fe
BLAKE2b-256 checksum
How to use checksums
12bd7dfd4eaa3142d8e53f193ddb3bc5b4967972a94a0177b1362734b6e669e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0+

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page