diff options
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/build/pidl/pidl.pl | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index 325f07b058..1d6b45172a 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -34,11 +34,11 @@ my($opt_help) = 0; my($opt_parse) = 0; my($opt_dump) = 0; my($opt_diff) = 0; -my($opt_header) = 0; +my($opt_header); my($opt_template) = 0; my($opt_client) = 0; my($opt_server) = 0; -my($opt_parser) = 0; +my($opt_parser); my($opt_eparser) = 0; my($opt_keep) = 0; my($opt_swig) = 0; @@ -59,7 +59,6 @@ sub IdlParse($) return $idl; } - ######################################### # display help text sub ShowHelp() @@ -72,11 +71,11 @@ sub ShowHelp() Options: --help this help page - --output OUTNAME put output in OUTNAME.* + --output=OUTNAME put output in OUTNAME.* --parse parse a idl file to a .pidl file --dump dump a pidl file back to idl - --header create a C NDR header file - --parser create a C NDR parser + --header[=OUTFILE] create a C NDR header file + --parser[=OUTFILE] create a C NDR parser --client create a C NDR client --server create server boilerplate --template print a template for a pipe @@ -97,10 +96,10 @@ GetOptions ( 'output=s' => \$opt_output, 'parse' => \$opt_parse, 'dump' => \$opt_dump, - 'header' => \$opt_header, + 'header:s' => \$opt_header, 'server' => \$opt_server, 'template' => \$opt_template, - 'parser' => \$opt_parser, + 'parser:s' => \$opt_parser, 'client' => \$opt_client, 'eparser' => \$opt_eparser, 'diff' => \$opt_diff, @@ -186,8 +185,12 @@ sub process_file($) $pidl = ODL::ODL2IDL($pidl); } - if ($opt_header) { - my($header) = util::ChangeExtension($output, ".h"); + if (defined($opt_header)) { + my $header = $opt_header; + if ($header eq "") { + $header = util::ChangeExtension($output, ".h"); + } + util::FileSave($header, NdrHeader::Parse($pidl)); if ($opt_eparser) { my($eparserhdr) = dirname($output) . "/packet-dcerpc-$basename.h"; @@ -248,8 +251,11 @@ $dcom } } - if ($opt_parser) { - my($parser) = util::ChangeExtension($output, ".c"); + if (defined($opt_parser)) { + my $parser = $opt_parser; + if ($parser eq "") { + $parser = util::ChangeExtension($output, ".c"); + } util::FileSave($parser, NdrParser::Parse($pidl, $parser)); if($opt_eparser) { my($eparser) = dirname($output) . "/packet-dcerpc-$basename.c"; |