summaryrefslogtreecommitdiff
path: root/source4/build/pidl/util.pm
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-05 16:31:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:19 -0500
commitecd9557922ec676214c72be93684eb7d54ec5773 (patch)
tree47d5f90940ccd55e87287d4bcc79d1a24bbe25d6 /source4/build/pidl/util.pm
parent4a49604e6c84597f97d98dd884f053edd6a84da3 (diff)
downloadsamba-ecd9557922ec676214c72be93684eb7d54ec5773.tar.gz
samba-ecd9557922ec676214c72be93684eb7d54ec5773.tar.bz2
samba-ecd9557922ec676214c72be93684eb7d54ec5773.zip
r4540: sync enum and bitmap code
metze (This used to be commit 2f3aea72ee7d9d90f7b910d11bdd1e96f9f0ebe1)
Diffstat (limited to 'source4/build/pidl/util.pm')
-rw-r--r--source4/build/pidl/util.pm24
1 files changed, 18 insertions, 6 deletions
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm
index 1b00bdea1b..e3ec3d6138 100644
--- a/source4/build/pidl/util.pm
+++ b/source4/build/pidl/util.pm
@@ -202,10 +202,11 @@ sub property_matches($$$)
my %enum_list;
-sub register_enum($)
+sub register_enum($$)
{
+ my $enum = shift;
my $name = shift;
- $enum_list{$name} = 1;
+ $enum_list{$name} = $enum;
}
sub is_enum($)
@@ -214,16 +215,27 @@ sub is_enum($)
return defined $enum_list{$name}
}
+sub get_enum($)
+{
+ my $name = shift;
+ return $enum_list{$name};
+}
+
sub enum_type_decl($)
{
- my $e = shift;
- return "enum $e->{TYPE}";
+ my $enum = shift;
+ return "enum $enum->{TYPE}";
}
sub enum_type_fn($)
{
- my $e = shift;
- return "$e->{TYPE}";
+ my $enum = shift;
+ if (util::has_property($enum->{PARENT}, "enum8bit")) {
+ return "uint8";
+ } elsif (util::has_property($enum->{PARENT}, "v1_enum")) {
+ return "uint32";
+ }
+ return "uint16";
}
my %bitmap_list;