svn commit: samba r4993 - in branches/SAMBA_4_0/source/build/pidl: .

tpot at samba.org tpot at samba.org
Tue Jan 25 23:14:46 GMT 2005


Author: tpot
Date: 2005-01-25 23:14:46 +0000 (Tue, 25 Jan 2005)
New Revision: 4993

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

Log:
Generate nicer name for enum hf.

Start work on supporting bitmaps.

Modified:
   branches/SAMBA_4_0/source/build/pidl/eparser.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/eparser.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/eparser.pm	2005-01-25 22:56:13 UTC (rev 4992)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.pm	2005-01-25 23:14:46 UTC (rev 4993)
@@ -288,12 +288,24 @@
 	if ($t->{DATA}->{TYPE} eq "ENUM") {
 
 	    $needed{"hf_$t->{NAME}"} = {
-		'name' => $t->{NAME},
+		'name' => field2name($t->{NAME}),
 		'ft' => 'FT_UINT16',
 		'base' => 'BASE_DEC',
 		'strings' => "VALS($t->{NAME}_vals)"
 		};
 	}
+
+	if ($t->{DATA}->{TYPE} eq "BITMAP") {
+	    foreach my $e (@{$t->{DATA}{ELEMENTS}}) {
+		$e =~ /^(.*?) \( (.*?) \)$/;
+		$needed{"hf_$t->{NAME}_$1"} = {
+		    'name' => "$t->{NAME} $1",
+		    'ft' => "FT_BOOLEAN",
+		    'base' => "32",
+		    'bitmask' => "$2"
+		    };
+	    }
+	}
 }
 
 #####################################################################
@@ -766,7 +778,8 @@
 	next, if !($x =~ /^hf_/);
 	pidl "\t{ &$x,\n";
 	$needed{$x}{strings} = "NULL", if !defined($needed{$x}{strings});
-	pidl "\t  { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, $needed{$x}{base}, $needed{$x}{strings}, 0, \"$x\", HFILL }},\n";
+	$needed{$x}{bitmask} = "0", if !defined($needed{$x}{bitmask});
+	pidl "\t  { \"$needed{$x}{name}\", \"$x\", $needed{$x}{ft}, $needed{$x}{base}, $needed{$x}{strings}, $needed{$x}{bitmask}, \"$x\", HFILL }},\n";
     }
 
     pidl "\t};\n\n";



More information about the samba-cvs mailing list