XML technologies / DocBook / Block elements / Synopses / Function references (funcsynopsis)
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
Reference pages often need to describe functions as well as commands. The element for this is funcsynopsis. Consider the fictional function in the following example:
Example: Structure of a function reference (funcsynopsis.xml)
<funcsynopsis>
<funcprototype>
<?dbhtml funcsynopsis-style="..."?>
<funcdef>int <function>foo</function></funcdef>
<paramdef>char *<parameter>src</parameter>[]</paramdef>
<paramdef>int <parameter>val</parameter></paramdef>
</funcprototype>
</funcsynopsis>Line 2: The function prototype begins with the element funcprototype.
Line 3: processing instruction for the output style; for C++, this is either kr (from Kerningham and Richie) or ansi (see the output below).
Line 4: The return value is entered directly; the function name uses function.
Line 5: Function parameters are marked with the element paramdef. The type is entered directly; the parameter name uses parameter.
The available styles are shown below:
K&R style | ANSI style |
| |
For further examples, see the TDG entry for funcprototype.
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top