svn commit: samba r8283 - in branches/SAMBA_4_0/source/build/pidl/Parse/Pidl/Samba: .

tridge at samba.org tridge at samba.org
Sun Jul 10 08:07:12 GMT 2005


Author: tridge
Date: 2005-07-10 08:07:12 +0000 (Sun, 10 Jul 2005)
New Revision: 8283

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

Log:
make sure we build constant variables for both pull and push side of enums

Modified:
   branches/SAMBA_4_0/source/build/pidl/Parse/Pidl/Samba/EJS.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/Parse/Pidl/Samba/EJS.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/Parse/Pidl/Samba/EJS.pm	2005-07-10 08:06:28 UTC (rev 8282)
+++ branches/SAMBA_4_0/source/build/pidl/Parse/Pidl/Samba/EJS.pm	2005-07-10 08:07:12 UTC (rev 8283)
@@ -289,12 +289,31 @@
 	pidl "}";
 }
 
+##############################################
+# put the enum elements in the constants array
+sub EjsEnumConstant($)
+{
+	my $d = shift;
+	my $v = 0;
+	foreach my $e (@{$d->{ELEMENTS}}) {
+		my $el = $e;
+		chomp $el;
+		if ($el =~ /^(.*)=\s*(.*)\s*$/) {
+			$el = $1;
+			$v = $2;
+		}
+		$constants{$el} = $v;
+		$v++;
+	}
+}
+
 ###########################
 # pull a enum
 sub EjsEnumPull($$)
 {
 	my $name = shift;
 	my $d = shift;
+	EjsEnumConstant($d);
 	pidl fn_prefix($d);
 	pidl "NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, enum $name *r)\n{";
 	indent;
@@ -536,18 +555,7 @@
 {
 	my $name = shift;
 	my $d = shift;
-	my $v = 0;
-	# put the enum elements in the constants array
-	foreach my $e (@{$d->{ELEMENTS}}) {
-		my $el = $e;
-		chomp $el;
-		if ($el =~ /^(.*)=\s*(.*)\s*$/) {
-			$el = $1;
-			$v = $2;
-		}
-		$constants{$el} = $v;
-		$v++;
-	}
+	EjsEnumConstant($d);
 	pidl fn_prefix($d);
 	pidl "NTSTATUS ejs_push_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const enum $name *r)\n{";
 	indent;



More information about the samba-cvs mailing list