summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/build/pidl/pidl.pl21
1 files changed, 16 insertions, 5 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl
index 45aec06c02..3af933685c 100755
--- a/source4/build/pidl/pidl.pl
+++ b/source4/build/pidl/pidl.pl
@@ -11,12 +11,14 @@ use Getopt::Long;
use Data::Dumper;
use Parse::RecDescent;
use dump;
+use header;
use util;
my($opt_help) = 0;
my($opt_parse) = 0;
my($opt_dump) = 0;
my($opt_diff) = 0;
+my($opt_header) = 0;
#####################################################################
# parse an IDL file returning a structure containing all the data
@@ -52,8 +54,9 @@ sub ShowHelp()
--help this help page
--parse parse a idl file to a .pidl file
--dump dump a pidl file back to idl
+ --header dump a C header file
--diff run diff on the idl and dumped output
- ";
+ \n";
exit(0);
}
@@ -62,18 +65,20 @@ GetOptions (
'help|h|?' => \$opt_help,
'parse' => \$opt_parse,
'dump' => \$opt_dump,
+ 'header' => \$opt_header,
'diff' => \$opt_diff
);
+if ($opt_help) {
+ ShowHelp();
+ exit(0);
+}
+
my($idl_file) = shift;
die "ERROR: You must specify an idl file to process" unless ($idl_file);
my($pidl_file) = util::ChangeExtension($idl_file, "pidl");
-if ($opt_help) {
- ShowHelp();
-}
-
if ($opt_parse) {
print "Parsing $idl_file\n";
my($idl) = IdlParse($idl_file);
@@ -86,6 +91,12 @@ if ($opt_dump) {
print IdlDump::Dump($idl);
}
+if ($opt_header) {
+ my($idl) = util::LoadStructure($pidl_file);
+ my($header) = util::ChangeExtension($idl_file, "h");
+ util::FileSave($header, IdlHeader::Dump($idl));
+}
+
if ($opt_diff) {
my($idl) = util::LoadStructure($pidl_file);
my($tempfile) = util::ChangeExtension($idl_file, "tmp");