mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
pidl/Typelist: add is_fixed_size_scalar()
metze
This commit is contained in:
parent
6ef40f3199
commit
6e4e3f57e4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user