The abi-compliance-checker tool can be used as a parser of C/C++ header files:
abi-compliance-checker -lib NAME -dump VER.xml -headers-only -xml -stdout > api.xml
VER.xml
input file is the following:
<version>
1.0
</version>
<headers>
/path1/to/header(s)/
/path2/to/header(s)/
...
</headers>
The output api.xml
file contains function signatures and other information from header files in the structured form:
...
<symbol>
<id>37348</id>
<mangled>_ZN7MWidget11qt_metacallEN11QMetaObject4CallEiPPv</mangled>
<short>qt_metacall</short>
<class>13749</class>
<header>mwidget.h</header>
<line>45</line>
<return>44</return>
<spec>virtual</spec>
<parameters>
<param>
<name>p1</name>
<type>4078</type>
<algn>4</algn>
<pos>0</pos>
</param>
<param>
<name>p2</name>
<type>44</type>
<algn>4</algn>
<pos>1</pos>
</param>
<param>
<name>p3</name>
<type>3905</type>
<algn>8</algn>
<pos>2</pos>
</param>
</parameters>
</symbol>
...
See also information about api-sanity-checker tool, that can generate basic unit test cases for every function in the API through the analysis of declarations in header files.