summaryrefslogtreecommitdiff
path: root/source4/build/pidl
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-05-07 11:57:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:47 -0500
commitdee25d910e5ed3d07a240cebe8600f4a95c94159 (patch)
tree98a3c396108d4ff109e132f3842277b62fce2580 /source4/build/pidl
parent7e921fb96d9310e649a7d73972a0a87af8cb1233 (diff)
downloadsamba-dee25d910e5ed3d07a240cebe8600f4a95c94159.tar.gz
samba-dee25d910e5ed3d07a240cebe8600f4a95c94159.tar.bz2
samba-dee25d910e5ed3d07a240cebe8600f4a95c94159.zip
r550: Remove clientfns.pm module - it was a bad idea.
Start to resurrect eparser.pm for auto-generating ethereal dissectors for rpc. (This used to be commit 993a18dd35fb0b09c088eb2bb38d3e14ff755130)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r--source4/build/pidl/clientfns.pm127
-rw-r--r--source4/build/pidl/eparser.pm2
-rwxr-xr-xsource4/build/pidl/pidl.pl10
3 files changed, 2 insertions, 137 deletions
diff --git a/source4/build/pidl/clientfns.pm b/source4/build/pidl/clientfns.pm
deleted file mode 100644
index ef107b16f0..0000000000
--- a/source4/build/pidl/clientfns.pm
+++ /dev/null
@@ -1,127 +0,0 @@
-###################################################
-# clientfs boilerplate generator
-# Copyright tpot@samba.org 2004
-# released under the GNU GPL
-
-package IdlClientFns;
-
-use strict;
-
-my($res);
-
-sub pidl($)
-{
- $res .= shift;
-}
-
-#use Data::Dumper;
-
-#####################################################################
-# produce boilerplate code for a interface
-sub Boilerplate_ClientFns($)
-{
- my($interface) = shift;
- my($data) = $interface->{DATA};
- my $name = $interface->{NAME};
-
- foreach my $d (@{$data}) {
- if ($d->{TYPE} eq "FUNCTION") {
-
- pidl "/*\n";
-# pidl Dumper($d);
- pidl "\n*/\n\n";
-
- pidl "$d->{RETURN_TYPE} $d->{NAME}(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx";
-
- my $count = 0, my $i = 0;
-
- foreach my $a (@{$d->{DATA}}) {
- $count++;
- }
-
- pidl ", ", if $count > 0;
-
- foreach my $a (@{$d->{DATA}}) {
-
- pidl "/* [";
- if ($a->{PROPERTIES}->{in}) {
- pidl "in";
- if ($a->{PROPERTIES}->{out} or
- $a->{PROPERTIES}->{ref}) {
- pidl ",";
- }
- }
- if ($a->{PROPERTIES}->{out}) {
- pidl "out";
- if ($a->{PROPERTIES}->{ref}) {
- pidl ",";
- }
- }
- if ($a->{PROPERTIES}->{ref}) {
- pidl "ref";
- }
- pidl "] */ ";
-
- pidl "struct ", if $a->{TYPE} eq "policy_handle";
-
- pidl "$a->{TYPE} ";
- if ($a->{PROPERTIES}->{out}) {
- pidl "*";
- }
-
- if (!$a->{PROPERTIES}->{ref}) {
- pidl "*", if $a->{POINTERS};
- }
-
- pidl "$a->{NAME}";
-
- $i++;
-
- pidl ", ", if $i < $count;
- }
- pidl ")\n";
- pidl "{\n";
-
- pidl "\tstruct $d->{NAME} r;\n";
- pidl "\tNTSTATUS status;\n";
- pidl "\n";
-
- foreach $a (@{$d->{DATA}}) {
- if ($a->{PROPERTIES}->{in}) {
- pidl "\tr.in.$a->{NAME} = $a->{NAME};\n";
- }
- if ($a->{PROPERTIES}->{out}) {
- pidl "\tr.out.$a->{NAME} = $a->{NAME};\n";
- }
- }
- pidl "\n";
-
- pidl "\tstatus = dcerpc_$d->{NAME}(p, mem_ctx, &r);\n";
- pidl "\n";
-
- pidl "\treturn NT_STATUS_OK;\n";
-
- pidl "}\n\n";
- }
- }
-}
-
-#####################################################################
-# parse a parsed IDL structure back into an IDL file
-sub Parse($)
-{
- my($idl) = shift;
- $res = "/* dcerpc client functions generated by pidl */\n\n";
-
- $res .= "#include \"includes.h\"\n\n";
-
- foreach my $x (@{$idl}) {
- if ($x->{TYPE} eq "INTERFACE") {
- Boilerplate_ClientFns($x);
- }
- }
-
- return $res;
-}
-
-1;
diff --git a/source4/build/pidl/eparser.pm b/source4/build/pidl/eparser.pm
index ba1a691ee5..90af3c8665 100644
--- a/source4/build/pidl/eparser.pm
+++ b/source4/build/pidl/eparser.pm
@@ -4,7 +4,7 @@
# Copyright tridge@samba.org 2000
# released under the GNU GPL
-package eparser;
+package IdlEParser;
use strict;
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl
index b390ba7728..022dc393d5 100755
--- a/source4/build/pidl/pidl.pl
+++ b/source4/build/pidl/pidl.pl
@@ -17,7 +17,6 @@ use idl;
use dump;
use header;
use server;
-use clientfns;
use parser;
use eparser;
use validator;
@@ -32,7 +31,6 @@ my($opt_header) = 0;
my($opt_template) = 0;
my($opt_server) = 0;
my($opt_parser) = 0;
-my($opt_clientfns) = 0;
my($opt_eparser) = 0;
my($opt_keep) = 0;
my($opt_output);
@@ -86,7 +84,6 @@ GetOptions (
'server' => \$opt_server,
'template' => \$opt_template,
'parser' => \$opt_parser,
- 'clientfns' => \$opt_clientfns,
'eparser' => \$opt_eparser,
'diff' => \$opt_diff,
'keep' => \$opt_keep
@@ -146,13 +143,8 @@ sub process_file($)
IdlParser::Parse($pidl, $parser);
}
- if ($opt_clientfns) {
- my($clientfns) = util::ChangeExtension($output, "_c.c");
- util::FileSave($clientfns, IdlClientFns::Parse($pidl));
- }
-
if ($opt_eparser) {
- my($parser) = util::ChangeExtension($output, ".c");
+ my($parser) = util::ChangeExtension($output, "_ethereal.c");
util::FileSave($parser, IdlEParser::Parse($pidl));
}