svn commit: samba r10121 - in branches/tmp/samba4-winsrepl: . source/lib/registry source/pidl source/script

metze at samba.org metze at samba.org
Fri Sep 9 18:09:30 GMT 2005


Author: metze
Date: 2005-09-09 18:09:29 +0000 (Fri, 09 Sep 2005)
New Revision: 10121

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

Log:
 r10111 at SERNOX:  jelmer | 2005-09-09 12:59:54 +0200
 Make pidl by default assume the input file is an IDL file rather 
 then a .pidl file.
 

Modified:
   branches/tmp/samba4-winsrepl/
   branches/tmp/samba4-winsrepl/source/lib/registry/config.mk
   branches/tmp/samba4-winsrepl/source/pidl/pidl
   branches/tmp/samba4-winsrepl/source/pidl/pidl.1.xml
   branches/tmp/samba4-winsrepl/source/script/build_idl.sh


Changeset:

Property changes on: branches/tmp/samba4-winsrepl
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10110
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10111
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627

Modified: branches/tmp/samba4-winsrepl/source/lib/registry/config.mk
===================================================================
--- branches/tmp/samba4-winsrepl/source/lib/registry/config.mk	2005-09-09 18:09:01 UTC (rev 10120)
+++ branches/tmp/samba4-winsrepl/source/lib/registry/config.mk	2005-09-09 18:09:29 UTC (rev 10121)
@@ -18,7 +18,7 @@
 
 lib/registry/reg_backend_nt4.c: lib/registry/tdr_regf.c
 lib/registry/tdr_regf.c: lib/registry/regf.idl
-	@CPP="$(CPP)" $(PERL) pidl/pidl --header --outputdir=lib/registry --parse --tdr-header --tdr-parser -- lib/registry/regf.idl
+	@CPP="$(CPP)" $(PERL) pidl/pidl --header --outputdir=lib/registry --tdr-header --tdr-parser -- lib/registry/regf.idl
 
 ################################################
 # Start MODULE registry_w95

Modified: branches/tmp/samba4-winsrepl/source/pidl/pidl
===================================================================
--- branches/tmp/samba4-winsrepl/source/pidl/pidl	2005-09-09 18:09:01 UTC (rev 10120)
+++ branches/tmp/samba4-winsrepl/source/pidl/pidl	2005-09-09 18:09:29 UTC (rev 10121)
@@ -62,8 +62,9 @@
 }
 
 my($opt_help) = 0;
-my($opt_parse) = 0;
-my($opt_dump) = 0;
+my($opt_parse_tree) = 0;
+my($opt_dump_tree);
+my($opt_dump_idl) = 0;
 my($opt_uint_enums) = 0;
 my($opt_diff) = 0;
 my($opt_header);
@@ -75,7 +76,6 @@
 my($opt_tdr_header);
 my($opt_tdr_parser);
 my($opt_eth_parser);
-my($opt_keep);
 my($opt_swig);
 my($opt_dcom_proxy);
 my($opt_com_header);
@@ -98,15 +98,17 @@
 Generic Options:
  --help                  this help page
  --outputdir=OUTDIR      put output in OUTDIR/ [.]
- --parse                 parse a idl file to a .pidl file
- --dump                  dump a pidl file back to idl
- --diff                  run diff on the idl and dumped output
- --keep[=OUTFILE]        keep the .pidl file [BASENAME.pidl]
  --odl                   accept ODL input
  --warn-compat           warn about incompatibility with other compilers
  --quiet                 be quiet
  --verbose               be verbose
 
+Debugging:
+ --dump-tree[=OUTFILE]   dump internal representation to file [BASENAME.pidl]
+ --parse-tree            read internal representation instead of IDL
+ --dump-idl              regenerate IDL file
+ --diff                  run diff on original IDL and dumped output
+
 Samba 4 output:
  --header[=OUTFILE]      create generic header file [BASENAME.h]
  --uint-enums            don't use C enums, instead use uint* types
@@ -132,8 +134,9 @@
 GetOptions (
 	    'help|h|?' => \$opt_help, 
 	    'outputdir=s' => \$opt_outputdir,
-	    'parse' => \$opt_parse,
-	    'dump' => \$opt_dump,
+	    'dump-idl' => \$opt_dump_idl,
+		'dump-tree:s' => \$opt_dump_tree,
+		'parse-tree' => \$opt_parse_tree,
 	    'uint-enums' => \$opt_uint_enums,
 	    'ndr-header:s' => \$opt_ndr_header,
 		'header:s' => \$opt_header,
@@ -147,7 +150,6 @@
 	    'ejs' => \$opt_ejs,
 	    'diff' => \$opt_diff,
 	    'odl' => \$opt_odl,
-	    'keep:s' => \$opt_keep,
 	    'swig:s' => \$opt_swig,
 	    'dcom-proxy:s' => \$opt_dcom_proxy,
 	    'com-header:s' => \$opt_com_header,
@@ -170,11 +172,14 @@
 
 	my $basename = basename($idl_file, ".idl");
 
-	my($pidl_file) = ($opt_keep or "$outputdir/$basename.pidl");
+	my($pidl_file) = ($opt_dump_tree or "$outputdir/$basename.pidl");
 
 	unless ($opt_quiet) { print "Compiling $idl_file\n"; }
 
-	if ($opt_parse) {
+	if ($opt_parse_tree) {
+		$pidl = LoadStructure($pidl_file);
+		defined $pidl || die "Failed to load $pidl_file";
+	} else {
 		require Parse::Pidl::IDL;
 		my $idl_parser = new Parse::Pidl::IDL;
 
@@ -182,19 +187,17 @@
 		defined @$pidl || die "Failed to parse $idl_file";
 		require Parse::Pidl::Typelist;
 		Parse::Pidl::Typelist::LoadIdl($pidl);
-		if (defined($opt_keep) && !SaveStructure($pidl_file, $pidl)) {
-			    die "Failed to save $pidl_file\n";
-		}
-	} else {
-		$pidl = LoadStructure($pidl_file);
-		defined $pidl || die "Failed to load $pidl_file - maybe you need --parse\n";
 	}
+	
+	if (defined($opt_dump_tree) && !SaveStructure($pidl_file, $pidl)) {
+		    die "Failed to save $pidl_file\n";
+	}
 
 	if ($opt_uint_enums) {
 		Parse::Pidl::Util::setUseUintEnums(1);
 	}
 
-	if ($opt_dump) {
+	if ($opt_dump_idl) {
 		require Parse::Pidl::Dump;
 		print Parse::Pidl::Dump($pidl);
 	}

Modified: branches/tmp/samba4-winsrepl/source/pidl/pidl.1.xml
===================================================================
--- branches/tmp/samba4-winsrepl/source/pidl/pidl.1.xml	2005-09-09 18:09:01 UTC (rev 10120)
+++ branches/tmp/samba4-winsrepl/source/pidl/pidl.1.xml	2005-09-09 18:09:29 UTC (rev 10121)
@@ -17,8 +17,8 @@
 		<command>pidl</command>
 		<arg choice="opt">--help</arg>
 		<arg choice="opt">--outputdir OUTNAME</arg>
-		<arg choice="opt">--parse</arg>
-		<arg choice="opt">--dump</arg>
+		<arg choice="opt">--parse-tree</arg>
+		<arg choice="opt">--dump-tree</arg>
 		<arg choice="opt">--ndr-header[=OUTPUT]</arg>
 		<arg choice="opt">--header[=OUTPUT]</arg>
 		<arg choice="opt">--ejs[=OUTPUT]</arg>
@@ -36,7 +36,7 @@
 		<arg choice="opt">--template</arg>
 		<arg choice="opt">--eth-parser[=OUTPUT]</arg>
 		<arg choice="opt">--diff</arg>
-		<arg choice="opt">--keep</arg>
+		<arg choice="opt">--dump-idl</arg>
 		<arg choice="req">idlfile</arg>
 		<arg choice="opt">idlfile2</arg>
 		<arg choice="opt">...</arg>
@@ -93,16 +93,17 @@
 		</varlistentry>
 		
 		<varlistentry>
-		<term>--parse</term>
+		<term>--parse-tree</term>
 		<listitem><para>
-				Tell pidl the files specified are (midl-style) IDL files.</para></listitem>
+				Read internal tree structure from input files rather 
+		then assuming they contain IDL.</para></listitem>
 		</varlistentry>
 
 
 		<varlistentry>
-		<term>--dump</term>
+		<term>--dump-idl</term>
 		<listitem><para>
-				Convert .pidl files to (midl-style) IDL files. FIle will be named OUTNAME.idl.</para></listitem>
+				Generate a new IDL file. File will be named OUTNAME.idl.</para></listitem>
 		</varlistentry>
 
 
@@ -162,17 +163,18 @@
 		<varlistentry>
 		<term>--diff</term>
 		<listitem><para>
-		Convert an IDL file to a pidl file and then back to a 
-		IDL file and see if there are any differences with the 
+				Parse an IDL file,  generate a new IDL file based 
+				on the internal data structures and see if there are 
+				any differences with the 
 		original IDL file. Useful for debugging pidl.</para></listitem>
 		</varlistentry>
 
 
 		<varlistentry>
-		<term>--keep</term>
+		<term>--dump-tree</term>
 		<listitem><para>
-		Tell pidl to keep the pidl files (used as intermediate files 
-		between the IDL files and the parser/server/etc code). Useful 
+		Tell pidl to dump the internal tree representation of an IDL 
+		file the to disk. Useful 
 		for debugging pidl.</para></listitem>
 		</varlistentry>
 	</variablelist>
@@ -562,10 +564,10 @@
 
 	<programlisting>
 	# Generating an ethereal parser
-	$ ./pidl --eth-parser --parse -- atsvc.idl
+	$ ./pidl --eth-parser -- atsvc.idl
 	
 	# Generating a TDR parser
-	$ ./pidl --tdr-parser --tdr-header --header --parse -- regf.idl
+	$ ./pidl --tdr-parser --tdr-header --header -- regf.idl
 	</programlisting>
 
 </refsect1>

Modified: branches/tmp/samba4-winsrepl/source/script/build_idl.sh
===================================================================
--- branches/tmp/samba4-winsrepl/source/script/build_idl.sh	2005-09-09 18:09:01 UTC (rev 10120)
+++ branches/tmp/samba4-winsrepl/source/script/build_idl.sh	2005-09-09 18:09:29 UTC (rev 10121)
@@ -6,7 +6,7 @@
 
 [ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
 
-PIDL="$PERL ./pidl/pidl --outputdir librpc/gen_ndr --parse --ndr-header --header --ndr-parser --server --client --dcom-proxy --com-header --swig --odl --ejs $PIDL_EXTRA_ARGS"
+PIDL="$PERL ./pidl/pidl --outputdir librpc/gen_ndr --ndr-header --header --ndr-parser --server --client --dcom-proxy --com-header --swig --odl --ejs $PIDL_EXTRA_ARGS"
 
 if [ x$FULLBUILD = xFULL ]; then
       echo Rebuilding all idl files in librpc/idl



More information about the samba-cvs mailing list