summaryrefslogtreecommitdiff
path: root/cesar/common/doc/extractdoc
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/common/doc/extractdoc')
-rwxr-xr-xcesar/common/doc/extractdoc39
1 files changed, 39 insertions, 0 deletions
diff --git a/cesar/common/doc/extractdoc b/cesar/common/doc/extractdoc
new file mode 100755
index 0000000000..b63ec398b9
--- /dev/null
+++ b/cesar/common/doc/extractdoc
@@ -0,0 +1,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 '> ' . $_;
+ }
+}