summaryrefslogtreecommitdiffstats
path: root/pidl/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-03-08 15:45:33 +0100
committerStefan Metzmacher <metze@samba.org>2011-03-10 14:31:14 +0100
commit6e4e3f57e43189fa2944c841982621594d167d2d (patch)
treeeb6fd7e00b1f6e34b639d9e9ae205aea3456d6ab /pidl/lib
parent6ef40f31992455c7603f0722846cfab4fe4fa0bc (diff)
downloadsamba-6e4e3f57e43189fa2944c841982621594d167d2d.tar.gz
samba-6e4e3f57e43189fa2944c841982621594d167d2d.tar.xz
samba-6e4e3f57e43189fa2944c841982621594d167d2d.zip
pidl/Typelist: add is_fixed_size_scalar()
metze
Diffstat (limited to 'pidl/lib')
-rw-r--r--pidl/lib/Parse/Pidl/Typelist.pm18
1 files changed, 16 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Typelist.pm b/pidl/lib/Parse/Pidl/Typelist.pm
index ccc48578dfd..bf78717b12b 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;