From 0515f728e64dde0c197aee6180dce79ad281d5f8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 18 Feb 2007 18:44:56 +0000 Subject: r21433: Get rid of the COM support code - it's not used and unmaintained. We can always bring it back if we need to. This code was getting in the way while refactoring. Add some tests for TDR. Get rid of typedef in lib/registry/tdr_regf.idl and fix the TDR code to be able to deal with it. (This used to be commit 1ad0f99a439f0d52a735b391bf9900d50171aca5) --- source4/pidl/lib/Parse/Pidl/Samba4/COM/Header.pm | 142 ----------------------- 1 file changed, 142 deletions(-) delete mode 100644 source4/pidl/lib/Parse/Pidl/Samba4/COM/Header.pm (limited to 'source4/pidl/lib/Parse/Pidl/Samba4/COM/Header.pm') diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/COM/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/COM/Header.pm deleted file mode 100644 index 85dab37246..0000000000 --- a/source4/pidl/lib/Parse/Pidl/Samba4/COM/Header.pm +++ /dev/null @@ -1,142 +0,0 @@ -# COM Header generation -# (C) 2005 Jelmer Vernooij - -package Parse::Pidl::Samba4::COM::Header; - -use Parse::Pidl::Typelist qw(mapType); -use Parse::Pidl::Util qw(has_property is_constant); - -use vars qw($VERSION); -$VERSION = '0.01'; - -use strict; - -sub GetArgumentProtoList($) -{ - my $f = shift; - my $res = ""; - - foreach my $a (@{$f->{ELEMENTS}}) { - - $res .= ", " . mapType($a->{TYPE}) . " "; - - my $l = $a->{POINTERS}; - $l-- if (Parse::Pidl::Typelist::scalar_is_reference($a->{TYPE})); - foreach my $i (1..$l) { - $res .= "*"; - } - - if (defined $a->{ARRAY_LEN}[0] && !is_constant($a->{ARRAY_LEN}[0]) && - !$a->{POINTERS}) { - $res .= "*"; - } - $res .= $a->{NAME}; - if (defined $a->{ARRAY_LEN}[0] && is_constant($a->{ARRAY_LEN}[0])) { - $res .= "[$a->{ARRAY_LEN}[0]]"; - } - } - - return $res; -} - -sub GetArgumentList($) -{ - my $f = shift; - my $res = ""; - - foreach (@{$f->{ELEMENTS}}) { $res .= ", $_->{NAME}"; } - - return $res; -} - -##################################################################### -# generate vtable structure for COM interface -sub HeaderVTable($) -{ - my $interface = shift; - my $res; - $res .= "#define " . uc($interface->{NAME}) . "_METHODS \\\n"; - if (defined($interface->{BASE})) { - $res .= "\t" . uc($interface->{BASE} . "_METHODS") . "\\\n"; - } - - my $data = $interface->{DATA}; - foreach my $d (@{$data}) { - $res .= "\t" . mapType($d->{RETURN_TYPE}) . " (*$d->{NAME}) (struct $interface->{NAME} *d, TALLOC_CTX *mem_ctx" . GetArgumentProtoList($d) . ");\\\n" if ($d->{TYPE} eq "FUNCTION"); - } - $res .= "\n"; - $res .= "struct $interface->{NAME}_vtable {\n"; - $res .= "\tstruct GUID iid;\n"; - $res .= "\t" . uc($interface->{NAME}) . "_METHODS\n"; - $res .= "};\n\n"; - - return $res; -} - -sub ParseInterface($) -{ - my $if = shift; - my $res; - - $res .="\n\n/* $if->{NAME} */\n"; - - $res .="#define COM_" . uc($if->{NAME}) . "_UUID $if->{PROPERTIES}->{uuid}\n\n"; - - $res .="struct $if->{NAME}_vtable;\n\n"; - - $res .="struct $if->{NAME} { - struct com_context *ctx; - struct $if->{NAME}_vtable *vtable; - void *object_data; -};\n\n"; - - $res.=HeaderVTable($if); - - foreach my $d (@{$if->{DATA}}) { - next if ($d->{TYPE} ne "FUNCTION"); - - $res .= "#define $if->{NAME}_$d->{NAME}(interface, mem_ctx" . GetArgumentList($d) . ") "; - - $res .= "((interface)->vtable->$d->{NAME}(interface, mem_ctx" . GetArgumentList($d) . "))"; - - $res .="\n"; - } - - return $res; -} - -sub ParseCoClass($) -{ - my $c = shift; - my $res = ""; - $res .= "#define CLSID_" . uc($c->{NAME}) . " $c->{PROPERTIES}->{uuid}\n"; - if (has_property($c, "progid")) { - $res .= "#define PROGID_" . uc($c->{NAME}) . " $c->{PROPERTIES}->{progid}\n"; - } - $res .= "\n"; - return $res; -} - -sub Parse($$) -{ - my ($idl,$ndr_header) = @_; - my $res = ""; - - $res .= "#include \"librpc/gen_ndr/orpc.h\"\n" . - "#include \"$ndr_header\"\n\n"; - - foreach (@{$idl}) - { - if ($_->{TYPE} eq "INTERFACE" && has_property($_, "object")) { - $res.=ParseInterface($_); - } - - if ($_->{TYPE} eq "COCLASS") { - $res.=ParseCoClass($_); - } - } - - return $res; -} - -1; -- cgit