r5480: allow nopush and nopull on functions
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Feb 2005 11:01:57 +0000 (11:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:10:49 +0000 (13:10 -0500)
metze

source/build/pidl/ndr.pm

index 019300d7843a7c8d64d9e1b18cfa9f402c527c4f..d02d2c402f8c4d0be100846c08d1f46745168631 100644 (file)
@@ -1620,6 +1620,8 @@ sub ParseTypedefPrint($)
 
        my $args = $typefamily{$e->{DATA}->{TYPE}}->{PRINT_FN_ARGS}->($e);
 
+       return unless !util::has_property($e, "noprint");
+
        pidl "void ndr_print_$e->{NAME}($args)";
        pidl "{";
        indent;
@@ -1654,6 +1656,8 @@ sub ParseFunctionPrint($)
 {
        my($fn) = shift;
 
+       return unless !util::has_property($fn, "noprint");
+
        pidl "void ndr_print_$fn->{NAME}(struct ndr_print *ndr, const char *name, int flags, struct $fn->{NAME} *r)";
        pidl "{";
        indent;
@@ -1736,6 +1740,8 @@ sub ParseFunctionPush($)
        my($fn) = shift;
        my $static = fn_prefix($fn);
 
+       return unless !util::has_property($fn, "nopush");
+
        pidl $static . "NTSTATUS ndr_push_$fn->{NAME}(struct ndr_push *ndr, int flags, struct $fn->{NAME} *r)";
        pidl "{";
        indent;
@@ -1849,6 +1855,8 @@ sub ParseFunctionPull($)
        my($fn) = shift;
        my $static = fn_prefix($fn);
 
+       return unless !util::has_property($fn, "nopull");
+
        # pull function args
        pidl $static . "NTSTATUS ndr_pull_$fn->{NAME}(struct ndr_pull *ndr, int flags, struct $fn->{NAME} *r)";
        pidl "{";
@@ -2015,14 +2023,10 @@ sub ParseInterface($)
        
        # Print functions
        foreach my $d (@{$data}) {
-               if ($d->{TYPE} eq "TYPEDEF" &&
-                   !util::has_property($d, "noprint")) {
+               ($d->{TYPE} eq "TYPEDEF") &&
                        ParseTypedefPrint($d);
-               }
-               if ($d->{TYPE} eq "FUNCTION" &&
-                   !util::has_property($d, "noprint")) {
+               ($d->{TYPE} eq "FUNCTION") &&
                        ParseFunctionPrint($d);
-               }
        }
 
        # Size functions