1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
---|
2 | /* ***** BEGIN LICENSE BLOCK ***** |
---|
3 | * Version: NPL 1.1/GPL 2.0/LGPL 2.1 |
---|
4 | * |
---|
5 | * The contents of this file are subject to the Netscape Public License |
---|
6 | * Version 1.1 (the "License"); you may not use this file except in |
---|
7 | * compliance with the License. You may obtain a copy of the License at |
---|
8 | * http://www.mozilla.org/NPL/ |
---|
9 | * |
---|
10 | * Software distributed under the License is distributed on an "AS IS" basis, |
---|
11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
---|
12 | * for the specific language governing rights and limitations under the |
---|
13 | * License. |
---|
14 | * |
---|
15 | * The Original Code is mozilla.org code. |
---|
16 | * |
---|
17 | * The Initial Developer of the Original Code is |
---|
18 | * Netscape Communications Corporation. |
---|
19 | * Portions created by the Initial Developer are Copyright (C) 1998 |
---|
20 | * the Initial Developer. All Rights Reserved. |
---|
21 | * |
---|
22 | * Contributor(s): |
---|
23 | * |
---|
24 | * |
---|
25 | * Alternatively, the contents of this file may be used under the terms of |
---|
26 | * either the GNU General Public License Version 2 or later (the "GPL"), or |
---|
27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
---|
28 | * in which case the provisions of the GPL or the LGPL are applicable instead |
---|
29 | * of those above. If you wish to allow use of your version of this file only |
---|
30 | * under the terms of either the GPL or the LGPL, and not to allow others to |
---|
31 | * use your version of this file under the terms of the NPL, indicate your |
---|
32 | * decision by deleting the provisions above and replace them with the notice |
---|
33 | * and other provisions required by the GPL or the LGPL. If you do not delete |
---|
34 | * the provisions above, a recipient may use your version of this file under |
---|
35 | * the terms of any one of the NPL, the GPL or the LGPL. |
---|
36 | * |
---|
37 | * ***** END LICENSE BLOCK ***** */ |
---|
38 | |
---|
39 | |
---|
40 | /******************************************************************************* |
---|
41 | * Mini Component Object Model |
---|
42 | ******************************************************************************/ |
---|
43 | |
---|
44 | #ifndef MINICOM_H |
---|
45 | #define MINICOM_H |
---|
46 | |
---|
47 | #ifdef __cplusplus |
---|
48 | extern "C" { |
---|
49 | #endif |
---|
50 | |
---|
51 | /******************************************************************************/ |
---|
52 | |
---|
53 | #if defined(XP_PC) && !defined(XP_OS2) |
---|
54 | #if defined(_WIN32) |
---|
55 | #include "objbase.h" |
---|
56 | #else |
---|
57 | #include <windows.h> |
---|
58 | #include "compobj.h" |
---|
59 | #endif |
---|
60 | #else /* !XP_PC or XP_OS2*/ |
---|
61 | |
---|
62 | #if defined(XP_OS2) |
---|
63 | #define TID OS2TID /* global rename in OS2 H's! */ |
---|
64 | #include <os2.h> |
---|
65 | #undef TID /* and restore */ |
---|
66 | #endif |
---|
67 | |
---|
68 | typedef struct _GUID { |
---|
69 | long Data1; |
---|
70 | short Data2; |
---|
71 | short Data3; |
---|
72 | char Data4[8]; |
---|
73 | } GUID; |
---|
74 | |
---|
75 | typedef GUID IID; |
---|
76 | typedef GUID CLSID; |
---|
77 | |
---|
78 | typedef IID* REFIID; |
---|
79 | typedef GUID* REFGUID; |
---|
80 | typedef CLSID* REFCLSID; |
---|
81 | |
---|
82 | #ifdef __cplusplus |
---|
83 | #define EXTERN_C extern "C" |
---|
84 | #else |
---|
85 | #define EXTERN_C |
---|
86 | #endif /* cplusplus */ |
---|
87 | |
---|
88 | #ifndef INITGUID |
---|
89 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ |
---|
90 | EXTERN_C const GUID name |
---|
91 | #else |
---|
92 | #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ |
---|
93 | EXTERN_C const GUID name \ |
---|
94 | = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } |
---|
95 | #endif /* INITGUID */ |
---|
96 | |
---|
97 | #endif /* !XP_PC or XP_OS2*/ |
---|
98 | |
---|
99 | #define JRI_DEFINE_GUID(name, l, w1, w2) \ |
---|
100 | DEFINE_GUID(name, l, w1, w2, \ |
---|
101 | 0xbb, 0x58, 0x00, 0x80, 0x5f, 0x74, 0x03, 0x79) |
---|
102 | |
---|
103 | typedef long |
---|
104 | (*MCOM_QueryInterface_t)(void* self, REFIID id, void* *result); |
---|
105 | |
---|
106 | typedef long |
---|
107 | (*MCOM_AddRef_t)(void* self); |
---|
108 | |
---|
109 | typedef long |
---|
110 | (*MCOM_Release_t)(void* self); |
---|
111 | |
---|
112 | #if !defined(XP_PC) || defined(XP_OS2) |
---|
113 | |
---|
114 | typedef struct IUnknown { |
---|
115 | MCOM_QueryInterface_t QueryInterface; |
---|
116 | MCOM_AddRef_t AddRef; |
---|
117 | MCOM_Release_t Release; |
---|
118 | } IUnknown; |
---|
119 | |
---|
120 | #define IUnknown_QueryInterface(self, interfaceID, resultingInterface) \ |
---|
121 | (((*((IUnknown**)self))->QueryInterface)(self, interfaceID, resultingInterface)) |
---|
122 | |
---|
123 | #define IUnknown_AddRef(self) \ |
---|
124 | (((*((IUnknown**)self))->AddRef)(self)) |
---|
125 | |
---|
126 | #define IUnknown_Release(self) \ |
---|
127 | (((*((IUnknown**)self))->Release)(self)) |
---|
128 | |
---|
129 | #endif /* !XP_PC or XP_OS2*/ |
---|
130 | |
---|
131 | typedef long |
---|
132 | (*MCOM_CreateInstance_t)(void* self, IUnknown* outer, REFIID interfaceID, |
---|
133 | void** newInstance); |
---|
134 | |
---|
135 | typedef long |
---|
136 | (*MCOM_LockServer_t)(void* self, int doLock); |
---|
137 | |
---|
138 | /******************************************************************************/ |
---|
139 | #ifdef __cplusplus |
---|
140 | } |
---|
141 | #endif |
---|
142 | #endif /* MINICOM_H */ |
---|
143 | /******************************************************************************/ |
---|