--- /dev/null
+#!/usr/bin/perl
+
+# Doxygen is usefull for html documentation, but sucks
+# in making manual pages. Still tool also parses the .h
+# files with the doxygen documentation and creates
+# the man page we want
+#
+# 2 way process
+# 1. All the .h files are processed to create in file in which:
+# filename | API | description | return values
+# are documented
+# 2. Another file is parsed which states which function should
+# be grouped together in which manpage. Symlinks are also created.
+#
+# With this all in place, all documentation should be autogenerated
+# from the doxydoc.
+
+use strict;
+
+my $state;
+
+my $description;
+my $key;
+my $return;
+my $param;
+my $api;
+
+my %description;
+my %api;
+my %return;
+
+# 0 - somewhere in the file
+# 1 - in a doxygen par
+
+$state = 0;
+
+while(<>) {
+ if (/\/\*\*/) {
+ # /** Seen
+ $state = 1;
+ next;
+ }
+ if (/\*\//) {
+ $state = 0;
+ next;
+ }
+
+ if ($state == 1) {
+ # inside doxygen
+ s/^[ \t]*\*[ \t]*//;
+
+ $description = $description . $_;
+ }
+ if (/(.*)[\t ]+(.*?)\((.*)\);/) {
+ # this should also end the current comment parsing
+ $return = $1;
+ $key = $2;
+ $api = $3;
+ # sometimes the * is stuck to the function
+ # name instead to the return type
+ if ($key =~ /^\*/) {
+ #print"Name starts with *\n";
+ $key =~ s/^\*//;
+ $return = '*' . $return;
+ }
+ print "Function seen\t$return [$key] [$api]\n";
+ $description{$key} = $description;
+ $api{$key} = $api;
+ $return{$key} = $return;
+ undef $description;
+ $state = 0;
+ }
+}
+
+# walk over the found functions
+foreach (keys %description) {
+ if ($_ eq "") { next; }
+
+ # func name || api || description || return
+
+ print $_, "||";
+ print $api{$_}, "||";
+ print $description{$_},"||";
+ print $return{$_},"\n";
+}