{"id":5078,"date":"2026-08-30T05:30:35","date_gmt":"2026-08-29T20:30:35","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/doxygen-c-call-graph-visualization-2\/"},"modified":"2026-08-30T05:30:37","modified_gmt":"2026-08-29T20:30:37","slug":"doxygen-c-call-graph-visualization","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/development-programming-git\/doxygen-c-call-graph-visualization\/","title":{"rendered":"Visualizing Call Graphs in C Language Projects with Doxygen and Graphviz"},"content":{"rendered":"<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Analyzing and documenting C language projects becomes more complex as the project scale grows.<\/span><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">In particular, understanding call relationships between functions is crucial for code comprehension and maintenance.<\/span><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">This article introduces how to automatically generate call graphs for a C language project by combining Doxygen, an open-source documentation generation tool, and Graphviz, a graph visualization tool, using a signature scheme based on Post-Quantum Cryptography (PQC).<\/span><\/p>\n<h3>Overview of Doxygen and Graphviz<\/h3>\n<ul>\n<li>\n<p><strong>Doxygen<\/strong>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">A documentation generation tool supporting many programming languages such as C, C++, and Java.<\/span><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">It can generate API documentation from comments in the source code.<\/span><\/p>\n<\/li>\n<li>\n<p><strong>Graphviz<\/strong>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">A tool for drawing graph structures, which works with Doxygen to generate call graphs and class diagrams.<\/span><\/p>\n<\/li>\n<\/ul>\n<h3>Environment Setup<\/h3>\n<ol>\n<li>\n<p><strong>Installing Doxygen<\/strong>:<\/p>\n<ul>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">macOS: <code>brew install doxygen<\/code><\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Ubuntu: <code>sudo apt-get install doxygen<\/code><\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Installing Graphviz<\/strong>:<\/p>\n<ul>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">macOS: <code>brew install graphviz<\/code><\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Ubuntu: <code>sudo apt-get install graphviz<\/code><\/span><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>Clone MAYO:<\/strong>\n<ul>\n<li>git clone https:\/\/github.com\/PQCMayo\/MAYO-C.git<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Editing the Doxygen Configuration File (Doxyfile)<\/h3>\n<p>Run the following command to create the base configuration file:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">doxygen -g<\/pre>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Edit the Doxygen configuration file, <code>Doxyfile<\/code>, and configure the following items:<\/span><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">PROJECT_NAME = &quot;MAYO-C&quot;\nOUTPUT_LANGUAGE = Japanese-en\nEXTRACT_ALL = YES\nINPUT = src\nRECURSIVE = YES\nSOURCE_BROWSER = YES\nCALL_GRAPH = YES\nCALLER_GRAPH = YES\nHAVE_DOT = YES\nDOT_PATH = \/usr\/bin\/dot<\/pre>\n<ul>\n<li>\n<p><code>EXTRACT_ALL<\/code>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Includes all functions and variables in the documentation target.<\/span><\/p>\n<\/li>\n<li>\n<p><code>INPUT<\/code>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Specifies the directory containing the source code.<\/span><\/p>\n<\/li>\n<li>\n<p><code>RECURSIVE<\/code>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Analyzes including subdirectories.<\/span><\/p>\n<\/li>\n<li>\n<p><code>CALL_GRAPH<\/code> and <code>CALLER_GRAPH<\/code>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Generates function call relationship diagrams.<\/span><\/p>\n<\/li>\n<li>\n<p><code>HAVE_DOT<\/code> and <code>DOT_PATH<\/code>: <span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Settings for using Graphviz&#8217;s dot command.<\/span><\/p>\n<\/li>\n<\/ul>\n<h3>Generating and Verifying Documentation<\/h3>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Once configuration is complete, generate the documentation with the following command:<\/span><\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\"><\/div>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">doxygen Doxyfile<\/pre>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">The generated documentation is typically output inside the <code>html<\/code> directory.<\/span><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">By opening <code>index.html<\/code> in a browser, you can visually check function call graphs and the source code structure. Below is the dependency graph for the src directory.<\/span><\/p>\n<p><a href=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png\"><img decoding=\"async\" class=\"aligncenter size-thumb710 wp-image-1694\" src=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep-710x196.png\" alt=\"src directory dependency graph\" width=\"710\" height=\"196\" srcset=\"https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep-710x196.png 710w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep-300x83.png 300w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep-530x147.png 530w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep-565x156.png 565w, https:\/\/donguri3.net\/wp-content\/uploads\/2025\/06\/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png 712w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><\/a><\/p>\n<h3>Notes and Best Practices<\/h3>\n<ul>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Adding proper Doxygen-style comments to functions and structures improves documentation quality.<\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">If you also want to document static functions, set <code>EXTRACT_STATIC = YES<\/code>.<\/span><\/p>\n<\/li>\n<li>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">In large-scale projects, the generated graphs can become complex. You can control graph complexity by adjusting settings such as <code>MAX_DOT_GRAPH_DEPTH<\/code> and <code>DOT_GRAPH_MAX_NODES<\/code>.<\/span><\/p>\n<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">Leveraging Doxygen and Graphviz makes it easier to visually grasp function call relationships in C language projects.<\/span><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">This enables more efficient code comprehension and maintenance.<\/span><span class=\"relative -mx-px my-[-0.2rem] rounded px-px py-[0.2rem] transition-colors duration-100 ease-in-out\">This effect is particularly remarkable when analyzing cryptographic libraries like MAYO-C.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Analyzing and documenting C language projects becomes more complex as the project scale grows.In particular, u [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1692,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=1691","footnotes":""},"categories":[1172],"tags":[51,52,387,352,106],"class_list":["post-5078","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development-programming-git","tag-git","tag-https","tag-java","tag-ubuntu","tag-106","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=5078"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5078\/revisions"}],"predecessor-version":[{"id":5081,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/5078\/revisions\/5081"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/1692"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=5078"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=5078"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=5078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}