summaryrefslogtreecommitdiff
path: root/cesar/common/doc/extractdoc
blob: b63ec398b947da076adb279c473c15884ed85908 (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
#!/usr/bin/perl -nl
use strict;
use warnings;

# Extract the file comment.
if (/^\/\*\*$/ .. /^ \*\/$/)
{
    if (/^ \* \\file/ .. /^ \*\/$/)
    {
	if (not /^ \* \\(?:file|brief|ingroup)| \*\//)
	{
	    s/^ \* ?//;
	    print;
	}
    }
}

if (/^BEGIN_DECLS$/ .. /^END_DECLS$/)
{
    if (/^BEGIN_DECLS$/)
    {
	print "\nFunctions\n---------";
    }
    elsif (/^END_DECLS$/)
    {
    }
    elsif (m#^$|^/\*\*$|^ \*/$#)
    {
	print '';
    }
    elsif (s/^ \* ?//)
    {
	print;
    }
    else
    {
	print '>   ' . $_;
    }
}