# A taste of Doxygen used to diagram the SWI-Prolog C structures relations

**URL:** <https://swi-prolog.discourse.group/t/a-taste-of-doxygen-used-to-diagram-the-swi-prolog-c-structures-relations/4594>\
**Category:** Nice to know\
**Created:** [October 26, 2021, 8:42am UTC](https://swi-prolog.discourse.group/t/a-taste-of-doxygen-used-to-diagram-the-swi-prolog-c-structures-relations/4594 "2021-10-26T08:42:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [October 26, 2021, 8:42am UTC](https://swi-prolog.discourse.group/t/a-taste-of-doxygen-used-to-diagram-the-swi-prolog-c-structures-relations/4594/1 "2021-10-26T08:42:34Z")

</div>

[Doxygen](https://www.doxygen.nl/index.html) is used to generate documentation from source code.

Doxygen can also generate a diagram of the usage relations with other structs. ([ref](https://www.doxygen.nl/manual/diagrams.html))

The following image is a capture of an SVG and one of hundreds generated automatically from the SWI-Prolog C header files (`*.h`). ([GitHub](https://github.com/SWI-Prolog/swipl-devel/tree/master/src))

 ![image](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/2X/0/05cf91b9b7879217a4cf97c244ac840f2ea048c6.png)

Note: To get a better view of the image, click on image and open in another/new tab.

Note: [GraphViz](https://graphviz.org/) must be installed to generate the images and some DOxygen expert options set such as `HAVE_DOT`, `CALL_GRAPH`, `DOT_IMAGE_FORMAT`, `CALLER_GRAPH`, `DOT_PATH`.

* * *

I don’t know if there is a way to get all of the related structures in one image but the example above shows many of the core structures.

* * *

* * *

Side note about SWI-Prolog Doxygen extension.

> A filter done in LEX (.l) to convert _PROLOG_ programs into simple tokens of _C/C++_ that can be used to generate documentation of Prolog programs with Doxygen.

If you find the page [Doxygen plugin (helper) for Prolog](https://www.swi-prolog.org/news/3b9546ec-1d66-11e5-9067-00163e357fe2), the link ([Extensions](http://www.stack.nl/~dimitri/doxygen/helpers.html)) is dead.

I believe the code is on GitHub.

> **[GitHub - drbeco/doxygenprolog: A doxygen filter to use with Prolog](https://github.com/drbeco/doxygenprolog)**
>
> A doxygen filter to use with Prolog. Contribute to drbeco/doxygenprolog development by creating an account on GitHub.
