[94] | 1 | /* ***** BEGIN LICENSE BLOCK *****
|
---|
| 2 | * Version: CDDL 1.0/LGPL 2.1
|
---|
| 3 | *
|
---|
| 4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND
|
---|
| 5 | * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
|
---|
| 6 | * this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at http://www.sun.com/cddl/
|
---|
| 8 | *
|
---|
| 9 | * Software distributed under the License is distributed on an "AS IS" basis,
|
---|
| 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
| 11 | * for the specific language governing rights and limitations under the
|
---|
| 12 | * License.
|
---|
| 13 | *
|
---|
| 14 | * The Original Code is "NOM" Netlabs Object Model
|
---|
| 15 | *
|
---|
| 16 | * The Initial Developer of the Original Code is
|
---|
| 17 | * netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
|
---|
| 18 | * Portions created by the Initial Developer are Copyright (C) 2005-2006
|
---|
| 19 | * the Initial Developer. All Rights Reserved.
|
---|
| 20 | *
|
---|
| 21 | * Contributor(s):
|
---|
| 22 | *
|
---|
| 23 | * Alternatively, the contents of this file may be used under the terms of
|
---|
| 24 | * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
|
---|
| 25 | * case the provisions of the LGPL are applicable instead of those above. If
|
---|
| 26 | * you wish to allow use of your version of this file only under the terms of
|
---|
| 27 | * the LGPL, and not to allow others to use your version of this file under
|
---|
| 28 | * the terms of the CDDL, indicate your decision by deleting the provisions
|
---|
| 29 | * above and replace them with the notice and other provisions required by the
|
---|
| 30 | * LGPL. If you do not delete the provisions above, a recipient may use your
|
---|
| 31 | * version of this file under the terms of any one of the CDDL or the LGPL.
|
---|
| 32 | *
|
---|
| 33 | * ***** END LICENSE BLOCK ***** */
|
---|
| 34 |
|
---|
| 35 | #ifndef NOM_H_INCLUDED
|
---|
| 36 | #define NOM_H_INCLUDED
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 | #include <glib.h>
|
---|
| 40 |
|
---|
| 41 | #ifndef NOMEXTERN
|
---|
| 42 | #ifdef __cplusplus
|
---|
| 43 | #define NOMEXTERN extern "C"
|
---|
| 44 | #else
|
---|
[326] | 45 | #define NOMEXTERN extern
|
---|
[94] | 46 | #endif
|
---|
| 47 | #endif
|
---|
| 48 |
|
---|
| 49 | #define NOM_Scope NOMEXTERN
|
---|
| 50 |
|
---|
| 51 | #ifndef NOMLINK
|
---|
| 52 | #if defined(__OS2__)
|
---|
| 53 | #if defined(__IBMCPP__)
|
---|
| 54 | #define NOMLINK _System
|
---|
| 55 | #elif defined(__EMX__)
|
---|
| 56 | #define NOMLINK _System
|
---|
| 57 | #else
|
---|
| 58 | #define NOMLINK
|
---|
| 59 | #endif /* __IBMCPP__ */
|
---|
| 60 | #else
|
---|
| 61 | #define NOMLINK
|
---|
| 62 | #endif
|
---|
| 63 | #endif
|
---|
| 64 |
|
---|
| 65 | #define NOMDLINK
|
---|
| 66 |
|
---|
[326] | 67 | /** @def NOMDLLEXPORT
|
---|
| 68 | * Used for exporting a symbol.
|
---|
| 69 | * See __declspec(dllexport) in the Visual C++ reference for details. */
|
---|
| 70 | /** @def NOMDLLIMPORT
|
---|
| 71 | * Used for importing a symbol from a DLL/so.
|
---|
| 72 | * See __declspec(dllimport) in the Visual C++ reference for details. */
|
---|
| 73 | #if defined(_WIN32) || (defined(__OS2__) && defined(__GNUC__) && defined(__declspec))
|
---|
| 74 | # define NOMDLLEXPORT __declspec(dllexport)
|
---|
| 75 | # define NOMDLLIMPORT __declspec(dllimport)
|
---|
| 76 | #elif defined(__GNUC__)
|
---|
| 77 | # if __GNUC__ >= 4
|
---|
| 78 | # define NOMDLLEXPORT __attribute__((visibility("default")))
|
---|
| 79 | # else
|
---|
| 80 | # define NOMDLLEXPORT
|
---|
| 81 | # endif
|
---|
| 82 | # define NOMDLLIMPORT
|
---|
| 83 | #else
|
---|
| 84 | # define NOMDLLEXPORT
|
---|
| 85 | # define NOMDLLIMPORT
|
---|
| 86 | #endif
|
---|
| 87 |
|
---|
[94] | 88 | typedef void* NOMLINK nomMethodProc(void*);
|
---|
| 89 |
|
---|
| 90 | #ifndef NULL
|
---|
[326] | 91 | # ifdef __cplusplus
|
---|
| 92 | # define NULL 0
|
---|
| 93 | # else
|
---|
| 94 | # define NULL ((void *) 0)
|
---|
| 95 | # endif
|
---|
[94] | 96 | #endif
|
---|
| 97 |
|
---|
| 98 | #ifndef IN
|
---|
| 99 | #define IN
|
---|
| 100 | #endif
|
---|
| 101 |
|
---|
| 102 | #ifndef OUT
|
---|
| 103 | #define OUT
|
---|
| 104 | #endif
|
---|
| 105 |
|
---|
| 106 | #ifndef INOUT
|
---|
| 107 | #define INOUT
|
---|
| 108 | #endif
|
---|
| 109 |
|
---|
| 110 | typedef gchar *string;
|
---|
| 111 |
|
---|
| 112 | typedef gint16 CORBA_short;
|
---|
| 113 | typedef gint32 CORBA_long;
|
---|
| 114 | typedef guint16 CORBA_unsigned_short;
|
---|
| 115 | typedef guint32 CORBA_unsigned_long;
|
---|
| 116 | typedef gfloat CORBA_float;
|
---|
| 117 | typedef gdouble CORBA_double;
|
---|
| 118 | typedef char CORBA_char;
|
---|
| 119 | typedef gunichar2 CORBA_wchar;
|
---|
| 120 | typedef guchar CORBA_boolean;
|
---|
| 121 | typedef guchar CORBA_octet;
|
---|
| 122 | typedef gdouble CORBA_long_double;
|
---|
| 123 | typedef char* CORBA_string;
|
---|
| 124 |
|
---|
[281] | 125 | //typedef gboolean boolean;
|
---|
| 126 |
|
---|
[94] | 127 | #if 0
|
---|
| 128 | #if !defined(ORBIT_DECL_CORBA_Object) && !defined(_CORBA_Object_defined)
|
---|
| 129 | #define ORBIT_DECL_CORBA_Object 1
|
---|
| 130 | #define _CORBA_Object_defined 1
|
---|
| 131 | typedef struct CORBA_Object_type *CORBA_Object;
|
---|
| 132 | #endif
|
---|
| 133 | #endif
|
---|
| 134 |
|
---|
| 135 | typedef unsigned long NOM_ulong;
|
---|
| 136 | typedef GQuark nomId;
|
---|
[190] | 137 | typedef nomId* pnomId;
|
---|
[94] | 138 |
|
---|
[185] | 139 | typedef GData* PGData;
|
---|
[174] | 140 | typedef gulong* pgulong;
|
---|
[185] | 141 | typedef GTree* PGTree;
|
---|
[242] | 142 | typedef GArray* PGArray;
|
---|
[94] | 143 |
|
---|
[242] | 144 |
|
---|
[158] | 145 | typedef gchar **nomID; /* This will be reomoved later. Don't use anymore */
|
---|
| 146 | typedef void *nomToken; /* Use a gpointer instead of void* here? */
|
---|
[94] | 147 |
|
---|
| 148 | #ifndef NOM_BOOLEAN
|
---|
| 149 | #define NOM_BOOLEAN
|
---|
[281] | 150 | typedef gboolean boolean;
|
---|
[94] | 151 | #endif /* NOM_BOOLEAN */
|
---|
| 152 |
|
---|
| 153 |
|
---|
| 154 | /* Object Instance Structure */
|
---|
| 155 | struct nomMethodTabStruct;
|
---|
| 156 | typedef struct NOMAnyObj_struct {
|
---|
| 157 | struct nomMethodTabStruct *mtab;
|
---|
[139] | 158 | gulong body[1];
|
---|
[94] | 159 | } NOMAnyObj;
|
---|
| 160 |
|
---|
[213] | 161 | #if 0
|
---|
[179] | 162 | #ifndef NOMClass
|
---|
| 163 | typedef struct NOMClass_struct {
|
---|
| 164 | struct nomMethodTabStruct *mtab;
|
---|
| 165 | gulong body[1];
|
---|
| 166 | } NOMClassObj;
|
---|
| 167 | #define NOMClass NOMClassObj
|
---|
| 168 | typedef NOMClass *PNOMClass;
|
---|
| 169 | #endif
|
---|
[213] | 170 | #endif
|
---|
[179] | 171 |
|
---|
| 172 | #ifndef NOMObject
|
---|
| 173 | typedef struct NOMObject_struct {
|
---|
| 174 | struct nomMethodTabStruct *mtab;
|
---|
| 175 | gulong body[1];
|
---|
| 176 | } NOMObjectObj;
|
---|
| 177 | #define NOMObject NOMObjectObj
|
---|
| 178 | typedef NOMObject *PNOMObject;
|
---|
| 179 | #endif
|
---|
| 180 |
|
---|
[213] | 181 | #define NOMClass NOMObject
|
---|
| 182 | typedef NOMClass *PNOMClass;
|
---|
| 183 |
|
---|
[179] | 184 | //#define NOMObject NOMAnyObj
|
---|
[94] | 185 | #define NOMClassMgr NOMAnyObj
|
---|
| 186 |
|
---|
| 187 | typedef NOMObject *CORBA_Object;
|
---|
| 188 |
|
---|
[139] | 189 | /* The following is probably not correct... */
|
---|
[255] | 190 | //typedef NOMAnyObj CORBA_Environment;
|
---|
[94] | 191 |
|
---|
| 192 | #define nomresolve_(obj,mToken) ((nomMethodProc*)((void)obj, mToken))
|
---|
| 193 | #define NOM_Resolve(obj, objClassName, methodName) \
|
---|
| 194 | (( nomTD_ ## objClassName ## _ ## methodName ) \
|
---|
| 195 | nomresolve_(obj, objClassName ## ClassData.methodName ))
|
---|
| 196 |
|
---|
| 197 | #include <nomapi.h>
|
---|
| 198 |
|
---|
| 199 | #endif /* NOM_H_INCLUDED */
|
---|
| 200 |
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 |
|
---|
| 204 |
|
---|
| 205 |
|
---|
| 206 |
|
---|