3 for $filename (@ARGV) {
4 open(SRC, $filename) || die "$filename: $!";
6 delete @tvars{keys %tvars};
9 if(/struct configvar/ && /\[\]/) {
12 if(($state == 1) && /^\s*\/\*\*/) {
17 if(($state == 1) && /\{CONF_VAR_(\w+), \"([^\"]*)\"/) {
18 $var = $2; $type = $1; $def = "";
20 ($def) = /\.num = (\d+)/;
21 } elsif($type eq "BOOL") {
22 ($def) = /\.num = (\d+)/;
28 } elsif($type eq "STRING") {
29 ($def) = /\.str = L\"([^\"]*)\"/;
32 $tvars{$var} = {"doc" => $curdoc, "type" => $type, "def" => $def};
35 if(($state == 1) && /\s*\};$/) {
45 if(length($curdoc) > 0) {
55 for $var (keys %tvars) {
56 $vars{"$module.$var"} = $tvars{$var};
60 $types{"BOOL"} = "boolean";
61 $types{"INT"} = "integer";
62 $types{"STRING"} = "string";
63 $types{"IPV4"} = "IPv4 address";
67 $date = sprintf("%04i-%02i-%02i", $lt[5] + 1900, $lt[4] + 1, $lt[3]);
72 for $var (sort keys %vars) {
73 $_ .= ".TP\n.BI $var \" ";
74 $_ .= $types{$vars{$var}->{"type"}};
76 $_ .= $vars{$var}->{"doc"};
77 if(!($vars{$var}->{"type"} eq "IPV4")) {
78 $_ .= "\n\nDefault value: ";
79 $_ .= $vars{$var}->{"def"};