Commit 4d9f6c2e authored by Franksen, Benjamin's avatar Franksen, Benjamin
Browse files

make dbdExpand.pl print everything sorted

parent a451d972
......@@ -39,7 +39,8 @@ sub OutputDB {
sub OutputMenus {
my ($out, $menus) = @_;
while (my ($name, $menu) = each %{$menus}) {
foreach my $name (sort(keys(%{$menus}))) {
my $menu = $menus->{$name};
printf $out "menu(%s) {\n", $name;
printf $out " choice(%s, \"%s\")\n", @{$_}
foreach $menu->choices;
......@@ -49,14 +50,16 @@ sub OutputMenus {
sub OutputRecordtypes {
my ($out, $recordtypes) = @_;
while (my ($name, $recordtype) = each %{$recordtypes}) {
foreach my $name (sort(keys(%{$recordtypes}))) {
my $recordtype = $recordtypes->{$name};
printf $out "recordtype(%s) {\n", $name;
print $out " %$_\n"
foreach $recordtype->cdefs;
foreach my $field ($recordtype->fields) {
printf $out " field(%s, %s) {\n",
$field->name, $field->dbf_type;
while (my ($attr, $val) = each %{$field->attributes}) {
foreach my $attr (sort(keys(%{$field->attributes}))) {
my $val = $field->attributes->{$attr};
$val = "\"$val\""
if $val !~ m/^$RXname$/x
|| $attr eq 'prompt'
......@@ -75,31 +78,33 @@ sub OutputRecordtypes {
sub OutputDrivers {
my ($out, $drivers) = @_;
printf $out "driver(%s)\n", $_
foreach keys %{$drivers};
foreach sort(keys(%{$drivers}));
}
sub OutputRegistrars {
my ($out, $registrars) = @_;
printf $out "registrar(%s)\n", $_
foreach keys %{$registrars};
foreach sort(keys(%{$registrars}));
}
sub OutputFunctions {
my ($out, $functions) = @_;
printf $out "function(%s)\n", $_
foreach keys %{$functions};
foreach sort(keys(%{$functions}));
}
sub OutputVariables {
my ($out, $variables) = @_;
while (my ($name, $variable) = each %{$variables}) {
foreach my $name (sort(keys(%{$variables}))) {
my $variable = $variables->{$name};
printf $out "variable(%s, %s)\n", $name, $variable->var_type;
}
}
sub OutputBreaktables {
my ($out, $breaktables) = @_;
while (my ($name, $breaktable) = each %{$breaktables}) {
foreach my $name (sort(keys(%{$breaktables}))) {
my $breaktable = $breaktables->{$name};
printf $out "breaktable(\"%s\") {\n", $name;
printf $out " %s, %s\n", @{$_}
foreach $breaktable->points;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment