summaryrefslogtreecommitdiff
path: root/tools/pidl
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-09-26 19:51:34 +0200
committerAnders Broman <a.broman58@gmail.com>2014-09-29 06:24:11 +0000
commit4110bdead7dfba8ee87a81a0c2c8b2b1dcdded16 (patch)
tree29a08f97ca44708c465e6a28b01b66b2fdb41b9d /tools/pidl
parentb2d81a2a8d1e760bd57bdde58a44c686acaee12c (diff)
downloadwireshark-4110bdead7dfba8ee87a81a0c2c8b2b1dcdded16.tar.gz
PIDL: fix indent (use 4 tabs) and remove trailing whitespace
Change-Id: I0ee63a040867b44ac9915704f5e581483ed6f7e2 Reviewed-on: https://code.wireshark.org/review/4310 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tools/pidl')
-rw-r--r--tools/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm10
-rwxr-xr-xtools/pidl/pidl146
-rw-r--r--tools/pidl/tests/Util.pm2
-rwxr-xr-xtools/pidl/tests/wireshark-conf.pl2
4 files changed, 80 insertions, 80 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
index 895536ce7a..01a8c473c5 100644
--- a/tools/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
+++ b/tools/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
@@ -59,7 +59,7 @@ Register a custom ett field
=item I<STRIP_PREFIX> prefix
Remove the specified prefix from all function names (if present).
-
+
=item I<PROTOCOL> longname shortname filtername
Change the short-, long- and filter-name for the current interface in
@@ -371,11 +371,11 @@ sub handle_include
my %field_handlers = (
TYPE => \&handle_type,
- NOEMIT => \&handle_noemit,
+ NOEMIT => \&handle_noemit,
MANUAL => \&handle_manual,
- PARAM_VALUE => \&handle_param_value,
- HF_FIELD => \&handle_hf_field,
- HF_RENAME => \&handle_hf_rename,
+ PARAM_VALUE => \&handle_param_value,
+ HF_FIELD => \&handle_hf_field,
+ HF_RENAME => \&handle_hf_rename,
ETT_FIELD => \&handle_ett_field,
TFS => \&handle_tfs,
STRIP_PREFIX => \&handle_strip_prefix,
diff --git a/tools/pidl/pidl b/tools/pidl/pidl
index 28a15310e2..e8cb7d874b 100755
--- a/tools/pidl/pidl
+++ b/tools/pidl/pidl
@@ -200,7 +200,7 @@ midl.exe would write the above array as the following C header:
pidl takes a different approach, and writes it like this:
- typedef struct {
+ typedef struct {
long abc;
long count;
long foo;
@@ -226,9 +226,9 @@ This will look like this on the wire:
A fixed array looks like this:
- typedef struct {
- long s[10];
- } Struct1;
+ typedef struct {
+ long s[10];
+ } Struct1;
The NDR representation looks just like 10 separate long
declarations. The array size is not encoded on the wire.
@@ -236,12 +236,12 @@ declarations. The array size is not encoded on the wire.
pidl also supports "inline" arrays, which are not part of the IDL/NDR
standard. These are declared like this:
- typedef struct {
- uint32 foo;
- uint32 count;
- uint32 bar;
- long s[count];
- } Struct1;
+ typedef struct {
+ uint32 foo;
+ uint32 count;
+ uint32 bar;
+ long s[count];
+ } Struct1;
This appears like this:
@@ -432,27 +432,27 @@ sub LoadStructure($)
# read a file into a string
sub FileLoad($)
{
- my($filename) = shift;
- local(*INPUTFILE);
- open(INPUTFILE, $filename) || return undef;
- my($saved_delim) = $/;
- undef $/;
- my($data) = <INPUTFILE>;
- close(INPUTFILE);
- $/ = $saved_delim;
- return $data;
+ my($filename) = shift;
+ local(*INPUTFILE);
+ open(INPUTFILE, $filename) || return undef;
+ my($saved_delim) = $/;
+ undef $/;
+ my($data) = <INPUTFILE>;
+ close(INPUTFILE);
+ $/ = $saved_delim;
+ return $data;
}
#####################################################################
# write a string into a file
sub FileSave($$)
{
- my($filename) = shift;
- my($v) = shift;
- local(*FILE);
- open(FILE, ">$filename") || die "can't open $filename";
- print FILE $v;
- close(FILE);
+ my($filename) = shift;
+ my($v) = shift;
+ local(*FILE);
+ open(FILE, ">$filename") || die "can't open $filename";
+ print FILE $v;
+ close(FILE);
}
my(@opt_incdirs) = ();
@@ -533,57 +533,57 @@ Samba 3 output:
Wireshark parsers:
--ws-parser[=OUTFILE] create Wireshark parser and header
\n";
- exit(0);
+ exit(0);
}
#########################################
# Display version
sub ShowVersion()
{
- print "perl IDL version $VERSION\n";
+ print "perl IDL version $VERSION\n";
}
# main program
my $result = GetOptions (
- 'help|h|?' => \$opt_help,
- 'version' => \$opt_version,
- 'outputdir=s' => \$opt_outputdir,
- 'dump-idl' => \$opt_dump_idl,
+ 'help|h|?' => \$opt_help,
+ 'version' => \$opt_version,
+ 'outputdir=s' => \$opt_outputdir,
+ 'dump-idl' => \$opt_dump_idl,
'dump-idl-tree:s' => \$opt_dump_idl_tree,
'parse-idl-tree' => \$opt_parse_idl_tree,
'dump-ndr-tree:s' => \$opt_dump_ndr_tree,
'samba3-ndr-client:s' => \$opt_samba3_ndr_client,
'samba3-ndr-server:s' => \$opt_samba3_ndr_server,
'header:s' => \$opt_header,
- 'server:s' => \$opt_server,
+ 'server:s' => \$opt_server,
'typelib:s' => \$opt_typelib,
- 'tdr-parser:s' => \$opt_tdr_parser,
- 'template' => \$opt_template,
- 'ndr-parser:s' => \$opt_ndr_parser,
- 'client:s' => \$opt_client,
- 'ws-parser:s' => \$opt_ws_parser,
+ 'tdr-parser:s' => \$opt_tdr_parser,
+ 'template' => \$opt_template,
+ 'ndr-parser:s' => \$opt_ndr_parser,
+ 'client:s' => \$opt_client,
+ 'ws-parser:s' => \$opt_ws_parser,
'python' => \$opt_python,
- 'diff' => \$opt_diff,
- 'dcom-proxy:s' => \$opt_dcom_proxy,
+ 'diff' => \$opt_diff,
+ 'dcom-proxy:s' => \$opt_dcom_proxy,
'com-header:s' => \$opt_com_header,
- 'quiet' => \$opt_quiet,
+ 'quiet' => \$opt_quiet,
'verbose' => \$opt_verbose,
- 'warn-compat' => \$opt_warn_compat,
+ 'warn-compat' => \$opt_warn_compat,
'includedir=s@' => \@opt_incdirs
- );
+ );
if (not $result) {
exit(1);
}
if ($opt_help) {
- ShowHelp();
- exit(0);
+ ShowHelp();
+ exit(0);
}
if ($opt_version) {
- ShowVersion();
- exit(0);
+ ShowVersion();
+ exit(0);
}
sub process_file($)
@@ -653,28 +653,28 @@ sub process_file($)
$pidl = Parse::Pidl::ODL::ODL2IDL($pidl, dirname($idl_file), \@opt_incdirs);
if (defined($opt_ws_parser)) {
- require Parse::Pidl::Wireshark::NDR;
+ require Parse::Pidl::Wireshark::NDR;
- my $cnffile = $idl_file;
- $cnffile =~ s/\.idl$/\.cnf/;
+ my $cnffile = $idl_file;
+ $cnffile =~ s/\.idl$/\.cnf/;
- my $generator = new Parse::Pidl::Wireshark::NDR();
- $generator->Initialize($cnffile);
+ my $generator = new Parse::Pidl::Wireshark::NDR();
+ $generator->Initialize($cnffile);
}
if (defined($opt_ws_parser) or
- defined($opt_client) or
- defined($opt_server) or
- defined($opt_header) or
- defined($opt_ndr_parser) or
- defined($opt_python) or
- defined($opt_dump_ndr_tree) or
- defined($opt_samba3_header) or
- defined($opt_samba3_parser) or
- defined($opt_samba3_server) or
- defined($opt_samba3_ndr_client) or
- defined($opt_samba3_ndr_server)) {
+ defined($opt_client) or
+ defined($opt_server) or
+ defined($opt_header) or
+ defined($opt_ndr_parser) or
+ defined($opt_python) or
+ defined($opt_dump_ndr_tree) or
+ defined($opt_samba3_header) or
+ defined($opt_samba3_parser) or
+ defined($opt_samba3_server) or
+ defined($opt_samba3_ndr_client) or
+ defined($opt_samba3_ndr_server)) {
require Parse::Pidl::NDR;
$ndr = Parse::Pidl::NDR::Parse($pidl);
}
@@ -732,17 +732,17 @@ sub process_file($)
}
if (defined($opt_ws_parser)) {
- require Parse::Pidl::Wireshark::NDR;
- my($eparser) = ($opt_ws_parser or "$outputdir/packet-dcerpc-$basename.c");
- my $eheader = $eparser;
- $eheader =~ s/\.c$/\.h/;
- my $cnffile = $idl_file;
- $cnffile =~ s/\.idl$/\.cnf/;
-
- my $generator = new Parse::Pidl::Wireshark::NDR();
- my ($dp, $dh) = $generator->Parse($ndr, $idl_file, $eheader, $cnffile);
- FileSave($eparser, $dp) if defined($dp);
- FileSave($eheader, $dh) if defined($dh);
+ require Parse::Pidl::Wireshark::NDR;
+ my($eparser) = ($opt_ws_parser or "$outputdir/packet-dcerpc-$basename.c");
+ my $eheader = $eparser;
+ $eheader =~ s/\.c$/\.h/;
+ my $cnffile = $idl_file;
+ $cnffile =~ s/\.idl$/\.cnf/;
+
+ my $generator = new Parse::Pidl::Wireshark::NDR();
+ my ($dp, $dh) = $generator->Parse($ndr, $idl_file, $eheader, $cnffile);
+ FileSave($eparser, $dp) if defined($dp);
+ FileSave($eheader, $dh) if defined($dh);
}
if (defined($opt_tdr_parser)) {
diff --git a/tools/pidl/tests/Util.pm b/tools/pidl/tests/Util.pm
index 63949eb5a3..86b521bf94 100644
--- a/tools/pidl/tests/Util.pm
+++ b/tools/pidl/tests/Util.pm
@@ -118,7 +118,7 @@ $c
my $test_data_prefix = $ENV{TEST_DATA_PREFIX};
my $outfile;
if (defined($test_data_prefix)) {
- $outfile = "$test_data_prefix/test-$name";
+ $outfile = "$test_data_prefix/test-$name";
} else {
$outfile = "./test-$name";
}
diff --git a/tools/pidl/tests/wireshark-conf.pl b/tools/pidl/tests/wireshark-conf.pl
index 9da5c7d1ed..a8e33dfecd 100755
--- a/tools/pidl/tests/wireshark-conf.pl
+++ b/tools/pidl/tests/wireshark-conf.pl
@@ -15,7 +15,7 @@ use Parse::Pidl::Wireshark::Conformance qw(ReadConformanceFH valid_ft_type valid
sub parse_conf($)
{
my $str = shift;
- open(TMP, "+>", undef) or die("unable to open temp file");
+ open(TMP, "+>", undef) or die("unable to open temp file");
print TMP $str;
seek(TMP, 0, 0);
my $data = {};