summaryrefslogtreecommitdiff
path: root/source4/build/pidl/Parse/Pidl/Samba
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-07-10 00:23:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:28 -0500
commitd0c347188246ae6d36e56457cb96c002f430da23 (patch)
treeec359f0e653410a8cfec85660484b7db4b044ab5 /source4/build/pidl/Parse/Pidl/Samba
parent2a08b290134eacc803389b20e604792a7e74eac4 (diff)
downloadsamba-d0c347188246ae6d36e56457cb96c002f430da23.tar.gz
samba-d0c347188246ae6d36e56457cb96c002f430da23.tar.bz2
samba-d0c347188246ae6d36e56457cb96c002f430da23.zip
r8270: Export some symbols, making the code more readable.
(This used to be commit d64bffa17ea1c46d917e362d51741148b85fb97f)
Diffstat (limited to 'source4/build/pidl/Parse/Pidl/Samba')
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/COM/Header.pm5
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/COM/Proxy.pm11
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/COM/Stub.pm3
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/EJS.pm13
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/EJSHeader.pm3
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/NDR/Header.pm19
-rw-r--r--source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm47
7 files changed, 54 insertions, 47 deletions
diff --git a/source4/build/pidl/Parse/Pidl/Samba/COM/Header.pm b/source4/build/pidl/Parse/Pidl/Samba/COM/Header.pm
index 4f5e0d68ad..7b6c4db212 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/COM/Header.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/COM/Header.pm
@@ -4,6 +4,7 @@
package Parse::Pidl::Samba::COM::Header;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
use strict;
@@ -109,7 +110,7 @@ sub ParseCoClass($)
my $c = shift;
my $res = "";
$res .= "#define CLSID_" . uc($c->{NAME}) . " $c->{PROPERTIES}->{uuid}\n";
- if (Parse::Pidl::Util::has_property($c, "progid")) {
+ if (has_property($c, "progid")) {
$res .= "#define PROGID_" . uc($c->{NAME}) . " $c->{PROPERTIES}->{progid}\n";
}
$res .= "\n";
@@ -123,7 +124,7 @@ sub Parse($)
foreach my $x (@{$idl})
{
- if ($x->{TYPE} eq "INTERFACE" && Parse::Pidl::Util::has_property($x, "object")) {
+ if ($x->{TYPE} eq "INTERFACE" && has_property($x, "object")) {
$res.=ParseInterface($x);
}
diff --git a/source4/build/pidl/Parse/Pidl/Samba/COM/Proxy.pm b/source4/build/pidl/Parse/Pidl/Samba/COM/Proxy.pm
index f4c23e1d9b..c94ef59ae9 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/COM/Proxy.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/COM/Proxy.pm
@@ -7,6 +7,7 @@
package Parse::Pidl::Samba::COM::Proxy;
use Parse::Pidl::Samba::COM::Header;
+use Parse::Pidl::Util qw(has_property);
use strict;
@@ -103,7 +104,7 @@ static $fn->{RETURN_TYPE} dcom_proxy_$interface->{NAME}_$name(struct $interface-
# Put arguments into r
foreach my $a (@{$fn->{ELEMENTS}}) {
- next unless (Parse::Pidl::Util::has_property($a, "in"));
+ next unless (has_property($a, "in"));
if (Parse::Pidl::Typelist::typeIs($a->{TYPE}, "INTERFACE")) {
$res .="\tNDR_CHECK(dcom_OBJREF_from_IUnknown(&r.in.$a->{NAME}.obj, $a->{NAME}));\n";
} else {
@@ -126,7 +127,7 @@ static $fn->{RETURN_TYPE} dcom_proxy_$interface->{NAME}_$name(struct $interface-
# Put r info back into arguments
foreach my $a (@{$fn->{ELEMENTS}}) {
- next unless (Parse::Pidl::Util::has_property($a, "out"));
+ next unless (has_property($a, "out"));
if (Parse::Pidl::Typelist::typeIs($a->{TYPE}, "INTERFACE")) {
$res .="\tNDR_CHECK(dcom_IUnknown_from_OBJREF(d->ctx, &$a->{NAME}, r.out.$a->{NAME}.obj));\n";
@@ -171,7 +172,7 @@ sub RegistrationFunction($$)
$res .="\tNTSTATUS status = NT_STATUS_OK;\n";
foreach my $interface (@{$idl}) {
next if $interface->{TYPE} ne "INTERFACE";
- next if not Parse::Pidl::Util::has_property($interface, "object");
+ next if not has_property($interface, "object");
my $data = $interface->{DATA};
my $count = 0;
@@ -199,8 +200,8 @@ sub Parse($)
foreach my $x (@{$pidl}) {
next if ($x->{TYPE} ne "INTERFACE");
- next if Parse::Pidl::Util::has_property($x, "local");
- next unless Parse::Pidl::Util::has_property($x, "object");
+ next if has_property($x, "local");
+ next unless has_property($x, "object");
$res .= ParseInterface($x);
}
diff --git a/source4/build/pidl/Parse/Pidl/Samba/COM/Stub.pm b/source4/build/pidl/Parse/Pidl/Samba/COM/Stub.pm
index a06671e76d..785c34fc77 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/COM/Stub.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/COM/Stub.pm
@@ -7,6 +7,7 @@
package Parse::Pidl::Samba::COM::Stub;
+use Parse::Pidl::Util qw(has_property);
use strict;
my($res);
@@ -290,7 +291,7 @@ sub ParseInterface($)
{
my($interface) = shift;
- return "" if Parse::Pidl::Util::has_property($interface, "local");
+ return "" if has_property($interface, "local");
my($data) = $interface->{DATA};
my $count = 0;
diff --git a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm
index ed35d2d237..26556b2820 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/EJS.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/EJS.pm
@@ -8,6 +8,7 @@ package Parse::Pidl::Samba::EJS;
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
my($res);
my %constants;
@@ -110,7 +111,7 @@ sub fn_prefix($)
{
my $fn = shift;
- return "" if (Parse::Pidl::Util::has_property($fn, "public"));
+ return "" if (has_property($fn, "public"));
return "static ";
}
@@ -120,7 +121,7 @@ sub EjsPullScalar($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- return if (Parse::Pidl::Util::has_property($e, "value"));
+ return if (has_property($e, "value"));
my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l);
$var = get_pointer_to($var);
@@ -203,7 +204,7 @@ sub EjsPullSwitch($$$$$)
sub EjsPullElement($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
EjsPullString($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
EjsPullArray($e, $l, $var, $name, $env);
@@ -327,7 +328,7 @@ sub EjsBitmapPull($$)
sub EjsTypedefPull($)
{
my $d = shift;
- return if (Parse::Pidl::Util::has_property($d, "noejs"));
+ return if (has_property($d, "noejs"));
if ($d->{DATA}->{TYPE} eq 'STRUCT') {
EjsStructPull($d->{NAME}, $d->{DATA});
} elsif ($d->{DATA}->{TYPE} eq 'UNION') {
@@ -444,7 +445,7 @@ sub EjsPushArray($$$$$)
sub EjsPushElement($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
EjsPushString($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
EjsPushArray($e, $l, $var, $name, $env);
@@ -587,7 +588,7 @@ sub EjsBitmapPush($$)
sub EjsTypedefPush($)
{
my $d = shift;
- return if (Parse::Pidl::Util::has_property($d, "noejs"));
+ return if (has_property($d, "noejs"));
if ($d->{DATA}->{TYPE} eq 'STRUCT') {
EjsStructPush($d->{NAME}, $d->{DATA});
} elsif ($d->{DATA}->{TYPE} eq 'UNION') {
diff --git a/source4/build/pidl/Parse/Pidl/Samba/EJSHeader.pm b/source4/build/pidl/Parse/Pidl/Samba/EJSHeader.pm
index e2472545ef..81c75705de 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/EJSHeader.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/EJSHeader.pm
@@ -7,6 +7,7 @@ package Parse::Pidl::Samba::EJSHeader;
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
my($res);
@@ -22,7 +23,7 @@ sub HeaderTypedefProto($)
my $d = shift;
my $name = $d->{NAME};
- return unless Parse::Pidl::Util::has_property($d, "public");
+ return unless has_property($d, "public");
my $type_decl = Parse::Pidl::Typelist::mapType($name);
diff --git a/source4/build/pidl/Parse/Pidl/Samba/NDR/Header.pm b/source4/build/pidl/Parse/Pidl/Samba/NDR/Header.pm
index d15e9bfbcb..09e4bb5050 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/NDR/Header.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/NDR/Header.pm
@@ -8,6 +8,7 @@ package Parse::Pidl::Samba::NDR::Header;
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
use Parse::Pidl::Samba::NDR::Parser;
my($res);
@@ -214,7 +215,7 @@ sub HeaderType($$$)
return;
}
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "const char";
} else {
pidl Parse::Pidl::Typelist::mapType($e->{TYPE});
@@ -238,23 +239,23 @@ sub HeaderTypedefProto($)
my $tf = Parse::Pidl::Samba::NDR::Parser::get_typefamily($d->{DATA}{TYPE});
- if (Parse::Pidl::Util::has_property($d, "gensize")) {
+ if (has_property($d, "gensize")) {
my $size_args = $tf->{SIZE_FN_ARGS}->($d);
pidl "size_t ndr_size_$d->{NAME}($size_args);\n";
}
- return unless Parse::Pidl::Util::has_property($d, "public");
+ return unless has_property($d, "public");
my $pull_args = $tf->{PULL_FN_ARGS}->($d);
my $push_args = $tf->{PUSH_FN_ARGS}->($d);
my $print_args = $tf->{PRINT_FN_ARGS}->($d);
- unless (Parse::Pidl::Util::has_property($d, "nopush")) {
+ unless (has_property($d, "nopush")) {
pidl "NTSTATUS ndr_push_$d->{NAME}($push_args);\n";
}
- unless (Parse::Pidl::Util::has_property($d, "nopull")) {
+ unless (has_property($d, "nopull")) {
pidl "NTSTATUS ndr_pull_$d->{NAME}($pull_args);\n";
}
- unless (Parse::Pidl::Util::has_property($d, "noprint")) {
+ unless (has_property($d, "noprint")) {
pidl "void ndr_print_$d->{NAME}($print_args);\n";
}
}
@@ -278,7 +279,7 @@ sub HeaderFunctionInOut($$)
my($fn,$prop) = @_;
foreach my $e (@{$fn->{ELEMENTS}}) {
- if (Parse::Pidl::Util::has_property($e, $prop)) {
+ if (has_property($e, $prop)) {
HeaderElement($e);
}
}
@@ -295,7 +296,7 @@ sub HeaderFunctionInOut_needed($$)
}
foreach my $e (@{$fn->{ELEMENTS}}) {
- if (Parse::Pidl::Util::has_property($e, $prop)) {
+ if (has_property($e, $prop)) {
return 1;
}
}
@@ -369,7 +370,7 @@ sub HeaderFnProto($$)
pidl "struct rpc_request *dcerpc_$name\_send(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r);\n";
}
- return unless Parse::Pidl::Util::has_property($fn, "public");
+ return unless has_property($fn, "public");
pidl "NTSTATUS ndr_push_$name(struct ndr_push *ndr, int flags, const struct $name *r);\n";
pidl "NTSTATUS ndr_pull_$name(struct ndr_pull *ndr, int flags, struct $name *r);\n";
diff --git a/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm b/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
index 21e1449067..421f854e3e 100644
--- a/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
+++ b/source4/build/pidl/Parse/Pidl/Samba/NDR/Parser.pm
@@ -9,6 +9,7 @@ package Parse::Pidl::Samba::NDR::Parser;
use strict;
use Parse::Pidl::Typelist;
+use Parse::Pidl::Util qw(has_property);
use Parse::Pidl::NDR;
# list of known types
@@ -130,7 +131,7 @@ sub fn_prefix($)
{
my $fn = shift;
- return "" if (Parse::Pidl::Util::has_property($fn, "public"));
+ return "" if (has_property($fn, "public"));
return "static ";
}
@@ -139,7 +140,7 @@ sub fn_prefix($)
sub start_flags($)
{
my $e = shift;
- my $flags = Parse::Pidl::Util::has_property($e, "flag");
+ my $flags = has_property($e, "flag");
if (defined $flags) {
pidl "{";
indent;
@@ -153,7 +154,7 @@ sub start_flags($)
sub end_flags($)
{
my $e = shift;
- my $flags = Parse::Pidl::Util::has_property($e, "flag");
+ my $flags = has_property($e, "flag");
if (defined $flags) {
pidl "ndr->flags = _flags_save_$e->{TYPE};";
deindent;
@@ -389,7 +390,7 @@ sub ParseObfuscationPushStart($$)
sub ParseObfuscationPushEnd($$)
{
my ($e,$ndr) = @_;
- my $obfuscation = Parse::Pidl::Util::has_property($e, "obfuscation");
+ my $obfuscation = has_property($e, "obfuscation");
pidl "NDR_CHECK(ndr_push_obfuscation($ndr, $obfuscation));";
}
@@ -397,7 +398,7 @@ sub ParseObfuscationPushEnd($$)
sub ParseObfuscationPullStart($$)
{
my ($e,$ndr) = @_;
- my $obfuscation = Parse::Pidl::Util::has_property($e, "obfuscation");
+ my $obfuscation = has_property($e, "obfuscation");
pidl "NDR_CHECK(ndr_pull_obfuscation($ndr, $obfuscation));";
@@ -528,7 +529,7 @@ sub ParseElementPushLevel
my $nl = Parse::Pidl::NDR::GetNextLevel($e, $l);
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "NDR_CHECK(ndr_push_charset($ndr, $ndr_flags, $var_name, $length, sizeof(" . Parse::Pidl::Typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
@@ -602,7 +603,7 @@ sub ParseElementPush($$$$$$)
start_flags($e);
- if (my $value = Parse::Pidl::Util::has_property($e, "value")) {
+ if (my $value = has_property($e, "value")) {
$var_name = Parse::Pidl::Util::ParseExpr($value, $env);
}
@@ -641,9 +642,9 @@ sub ParseElementPrint($$$)
my($e,$var_name,$env) = @_;
$var_name = append_prefix($e, $var_name);
- return if (Parse::Pidl::Util::has_property($e, "noprint"));
+ return if (has_property($e, "noprint"));
- if (my $value = Parse::Pidl::Util::has_property($e, "value")) {
+ if (my $value = has_property($e, "value")) {
$var_name = "(ndr->flags & LIBNDR_PRINT_SET_VALUES)?" . Parse::Pidl::Util::ParseExpr($value,$env) . ":$var_name";
}
@@ -670,7 +671,7 @@ sub ParseElementPrint($$$)
}
if (is_scalar_array($e, $l)) {
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "ndr_print_string(ndr, \"$e->{NAME}\", $var_name);";
} else {
my $nl = Parse::Pidl::NDR::GetNextLevel($e, $l);
@@ -761,7 +762,7 @@ sub ParseDataPull($$$$$)
pidl "NDR_CHECK(ndr_pull_$l->{DATA_TYPE}($ndr, $ndr_flags, $var_name));";
- if (my $range = Parse::Pidl::Util::has_property($e, "range")) {
+ if (my $range = has_property($e, "range")) {
$var_name = get_value_of($var_name);
my ($low, $high) = split(/ /, $range, 2);
pidl "if ($var_name < $low || $var_name > $high) {";
@@ -830,7 +831,7 @@ sub ParseElementPullLevel
}
my $nl = Parse::Pidl::NDR::GetNextLevel($e, $l);
- if (Parse::Pidl::Util::has_property($e, "charset")) {
+ if (has_property($e, "charset")) {
pidl "NDR_CHECK(ndr_pull_charset($ndr, $ndr_flags, ".get_pointer_to($var_name).", $length, sizeof(" . Parse::Pidl::Typelist::mapType($nl->{DATA_TYPE}) . "), CH_$e->{PROPERTIES}->{charset}));";
} else {
pidl "NDR_CHECK(ndr_pull_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));";
@@ -1356,7 +1357,7 @@ sub ParseStructNdrSize($)
my $t = shift;
my $sizevar;
- if (my $flags = Parse::Pidl::Util::has_property($t, "flag")) {
+ if (my $flags = has_property($t, "flag")) {
pidl "flags |= $flags;";
}
pidl "return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_$t->{NAME});";
@@ -1404,7 +1405,7 @@ sub ParseUnionNdrSize($)
my $t = shift;
my $sizevar;
- if (my $flags = Parse::Pidl::Util::has_property($t, "flag")) {
+ if (my $flags = has_property($t, "flag")) {
pidl "flags |= $flags;";
}
@@ -1748,7 +1749,7 @@ sub ParseFunctionPrint($)
{
my($fn) = shift;
- return if Parse::Pidl::Util::has_property($fn, "noprint");
+ return if has_property($fn, "noprint");
pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, const struct $fn->{NAME} *r)";
pidl "{";
@@ -1811,7 +1812,7 @@ sub ParseFunctionPush($)
{
my($fn) = shift;
- return if Parse::Pidl::Util::has_property($fn, "nopush");
+ return if has_property($fn, "nopush");
pidl fn_prefix($fn) . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, const struct $fn->{NAME} *r)";
pidl "{";
@@ -1861,7 +1862,7 @@ sub AllocateArrayLevel($$$$$)
{
my ($e,$l,$ndr,$env,$size) = @_;
- return if (Parse::Pidl::Util::has_property($e, "charset"));
+ return if (has_property($e, "charset"));
my $var = Parse::Pidl::Util::ParseExpr($e->{NAME}, $env);
@@ -1890,7 +1891,7 @@ sub ParseFunctionPull($)
{
my($fn) = shift;
- return if Parse::Pidl::Util::has_property($fn, "nopull");
+ return if has_property($fn, "nopull");
# pull function args
pidl fn_prefix($fn) . "NTSTATUS ndr_pull_$fn->{NAME}(struct ndr_pull *ndr, int flags, struct $fn->{NAME} *r)";
@@ -2185,14 +2186,14 @@ sub NeededFunction($$)
sub NeededTypedef($$)
{
my ($t,$needed) = @_;
- if (Parse::Pidl::Util::has_property($t, "public")) {
- $needed->{"pull_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "nopull");
- $needed->{"push_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "nopush");
- $needed->{"print_$t->{NAME}"} = not Parse::Pidl::Util::has_property($t, "noprint");
+ if (has_property($t, "public")) {
+ $needed->{"pull_$t->{NAME}"} = not has_property($t, "nopull");
+ $needed->{"push_$t->{NAME}"} = not has_property($t, "nopush");
+ $needed->{"print_$t->{NAME}"} = not has_property($t, "noprint");
}
if ($t->{DATA}->{TYPE} eq "STRUCT" or $t->{DATA}->{TYPE} eq "UNION") {
- if (Parse::Pidl::Util::has_property($t, "gensize")) {
+ if (has_property($t, "gensize")) {
$needed->{"ndr_size_$t->{NAME}"} = 1;
}