X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=build%2Fdoc-extract;h=67fdd64cb070ab919fe7de69cc239c8bf39ccd2f;hb=4313ba1d176383101791bcfad9660dd16ea30a84;hp=8d7325c7dc5788bd767c979db6137172e34722ee;hpb=5d4f108eed9f0aaaf542fb0e846d88fdbf6f45cc;p=libucw.git diff --git a/build/doc-extract b/build/doc-extract index 8d7325c7..67fdd64c 100755 --- a/build/doc-extract +++ b/build/doc-extract @@ -22,7 +22,7 @@ if( defined $defdump ) { $hasdump = 1; } -# Function to guess type of stytement +# Function to guess type of statement sub detect( $ ) { ( $_ ) = @_; # typedef struct|enum { something } name; @@ -42,6 +42,8 @@ sub detect( $ ) { } # typedef type (*function_type)(params); return( 'type', 1, $2, $_ ) if /^\s*typedef[^()]+?(\(\s*?\*\s*?)?(\w+)(\s*\))?\s*\(.*\)/; + # type (*function_var)(params); + return( 'var', 1, $1, $_ ) if /^.*?\(\*(\w+)\)\(.*\)/; # type function(name); return( 'fun', 1, $2, $1 ) if /^(.*?(\w+)\([^{]*\)[^{]*)/; # typedef something name; @@ -66,7 +68,7 @@ sub formatNote( $$ ) { $oneline =~ s/\s+$//; $oneline =~ s/;?$/;/ if( $semicolon ); $head =~ s/;?\s*$/;/ if( $semicolon ); - $head =~ s/(\.\.\.)/\\$1/g; + $head =~ s/(\s|,|\()(\.\.\.)/$1\\$2/g; # Do not convert tripple dot into ellipsis print OUT "[[${type}_$name]]\n"; $head = $oneline if $type eq 'fun';#Remove { from inline functions # Remove the generic hack markup @@ -157,9 +159,12 @@ sub process( $$ ) { $struct = $sdepth = 1; } } elsif( ( $buff ) = ( $line =~ /\/\*\*\*(.*)\*\*\*\// ) ) { - $buff =~ s/\s?//; + $buff =~ s/^\s?//; print OUT "$buff\n\n"; $buff = undef; + } elsif( ( $buff ) = ( $line =~ /^\s*\/\*\*(.*)\*\*\// ) ) { + $buff =~ s/^\s*//; + $buff .= "\n"; } elsif( ( $head, $buff ) = ( $line =~ /^(.*)\/\*\*(.*)\*\*\// ) ) { $buff =~ s/^\s*//; $buff =~ s/\s*$//;