summaryrefslogtreecommitdiff
path: root/source4/build/pidl/util.pm
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-02-22 01:49:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:51 -0500
commit2787b5af416787ba0fcda02c1dbe7610b1f1623b (patch)
tree2a9b05ee92af34c1f135d638dfd695b158bd81cc /source4/build/pidl/util.pm
parenta2223ef458eb6edc75a1c268d9781c1cc4c26ac1 (diff)
downloadsamba-2787b5af416787ba0fcda02c1dbe7610b1f1623b.tar.gz
samba-2787b5af416787ba0fcda02c1dbe7610b1f1623b.tar.bz2
samba-2787b5af416787ba0fcda02c1dbe7610b1f1623b.zip
r5494: Some more code simplification, some additional comments.
(This used to be commit e601f51b82e99a999f0a9c62b487d56c715a3502)
Diffstat (limited to 'source4/build/pidl/util.pm')
-rw-r--r--source4/build/pidl/util.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/build/pidl/util.pm b/source4/build/pidl/util.pm
index a662ed005e..f216f75572 100644
--- a/source4/build/pidl/util.pm
+++ b/source4/build/pidl/util.pm
@@ -246,4 +246,23 @@ sub make_str($)
return "\"" . $str . "\"";
}
+###################################
+# find a sibling var in a structure
+sub find_sibling($$)
+{
+ my($e) = shift;
+ my($name) = shift;
+ my($fn) = $e->{PARENT};
+
+ if ($name =~ /\*(.*)/) {
+ $name = $1;
+ }
+
+ for my $e2 (@{$fn->{ELEMENTS}}) {
+ return $e2 if ($e2->{NAME} eq $name);
+ }
+
+ die "invalid sibling '$name'";
+}
+
1;