svn commit: samba r6843 - in branches/tmp/pidl2/source/build/pidl: .

jelmer at samba.org jelmer at samba.org
Tue May 17 01:20:00 GMT 2005


Author: jelmer
Date: 2005-05-17 01:19:59 +0000 (Tue, 17 May 2005)
New Revision: 6843

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6843

Log:
Patch from Alan DeKok that attempts to get the eparser generator working again 
in pidl2.

Modified:
   branches/tmp/pidl2/source/build/pidl/eparser.pm


Changeset:
Modified: branches/tmp/pidl2/source/build/pidl/eparser.pm
===================================================================
--- branches/tmp/pidl2/source/build/pidl/eparser.pm	2005-05-17 01:13:53 UTC (rev 6842)
+++ branches/tmp/pidl2/source/build/pidl/eparser.pm	2005-05-17 01:19:59 UTC (rev 6843)
@@ -171,7 +171,7 @@
 		$e->{PARENT} = $fn;
 		$needed{"pull_$e->{TYPE}"} = 1;
 
-		if (NdrParser::is_scalar_type($e->{TYPE})) {
+		if (Ndr::is_scalar_type($e->{TYPE})) {
 
 		    if (defined($e->{ARRAY_LEN}) or 
 			util::has_property($e, "size_is")) {
@@ -241,7 +241,7 @@
 				$needed{"pull_$e->{TYPE}"} = 1;
 			}
 
-			if (NdrParser::is_scalar_type($e->{TYPE})) {
+			if (Ndr::is_scalar_type($e->{TYPE})) {
 
 				if (defined($e->{ARRAY_LEN}) or 
 				util::has_property($e, "size_is")) {
@@ -413,8 +413,6 @@
     my($input) = shift;
     my($output) = shift;
 
-	NdrParser::Load($idl);
-
     %needed = ();
 
     # Open files
@@ -443,17 +441,20 @@
 	    /\#include \"packet-dcerpc-$1.h\"/smgx;
 
 	# Rename struct ndr_pull to struct pidl_pull
+	# this should only happen once, in a define...
+	s/^\#define STRUCT_NDR_PULL struct ndr_pull/\#define STRUCT_NDR_PULL struct pidl_pull/smg;
 
-	s/struct ndr_pull \*ndr/struct pidl_pull \*ndr/smg;
-
 	# Change prototypes for public functions
+	s/^\#define NDR_PULL_FLAGS int ndr_flags/\#define NDR_PULL_FLAGS int ndr_flags, pidl_tree *tree/smg;
 
-	s/(struct pidl_pull \*ndr, int ndr_flags)/$1, pidl_tree *tree/smg;
-
 	# Bitmaps
 
-	s/int ndr_flags, (pidl_tree \*tree), (uint32_t \*r\);)/$1, int hf, $2/smg;
+	s/^\#define NDR_PULL_FLAGS2 int ndr_flags/\#define NDR_PULL_FLAGS2 pidl_tree *tree, int hf/smg;
 
+	# enums
+
+	s/^\#define NDR_PULL_FLAGS3 int ndr_flags/\#define NDR_PULL_FLAGS3 pidl_tree *tree, int hf/smg;
+
 	pidl $_;
     }
 
@@ -468,8 +469,6 @@
     my($input) = shift;
     my($output) = shift;
 
-	NdrParser::Load($idl);
-
     # Open files
 
     open(IN, "<$input") || die "can't open $input for reading";
@@ -570,7 +569,7 @@
         # Remember which structure or function we are processing.
         #
 
-        $cur_fn = $1, if /NTSTATUS ndr_pull_(.*?)\(struct/;
+        $cur_fn = $1, if /NTSTATUS ndr_pull_(.*?)\(struct/i;
 
         # Skip functions we have marked as nopull
 
@@ -582,6 +581,7 @@
 
         $cur_fn = "", if /^}/;
 
+
         next, if $skip_fn;
 
 	#
@@ -639,7 +639,6 @@
 	    /NTSTATUS ndr_pull_$3, pidl_tree *tree, int hf, uint$4_t *r)/smgx;
 
         if (/ndr_pull_([^\)]*?)\(ndr,\ NDR_[^,]*,\ &v\);/) {
-
 	    s/(ndr_pull_([^\)]*?)\(ndr,\ (NDR_[^,]*?),\ &v\);)
 		/ndr_pull_$2(ndr, tree, hf, &v);/smgx;
 
@@ -664,7 +663,7 @@
 	# ndr_pull_uint32(ndr, &r->in.access_mask);
 	# ndr_pull_uint32(ndr, &r->idx);
 
-        if (/(ndr_pull_([^\)]*?)\(ndr, NDR_[^,]*?, (&?r->((in|out)\.)?([^\)]*?))\);)/ and NdrParser::is_scalar_type($2)) {
+        if (/(ndr_pull_([^\)]*?)\(ndr, NDR_[^,]*?, (&?r->((in|out)\.)?([^\)]*?))\);)/ and Ndr::is_scalar_type($2)) {
 
 	    my $pull_type = "${cur_fn}_$6";
 
@@ -699,7 +698,7 @@
 	# Three argument version is for structures
 
     if (/ndr_pull_([^\)]*?)\(ndr, (NDR_[^,]*?), ([^,]*?)\);/ and 
-			not NdrParser::is_scalar_type($1)) {
+			not Ndr::is_scalar_type($1)) {
 	   	s/(ndr_pull_([^\)]*?)\(
 	       ndr,\ 
 	       (NDR_[^,]*?),\ 
@@ -710,7 +709,7 @@
 
     # Four argument version if for unions
     if (/ndr_pull_([^\)]*?)\(ndr, (NDR_[SB][^,]*?), ([^,]*?), ([^,]*?)\);/ and
-			not NdrParser::is_scalar_type($1)) {
+			not Ndr::is_scalar_type($1)) {
 	    s/(ndr_pull_([^\)]*?)\(
 	       ndr,\ 
 	       (NDR_[^,]*?),\ 



More information about the samba-cvs mailing list