summaryrefslogtreecommitdiff
path: root/source4/build/pidl/header.pm
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-06 06:32:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:26 -0500
commite3fd8743417a655a478f49dd76f7cae6245f150b (patch)
tree192a02a7bf9e5b7330c6f20592e29a6074547eea /source4/build/pidl/header.pm
parente159e42d8472f36f51e400e351fc43f2a7dc44f5 (diff)
downloadsamba-e3fd8743417a655a478f49dd76f7cae6245f150b.tar.gz
samba-e3fd8743417a655a478f49dd76f7cae6245f150b.tar.bz2
samba-e3fd8743417a655a478f49dd76f7cae6245f150b.zip
r4551: add support for a pidl extensions
'declare bitmap foo1;' 'declare enum foo2;' and also allow typedef [public] bitmap ... typedef [public] enum ... you need to a forward declaration of bitmaps and enums when you want to use them in another idl file, and you need to make the real declaration to be public see the next commit to samr.idl and netlogon.idl metze (This used to be commit a8d61aa47388b82595ee02b9cfd35f15afb93c2a)
Diffstat (limited to 'source4/build/pidl/header.pm')
-rw-r--r--source4/build/pidl/header.pm34
1 files changed, 33 insertions, 1 deletions
diff --git a/source4/build/pidl/header.pm b/source4/build/pidl/header.pm
index 10adf94dba..0deead29ff 100644
--- a/source4/build/pidl/header.pm
+++ b/source4/build/pidl/header.pm
@@ -200,6 +200,19 @@ sub HeaderType($$$)
}
#####################################################################
+# parse a declare
+sub HeaderDeclare($)
+{
+ my($declare) = shift;
+
+ if ($declare->{DATA}->{TYPE} eq "ENUM") {
+ util::enum_bitmap($declare, $declare->{NAME});
+ } elsif ($declare->{DATA}->{TYPE} eq "BITMAP") {
+ util::register_bitmap($declare, $declare->{NAME});
+ }
+}
+
+#####################################################################
# parse a typedef
sub HeaderTypedef($)
{
@@ -237,6 +250,23 @@ sub HeaderTypedefProto($)
$res .= "void ndr_print_$d->{NAME}(struct ndr_print *ndr, const char *name, int level, union $d->{NAME} *r);\n";
}
}
+
+ if ($d->{DATA}{TYPE} eq "ENUM") {
+ $res .= "NTSTATUS ndr_push_$d->{NAME}(struct ndr_push *ndr, enum $d->{NAME} r);\n";
+ $res .= "NTSTATUS ndr_pull_$d->{NAME}(struct ndr_pull *ndr, enum $d->{NAME} *r);\n";
+ if (!util::has_property($d, "noprint")) {
+ $res .= "void ndr_print_$d->{NAME}(struct ndr_print *ndr, const char *name, enum $d->{NAME} r);\n";
+ }
+ }
+
+ if ($d->{DATA}{TYPE} eq "BITMAP") {
+ my $type_decl = util::bitmap_type_decl($d->{DATA});
+ $res .= "NTSTATUS ndr_push_$d->{NAME}(struct ndr_push *ndr, $type_decl r);\n";
+ $res .= "NTSTATUS ndr_pull_$d->{NAME}(struct ndr_pull *ndr, $type_decl *r);\n";
+ if (!util::has_property($d, "noprint")) {
+ $res .= "void ndr_print_$d->{NAME}(struct ndr_print *ndr, const char *name, $type_decl r);\n";
+ }
+ }
}
#####################################################################
@@ -431,6 +461,8 @@ sub HeaderInterface($)
foreach my $d (@{$data}) {
($d->{TYPE} eq "CONST") &&
HeaderConst($d);
+ ($d->{TYPE} eq "DECLARE") &&
+ HeaderDeclare($d);
($d->{TYPE} eq "TYPEDEF") &&
HeaderTypedef($d);
($d->{TYPE} eq "TYPEDEF") &&
@@ -438,7 +470,7 @@ sub HeaderInterface($)
($d->{TYPE} eq "FUNCTION") &&
HeaderFunction($d);
($d->{TYPE} eq "FUNCTION") &&
- HeaderFnProto($interface, $d);
+ HeaderFnProto($interface, $d);
}
(util::has_property($interface, "object")) &&