diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-03-08 15:45:33 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-03-10 14:31:14 +0100 |
commit | 6e4e3f57e43189fa2944c841982621594d167d2d (patch) | |
tree | eb6fd7e00b1f6e34b639d9e9ae205aea3456d6ab /pidl/lib/Parse/Pidl | |
parent | 6ef40f31992455c7603f0722846cfab4fe4fa0bc (diff) | |
download | samba-6e4e3f57e43189fa2944c841982621594d167d2d.tar.gz samba-6e4e3f57e43189fa2944c841982621594d167d2d.tar.bz2 samba-6e4e3f57e43189fa2944c841982621594d167d2d.zip |
pidl/Typelist: add is_fixed_size_scalar()
metze
Diffstat (limited to 'pidl/lib/Parse/Pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Typelist.pm | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm index ccc48578df..bf78717b12 100644 --- a/pidl/lib/Parse/Pidl/Typelist.pm +++ b/pidl/lib/Parse/Pidl/Typelist.pm @@ -8,8 +8,8 @@ package Parse::Pidl::Typelist; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(hasType getType resolveType mapTypeName scalar_is_reference expandAlias - mapScalarType addType typeIs is_signed is_scalar enum_type_fn - bitmap_type_fn mapType typeHasBody + mapScalarType addType typeIs is_signed is_scalar enum_type_fn + bitmap_type_fn mapType typeHasBody is_fixed_size_scalar ); use vars qw($VERSION); $VERSION = '0.01'; @@ -25,6 +25,11 @@ my @reference_scalars = ( "ipv4address", "ipv6address" ); +my @non_fixed_size_scalars = ( + "string", "string_array", "nbt_string", "dns_string", + "wrepl_nbt_name", "dnsp_name", "dnsp_string" +); + # a list of known scalar types my %scalars = ( "void" => "void", @@ -191,6 +196,15 @@ sub is_scalar($) return 0; } +sub is_fixed_size_scalar($) +{ + my $name = shift; + + return 0 unless is_scalar($name); + return 0 if (grep(/^$name$/, @non_fixed_size_scalars)); + return 1; +} + sub scalar_is_reference($) { my $name = shift; |