docs: Allow enhanced comments for macros (ie. #define).

This commit is contained in:
Richard W.M. Jones
2018-10-04 12:48:51 +01:00
parent ba82fb023d
commit 970dccf147

View File

@@ -245,13 +245,19 @@ foreach $dir (@dirs) {
}
}
else {
# First line tells us if this is a struct
# or function.
# First line tells us if this is a struct,
# define or function.
if (/^struct ([\w_]+) \{$/) {
$thing = "Structure";
$name = $1;
$end = "};";
}
elsif (/^#define ([\w_]+)/) {
$thing = "Definition";
$name = $1;
$found_end = 1;
last;
}
else {
$thing = "Function";
$end = "{";
@@ -276,6 +282,10 @@ foreach $dir (@dirs) {
push @defn, "};"
}
if ($thing eq "Definition") {
@defn = ( "#define $name" )
}
# Print the definition, followed by the comment.
print OUTPUT "=head4 $thing C<$input:$name>\n\n";
print OUTPUT " ", join ("\n ", @defn), "\n";