This file is indexed.

/usr/share/doc/doxygen/html/docblocks.html is in doxygen-doc 1.8.6-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Doxygen: Documenting the code</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen_manual.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('docblocks.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Documenting the code </div>  </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#specialblock">Special comment blocks</a><ul><li class="level2"><a href="#cppblock">Comment blocks for C-like languages (C/C++/C#/Objective-C/PHP/Java)</a><ul><li class="level3"><a href="#memberdoc">Putting documentation after members</a></li>
<li class="level3"><a href="#docexamples">Examples</a></li>
<li class="level3"><a href="#structuralcommands">Documentation at other places</a></li>
</ul>
</li>
<li class="level2"><a href="#pythonblocks">Comment blocks in Python</a></li>
<li class="level2"><a href="#vhdlblocks">Comment blocks in VHDL</a></li>
<li class="level2"><a href="#fortranblocks">Comment blocks in Fortran</a></li>
<li class="level2"><a href="#tclblocks">Comment blocks in Tcl</a></li>
</ul>
</li>
<li class="level1"><a href="#docstructure">Anatomy of a comment block</a></li>
</ul>
</div>
<div class="textblock"><p>This chapter covers two topics:</p>
<ol type="1">
<li>How to put comments in your code such that doxygen incorporates them in the documentation it generates. This is further detailed in the <a class="el" href="docblocks.html#specialblock">next section</a>.</li>
<li>Ways to structure the contents of a comment block such that the output looks good, as explained in section <a class="el" href="docblocks.html#docstructure">Anatomy of a comment block</a>.</li>
</ol>
<h1><a class="anchor" id="specialblock"></a>
Special comment blocks</h1>
<p>A special comment block is a C or C++ style comment block with some additional markings, so doxygen knows it is a piece of structured text that needs to end up in the generated documentation. The <a class="el" href="docblocks.html#cppblock">next</a> section presents the various styles supported by doxygen.</p>
<p>For Python, VHDL, Fortran, and Tcl code there are different commenting conventions, which can be found in sections <a class="el" href="docblocks.html#pythonblocks">Comment blocks in Python</a>, <a class="el" href="docblocks.html#vhdlblocks">Comment blocks in VHDL</a>, <a class="el" href="docblocks.html#fortranblocks">Comment blocks in Fortran</a>, and <a class="el" href="docblocks.html#tclblocks">Comment blocks in Tcl</a> respectively.</p>
<h2><a class="anchor" id="cppblock"></a>
Comment blocks for C-like languages (C/C++/C#/Objective-C/PHP/Java)</h2>
<p>For each entity in the code there are two (or in some cases three) types of descriptions, which together form the documentation for that entity; a <em>brief</em> description and <em>detailed</em> description, both are optional. For methods and functions there is also a third type of description, the so called <em>in body</em> description, which consists of the concatenation of all comment blocks found within the body of the method or function.</p>
<p>Having more than one brief or detailed description is allowed (but not recommended, as the order in which the descriptions will appear is not specified).</p>
<p>As the name suggest, a brief description is a short one-liner, whereas the detailed description provides longer, more detailed documentation. An "in body" description can also act as a detailed description or can describe a collection of implementation details. For the HTML output brief descriptions are also used to provide tooltips at places where an item is referenced.</p>
<p>There are several ways to mark a comment block as a detailed description: </p>
<ol>
<li>
<p class="startli">You can use the JavaDoc style, which consist of a C-style comment block starting with two *'s, like this:</p>
<pre class="fragment">/**
 * ... text ...
 */
</pre><p class="endli"></p>
</li>
<li>
<p class="startli">or you can use the Qt style and add an exclamation mark (!) after the opening of a C-style comment block, as shown in this example:</p>
<pre class="fragment">/*!
 * ... text ...
 */
</pre><p>In both cases the intermediate *'s are optional, so</p>
<pre class="fragment">/*!
 ... text ...
*/
</pre><p>is also valid.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">A third alternative is to use a block of <em>at least two</em> C++ comment lines, where each line starts with an additional slash or an exclamation mark. Here are examples of the two cases:</p>
<pre class="fragment">///
/// ... text ...
///
</pre><p>or</p>
<pre class="fragment">//!
//!... text ...
//!
</pre><p>Note that a blank line ends a documentation block in this case.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"></p>
<p>Some people like to make their comment blocks more visible in the documentation. For this purpose you can use the following:</p>
<pre class="fragment">/********************************************//**
 *  ... text
 ***********************************************/
</pre><p> (note the 2 slashes to end the normal comment block and start a special comment block).</p>
<p>or</p>
<pre class="fragment">/////////////////////////////////////////////////
/// ... text ...
/////////////////////////////////////////////////
</pre><p class="endli"></p>
</li>
</ol>
<p>For the brief description there are also several possibilities: </p>
<ol>
<li>
<p class="startli">One could use the <a class="el" href="commands.html#cmdbrief">\brief</a> command with one of the above comment blocks. This command ends at the end of a paragraph, so the detailed description follows after an empty line.</p>
<p>Here is an example:</p>
<pre class="fragment">/*! \brief Brief description.
 *         Brief description continued.
 *
 *  Detailed description starts here.
 */
</pre><p class="endli"></p>
</li>
<li>
<p class="startli">If <a class="el" href="config.html#cfg_javadoc_autobrief">JAVADOC_AUTOBRIEF</a> is set to <code>YES</code> in the configuration file, then using JavaDoc style comment blocks will automatically start a brief description which ends at the first dot followed by a space or new line. Here is an example:</p>
<pre class="fragment">/** Brief description which ends at this dot. Details follow
 *  here.
 */
</pre><p> The option has the same effect for multi-line special C++ comments: </p>
<pre class="fragment">/// Brief description which ends at this dot. Details follow
/// here.
</pre><p class="endli"></p>
</li>
<li>
<p class="startli">A third option is to use a special C++ style comment which does not span more than one line. Here are two examples: </p>
<pre class="fragment">/// Brief description.
/** Detailed description. */
</pre><p>or</p>
<pre class="fragment">//! Brief description.

//! Detailed description 
//! starts here.
</pre><p>Note the blank line in the last example, which is required to separate the brief description from the block containing the detailed description. The <a class="el" href="config.html#cfg_javadoc_autobrief">JAVADOC_AUTOBRIEF</a> should also be set to <code>NO</code> for this case.</p>
<p class="endli"></p>
</li>
</ol>
<p>As you can see doxygen is quite flexible. If you have multiple detailed descriptions, like in the following example:</p>
<pre class="fragment">//! Brief description, which is
//! really a detailed description since it spans multiple lines.
/*! Another detailed description!
 */
</pre><p>They will be joined. Note that this is also the case if the descriptions are at different places in the code! In this case the order will depend on the order in which doxygen parses the code.</p>
<p>Unlike most other documentation systems, doxygen also allows you to put the documentation of members (including global functions) in front of the <em>definition</em>. This way the documentation can be placed in the source file instead of the header file. This keeps the header file compact, and allows the implementer of the members more direct access to the documentation. As a compromise the brief description could be placed before the declaration and the detailed description before the member definition.</p>
<h3><a class="anchor" id="memberdoc"></a>
Putting documentation after members</h3>
<p>If you want to document the members of a file, struct, union, class, or enum, it is sometimes desired to place the documentation block after the member instead of before. For this purpose you have to put an additional &lt; marker in the comment block. Note that this also works for the parameters of a function.</p>
<p>Here are some examples: </p>
<pre class="fragment">int var; /*!&lt; Detailed description after the member */
</pre><p> This block can be used to put a Qt style detailed documentation block <em>after</em> a member. Other ways to do the same are: </p>
<pre class="fragment">int var; /**&lt; Detailed description after the member */
</pre><p> or </p>
<pre class="fragment">int var; //!&lt; Detailed description after the member
         //!&lt; 
</pre><p> or </p>
<pre class="fragment">int var; ///&lt; Detailed description after the member
         ///&lt; 
</pre><p>Most often one only wants to put a brief description after a member. This is done as follows: </p>
<pre class="fragment">int var; //!&lt; Brief description after the member
</pre><p> or </p>
<pre class="fragment">int var; ///&lt; Brief description after the member
</pre><p>For functions one can use the <a class="el" href="commands.html#cmdparam">@param</a> command to document the parameters and then use <code>[in]</code>, <code>[out]</code>, <code>[in,out]</code> to document the direction. For inline documentation this is also possible by starting with the direction attribute, e.g. </p>
<pre class="fragment">void foo(int v /**&lt; [in] docs for input parameter v. */);
</pre><p>Note that these blocks have the same structure and meaning as the special comment blocks in the previous section only the &lt; indicates that the member is located in front of the block instead of after the block.</p>
<p>Here is an example of the use of these comment blocks: </p>
<div class="fragment"><div class="line"><span class="comment">/*! A test class */</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">class </span>Test</div>
<div class="line">{</div>
<div class="line">  <span class="keyword">public</span>:<span class="comment"></span></div>
<div class="line"><span class="comment">    /** An enum type. </span></div>
<div class="line"><span class="comment">     *  The documentation block cannot be put after the enum! </span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line">    <span class="keyword">enum</span> EnumType</div>
<div class="line">    {</div>
<div class="line">      <span class="keywordtype">int</span> EVal1,     <span class="comment">/**&lt; enum value 1 */</span></div>
<div class="line">      <span class="keywordtype">int</span> EVal2      <span class="comment">/**&lt; enum value 2 */</span></div>
<div class="line">    };</div>
<div class="line">    <span class="keywordtype">void</span> member();   <span class="comment">//!&lt; a member function.</span></div>
<div class="line"><span class="comment"></span>    </div>
<div class="line">  <span class="keyword">protected</span>:</div>
<div class="line">    <span class="keywordtype">int</span> value;       <span class="comment">/*!&lt; an integer value */</span></div>
<div class="line">};</div>
</div><!-- fragment -->  
 Click <a href="../examples/afterdoc/html/class_test.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <dl class="section warning"><dt>Warning</dt><dd>These blocks can only be used to document <em>members</em> and <em>parameters</em>. They cannot be used to document files, classes, unions, structs, groups, namespaces and enums themselves. Furthermore, the structural commands mentioned in the next section (like <code>\class</code>) are not allowed inside these comment blocks.</dd></dl>
<h3><a class="anchor" id="docexamples"></a>
Examples</h3>
<p>Here is an example of a documented piece of C++ code using the Qt style: </p>
<div class="fragment"><div class="line"><span class="comment">//!  A test class. </span></div>
<div class="line"><span class="comment"></span><span class="comment">/*!</span></div>
<div class="line"><span class="comment">  A more elaborate class description.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">class </span>Test</div>
<div class="line">{</div>
<div class="line">  <span class="keyword">public</span>:</div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">    //! An enum.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*! More detailed enum description. */</span></div>
<div class="line">    <span class="keyword">enum</span> TEnum { </div>
<div class="line">                 TVal1, <span class="comment">/*!&lt; Enum value TVal1. */</span>  </div>
<div class="line">                 TVal2, <span class="comment">/*!&lt; Enum value TVal2. */</span>  </div>
<div class="line">                 TVal3  <span class="comment">/*!&lt; Enum value TVal3. */</span>  </div>
<div class="line">               } <span class="comment"></span></div>
<div class="line"><span class="comment">         //! Enum pointer.</span></div>
<div class="line"><span class="comment"></span><span class="comment">         /*! Details. */</span></div>
<div class="line">         *enumPtr, <span class="comment"></span></div>
<div class="line"><span class="comment">         //! Enum variable.</span></div>
<div class="line"><span class="comment"></span><span class="comment">         /*! Details. */</span></div>
<div class="line">         enumVar;  </div>
<div class="line">    <span class="comment"></span></div>
<div class="line"><span class="comment">    //! A constructor.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*!</span></div>
<div class="line"><span class="comment">      A more elaborate description of the constructor.</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">    Test();</div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">    //! A destructor.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*!</span></div>
<div class="line"><span class="comment">      A more elaborate description of the destructor.</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">   ~Test();</div>
<div class="line">    <span class="comment"></span></div>
<div class="line"><span class="comment">    //! A normal member taking two arguments and returning an integer value.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*!</span></div>
<div class="line"><span class="comment">      \param a an integer argument.</span></div>
<div class="line"><span class="comment">      \param s a constant character pointer.</span></div>
<div class="line"><span class="comment">      \return The test results</span></div>
<div class="line"><span class="comment">      \sa Test(), ~Test(), testMeToo() and publicVar()</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">    <span class="keywordtype">int</span> testMe(<span class="keywordtype">int</span> a,<span class="keyword">const</span> <span class="keywordtype">char</span> *s);</div>
<div class="line">       <span class="comment"></span></div>
<div class="line"><span class="comment">    //! A pure virtual member.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*!</span></div>
<div class="line"><span class="comment">      \sa testMe()</span></div>
<div class="line"><span class="comment">      \param c1 the first argument.</span></div>
<div class="line"><span class="comment">      \param c2 the second argument.</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">    <span class="keyword">virtual</span> <span class="keywordtype">void</span> testMeToo(<span class="keywordtype">char</span> c1,<span class="keywordtype">char</span> c2) = 0;</div>
<div class="line">   <span class="comment"></span></div>
<div class="line"><span class="comment">    //! A public variable.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*!</span></div>
<div class="line"><span class="comment">      Details.</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">    <span class="keywordtype">int</span> publicVar;</div>
<div class="line">       <span class="comment"></span></div>
<div class="line"><span class="comment">    //! A function variable.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    /*!</span></div>
<div class="line"><span class="comment">      Details.</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line">    int (*handler)(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b);</div>
<div class="line">};</div>
<div class="line"></div>
</div><!-- fragment -->  
 Click <a href="../examples/qtstyle/html/class_test.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <p>The brief descriptions are included in the member overview of a class, namespace or file and are printed using a small italic font (this description can be hidden by setting <a class="el" href="config.html#cfg_brief_member_desc">BRIEF_MEMBER_DESC</a> to <code>NO</code> in the config file). By default the brief descriptions become the first sentence of the detailed descriptions (but this can be changed by setting the <a class="el" href="config.html#cfg_repeat_brief">REPEAT_BRIEF</a> tag to <code>NO</code>). Both the brief and the detailed descriptions are optional for the Qt style.</p>
<p>By default a JavaDoc style documentation block behaves the same way as a Qt style documentation block. This is not according the JavaDoc specification however, where the first sentence of the documentation block is automatically treated as a brief description. To enable this behavior you should set <a class="el" href="config.html#cfg_javadoc_autobrief">JAVADOC_AUTOBRIEF</a> to YES in the configuration file. If you enable this option and want to put a dot in the middle of a sentence without ending it, you should put a backslash and a space after it. Here is an example: </p>
<pre class="fragment">  /** Brief description (e.g.\ using only a few words). Details follow. */
</pre><p>Here is the same piece of code as shown above, this time documented using the JavaDoc style and <a class="el" href="config.html#cfg_javadoc_autobrief">JAVADOC_AUTOBRIEF</a> set to YES: </p>
<div class="fragment"><div class="line"><span class="comment">/**</span></div>
<div class="line"><span class="comment"> *  A test class. A more elaborate class description.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">class </span>Test</div>
<div class="line">{</div>
<div class="line">  <span class="keyword">public</span>:</div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">    /** </span></div>
<div class="line"><span class="comment">     * An enum.</span></div>
<div class="line"><span class="comment">     * More detailed enum description.</span></div>
<div class="line"><span class="comment">     */</span></div>
<div class="line"></div>
<div class="line">    <span class="keyword">enum</span> TEnum { </div>
<div class="line">          TVal1, <span class="comment">/**&lt; enum value TVal1. */</span>  </div>
<div class="line">          TVal2, <span class="comment">/**&lt; enum value TVal2. */</span>  </div>
<div class="line">          TVal3  <span class="comment">/**&lt; enum value TVal3. */</span>  </div>
<div class="line">         } </div>
<div class="line">       *enumPtr, <span class="comment">/**&lt; enum pointer. Details. */</span></div>
<div class="line">       enumVar;  <span class="comment">/**&lt; enum variable. Details. */</span></div>
<div class="line">       <span class="comment"></span></div>
<div class="line"><span class="comment">      /**</span></div>
<div class="line"><span class="comment">       * A constructor.</span></div>
<div class="line"><span class="comment">       * A more elaborate description of the constructor.</span></div>
<div class="line"><span class="comment">       */</span></div>
<div class="line">      Test();</div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">      /**</span></div>
<div class="line"><span class="comment">       * A destructor.</span></div>
<div class="line"><span class="comment">       * A more elaborate description of the destructor.</span></div>
<div class="line"><span class="comment">       */</span></div>
<div class="line">     ~Test();</div>
<div class="line">    <span class="comment"></span></div>
<div class="line"><span class="comment">      /**</span></div>
<div class="line"><span class="comment">       * a normal member taking two arguments and returning an integer value.</span></div>
<div class="line"><span class="comment">       * @param a an integer argument.</span></div>
<div class="line"><span class="comment">       * @param s a constant character pointer.</span></div>
<div class="line"><span class="comment">       * @see Test()</span></div>
<div class="line"><span class="comment">       * @see ~Test()</span></div>
<div class="line"><span class="comment">       * @see testMeToo()</span></div>
<div class="line"><span class="comment">       * @see publicVar()</span></div>
<div class="line"><span class="comment">       * @return The test results</span></div>
<div class="line"><span class="comment">       */</span></div>
<div class="line">       <span class="keywordtype">int</span> testMe(<span class="keywordtype">int</span> a,<span class="keyword">const</span> <span class="keywordtype">char</span> *s);</div>
<div class="line">       <span class="comment"></span></div>
<div class="line"><span class="comment">      /**</span></div>
<div class="line"><span class="comment">       * A pure virtual member.</span></div>
<div class="line"><span class="comment">       * @see testMe()</span></div>
<div class="line"><span class="comment">       * @param c1 the first argument.</span></div>
<div class="line"><span class="comment">       * @param c2 the second argument.</span></div>
<div class="line"><span class="comment">       */</span></div>
<div class="line">       <span class="keyword">virtual</span> <span class="keywordtype">void</span> testMeToo(<span class="keywordtype">char</span> c1,<span class="keywordtype">char</span> c2) = 0;</div>
<div class="line">   <span class="comment"></span></div>
<div class="line"><span class="comment">      /** </span></div>
<div class="line"><span class="comment">       * a public variable.</span></div>
<div class="line"><span class="comment">       * Details.</span></div>
<div class="line"><span class="comment">       */</span></div>
<div class="line">       <span class="keywordtype">int</span> publicVar;</div>
<div class="line">       <span class="comment"></span></div>
<div class="line"><span class="comment">      /**</span></div>
<div class="line"><span class="comment">       * a function variable.</span></div>
<div class="line"><span class="comment">       * Details.</span></div>
<div class="line"><span class="comment">       */</span></div>
<div class="line">       int (*handler)(<span class="keywordtype">int</span> a,<span class="keywordtype">int</span> b);</div>
<div class="line">};</div>
<div class="line"></div>
</div><!-- fragment -->  
 Click <a href="../examples/jdstyle/html/class_test.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <p>Similarly, if one wishes the first sentence of a Qt style documentation block to automatically be treated as a brief description, one may set <a class="el" href="config.html#cfg_qt_autobrief">QT_AUTOBRIEF</a> to YES in the configuration file.</p>
<h3><a class="anchor" id="structuralcommands"></a>
Documentation at other places</h3>
<p>In the examples in the previous section the comment blocks were always located <em>in front</em> of the declaration or definition of a file, class or namespace or <em>in front</em> or <em>after</em> one of its members. Although this is often comfortable, there may sometimes be reasons to put the documentation somewhere else. For documenting a file this is even required since there is no such thing as "in front of a file".</p>
<p>Doxygen allows you to put your documentation blocks practically anywhere (the exception is inside the body of a function or inside a normal C style comment block).</p>
<p>The price you pay for not putting the documentation block directly before (or after) an item is the need to put a structural command inside the documentation block, which leads to some duplication of information. So in practice you should <em>avoid</em> the use of structural commands <em>unless</em> other requirements force you to do so.</p>
<p>Structural commands (like <a class="el" href="commands.html#cmd_intro">all other commands</a>) start with a backslash (<code>\</code>), or an at-sign (<code>@</code>) if you prefer JavaDoc style, followed by a command name and one or more parameters. For instance, if you want to document the class <code>Test</code> in the example above, you could have also put the following documentation block somewhere in the input that is read by doxygen: </p>
<pre class="fragment">/*! \class Test
    \brief A test class.

    A more detailed class description.
*/
</pre><p>Here the special command <code>\class</code> is used to indicate that the comment block contains documentation for the class <code>Test</code>. Other structural commands are: </p>
<ul>
<li>
<code>\struct</code> to document a C-struct. </li>
<li>
<code>\union</code> to document a union. </li>
<li>
<code>\enum</code> to document an enumeration type. </li>
<li>
<code>\fn</code> to document a function. </li>
<li>
<code>\var</code> to document a variable or typedef or enum value. </li>
<li>
<code>\def</code> to document a #define. </li>
<li>
<code>\typedef</code> to document a type definition. </li>
<li>
<code>\file</code> to document a file. </li>
<li>
<code>\namespace</code> to document a namespace. </li>
<li>
<code>\package</code> to document a Java package. </li>
<li>
<code>\interface</code> to document an IDL interface. </li>
</ul>
<p>See section <a class="el" href="commands.html">Special Commands</a> for detailed information about these and many other commands.</p>
<p>To document a member of a C++ class, you must also document the class itself. The same holds for namespaces. To document a global C function, typedef, enum or preprocessor definition you must first document the file that contains it (usually this will be a header file, because that file contains the information that is exported to other source files).</p>
<p>Let's repeat that, because it is often overlooked: to document global objects (functions, typedefs, enum, macros, etc), you <em>must</em> document the file in which they are defined. In other words, there <em>must</em> at least be a</p>
<pre class="fragment">/*! \file */ </pre><p> or a</p>
<pre class="fragment">/** @file */ </pre><p> line in this file.</p>
<p>Here is an example of a C header named <code>structcmd.h</code> that is documented using structural commands: </p>
<div class="fragment"><div class="line"><span class="comment">/*! \file structcmd.h</span></div>
<div class="line"><span class="comment">    \brief A Documented file.</span></div>
<div class="line"><span class="comment">    </span></div>
<div class="line"><span class="comment">    Details.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \def MAX(a,b)</span></div>
<div class="line"><span class="comment">    \brief A macro that returns the maximum of \a a and \a b.</span></div>
<div class="line"><span class="comment">   </span></div>
<div class="line"><span class="comment">    Details.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \var typedef unsigned int UINT32</span></div>
<div class="line"><span class="comment">    \brief A type definition for a .</span></div>
<div class="line"><span class="comment">    </span></div>
<div class="line"><span class="comment">    Details.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \var int errno</span></div>
<div class="line"><span class="comment">    \brief Contains the last error code.</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">    \warning Not thread safe!</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \fn int open(const char *pathname,int flags)</span></div>
<div class="line"><span class="comment">    \brief Opens a file descriptor.</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">    \param pathname The name of the descriptor.</span></div>
<div class="line"><span class="comment">    \param flags Opening flags.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \fn int close(int fd)</span></div>
<div class="line"><span class="comment">    \brief Closes the file descriptor \a fd.</span></div>
<div class="line"><span class="comment">    \param fd The descriptor to close.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \fn size_t write(int fd,const char *buf, size_t count)</span></div>
<div class="line"><span class="comment">    \brief Writes \a count bytes from \a buf to the filedescriptor \a fd.</span></div>
<div class="line"><span class="comment">    \param fd The descriptor to write to.</span></div>
<div class="line"><span class="comment">    \param buf The data buffer to write.</span></div>
<div class="line"><span class="comment">    \param count The number of bytes to write.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">/*! \fn int read(int fd,char *buf,size_t count)</span></div>
<div class="line"><span class="comment">    \brief Read bytes from a file descriptor.</span></div>
<div class="line"><span class="comment">    \param fd The descriptor to read from.</span></div>
<div class="line"><span class="comment">    \param buf The buffer to read into.</span></div>
<div class="line"><span class="comment">    \param count The number of bytes to read.</span></div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define MAX(a,b) (((a)&gt;(b))?(a):(b))</span></div>
<div class="line"><span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> UINT32;</div>
<div class="line"><span class="keywordtype">int</span> errno;</div>
<div class="line"><span class="keywordtype">int</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span> *,<span class="keywordtype">int</span>);</div>
<div class="line"><span class="keywordtype">int</span> close(<span class="keywordtype">int</span>);</div>
<div class="line"><span class="keywordtype">size_t</span> write(<span class="keywordtype">int</span>,<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>);</div>
<div class="line"><span class="keywordtype">int</span> read(<span class="keywordtype">int</span>,<span class="keywordtype">char</span> *,<span class="keywordtype">size_t</span>);</div>
</div><!-- fragment -->  
 Click <a href="../examples/structcmd/html/structcmd_8h.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <p>Because each comment block in the example above contains a structural command, all the comment blocks could be moved to another location or input file (the source file for instance), without affecting the generated documentation. The disadvantage of this approach is that prototypes are duplicated, so all changes have to be made twice! Because of this you should first consider if this is really needed, and avoid structural commands if possible. I often receive examples that contain \fn command in comment blocks which are place in front of a function. This is clearly a case where the \fn command is redundant and will only lead to problems.</p>
<h2><a class="anchor" id="pythonblocks"></a>
Comment blocks in Python</h2>
<p>For Python there is a standard way of documenting the code using so called documentation strings. Such strings are stored in <code><b>doc</b></code> and can be retrieved at runtime. Doxygen will extract such comments and assume they have to be represented in a preformatted way.</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="stringliteral">&quot;&quot;&quot;@package docstring</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="stringliteral">Documentation for this module.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="stringliteral">More details.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="stringliteral">&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">def </span>func():</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;Documentation for a function.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="stringliteral">    More details.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="stringliteral">    &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;    <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">class </span>PyClass:</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <span class="stringliteral">&quot;&quot;&quot;Documentation for a class.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="stringliteral"></span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="stringliteral">    More details.</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="stringliteral">    &quot;&quot;&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;   </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    <span class="keyword">def </span>__init__(self):</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;The constructor.&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        self._memVar = 0;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;   </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <span class="keyword">def </span>PyMethod(self):</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        <span class="stringliteral">&quot;&quot;&quot;Documentation for a method.&quot;&quot;&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;     </div>
</div><!-- fragment -->  
 Click <a href="../examples/docstring/html/index.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <p>Note that in this case none of doxygen's <a class="el" href="commands.html#cmd_intro">special commands</a> are supported.</p>
<p>There is also another way to document Python code using comments that start with "##". These type of comment blocks are more in line with the way documentation blocks work for the other languages supported by doxygen and this also allows the use of special commands.</p>
<p>Here is the same example again but now using doxygen style comments:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">## @package pyexample</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">#  Documentation for this module.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">#</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">#  More details.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">## Documentation for a function.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">#</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">#  More details.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">def </span>func():</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;    <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">## Documentation for a class.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">#</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">#  More details.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keyword">class </span>PyClass:</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;   </div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;    <span class="comment">## The constructor.</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <span class="keyword">def </span>__init__(self):</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        self._memVar = 0;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;   </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="comment">## Documentation for a method.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    <span class="comment">#  @param self The object pointer.</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <span class="keyword">def </span>PyMethod(self):</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        <span class="keywordflow">pass</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;     </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    <span class="comment">## A class variable.</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    classVar = 0;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="comment">## @var _memVar</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    <span class="comment">#  a member variable</span></div>
</div><!-- fragment -->  
 Click <a href="../examples/pyexample/html/index.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <p>Since python looks more like Java than like C or C++, you should set <a class="el" href="config.html#cfg_optimize_output_java">OPTIMIZE_OUTPUT_JAVA</a> to <code>YES</code> in the config file.</p>
<h2><a class="anchor" id="vhdlblocks"></a>
Comment blocks in VHDL</h2>
<p>For VHDL a comment normally start with "--". Doxygen will extract comments starting with "--!". There are only two types of comment blocks in VHDL; a one line "--!" comment representing a brief description, and a multi-line "--!" comment (where the "--!" prefix is repeated for each line) representing a detailed description.</p>
<p>Comments are always located in front of the item that is being documented with one exception: for ports the comment can also be after the item and is then treated as a brief description for the port.</p>
<p>Here is an example VHDL file with doxygen comments:</p>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="keyword">-------------------------------------------------------</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="keyword">--! @file</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">--! @brief 2:1 Mux using with-select</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">-------------------------------------------------------</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="keyword">--! Use standard library</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="vhdlkeyword">library </span><span class="keywordflow">ieee</span>;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">--! Use logic elements</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="vhdlkeyword">    use </span>ieee.std_logic_1164.all;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="keyword">--! Mux entity brief description</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">--! Detailed description of this </span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="keyword">--! mux design element.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="keywordflow">entity </span>mux_using_with <span class="vhdlchar">is</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    <span class="vhdlchar">port</span> <span class="vhdlchar">(</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;        <span class="vhdlchar">din_0</span>   <span class="vhdlchar">:</span> <span class="vhdlchar">in</span>  <span class="vhdlchar">std_logic</span>;<span class="keyword"> --! Mux first input</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;        <span class="vhdlchar">din_1</span>   <span class="vhdlchar">:</span> <span class="vhdlchar">in</span>  <span class="vhdlchar">std_logic</span>;<span class="keyword"> --! Mux Second input</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        <span class="vhdlchar">sel</span>     <span class="vhdlchar">:</span> <span class="vhdlchar">in</span>  <span class="vhdlchar">std_logic</span>;<span class="keyword"> --! Select input</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        <span class="vhdlchar">mux_out</span> <span class="vhdlchar">:</span> <span class="vhdlchar">out</span> <span class="vhdlchar">std_logic</span><span class="keyword">  --! Mux output</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    <span class="vhdlchar">)</span>;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="vhdlchar">end</span> <span class="vhdlchar">entity</span>;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">--! @brief Architure definition of the MUX</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">--! @details More details about this mux element.</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;architecture behavior of mux_using_with is</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="vhdlkeyword">begin</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="vhdlchar">with</span> <span class="vhdlchar">(</span><span class="vhdlchar">sel</span><span class="vhdlchar">)</span> <span class="vhdlchar">select</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="vhdlchar">mux_out</span> <span class="vhdlchar">&lt;=</span> <span class="vhdlchar">din_0</span> <span class="vhdlchar">when</span> <span class="vhdlchar">&#39;</span><span class="vhdllogic"></span><span class="vhdllogic">0</span><span class="vhdlchar">&#39;</span><span class="vhdlchar">,</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;               <span class="vhdlchar">din_1</span> <span class="vhdlchar">when</span> <span class="vhdlchar">others</span>;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="vhdlchar">end</span> <span class="vhdlchar">architecture</span>;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
</div><!-- fragment -->  
 Click <a href="../examples/mux/html/index.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <p>To get proper looking output you need to set <a class="el" href="config.html#cfg_optimize_output_vhdl">OPTIMIZE_OUTPUT_VHDL</a> to <code>YES</code> in the config file. This will also affect a number of other settings. When they were not already set correctly doxygen will produce a warning telling which settings where overruled.</p>
<h2><a class="anchor" id="fortranblocks"></a>
Comment blocks in Fortran</h2>
<p>When using doxygen for Fortran code you should set <a class="el" href="config.html#cfg_optimize_for_fortran">OPTIMIZE_FOR_FORTRAN</a> to <code>YES</code>.</p>
<p>For Fortran "!&gt;" or "!&lt;" starts a comment and "!!" or "!&gt;" can be used to continuate a one line comment into a multi-line comment.</p>
<p>Here is an example of a documented Fortran subroutine: </p>
<pre class="fragment">  !&gt; Build the restriction matrix for the aggregation 
  !! method.
  !! @param aggr information about the aggregates
  !! @todo Handle special case
  subroutine IntRestBuild(A,aggr,Restrict,A_ghost)
    implicit none
    Type(SpMtx), intent(in) :: A !&lt; our fine level matrix
    Type(Aggrs), intent(in) :: aggr
    Type(SpMtx), intent(out) :: Restrict !&lt; Our restriction matrix
</pre><p>As a alternative you can also use comments in fixed format code:</p>
<pre class="fragment">C&gt; Function comment
C&gt; another line of comment
      function A(i)
C&gt; input parameter
        integer i
      end function A
</pre><h2><a class="anchor" id="tclblocks"></a>
Comment blocks in Tcl</h2>
<p>Doxygen documentation can be included in normal Tcl comments.</p>
<p>To start a new documentation block start a line with <code>##</code> (two hashes). All following comment lines and continuation lines will be added to this block. The block ends with a line not starting with a <code>#</code> (hash sign).</p>
<p>A brief documentation can be added with <code></code>;#&lt; (semicolon, hash and lower then sign). The brief documentation also ends at a line not starting with a <code>#</code> (hash sign).</p>
<p>Inside doxygen comment blocks all normal doxygen markings are supported. The only exceptions are described in the following two paragraphs.</p>
<p>If a doxygen comment block ends with a line containing only <code>#\code</code> or <code>#@code</code> all code until a line only containing <code>#\endcode</code> or <code>#@endcode</code> is added to the generated documentation as code block.</p>
<p>If a doxygen comment block ends with a line containing only <code>#\verbatim</code> or <code>#@verbatim</code> all code until a line only containing <code>#\endverbatim</code> or <code>#@endverbatim</code> is added verbatim to the generated documentation.</p>
<p>To detect namespaces, classes, functions and variables the following Tcl commands are recognized. Documentation blocks can be put on the lines before the command.</p>
<ul>
<li>
<code>namespace eval ..</code> Namespace </li>
<li>
<code>proc ..</code> Function </li>
<li>
<code>variable ..</code> Variable </li>
<li>
<code>common ..</code> Common variable </li>
<li>
<code>itcl::class ..</code> Class </li>
<li>
<code>itcl::body ..</code> Class method body definition </li>
<li>
<code>oo::class create ..</code> Class </li>
<li>
<code>oo::define ..</code> OO Class definition </li>
<li>
<code>method ..</code> Class method definitions </li>
<li>
<code>constructor ..</code> Class constructor </li>
<li>
<code>destructor ..</code> Class destructor </li>
<li>
<code>public ..</code> Set protection level </li>
<li>
<code>protected ..</code> Set protection level </li>
<li>
<code>private ..</code> Set protection level </li>
</ul>
<p>Following is a example using doxygen style comments:</p>
<div class="fragment"><div class="line"><span class="comment">## \file tclexample.tcl</span></div>
<div class="line"><span class="comment"></span><span class="comment"># File documentation.</span></div>
<div class="line"><span class="comment"></span><span class="comment">#\verbatim</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment"># Startup code:\</span></div>
<div class="line"><span class="comment"></span><span class="comment">exec tclsh &quot;$0&quot; &quot;$@&quot;</span></div>
<div class="line"><span class="comment"></span><span class="comment">#\endverbatim</span></div>
<div class="line"><span class="comment"></span><span class="comment">## Documented namespace \c ns .</span></div>
<div class="line"><span class="comment"></span><span class="comment"># The code is inserted here:</span></div>
<div class="line"><span class="comment"></span><span class="comment">#\code</span></div>
<div class="line"><span class="comment"></span><span class="keyword">namespace</span> <span class="keyword">eval</span> ns {</div>
<div class="line">  <span class="comment">## Documented proc \c ns_proc .</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="comment"># param[in] arg some argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="keyword">proc</span> ns_proc {arg} {}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>  <span class="comment">## Documented var \c ns_var .</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="comment"># Some documentation.</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="keyword">variable</span> ns_var<span class="comment"></span></div>
<div class="line"><span class="comment"></span>  <span class="comment">## Documented itcl class \c itcl_class .</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="keyword">itcl::class</span> itcl_class {</div>
<div class="line">    <span class="comment">## Create object.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">constructor</span> {args} {<span class="keyword">eval</span> $args}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Destroy object.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">destructor</span> {<span class="keyword">exit</span>}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Documented itcl method \c itcl_method_x .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">private</span> <span class="keyword">method</span> itcl_method_x {arg}{}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Documented itcl method \c itcl_method_y .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">protected</span> <span class="keyword">method</span> itcl_method_y {arg} {}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Documented itcl method \c itcl_method_z .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">public</span> <span class="keyword">method</span> itcl_method_z {arg} {}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Documented common itcl var \c itcl_Var .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">common</span> itcl_Var<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## \protectedsection</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span></div>
<div class="line">    <span class="keyword">variable</span> itcl_var1<span class="comment">;#&lt; Documented itcl var \c itcl_var1 .</span></div>
<div class="line"><span class="comment">    </span><span class="keyword">variable</span> itcl_var2}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>  <span class="comment">## Documented oo class \c oo_class .</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="keyword">oo::class</span> create oo_class {</div>
<div class="line">    <span class="comment">## Create object.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># Configure with args</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">constructor</span> {args} {<span class="keyword">eval</span> $args}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Destroy object.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># Exit.</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">destructor</span> {<span class="keyword">exit</span>}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## Documented oo var \c oo_var .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># Defined inside class</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">variable</span> oo_var<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## \private Documented oo method \c oo_method_x .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">method</span> oo_method_x {arg} {}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## \protected Documented oo method \c oo_method_y .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">method</span> oo_method_y {arg} {}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>    <span class="comment">## \public Documented oo method \c oo_method_z .</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="comment">    </span><span class="keyword">method</span> oo_method_z {arg} {}<span class="comment"></span></div>
<div class="line"><span class="comment"></span>  }<span class="comment"></span></div>
<div class="line"><span class="comment"></span>}<span class="comment"></span></div>
<div class="line"><span class="comment"></span><span class="comment">#\endcode</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="keyword">itcl::body</span> ::ns::itcl_class::itcl_method_x {argx} {</div>
<div class="line">  <span class="keyword">puts</span> &quot;$argx OK&quot;<span class="comment"></span></div>
<div class="line"><span class="comment"></span>}<span class="comment"></span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="keyword">oo::define</span> ns::oo_class {</div>
<div class="line">  <span class="comment">## \public Outside defined variable \c oo_var_out .</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="comment"># Inside oo_class</span></div>
<div class="line"><span class="comment"></span><span class="comment">  </span><span class="keyword">variable</span> oo_var_out<span class="comment"></span></div>
<div class="line"><span class="comment"></span>}<span class="comment"></span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment">## Documented global proc \c glob_proc .</span></div>
<div class="line"><span class="comment"></span><span class="comment"># param[in] arg Argument</span></div>
<div class="line"><span class="comment"></span><span class="keyword">proc</span> glob_proc {arg} {<span class="keyword">puts</span> $arg}<span class="comment"></span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="keyword">variable</span> glob_var<span class="comment">;#&lt; Documented global var \c glob_var\</span></div>
<div class="line"><span class="comment">  with newline</span></div>
<div class="line"><span class="comment">#&lt; and continued line</span></div>
<div class="line"><span class="comment"></span></div>
<div class="line"><span class="comment"># end of file</span></div>
</div><!-- fragment -->  
 Click <a href="../examples/tclexample/html/index.html">here</a>
 for the corresponding HTML documentation that is generated by doxygen.
 <h1><a class="anchor" id="docstructure"></a>
Anatomy of a comment block</h1>
<p>The previous section focused on how to make the comments in your code known to doxygen, it explained the difference between a brief and a detailed description, and the use of structural commands.</p>
<p>In this section we look at the contents of the comment block itself.</p>
<p>Doxygen supports various styles of formatting your comments.</p>
<p>The simplest form is to use plain text. This will appear as-is in the output and is ideal for a short description.</p>
<p>For longer descriptions you often will find the need for some more structure, like a block of verbatim text, a list, or a simple table. For this doxygen supports the <a href="http://daringfireball.net/projects/markdown/syntax">Markdown</a> syntax, including parts of the <a href="http://michelf.com/projects/php-markdown/extra/">Markdown Extra</a> extension.</p>
<p>Markdown is designed to be very easy to read and write. It's formatting is inspired by plain text mail. Markdown works great for simple, generic formatting, like an introduction page for your project. Doxygen also supports reading of markdown files directly. See <a class="el" href="markdown.html">here</a> for more details regards Markdown support.</p>
<p>For programming language specific formatting doxygen has two forms of additional markup on top of Markdown formatting.</p>
<ol type="1">
<li><a href="http://en.wikipedia.org/wiki/Javadoc">Javadoc</a> like markup. See <a class="el" href="commands.html#cmd_intro">here</a> for a complete overview of all commands supported by doxygen.</li>
<li><a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)#XML_documentation_system">XML</a> markup as specified in the C# standard. See <a class="el" href="xmlcmds.html">here</a> for the XML commands supported by doxygen.</li>
</ol>
<p>If this is still not enough doxygen also supports a <a class="el" href="htmlcmds.html">subset</a> of the <a href="http://en.wikipedia.org/wiki/HTML">HTML</a> markup language.</p>
 
Go to the <a href="markdown.html">next</a> section or return to the
 <a href="index.html">index</a>.
 </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Jan 27 2014 11:24:39 for Doxygen by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>