Modify DBD processing scripts to output Doxygen comments

This commit is contained in:
Andrew Johnson
2018-08-05 00:12:54 -05:00
committed by Andrew Johnson
parent 6786b2e7c2
commit f571c5950b
6 changed files with 34 additions and 14 deletions

View File

@@ -67,13 +67,16 @@ sub toDeclaration {
my $name = $this->name;
my $macro_name = "${name}_NUM_CHOICES";
my @choices = map {
sprintf " %-31s /* %s */", @{$_}[0], escapeCcomment(@{$_}[1]);
sprintf " %-31s /**< \@brief State string \"%s\" */",
@{$_}[0], escapeCcomment(@{$_}[1]);
} $this->choices;
my $num = scalar @choices;
return "#ifndef $macro_name\n" .
"/** \@brief Enumerated type from menu $name */\n" .
"typedef enum {\n" .
join(",\n", @choices) .
"\n} $name;\n" .
"/** \@brief Number of states defined for menu $name */\n" .
"#define $macro_name $num\n" .
"#endif\n\n";
}

View File

@@ -185,7 +185,7 @@ sub toDeclaration {
my $name = $this->C_name;
my $result = sprintf " %-19s %-12s", $ctype, "$name;";
my $prompt = $this->attribute('prompt');
$result .= "/* $prompt */" if defined $prompt;
$result .= "/**< \@brief $prompt */" if defined $prompt;
return $result;
}
@@ -217,7 +217,7 @@ sub toDeclaration {
my $size = $this->attribute('size');
my $result = sprintf " %-19s %-12s", 'char', "${name}[${size}];";
my $prompt = $this->attribute('prompt');
$result .= "/* $prompt */" if defined $prompt;
$result .= "/**< \@brief $prompt */" if defined $prompt;
return $result;
}
@@ -540,7 +540,7 @@ sub toDeclaration {
my $extra = $this->attribute('extra');
my $result = sprintf " %-31s ", "$extra;";
my $prompt = $this->attribute('prompt');
$result .= "/* $prompt */" if defined $prompt;
$result .= "/**< \@brief $prompt */" if defined $prompt;
return $result;
}

View File

@@ -132,10 +132,15 @@ sub toDeclaration {
$_->toDeclaration
} $this->fields;
my $name = $this->name;
$name .= "Record" unless $name eq "dbCommon";
return "typedef struct $name {\n" .
join("\n", @fields) .
"\n} $name;\n\n";
my $doc = $name;
if ($name ne 'dbCommon') {
$name .= 'Record';
$doc .= ' record type.';
}
return "/** \@brief Declaration of $doc */\n" .
"typedef struct $name {\n" .
join("\n", @fields) .
"\n} $name;\n\n";
}
1;