summaryrefslogtreecommitdiff
path: root/source4/build/pidl/eparser.pm
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-01-25 23:14:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:12 -0500
commit1107607295ab68c7759c3c36a0c7674ee893a596 (patch)
treedf69593ee648f04820fd4a95c3716697bd43efe9 /source4/build/pidl/eparser.pm
parenta847628e58dd0aa5a1d3be98c8433f52ec40569b (diff)
downloadsamba-1107607295ab68c7759c3c36a0c7674ee893a596.tar.gz
samba-1107607295ab68c7759c3c36a0c7674ee893a596.tar.bz2
samba-1107607295ab68c7759c3c36a0c7674ee893a596.zip
r4993: Generate nicer name for enum hf.
Start work on supporting bitmaps. (This used to be commit 6f418f14267291bf8637e5dcd7e8ceca4e430314)
Diffstat (limited to 'source4/build/pidl/eparser.pm')
-rw-r--r--source4/build/pidl/eparser.pm17
1 files changed, 15 insertions, 2 deletions
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index e437e099d9..b334a5c467 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -288,12 +288,24 @@ sub NeededTypedef($)
if ($t->{DATA}->{TYPE} eq "ENUM") {
$needed{"hf_$t->{NAME}"} = {
- 'name' => $t->{NAME},
+ 'name' => field2name($t->{NAME}),
'ft' => 'FT_UINT16',
'base' => 'BASE_DEC',
'strings' => "VALS($t->{NAME}_vals)"
};
}
+
+ if ($t->{DATA}->{TYPE} eq "BITMAP") {
+ foreach my $e (@{$t->{DATA}{ELEMENTS}}) {
+ $e =~ /^(.*?) \( (.*?) \)$/;
+ $needed{"hf_$t->{NAME}_$1"} = {
+ 'name' => "$t->{NAME} $1",
+ 'ft' => "FT_BOOLEAN",
+ 'base' => "32",
+ 'bitmask' => "$2"
+ };
+ }
+ }
}
#####################################################################
@@ -766,7 +778,8 @@ sub RewriteC($$$)
next, if !($x =~ /^hf_/);
pidl "\t{ &$x,\n";
$needed{$x}{strings} = "NULL", if !defined($needed{$x}{strings});
- pidl "\t { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, $needed{$x}{base}, $needed{$x}{strings}, 0, \"$x\", HFILL }},\n";
+ $needed{$x}{bitmask} = "0", if !defined($needed{$x}{bitmask});
+ pidl "\t { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, $needed{$x}{base}, $needed{$x}{strings}, $needed{$x}{bitmask}, \"$x\", HFILL }},\n";
}
pidl "\t};\n\n";