summaryrefslogtreecommitdiffstats
path: root/docs/manual/developer/documenting.xml
blob: 77631189d3bf0ac7014e55c3e0d984f76213a750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
<!-- $LastChangedRevision$ -->

<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<manualpage metafile="documenting.xml.meta">
<parentdocument href="./">Developer Documentation</parentdocument>

<title>Documenting code in Apache 2.4</title>

<summary>
    <p>Apache 2.4 uses <a href="http://www.doxygen.org/">Doxygen</a> to
    document the APIs and global variables in the code. This will explain
    the basics of how to document using Doxygen.</p>
</summary>

<section id="brief"><title>Brief Description</title>
    <p>To start a documentation block, use <code>/**</code><br />
    To end a documentation block, use <code>*/</code></p>

    <p>In the middle of the block, there are multiple tags we can
    use:</p>

    <example>
      Description of this functions purpose<br />
      @param parameter_name description<br />
      @return description<br />
      @deffunc signature of the function<br />
    </example>

    <p>The <code>deffunc</code> is not always necessary. DoxyGen does not
    have a full parser  in it, so any prototype that use a macro in the
    return type declaration is too complex for scandoc. Those functions
    require a <code>deffunc</code>. An example (using &amp;gt; rather
    than &gt;):</p>

    <example>
      /**<br />
 &nbsp;* return the final element of the pathname<br />
 &nbsp;* @param pathname The path to get the final element of<br />
 &nbsp;* @return the final element of the path<br />
 &nbsp;* @tip Examples:<br />
 &nbsp;* &lt;pre&gt;<br />
 &nbsp;*                 "/foo/bar/gum"   -&amp;gt; "gum"<br />
 &nbsp;*                 "/foo/bar/gum/"  -&amp;gt; ""<br />
 &nbsp;*                 "gum"            -&amp;gt; "gum"<br />
 &nbsp;*                 "wi\\n32\\stuff" -&amp;gt; "stuff"<br />
 &nbsp;* &lt;/pre&gt;<br />
 &nbsp;* @deffunc const char * ap_filename_of_pathname(const char *pathname)<br />
 &nbsp;*/
    </example>

    <p>At the top of the header file, always include:</p>
    <example>
      /**<br />
 &nbsp;* @package Name of library header<br />
 &nbsp;*/
    </example>

    <p>Doxygen uses a new HTML file for each package. The HTML files are named
    {Name_of_library_header}.html, so try to be concise with your names.</p>

    <p>For a further discussion of the possibilities please refer to
    <a href="http://www.doxygen.org/">the Doxygen site</a>.</p>
</section>
</manualpage>