! Additional translation rules specific to COM, OLE, and OLESTD ! Copyright: 1996, 1998 Functional Objects, Inc. All rights reserved. ! special handling for "objbase.h": ! These two rules will be created automatically when processing "objbase.h", ! but need to be defined here for "ole2.h". :WINOLEAPI \G()\;=@stdfun{\\d$1\d$2} :WINOLEAPI_()\W\G()\;=@stdfun{$1\d$2\d$3} ! skip arglist of omitted functions to avoid warnings: WINOLEAPI ()\;= __RPC_\J ()\;= STD\J ()\;= __RPC_FAR\W\*\W__RPC_USER ()\;= omitted-function:=@fail omitted-function:=$1@end omitted-function:=@fail ! stdfun{type name args} stdfun:*\d*\d*=\ \N\ndefine C-function @export{@fnname{$2}}\n$3\N\ @result{$1}\ \ \ c-name\: \"$2\",@wrap{\ c-modifiers\: \"__stdcall\"\;}\n\ end\;\n :interface \{\}\;= ! special case to handle (in objidl.h): void __RPC_FAR *reserved2[ 5 ]; fields:void\ __RPC_FAR\W\*\W\W\[\W\W\]\;=\ \ \ array slot @export{$1-array} @tab{20}\:\:\ @wrap{\ \,}@wrap{\ length\: $2,}\ @ignore{@export{$1-array-setter}}\ @wrap{\ address-getter\: @export{$1-value}\;}\n def-flag:NONAMELESSUNION=$0@end type:HRESULT=\@end type:SCODE=\@end! used in "samples/include/olestd.h" ! Special-case to support smart LPSTREAM type:\IIStream=\@end type:I\J\J\J=\ \/\* I$1$2$3 \*\/@end type:OLECHAR __RPC_FAR\*=\@end type:OLECHAR FAR\*=\@end type:OLECHAR const FAR\*=\@end type:byte __RPC_FAR\W\*=\@end optstar:\*=$1@end optstar:__RPC_FAR= optstar:FAR= optstar:\S= optstar:=@end ! avoid a warning from "patterns.pat": resolve-type:\*\*Rem\J=@map-name{Rem$1}\*\* resolve-type:\*user\J=@map-name{user$1}\* ptr-type:LPUNKNOWN=Interface\* ptr-type:LPSTREAM=Interface\* ptr-type:LPDATAOBJECT=Interface\* ptr-type:LPENUMFORMATETC=Interface\* ptr-type:LPLOCKBYTES=Interface\* ptr-type:\*LOGPALETTE=LPLOGPALETTE\* ptr-type:ULARGE_INTEGER=PULARGE-INTEGER ! special case to support smarter lpstreams typedef \/\*

\*\/\ IStream __RPC_FAR\W\*LPSTREAM\;= typedef \/\*

\*\/\WI\J\J\J __RPC_FAR \*LP\J\;=\ define constant @export{\} \= \\;\n\ @define{itype\:$5$6\\I=\$0\@end} ! this one doesn't follow the usual pattern above: typedef\ IAdviseSink __RPC_FAR\W\*\WLPADVISESINK\;=\ define constant @export{\} \= \\;\n\ @define{itype\:ADVISESINK\\I=\$0\@end} ! special case to avoid generating a duplicate definition: typedef\ struct\ tagOleMenuGroupWidths __RPC_FAR\W\*LPOLEMENUGROUPWIDTHS\;= result:\=\ \ result status \:\: \\;\n stars:\&=\* stars:\*\ const=\* typedef\ GUID \;=\ \Ndefine inline constant @export{@type{$1}} \= \\;\n\ @define{typedef $1 __RPC_FAR\\\*\WLP$1\\\;\=\\N\ define inline constant \@export\{@type{LP$1}\} \\\= \\\\;\\n} \L\#define EXTERN_C \W\W=\ @define{$1 \\\G(\)\\\;\=\ \\N\\ndefine C-function \@export\{\@fnname\{\$1\}\}\\n\$2\\N\ \@result\{@quote{$3}\}\ \\ \\ c-name\\\: \\"\$1\\"\@wrap\{@quote{$4\;}\}\\n\ end\\\;\\n} \L\#define () EXTERN_C \W$2 =\ @define{$1()\\W\\\G(\)\\\;\=\ \\N\\ndefine C-function \@export\{\@fnname\{\$2\}\}\\n\$3\\N\ \@result\{\$1\}\ \\ \\ c-name\\\: \\"\$2\\"\@wrap\{@quote{$4\;}\}\\n\ end\\\;\\n} ! additional rules for output parameters in non-member functions: args:LP\J FAR\*\W=\ \ \ output parameter $2 @tab{24}\:\: \\;\ \ \/\/ \\n itype:\JSTREAM\I=$0@end! for CreateStreamOnHGlobal in "omisc.dylan" itype:\JDATAADVISEHOLDER\I=$0@end! for CreateDataAdviseHolder in "omisc.dylan" itype:=@fail args:LP\J FAR\*\W=@outparm{LP$1 FAR\* $2} args:LPUNKNOWN \*ppunkMarshal=@outparm{LPUNKNOWN\* ppunkMarshal} args:LPSTREAM \*ppStm=@outparm{LPSTREAM\* ppStm} args:BOOL FAR\W\*\W=@outparm{LPBOOL $1} ! for StgCreateDocfile etc. in "objbase.h": args:I\J\J FAR\W\*\WFAR\W\*=@outparm{I$1$2$3\*\* $4} ! unnamed output parameter for ParseCmdLine in "olestd.h": outok:\A\P,=out${argnum}@incr{argnum}@end ! additional output parameters: args:DWORD FAR\W\*\W=@outparm{DWORD\* $1} args:WORD FAR\W\*\W=@outparm{WORD\* $1} args:ULONG FAR\W\*\W=@outparm{ULONG\* $1} args:H\J FAR\W\*\W=@outparm{H$1\* $2} ! special case for functions in "ole2.h" that return an interface as a void* args:LPVOID\ FAR\*\W\I=\ \ \ output parameter $1 @tab{24}\:\: \\;\n return-interface:ppvObj=$0@end;lplpObj=$0@end;=@fail declspec:DECLSPEC_IMPORT=__declspec(dllimport)@end declspec:=@end ! Special hack for a case in "oleidl.h" that doesn't follow usual pattern: type:struct\ tagOIFI=@resolve-type{$1OLEINPLACEFRAMEINFO}@end link:STDMETHODCALLTYPE=, c-modifiers\: "__stdcall"@end link:__RPC_USER=, c-modifiers\: "__stdcall"@end type:TYMED\I=\@end! enumeration type defined in "objidl.h" :STDAPI \G()\;=@stdfun{\\d$1\d$2} :STDAPI_()\W\G()\;=@stdfun{$1\d$2\d$3} :STDMETHODIMP \G()\;=@stdfun{\\d$1\d$2} undef-flag:OBSOLETE=$0@end undef-flag:\s= ! for "samples/include/ansiapi.h": \L\#define \n=@define{def-flag\:$1\=\$0\@end} def-flag:=@fail ! have to undefine this for compatibility with Windows 95. undef-flag:_WIN32_DCOM=$0@end false-flag:DBG\=\=1=$0 ! for "samples/include/ole2ui.h": type:OLECHAR=\@end ! for VARENUM in "oaidl.h" [note that this is C++ syntax, not standard C] \Nenum \W\{\W\}\G\W\;=\N\/\/ enum $1\:\n$2\n\ @set{prev;-1}@export-end{} ! need addition for these: enumbody:OLE_E_\J\W\=\W\+\W=\ define inline-only constant @export{\$OLE_E_$1} \=\ @wrap{\ \\\%\+(\$@map-name{$2}, $3)\;}\n@set{prev;\$OLE-E-$1} enumbody:OLE_E_\J=\ define inline-only constant @export{\$OLE_E_$1} \=\ @wrap{\ \\\%\+(${prev;-1}, 1)\;}\n@set{prev;\$@map-name{OLE_E_$1}} ! for "oleauto.h": args:double FAR\* =@outparm{$0} args:unsigned short FAR\* =@outparm{$0} ! looks like a function name but is really a type name: relevant-name:StorageLayout=$0@end ! exclude this structure used only in stub functions: bad-struct:_FLAG_STGMEDIUM=$0@end ! structure PROPVARIANT doesn't follow the usual pattern typedef\ struct\ tagPROPVARIANT PROPVARIANT\;= struct tag\J\W\{\}\;=\ @{typedef struct tag$1 \{ $2 \} $1\;\n} ! ignore obsolete field ``_VARIANT_BOOL bool'' in union. fields:VARIANT_BOOL \;_VARIANT_BOOL bool\;=@fields{VARIANT_BOOL $1\;} ! not supporting these union fields yet: !fields:CA\J \;=\ \ \/\/ slot $2-value @tab{36}\:\: @type{CA$1}\;\n ! Don't re-export imported slots: export-slot:\CcbSize=$0-value@end export-slot:\Ccb=$0-value@end export-slot:\CcBytes=$0-value@end export-slot:\CdwPlatformId=$0-value@end export-slot:\Cu=$0-value@end export-slot:\CBuffer=$0-value@end