summaryrefslogtreecommitdiff
path: root/source4/build/pidl/util.pm
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-06 12:29:23 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-06 12:29:23 +0000
commitfa3db33a5441ed31f9d8c19dc6984d160b86e4da (patch)
tree12fd394ae4baad3eeded82953c39959a3521f362 /source4/build/pidl/util.pm
parent60f4bb657a5bbec766e170cb0755b1f36a33c8bc (diff)
downloadsamba-fa3db33a5441ed31f9d8c19dc6984d160b86e4da.tar.gz
samba-fa3db33a5441ed31f9d8c19dc6984d160b86e4da.tar.bz2
samba-fa3db33a5441ed31f9d8c19dc6984d160b86e4da.zip
updated pidl to auto-generate the ndr_push_*() functions for the
Samba4 rpc framework not complete, but sufficient for a number of lsa functions (This used to be commit 42cd6904f51bac1ff92f0aea0deffb11864dfac2)
Diffstat (limited to 'source4/build/pidl/util.pm')
-rw-r--r--source4/build/pidl/util.pm60
1 files changed, 59 insertions, 1 deletions
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm
index f0e3c2a2f8..53e391eb42 100644
--- a/source4/build/pidl/util.pm
+++ b/source4/build/pidl/util.pm
@@ -6,6 +6,25 @@ package util;
use Data::Dumper;
+sub dumpit($)
+{
+ my $a = shift;
+ return Dumper $a;
+}
+
+#####################################################################
+# flatten an array of arrays into a single array
+sub FlattenArray2($)
+{
+ my $a = shift;
+ my @b;
+ for my $d (@{$a}) {
+ for my $d1 (@{$d}) {
+ push(@b, $d1);
+ }
+ }
+ return \@b;
+}
#####################################################################
# flatten an array of arrays into a single array
@@ -75,7 +94,7 @@ sub FileLoad($)
{
my($filename) = shift;
local(*INPUTFILE);
- open(INPUTFILE, $filename) || die "can't open $filename";
+ open(INPUTFILE, $filename) || die "can't load $filename";
my($saved_delim) = $/;
undef $/;
my($data) = <INPUTFILE>;
@@ -124,5 +143,44 @@ sub LoadStructure($)
return eval FileLoad(shift);
}
+#####################################################################
+# see if a pidl property list contains a give property
+sub has_property($$)
+{
+ my($props) = shift;
+ my($p) = shift;
+
+ foreach my $d (@{$props}) {
+ if (ref($d) ne "HASH") {
+ return 1, if ($d eq $p);
+ return 1, if ($d eq "in,out" && ($p eq "in" || $p eq "out"));
+ } else {
+ foreach my $k (keys %{$d}) {
+ return $d->{$k}, if ($k eq $p);
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+sub is_scalar_type($)
+{
+ my($type) = shift;
+
+ return 1, if ($type eq "uint32");
+ return 1, if ($type eq "long");
+ return 1, if ($type eq "short");
+ return 1, if ($type eq "char");
+ return 1, if ($type eq "uint8");
+ return 1, if ($type eq "uint16");
+ return 1, if ($type eq "hyper");
+ return 1, if ($type eq "wchar_t");
+
+ return 0;
+}
+
1;
+