svn commit: samba r3440 - in branches/SAMBA_4_0/source: build/pidl
librpc/idl
jelmer at samba.org
jelmer at samba.org
Mon Nov 1 20:00:05 GMT 2004
Author: jelmer
Date: 2004-11-01 20:00:02 +0000 (Mon, 01 Nov 2004)
New Revision: 3440
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3440
Log:
Add support for "coclass" to the pidl parser - the idl keyword that
describes a COM class. A coclass is the implementation of one or more
interfaces. It has a UUID referred to as it's CLSID (Class ID).
Also adding an example coclass called "CoffeeMachine". You can give
it a string (or a cup, whatever you like ;-) and it will fill it with
"COFFEE" (kind of the like the echo pipe is for regular RPC). CoffeeMachine's
Windows implementation already works, a torture test for Samba will follow
soon.
Modified:
branches/SAMBA_4_0/source/build/pidl/idl.yp
branches/SAMBA_4_0/source/librpc/idl/dcom.idl
Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/idl.yp
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/idl.yp 2004-11-01 19:35:55 UTC (rev 3439)
+++ branches/SAMBA_4_0/source/build/pidl/idl.yp 2004-11-01 20:00:02 UTC (rev 3440)
@@ -16,11 +16,24 @@
%%
idl:
#empty { {} }
- | idl interface {
- push(@{$_[1]}, $_[2]); $_[1]
- }
+ | idl interface { push(@{$_[1]}, $_[2]); $_[1] }
+ | idl coclass { push(@{$_[1]}, $_[2]); $_[1] }
;
+coclass: property_list 'coclass' identifier '{' interfaces '}' optional_semicolon
+ {$_[3] => {
+ "TYPE" => "COCLASS",
+ "PROPERTIES" => $_[1],
+ "NAME" => $_[3],
+ "DATA" => $_[5],
+ }}
+;
+
+interfaces:
+ #empty { {} }
+ | interfaces interface { push(@{$_[1]}, $_[2]); $_[1] }
+;
+
interface: property_list 'interface' identifier base_interface '{' definitions '}' optional_semicolon
{$_[3] => {
"TYPE" => "INTERFACE",
@@ -291,7 +304,7 @@
if (s/^([\w_]+)//) {
$parser->YYData->{LAST_TOKEN} = $1;
if ($1 =~
- /^(interface|const|typedef|union
+ /^(coclass|interface|const|typedef|union
|struct|enum|void|case|default)$/x) {
return $1;
}
Modified: branches/SAMBA_4_0/source/librpc/idl/dcom.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/dcom.idl 2004-11-01 19:35:55 UTC (rev 3439)
+++ branches/SAMBA_4_0/source/librpc/idl/dcom.idl 2004-11-01 20:00:02 UTC (rev 3440)
@@ -486,3 +486,21 @@
WERROR MarshalInterface();
WERROR UnMarshalInterface();
}
+
+
+[
+uuid(DB7C21F8-FE33-4C11-AEA5-CEB56F076FBB),
+ helpstring("CoffeeMachine Class")
+] coclass CoffeeMachine
+{
+ [
+ uuid(DA23F6DB-6F45-466C-9EED-0B65286F2D78),
+ helpstring("ICoffeeMachine Interface"),
+ pointer_default(unique)
+ ]
+
+ interface ICoffeeMachine : IUnknown
+ {
+ [helpstring("method MakeCoffee")] HRESULT MakeCoffee(BSTR *flavor);
+ }
+}
More information about the samba-cvs
mailing list