| 1 |
<chapter xmlns="http://docbook.org/ns/docbook" |
| 2 |
id="funcsynopsis"> |
| 3 |
<title>Function Synopses</title> |
| 4 |
|
| 5 |
<section id="funcsynopsis-ansi"> |
| 6 |
<title>ANSI Formatting</title> |
| 7 |
|
| 8 |
<para>Here's an example with two <sgmltag>modifier</sgmltag> elements:</para> |
| 9 |
<funcsynopsis> |
| 10 |
<?db2html.funcsynopsis.style ANSI?> |
| 11 |
<funcsynopsisinfo>// This is a funcsynopsisinfo</funcsynopsisinfo> |
| 12 |
<funcprototype> |
| 13 |
<modifier>static</modifier> |
| 14 |
<modifier>SILLY</modifier> |
| 15 |
<funcdef><type>Foo *</type> <function>foo_list_get_nth</function></funcdef> |
| 16 |
<paramdef><type>FooList *</type><parameter>list</parameter></paramdef> |
| 17 |
<paramdef>int <parameter>n</parameter></paramdef> |
| 18 |
</funcprototype> |
| 19 |
</funcsynopsis> |
| 20 |
|
| 21 |
<para>This example uses <sgmltag>void</sgmltag>:</para> |
| 22 |
<funcsynopsis> |
| 23 |
<?db2html.funcsynopsis.style ANSI?> |
| 24 |
<funcprototype> |
| 25 |
<modifier>static</modifier> |
| 26 |
<funcdef>void <function>foo_noop</function></funcdef> |
| 27 |
<void/> |
| 28 |
</funcprototype> |
| 29 |
</funcsynopsis> |
| 30 |
|
| 31 |
<para>This example uses <sgmltag>varargs</sgmltag>:</para> |
| 32 |
<funcsynopsis> |
| 33 |
<?db2html.funcsynopsis.style ANSI?> |
| 34 |
<funcprototype> |
| 35 |
<modifier>static</modifier> |
| 36 |
<funcdef>void <function>foo_process_args</function></funcdef> |
| 37 |
<paramdef><type>Foo *</type><parameter>foo</parameter></paramdef> |
| 38 |
<varargs/> |
| 39 |
</funcprototype> |
| 40 |
</funcsynopsis> |
| 41 |
|
| 42 |
<para>This example places a <sgmltag>modifier</sgmltag> after the |
| 43 |
<sgmltag>func</sgmltag>, for some strange reason:</para> |
| 44 |
<funcsynopsis> |
| 45 |
<?db2html.funcsynopsis.style ANSI?> |
| 46 |
<funcprototype> |
| 47 |
<funcdef>void <function>foo_process_args</function></funcdef> |
| 48 |
<paramdef><type>Foo *</type><parameter>foo</parameter></paramdef> |
| 49 |
<varargs/> |
| 50 |
<modifier>AFTER</modifier> |
| 51 |
</funcprototype> |
| 52 |
</funcsynopsis> |
| 53 |
|
| 54 |
<para>This example uses <sgmltag>funcparams</sgmltag>:</para> |
| 55 |
<funcsynopsis> |
| 56 |
<?db2html.funcsynopsis.style ANSI?> |
| 57 |
<funcprototype> |
| 58 |
<funcdef>void <function>foo_list_foreach</function></funcdef> |
| 59 |
<paramdef><type>FooList *</type><parameter>list</parameter></paramdef> |
| 60 |
<paramdef>int (*<parameter>func</parameter>) <funcparams>Foo *, void *</funcparams></paramdef> |
| 61 |
<paramdef>void *<parameter>user_data</parameter></paramdef> |
| 62 |
</funcprototype> |
| 63 |
|
| 64 |
</funcsynopsis> |
| 65 |
|
| 66 |
</section> <!-- funcsynopsis-ansi --> |
| 67 |
|
| 68 |
<section id="funcsynopsis-kr"> |
| 69 |
<title>K&R Formatting</title> |
| 70 |
|
| 71 |
<para>Here's an example with two <sgmltag>modifier</sgmltag> elements:</para> |
| 72 |
<funcsynopsis> |
| 73 |
<?db2html.funcsynopsis.style KR?> |
| 74 |
<funcsynopsisinfo>// This is a funcsynopsisinfo</funcsynopsisinfo> |
| 75 |
<funcprototype> |
| 76 |
<modifier>static</modifier> |
| 77 |
<modifier>SILLY</modifier> |
| 78 |
<funcdef><type>Foo *</type> <function>foo_list_get_nth</function></funcdef> |
| 79 |
<paramdef><type>FooList *</type><parameter>list</parameter></paramdef> |
| 80 |
<paramdef>int <parameter>n</parameter></paramdef> |
| 81 |
</funcprototype> |
| 82 |
</funcsynopsis> |
| 83 |
|
| 84 |
<para>This example uses <sgmltag>void</sgmltag>:</para> |
| 85 |
<funcsynopsis> |
| 86 |
<?db2html.funcsynopsis.style KR?> |
| 87 |
<funcprototype> |
| 88 |
<modifier>static</modifier> |
| 89 |
<funcdef>void <function>foo_noop</function></funcdef> |
| 90 |
<void/> |
| 91 |
</funcprototype> |
| 92 |
</funcsynopsis> |
| 93 |
|
| 94 |
<para>This example uses <sgmltag>varargs</sgmltag>:</para> |
| 95 |
<funcsynopsis> |
| 96 |
<?db2html.funcsynopsis.style KR?> |
| 97 |
<funcprototype> |
| 98 |
<modifier>static</modifier> |
| 99 |
<funcdef>void <function>foo_process_args</function></funcdef> |
| 100 |
<paramdef><type>Foo *</type><parameter>foo</parameter></paramdef> |
| 101 |
<varargs/> |
| 102 |
</funcprototype> |
| 103 |
</funcsynopsis> |
| 104 |
|
| 105 |
<para>This example places a <sgmltag>modifier</sgmltag> after the |
| 106 |
<sgmltag>func</sgmltag>, for some strange reason:</para> |
| 107 |
<funcsynopsis> |
| 108 |
<?db2html.funcsynopsis.style KR?> |
| 109 |
<funcprototype> |
| 110 |
<funcdef>void <function>foo_process_args</function></funcdef> |
| 111 |
<paramdef><type>Foo *</type><parameter>foo</parameter></paramdef> |
| 112 |
<varargs/> |
| 113 |
<modifier>AFTER</modifier> |
| 114 |
</funcprototype> |
| 115 |
</funcsynopsis> |
| 116 |
|
| 117 |
<para>This example uses <sgmltag>funcparams</sgmltag>:</para> |
| 118 |
<funcsynopsis> |
| 119 |
<?db2html.funcsynopsis.style KR?> |
| 120 |
<funcprototype> |
| 121 |
<funcdef>void <function>foo_list_foreach</function></funcdef> |
| 122 |
<paramdef><type>FooList *</type><parameter>list</parameter></paramdef> |
| 123 |
<paramdef>int (*<parameter>func</parameter>) <funcparams>Foo *, void *</funcparams></paramdef> |
| 124 |
<paramdef>void *<parameter>user_data</parameter></paramdef> |
| 125 |
</funcprototype> |
| 126 |
|
| 127 |
</funcsynopsis> |
| 128 |
|
| 129 |
</section> <!-- funcsynopsis-kr --> |
| 130 |
|
| 131 |
</chapter> |