$length = $size;
}
- if ($e == $e->{PARENT}->{ELEMENTS}[-1]
+ if ($e == $e->{PARENT}->{ELEMENTS}[-1]
and $e->{PARENT}->{TYPE} ne "FUNCTION") {
$is_surrounding = 1;
}
$pt = $pointer_default;
}
- push (@$order, {
+ push (@$order, {
TYPE => "POINTER",
POINTER_TYPE => $pt,
POINTER_INDEX => $pointer_idx,
LEVEL => $level
});
- warning($e, "top-level \[out\] pointer `$e->{NAME}' is not a \[ref\] pointer")
+ warning($e, "top-level \[out\] pointer `$e->{NAME}' is not a \[ref\] pointer")
if ($i == 1 and $pt ne "ref" and
- $e->{PARENT}->{TYPE} eq "FUNCTION" and
+ $e->{PARENT}->{TYPE} eq "FUNCTION" and
not has_property($e, "in"));
$pointer_idx++;
-
+
# everything that follows will be deferred
$is_deferred = 1 if ($level ne "TOP");
$array_length = $array_size;
$is_varying =0;
}
- }
-
- if (scalar(@size_is) == 0 and has_property($e, "string") and
+ }
+
+ if (scalar(@size_is) == 0 and has_property($e, "string") and
$i == $e->{POINTERS}) {
$is_string = 1;
$is_varying = $is_conformant = has_property($e, "noheader")?0:1;
});
$is_deferred = 0;
- }
+ }
}
if ($is_pipe) {
if (defined(has_property($e, "subcontext"))) {
my $hdr_size = has_property($e, "subcontext");
my $subsize = has_property($e, "subcontext_size");
- if (not defined($subsize)) {
- $subsize = -1;
+ if (not defined($subsize)) {
+ $subsize = -1;
}
-
+
push (@$order, {
TYPE => "SUBCONTEXT",
HEADER_SIZE => $hdr_size,
if (my $switch = has_property($e, "switch_is")) {
push (@$order, {
- TYPE => "SWITCH",
+ TYPE => "SWITCH",
SWITCH_IS => $switch,
IS_DEFERRED => $is_deferred
});
}
#####################################################################
-# see if a type contains any deferred data
+# see if a type contains any deferred data
sub can_contain_deferred
{
sub can_contain_deferred;
my $e = shift;
return undef unless $e->{POINTERS};
-
+
return "ref" if (has_property($e, "ref"));
return "full" if (has_property($e, "ptr"));
return "sptr" if (has_property($e, "sptr"));
# the NDR layer translates this into
# an alignment of 4 for NDR and 8 for NDR64
$a = 5;
- } elsif (has_property($e, "subcontext")) {
+ } elsif (has_property($e, "subcontext")) {
$a = 1;
} elsif (has_property($e, "transmit_as")) {
$a = align_type($e->{PROPERTIES}->{transmit_as},
return 0 if ($e eq "EMPTY");
unless (hasType($e)) {
- # it must be an external type - all we can do is guess
+ # it must be an external type - all we can do is guess
# warning($e, "assuming alignment of unknown type '$e' is 4");
return 4;
}
CheckPointerTypes($struct, $pointer_default);
- foreach my $x (@{$struct->{ELEMENTS}})
+ foreach my $x (@{$struct->{ELEMENTS}})
{
my $e = ParseElement($x, $pointer_default, $ms_union);
- if ($x != $struct->{ELEMENTS}[-1] and
+ if ($x != $struct->{ELEMENTS}[-1] and
$e->{LEVELS}[0]->{IS_SURROUNDING}) {
fatal($x, "conformant member not at end of struct");
}
if ($struct->{NAME}) {
$align = align_type($struct->{NAME});
}
-
+
return {
TYPE => "STRUCT",
NAME => $struct->{NAME},
CheckPointerTypes($e, $pointer_default);
- foreach my $x (@{$e->{ELEMENTS}})
+ foreach my $x (@{$e->{ELEMENTS}})
{
my $t;
if ($x->{TYPE} eq "EMPTY") {
if ($d->{RETURN_TYPE} ne "void") {
$rettype = expandAlias($d->{RETURN_TYPE});
}
-
+
return {
NAME => $d->{NAME},
TYPE => "FUNCTION",
$version = "0.0";
- if(defined $idl->{PROPERTIES}->{version}) {
+ if(defined $idl->{PROPERTIES}->{version}) {
my @if_version = split(/\./, $idl->{PROPERTIES}->{version});
if ($if_version[0] == $idl->{PROPERTIES}->{version}) {
$version = $idl->{PROPERTIES}->{version};
@endpoints = split /,/, $idl->{PROPERTIES}->{endpoint};
}
- return {
+ return {
NAME => $idl->{NAME},
UUID => lc(has_property($idl, "uuid") // ''),
VERSION => $version,
return undef unless (defined($idl));
Parse::Pidl::NDR::Validate($idl);
-
+
my @ndr = ();
foreach (@{$idl}) {
while ($l = GetNextLevel($e,$l))
{
- return 1 if ($l->{IS_DEFERRED});
+ return 1 if ($l->{IS_DEFERRED});
return 1 if ($l->{CONTAINS_DEFERRED});
- }
-
+ }
+
return 0;
}
has_property($e, "relative") or
has_property($e, "relative_short") or
has_property($e, "ref"))) {
- fatal($e, el_name($e) . " : pointer properties on non-pointer element\n");
+ fatal($e, el_name($e) . " : pointer properties on non-pointer element\n");
}
}
ValidProperties($union,"UNION");
- if (has_property($union->{PARENT}, "nodiscriminant") and
+ if (has_property($union->{PARENT}, "nodiscriminant") and
has_property($union->{PARENT}, "switch_type")) {
fatal($union->{PARENT}, $union->{PARENT}->{NAME} . ": switch_type(" . $union->{PARENT}->{PROPERTIES}->{switch_type} . ") on union without discriminant");
}
foreach my $e (@{$union->{ELEMENTS}}) {
$e->{PARENT} = $union;
- if (defined($e->{PROPERTIES}->{default}) and
+ if (defined($e->{PROPERTIES}->{default}) and
defined($e->{PROPERTIES}->{case})) {
fatal($e, "Union member $e->{NAME} can not have both default and case properties!");
}
-
- unless (defined ($e->{PROPERTIES}->{default}) or
+
+ unless (defined ($e->{PROPERTIES}->{default}) or
defined ($e->{PROPERTIES}->{case})) {
fatal($e, "Union member $e->{NAME} must have default or case property");
}
{
my ($t) = @_;
- {
+ {
TYPEDEF => \&ValidTypedef,
STRUCT => \&ValidStruct,
UNION => \&ValidUnion,
ValidProperties($interface,"INTERFACE");
if (has_property($interface, "pointer_default")) {
- if (not grep (/$interface->{PROPERTIES}->{pointer_default}/,
+ if (not grep (/$interface->{PROPERTIES}->{pointer_default}/,
("ref", "unique", "ptr"))) {
fatal($interface, "Unknown default pointer type `$interface->{PROPERTIES}->{pointer_default}'");
}
}
if (has_property($interface, "object")) {
- if (has_property($interface, "version") &&
+ if (has_property($interface, "version") &&
$interface->{PROPERTIES}->{version} != 0) {
fatal($interface, "Object interfaces must have version 0.0 ($interface->{NAME})");
}
- if (!defined($interface->{BASE}) &&
+ if (!defined($interface->{BASE}) &&
not ($interface->{NAME} eq "IUnknown")) {
fatal($interface, "Object interfaces must all derive from IUnknown ($interface->{NAME})");
}
}
-
+
foreach my $d (@{$data}) {
($d->{TYPE} eq "FUNCTION") && ValidFunction($d);
- ($d->{TYPE} eq "TYPEDEF" or
+ ($d->{TYPE} eq "TYPEDEF" or
$d->{TYPE} eq "STRUCT" or
- $d->{TYPE} eq "UNION" or
+ $d->{TYPE} eq "UNION" or
$d->{TYPE} eq "ENUM" or
$d->{TYPE} eq "BITMAP" or
$d->{TYPE} eq "PIPE") && ValidType($d);
my($idl) = shift;
foreach my $x (@{$idl}) {
- ($x->{TYPE} eq "INTERFACE") &&
+ ($x->{TYPE} eq "INTERFACE") &&
ValidInterface($x);
($x->{TYPE} eq "IMPORTLIB") &&
fatal($x, "importlib() not supported");
$pointers++;
} elsif ($l->{TYPE} eq "ARRAY") {
$arrays++;
- if (($pointers == 0) and
+ if (($pointers == 0) and
(not $l->{IS_FIXED}) and
(not $l->{IS_INLINE})) {
return get_value_of($var_name);
}
}
}
-
+
return $var_name;
}
}
####################################
-# defer() is like pidl(), but adds to
-# a deferred buffer which is then added to the
+# defer() is like pidl(), but adds to
+# a deferred buffer which is then added to the
# output buffer at the end of the structure/union/function
# This is needed to cope with code that must be pushed back
# to the end of a block of elements
last;
}
}
-
+
return($origvar) unless (defined($var));
my $e;
foreach (@{$element->{PARENT}->{ELEMENTS}}) {
warning($element->{ORIGINAL}, "Got pointer for `$e->{NAME}', expected fully dereferenced variable") if ($nump > length($ptr));
return ($origvar);
}
-}
+}
sub check_null_pointer($$$$)
{
last;
}
}
-
+
if (defined($var)) {
my $e;
# lookup ptr in $e
# See if pointer at pointer level $level
# needs to be checked.
foreach my $l (@{$e->{LEVELS}}) {
- if ($l->{TYPE} eq "POINTER" and
+ if ($l->{TYPE} eq "POINTER" and
$l->{POINTER_INDEX} == length($ptr)) {
# No need to check ref pointers
$check = ($l->{POINTER_TYPE} ne "ref");
warning($element, "unknown dereferenced expression `$expandedvar'");
$check = 1;
}
-
+
$print_fn->("if ($ptr$expandedvar == NULL) $return") if $check;
}
}
if ($l->{IS_VARYING} and (defined($l->{LENGTH_IS}) or not $l->{IS_ZERO_TERMINATED})) {
$self->defer("if ($var_name) {");
$self->defer_indent;
- my $length = ParseExprExt($l->{LENGTH_IS}, $env, $e->{ORIGINAL},
+ my $length = ParseExprExt($l->{LENGTH_IS}, $env, $e->{ORIGINAL},
check_null_pointer($e, $env, sub { $self->defer(shift); },
"return ndr_pull_error($ndr, NDR_ERR_INVALID_POINTER, \"NULL Pointer for length_is()\");"),
check_fully_dereferenced($e, $env));
} elsif ($l->{TYPE} eq "POINTER") {
$self->ParsePtrPush($e, $l, $ndr, $var_name);
} elsif ($l->{TYPE} eq "ARRAY") {
- my $length = $self->ParseArrayPushHeader($e, $l, $ndr, $var_name, $env);
+ my $length = $self->ParseArrayPushHeader($e, $l, $ndr, $var_name, $env);
my $nl = GetNextLevel($e, $l);
} elsif (has_fast_array($e,$l)) {
$self->pidl("NDR_CHECK(ndr_push_array_$nl->{DATA_TYPE}($ndr, $ndr_flags, $var_name, $length));");
return;
- }
+ }
} elsif ($l->{TYPE} eq "DATA") {
$self->ParseDataPush($e, $l, $ndr, $var_name, $primitives, $deferred);
} elsif ($l->{TYPE} eq "TYPEDEF") {
my $length;
if ($l->{IS_CONFORMANT} or $l->{IS_VARYING}) {
- $var_name = get_pointer_to($var_name);
+ $var_name = get_pointer_to($var_name);
}
-
+
if ($l->{IS_ZERO_TERMINATED} and not defined($l->{LENGTH_IS})) {
$length = "ndr_string_length($var_name, sizeof(*$var_name))";
} else {
- $length = ParseExprExt($l->{LENGTH_IS}, $env, $e->{ORIGINAL},
+ $length = ParseExprExt($l->{LENGTH_IS}, $env, $e->{ORIGINAL},
check_null_pointer($e, $env, sub { $self->pidl(shift); }, "return;"), check_fully_dereferenced($e, $env));
}
} elsif ($l->{TYPE} eq "DATA") {
$self->ParseDataPrint($e, $l, $ndr, $var_name);
} elsif ($l->{TYPE} eq "SWITCH") {
- my $switch_var = ParseExprExt($l->{SWITCH_IS}, $env, $e->{ORIGINAL},
+ my $switch_var = ParseExprExt($l->{SWITCH_IS}, $env, $e->{ORIGINAL},
check_null_pointer($e, $env, sub { $self->pidl(shift); }, "return;"), check_fully_dereferenced($e, $env));
$self->pidl("ndr_print_set_switch_value($ndr, " . get_pointer_to($var_name) . ", $switch_var);");
- }
+ }
}
foreach my $l (reverse @{$e->{LEVELS}}) {
sub ParseSwitchPull($$$$$$)
{
my($self,$e,$l,$ndr,$var_name,$env) = @_;
- my $switch_var = ParseExprExt($l->{SWITCH_IS}, $env, $e->{ORIGINAL},
+ my $switch_var = ParseExprExt($l->{SWITCH_IS}, $env, $e->{ORIGINAL},
check_null_pointer($e, $env, sub { $self->pidl(shift); },
"return ndr_pull_error($ndr, NDR_ERR_INVALID_POINTER, \"NULL Pointer for switch_is()\");"),
check_fully_dereferenced($e, $env));
sub ParseSwitchPush($$$$$$)
{
my($self,$e,$l,$ndr,$var_name,$env) = @_;
- my $switch_var = ParseExprExt($l->{SWITCH_IS}, $env, $e->{ORIGINAL},
+ my $switch_var = ParseExprExt($l->{SWITCH_IS}, $env, $e->{ORIGINAL},
check_null_pointer($e, $env, sub { $self->pidl(shift); },
"return ndr_push_error($ndr, NDR_ERR_INVALID_POINTER, \"NULL Pointer for switch_is()\");"),
check_fully_dereferenced($e, $env));
my $scalars = 0;
my $buffers = 0;
- # Add NDR_SCALARS if this one is deferred
+ # Add NDR_SCALARS if this one is deferred
# and deferreds may be pushed
$scalars = 1 if ($l->{IS_DEFERRED} and $deferred);
- # Add NDR_SCALARS if this one is not deferred and
+ # Add NDR_SCALARS if this one is not deferred and
# primitives may be pushed
$scalars = 1 if (!$l->{IS_DEFERRED} and $primitives);
-
+
# Add NDR_BUFFERS if this one contains deferred stuff
# and deferreds may be pushed
$buffers = 1 if ($l->{CONTAINS_DEFERRED} and $deferred);
$self->deindent;
$self->pidl("}");
}
- } elsif ($l->{TYPE} eq "ARRAY" and
+ } elsif ($l->{TYPE} eq "ARRAY" and
not has_fast_array($e,$l) and not is_charset_array($e, $l)) {
my $length = $array_length;
my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}";
my $nl = GetNextLevel($e, $l);
my $next_is_array = ($nl->{TYPE} eq "ARRAY");
- my $next_is_string = (($nl->{TYPE} eq "DATA") and
+ my $next_is_string = (($nl->{TYPE} eq "DATA") and
($nl->{DATA_TYPE} eq "string"));
if ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "TOP") {
if (!$next_is_array and !$next_is_string) {
$self->pidl("if ($ndr->flags & LIBNDR_FLAG_REF_ALLOC) {");
- $self->pidl("\tNDR_PULL_ALLOC($ndr, $var_name);");
+ $self->pidl("\tNDR_PULL_ALLOC($ndr, $var_name);");
$self->pidl("}");
}
return;
} elsif ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "EMBEDDED") {
$self->pidl("NDR_CHECK(ndr_pull_ref_ptr($ndr, &_ptr_$e->{NAME}));");
- } elsif (($l->{POINTER_TYPE} eq "unique") or
+ } elsif (($l->{POINTER_TYPE} eq "unique") or
($l->{POINTER_TYPE} eq "relative") or
($l->{POINTER_TYPE} eq "full")) {
$self->pidl("NDR_CHECK(ndr_pull_generic_ptr($ndr, &_ptr_$e->{NAME}));");
# allocation, as we forced it to NULL just above, and
# we may not know the declared type anyway.
} else {
- # Don't do this for arrays, they're allocated at the actual level
+ # Don't do this for arrays, they're allocated at the actual level
# of the array
- unless ($next_is_array or $next_is_string) {
- $self->pidl("NDR_PULL_ALLOC($ndr, $var_name);");
+ unless ($next_is_array or $next_is_string) {
+ $self->pidl("NDR_PULL_ALLOC($ndr, $var_name);");
} else {
# FIXME: Yes, this is nasty.
# We allocate an array twice
if (defined($struct->{SURROUNDING_ELEMENT})) {
my $e = $struct->{SURROUNDING_ELEMENT};
- if (defined($e->{LEVELS}[0]) and
+ if (defined($e->{LEVELS}[0]) and
$e->{LEVELS}[0]->{TYPE} eq "ARRAY") {
my $size;
-
+
if ($e->{LEVELS}[0]->{IS_ZERO_TERMINATED}) {
if (has_property($e, "charset")) {
$size = "ndr_charset_length($varname->$e->{NAME}, CH_$e->{PROPERTIES}->{charset})";
sub ParseStructPush($$$$)
{
my ($self, $struct, $ndr, $varname) = @_;
-
+
return unless defined($struct->{ELEMENTS});
my $env = GenerateStructEnv($struct, $varname);
$self->deindent;
$self->pidl("}");
-
+
$self->pidl("ndr_print_enum($ndr, name, \"$enum->{TYPE}\", val, $varname);");
$self->end_flags($enum, $ndr);
sub DeclEnum($$$$)
{
my ($e,$t,$name,$varname) = @_;
- return "enum $name " .
+ return "enum $name " .
($t eq "pull"?"*":"") . $varname;
}
sub DeclBitmap($$$$)
{
my ($e,$t,$name,$varname) = @_;
- return mapTypeName(Parse::Pidl::Typelist::bitmap_type_fn($e)) .
+ return mapTypeName(Parse::Pidl::Typelist::bitmap_type_fn($e)) .
($t eq "pull"?" *":" ") . $varname;
}
$self->start_flags($struct, $ndr);
$self->pidl("$ndr->depth++;");
-
+
$self->ParseElementPrint($_, $ndr, $env->{$_->{NAME}}, $env)
foreach (@{$struct->{ELEMENTS}});
$self->pidl("$ndr->depth--;");
foreach my $l (@{$e->{LEVELS}}) {
my $size = 32;
- if ($l->{TYPE} eq "POINTER" and
+ if ($l->{TYPE} eq "POINTER" and
not ($l->{POINTER_TYPE} eq "ref" and $l->{LEVEL} eq "TOP")) {
if ($l->{POINTER_TYPE} eq "relative_short") {
$size = 16;
}
$self->pidl("NDR_CHECK(ndr_pull_$switch_type($ndr, NDR_SCALARS, &_level));");
- $self->pidl("if (_level != level) {");
+ $self->pidl("if (_level != level) {");
$self->pidl("\treturn ndr_pull_error($ndr, NDR_ERR_BAD_SWITCH, \"Bad switch value %$fmt for $varname at \%s\", ($data_type)_level, __location__);");
$self->pidl("}");
}
foreach my $el (@{$e->{ELEMENTS}}) {
if ($el->{CASE} eq "default") {
$have_default = 1;
- }
+ }
$self->pidl("$el->{CASE}: {");
if ($el->{TYPE} ne "EMPTY") {
foreach my $el (@{$e->{ELEMENTS}}) {
if ($el->{CASE} eq "default") {
$have_default = 1;
- }
+ }
$self->pidl("$el->{CASE}:");
if ($el->{TYPE} ne "EMPTY") {
SIZE_FN_ARGS => \&ArgsUnionNdrSize,
SIZE_FN_BODY => \&ParseUnionNdrSize,
};
-
+
#####################################################################
# parse a typedef - push side
sub ParseTypedefPush($$$$)
sub DeclTypedef($$$$)
{
my ($e, $t, $name, $varname) = @_;
-
+
return $typefamily{$e->{DATA}->{TYPE}}->{DECL}->($e->{DATA}, $t, $name, $varname);
}
$self->pidl("$ndr->depth--;");
$self->deindent;
$self->pidl("}");
-
+
$self->pidl("if (flags & NDR_OUT) {");
$self->indent;
$self->pidl("ndr_print_struct($ndr, \"out\", \"$fn->{NAME}\");");
$self->pidl("$ndr->depth--;");
$self->deindent;
$self->pidl("}");
-
+
$self->pidl("$ndr->depth--;");
$self->deindent;
$self->pidl("}");
#####################################################################
# parse a function
sub ParseFunctionPush($$)
-{
+{
my($self, $fn) = @_;
my $ndr = "ndr";
$self->pidl("{");
$self->indent;
- foreach my $e (@{$fn->{ELEMENTS}}) {
+ foreach my $e (@{$fn->{ELEMENTS}}) {
$self->DeclareArrayVariables($e);
}
if ($fn->{RETURN_TYPE}) {
$self->pidl("NDR_CHECK(ndr_push_$fn->{RETURN_TYPE}($ndr, NDR_SCALARS, r->out.result));");
}
-
+
$self->deindent;
$self->pidl("}");
$self->pidl("return NDR_ERR_SUCCESS;");
my ($self,$e,$l,$ndr,$var,$size) = @_;
my $pl = GetPrevLevel($e, $l);
- if (defined($pl) and
- $pl->{TYPE} eq "POINTER" and
+ if (defined($pl) and
+ $pl->{TYPE} eq "POINTER" and
$pl->{POINTER_TYPE} eq "ref"
and not $l->{IS_ZERO_TERMINATED}) {
$self->pidl("if ($ndr->flags & LIBNDR_FLAG_REF_ALLOC) {");
#####################################################################
# parse a function
sub ParseFunctionPull($$)
-{
+{
my($self,$fn) = @_;
my $ndr = "ndr";
$self->indent;
# declare any internal pointers we need
- foreach my $e (@{$fn->{ELEMENTS}}) {
+ foreach my $e (@{$fn->{ELEMENTS}}) {
$self->DeclarePtrVariables($e);
$self->DeclareArrayVariables($e, "pull");
}
foreach my $e (@{$fn->{ELEMENTS}}) {
next unless (grep(/out/, @{$e->{DIRECTION}}));
- next unless ($e->{LEVELS}[0]->{TYPE} eq "POINTER" and
+ next unless ($e->{LEVELS}[0]->{TYPE} eq "POINTER" and
$e->{LEVELS}[0]->{POINTER_TYPE} eq "ref");
- next if (($e->{LEVELS}[1]->{TYPE} eq "DATA") and
+ next if (($e->{LEVELS}[1]->{TYPE} eq "DATA") and
($e->{LEVELS}[1]->{DATA_TYPE} eq "string"));
next if ($e->{LEVELS}[1]->{TYPE} eq "PIPE");
- next if (($e->{LEVELS}[1]->{TYPE} eq "ARRAY")
+ next if (($e->{LEVELS}[1]->{TYPE} eq "ARRAY")
and $e->{LEVELS}[1]->{IS_ZERO_TERMINATED});
if ($e->{LEVELS}[1]->{TYPE} eq "ARRAY") {
}
} else {
$self->pidl("NDR_PULL_ALLOC($ndr, r->out.$e->{NAME});");
-
+
if (grep(/in/, @{$e->{DIRECTION}})) {
$self->pidl("*r->out.$e->{NAME} = *r->in.$e->{NAME};");
} else {
$self->add_deferred();
$self->deindent;
$self->pidl("}");
-
+
$self->pidl("if (flags & NDR_OUT) {");
$self->indent;
$self->pidl("\t$ep, ");
}
my $endpoint_count = $#{$interface->{ENDPOINTS}}+1;
-
+
$self->pidl("};");
$self->pidl("");
#####################################################################
# generate prototypes and defines for the interface definitions
-# FIXME: these prototypes are for the DCE/RPC client functions, not the
+# FIXME: these prototypes are for the DCE/RPC client functions, not the
# NDR parser and so do not belong here, technically speaking
sub HeaderInterface($$$)
{
if (defined $interface->{PROPERTIES}->{uuid}) {
my $name = uc $interface->{NAME};
- $self->pidl_hdr("#define NDR_$name\_UUID " .
+ $self->pidl_hdr("#define NDR_$name\_UUID " .
Parse::Pidl::Util::make_str(lc($interface->{UUID})));
$self->pidl_hdr("#define NDR_$name\_VERSION $interface->{VERSION}");
next if has_property($_, "noopnum");
next if grep(/^$_->{NAME}$/,@{$interface->{INHERITED_FUNCTIONS}});
my $u_name = uc $_->{NAME};
-
+
my $val = sprintf("0x%02x", $count);
if (defined($interface->{BASE})) {
$val .= " + NDR_" . uc $interface->{BASE} . "_CALL_COUNT";
}
-
+
$self->pidl_hdr("#define NDR_$u_name ($val)");
$self->pidl_hdr("");
($needed->{TypeFunctionName("ndr_print", $d)}) && $self->ParseTypePrintFunction($d, "r");
# Make sure we don't generate a function twice...
- $needed->{TypeFunctionName("ndr_push", $d)} =
- $needed->{TypeFunctionName("ndr_pull", $d)} =
+ $needed->{TypeFunctionName("ndr_push", $d)} =
+ $needed->{TypeFunctionName("ndr_pull", $d)} =
$needed->{TypeFunctionName("ndr_print", $d)} = 0;
($needed->{"ndr_size_$d->{NAME}"}) && $self->ParseTypeNdrSize($d);
return if ($e->{TYPE} eq "EMPTY");
- return if (ref($e->{TYPE}) eq "HASH" and
+ return if (ref($e->{TYPE}) eq "HASH" and
not defined($e->{TYPE}->{NAME}));
my ($t, $rt);
return unless defined($t->{ELEMENTS});
for my $e (@{$t->{ELEMENTS}}) {
$e->{PARENT} = $t;
- if (has_property($e, "compression")) {
+ if (has_property($e, "compression")) {
$needed->{"compression"} = 1;
}
NeededElement($e, $req, $needed);
foreach (reverse @{$interface->{TYPES}}) {
if (has_property($_, "public")) {
- $needed->{TypeFunctionName("ndr_pull", $_)} = $needed->{TypeFunctionName("ndr_push", $_)} =
+ $needed->{TypeFunctionName("ndr_pull", $_)} = $needed->{TypeFunctionName("ndr_push", $_)} =
$needed->{TypeFunctionName("ndr_print", $_)} = 1;
}
{
my ($prefix, $t) = @_;
- return "$prefix\_$t->{NAME}" if (ref($t) eq "HASH" and
+ return "$prefix\_$t->{NAME}" if (ref($t) eq "HASH" and
$t->{TYPE} eq "TYPEDEF");
return "$prefix\_$t->{TYPE}_$t->{NAME}" if (ref($t) eq "HASH");
return "$prefix\_$t";