Changeset 17304 in vbox
- Timestamp:
- Mar 3, 2009 5:13:00 PM (16 years ago)
- Location:
- trunk/src/VBox/Main/cbinding
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/Makefile.kmk
r16841 r17304 41 41 XpComCHeaders_INST = $(INST_SDK)bindings/xpcom/include/ 42 42 XpComCHeaders_SOURCES = \ 43 cbinding.h \44 43 $(XpComCHeaders_0_OUTDIR)/VirtualBox_CXPCOM.h 45 44 -
trunk/src/VBox/Main/cbinding/VBoxXPCOMC.cpp
r16832 r17304 30 30 31 31 #include "VirtualBox_XPCOM.h" 32 #include "VirtualBox_CXPCOM.h" 32 33 #include "VBox/com/com.h" 33 #include "cbinding.h"34 34 35 35 using namespace std; -
trunk/src/VBox/Main/cbinding/VBoxXPCOMCGlue.h
r16837 r17304 1 1 /* $Revision$ */ 2 /** @file cbinding.h2 /** @file VBoxXPCOMCGlue.h 3 3 * Glue for dynamically linking with VBoxXPCOMC. 4 4 */ … … 32 32 #define ___VBoxXPCOMC_cglue_h 33 33 34 #include " cbinding.h"34 #include "VirtualBox_CXPCOM.h" 35 35 36 36 #ifdef __cplusplus -
trunk/src/VBox/Main/cbinding/makefile.tstLinuxC
r16729 r17304 21 21 22 22 PATH_BIN = /opt/VirtualBox 23 XPCOM_INCLUDE = ../../include 24 INCS_XPCOM = -I$(XPCOM_INCLUDE) \ 25 -I$(XPCOM_INCLUDE)/nsprpub 23 INCS_XPCOM = -I../../include 26 24 27 25 CC = gcc … … 39 37 40 38 tstLinuxC.o: tstLinuxC.c 41 $(CC) $(CFLAGS) -DRT_OS_LINUX -DMOZ_UNICODE$(INCS_XPCOM) -o $@ -c $<39 $(CC) $(CFLAGS) $(INCS_XPCOM) -o $@ -c $< 42 40 43 41 tstdlOpen: tstdlOpen.o … … 45 43 46 44 tstdlOpen.o: tstdlOpen.c 47 $(CC) $(CFLAGS) -D RT_OS_LINUX -DMOZ_UNICODE -DUSE_DYNAMIC_GLUE $(INCS_XPCOM) -o $@ -c $<45 $(CC) $(CFLAGS) -DUSE_DYNAMIC_GLUE $(INCS_XPCOM) -o $@ -c $< -
trunk/src/VBox/Main/cbinding/tstLinuxC.c
r16838 r17304 26 26 #include <stdlib.h> 27 27 #include <sys/stat.h> 28 #include " cbinding.h"28 #include "VirtualBox_CXPCOM.h" 29 29 30 30 static char *nsIDToString(nsID *guid); -
trunk/src/VBox/Main/cbinding/tstdlOpen.c
r16838 r17304 26 26 #include <sys/stat.h> 27 27 #include <dlfcn.h> 28 #include " cbinding.h"28 #include "VirtualBox_CXPCOM.h" 29 29 30 30 static char *nsIDToString(nsID *guid); -
trunk/src/VBox/Main/cbinding/xpcidl.xsl
r16406 r17304 115 115 */ 116 116 117 #ifndef ___VirtualBox_CXPCOM_h 118 #define ___VirtualBox_CXPCOM_h 119 120 #ifdef __cplusplus 121 # include "VirtualBox_XPCOM.h" 122 #else /* !__cplusplus */ 123 124 #include <stddef.h> 117 125 #include "wchar.h" 118 #include "prtypes.h" 126 127 #if defined(WIN32) 128 129 #define PR_EXPORT(__type) extern __declspec(dllexport) __type 130 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type 131 #define PR_IMPORT(__type) __declspec(dllimport) __type 132 #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type 133 134 #define PR_EXTERN(__type) extern __declspec(dllexport) __type 135 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type 136 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type 137 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type 138 139 #define PR_CALLBACK 140 #define PR_CALLBACK_DECL 141 #define PR_STATIC_CALLBACK(__x) static __x 142 143 #elif defined(XP_BEOS) 144 145 #define PR_EXPORT(__type) extern __declspec(dllexport) __type 146 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type 147 #define PR_IMPORT(__type) extern __declspec(dllexport) __type 148 #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type 149 150 #define PR_EXTERN(__type) extern __declspec(dllexport) __type 151 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type 152 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type 153 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type 154 155 #define PR_CALLBACK 156 #define PR_CALLBACK_DECL 157 #define PR_STATIC_CALLBACK(__x) static __x 158 159 #elif defined(WIN16) 160 161 #define PR_CALLBACK_DECL __cdecl 162 163 #if defined(_WINDLL) 164 #define PR_EXPORT(__type) extern __type _cdecl _export _loadds 165 #define PR_IMPORT(__type) extern __type _cdecl _export _loadds 166 #define PR_EXPORT_DATA(__type) extern __type _export 167 #define PR_IMPORT_DATA(__type) extern __type _export 168 169 #define PR_EXTERN(__type) extern __type _cdecl _export _loadds 170 #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds 171 #define PR_EXTERN_DATA(__type) extern __type _export 172 #define PR_IMPLEMENT_DATA(__type) __type _export 173 174 #define PR_CALLBACK __cdecl __loadds 175 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK 176 177 #else /* this must be .EXE */ 178 #define PR_EXPORT(__type) extern __type _cdecl _export 179 #define PR_IMPORT(__type) extern __type _cdecl _export 180 #define PR_EXPORT_DATA(__type) extern __type _export 181 #define PR_IMPORT_DATA(__type) extern __type _export 182 183 #define PR_EXTERN(__type) extern __type _cdecl _export 184 #define PR_IMPLEMENT(__type) __type _cdecl _export 185 #define PR_EXTERN_DATA(__type) extern __type _export 186 #define PR_IMPLEMENT_DATA(__type) __type _export 187 188 #define PR_CALLBACK __cdecl __loadds 189 #define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK 190 #endif /* _WINDLL */ 191 192 #elif defined(XP_MAC) 193 194 #define PR_EXPORT(__type) extern __declspec(export) __type 195 #define PR_EXPORT_DATA(__type) extern __declspec(export) __type 196 #define PR_IMPORT(__type) extern __declspec(export) __type 197 #define PR_IMPORT_DATA(__type) extern __declspec(export) __type 198 199 #define PR_EXTERN(__type) extern __declspec(export) __type 200 #define PR_IMPLEMENT(__type) __declspec(export) __type 201 #define PR_EXTERN_DATA(__type) extern __declspec(export) __type 202 #define PR_IMPLEMENT_DATA(__type) __declspec(export) __type 203 204 #define PR_CALLBACK 205 #define PR_CALLBACK_DECL 206 #define PR_STATIC_CALLBACK(__x) static __x 207 208 #elif defined(XP_OS2) && defined(__declspec) 209 210 #define PR_EXPORT(__type) extern __declspec(dllexport) __type 211 #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type 212 #define PR_IMPORT(__type) __declspec(dllimport) __type 213 #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type 214 215 #define PR_EXTERN(__type) extern __declspec(dllexport) __type 216 #define PR_IMPLEMENT(__type) __declspec(dllexport) __type 217 #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type 218 #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type 219 220 #define PR_CALLBACK 221 #define PR_CALLBACK_DECL 222 #define PR_STATIC_CALLBACK(__x) static __x 223 224 #elif defined(XP_OS2_VACPP) 225 226 #define PR_EXPORT(__type) extern __type 227 #define PR_EXPORT_DATA(__type) extern __type 228 #define PR_IMPORT(__type) extern __type 229 #define PR_IMPORT_DATA(__type) extern __type 230 231 #define PR_EXTERN(__type) extern __type 232 #define PR_IMPLEMENT(__type) __type 233 #define PR_EXTERN_DATA(__type) extern __type 234 #define PR_IMPLEMENT_DATA(__type) __type 235 #define PR_CALLBACK _Optlink 236 #define PR_CALLBACK_DECL 237 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK 238 239 #else /* Unix */ 240 241 # ifdef VBOX_HAVE_VISIBILITY_HIDDEN 242 # define PR_EXPORT(__type) __attribute__((visibility("default"))) extern __type 243 # define PR_EXPORT_DATA(__type) __attribute__((visibility("default"))) extern __type 244 # define PR_IMPORT(__type) extern __type 245 # define PR_IMPORT_DATA(__type) extern __type 246 # define PR_EXTERN(__type) __attribute__((visibility("default"))) extern __type 247 # define PR_IMPLEMENT(__type) __attribute__((visibility("default"))) __type 248 # define PR_EXTERN_DATA(__type) __attribute__((visibility("default"))) extern __type 249 # define PR_IMPLEMENT_DATA(__type) __attribute__((visibility("default"))) __type 250 # define PR_CALLBACK 251 # define PR_CALLBACK_DECL 252 # define PR_STATIC_CALLBACK(__x) static __x 253 # else 254 # define PR_EXPORT(__type) extern __type 255 # define PR_EXPORT_DATA(__type) extern __type 256 # define PR_IMPORT(__type) extern __type 257 # define PR_IMPORT_DATA(__type) extern __type 258 # define PR_EXTERN(__type) extern __type 259 # define PR_IMPLEMENT(__type) __type 260 # define PR_EXTERN_DATA(__type) extern __type 261 # define PR_IMPLEMENT_DATA(__type) __type 262 # define PR_CALLBACK 263 # define PR_CALLBACK_DECL 264 # define PR_STATIC_CALLBACK(__x) static __x 265 # endif 266 #endif 267 268 #if defined(_NSPR_BUILD_) 269 #define NSPR_API(__type) PR_EXPORT(__type) 270 #define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type) 271 #else 272 #define NSPR_API(__type) PR_IMPORT(__type) 273 #define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type) 274 #endif 275 276 typedef unsigned char PRUint8; 277 #if (defined(HPUX) && defined(__cplusplus) \ 278 && !defined(__GNUC__) && __cplusplus < 199707L) \ 279 || (defined(SCO) && defined(__cplusplus) \ 280 && !defined(__GNUC__) && __cplusplus == 1L) 281 typedef char PRInt8; 282 #else 283 typedef signed char PRInt8; 284 #endif 285 286 #define PR_INT8_MAX 127 287 #define PR_INT8_MIN (-128) 288 #define PR_UINT8_MAX 255U 289 290 typedef unsigned short PRUint16; 291 typedef short PRInt16; 292 293 #define PR_INT16_MAX 32767 294 #define PR_INT16_MIN (-32768) 295 #define PR_UINT16_MAX 65535U 296 297 typedef unsigned int PRUint32; 298 typedef int PRInt32; 299 #define PR_INT32(x) x 300 #define PR_UINT32(x) x ## U 301 302 #define PR_INT32_MAX PR_INT32(2147483647) 303 #define PR_INT32_MIN (-PR_INT32_MAX - 1) 304 #define PR_UINT32_MAX PR_UINT32(4294967295) 305 306 typedef long PRInt64; 307 typedef unsigned long PRUint64; 308 typedef int PRIntn; 309 typedef unsigned int PRUintn; 310 311 typedef double PRFloat64; 312 typedef size_t PRSize; 313 314 typedef ptrdiff_t PRPtrdiff; 315 316 typedef unsigned long PRUptrdiff; 317 318 typedef PRIntn PRBool; 319 320 #define PR_TRUE 1 321 #define PR_FALSE 0 322 323 typedef PRUint8 PRPackedBool; 324 325 /* 326 ** Status code used by some routines that have a single point of failure or 327 ** special status return. 328 */ 329 typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; 330 331 #ifndef __PRUNICHAR__ 332 #define __PRUNICHAR__ 333 #if defined(WIN32) || defined(XP_MAC) 334 typedef wchar_t PRUnichar; 335 #else 336 typedef PRUint16 PRUnichar; 337 #endif 338 #endif 339 340 typedef long PRWord; 341 typedef unsigned long PRUword; 119 342 120 343 #define nsnull 0 … … 311 534 </xsl:text> 312 535 <xsl:apply-templates/> 536 <xsl:text> 537 #endif /* !__cplusplus */ 538 539 #ifdef IN_VBOXXPCOMC 540 # define VBOXXPCOMC_DECL(type) PR_EXPORT(type) 541 #else 542 # define VBOXXPCOMC_DECL(type) PR_IMPORT(type) 543 #endif 544 545 #ifdef __cplusplus 546 extern "C" { 547 #endif 548 549 /* Initialize/Uninitialize XPCOM. */ 550 VBOXXPCOMC_DECL(void) VBoxComInitialize(IVirtualBox **virtualBox, ISession **session); 551 VBOXXPCOMC_DECL(void) VBoxComUninitialize(void); 552 553 /* Deallocation functions. */ 554 VBOXXPCOMC_DECL(void) VBoxComUnallocMem(void *ptr); 555 VBOXXPCOMC_DECL(void) VBoxUtf16Free(PRUnichar *pwszString); 556 VBOXXPCOMC_DECL(void) VBoxUtf8Free(char *pszString); 557 558 /* Converting to and from UTF-8 and UTF-16. */ 559 VBOXXPCOMC_DECL(int) VBoxUtf16ToUtf8(const PRUnichar *pwszString, char **ppszString); 560 VBOXXPCOMC_DECL(int) VBoxUtf8ToUtf16(const char *pszString, PRUnichar **ppwszString); 561 562 /* Getting and setting the environment variables. */ 563 VBOXXPCOMC_DECL(const char *) VBoxGetEnv(const char *pszVar); 564 VBOXXPCOMC_DECL(int) VBoxSetEnv(const char *pszVar, const char *pszValue); 565 566 567 /** 568 * Function table for dynamic linking. 569 * Use VBoxGetFunctions() to obtain the pointer to it. 570 */ 571 typedef struct VBOXXPCOMC 572 { 573 /** The size of the structure. */ 574 unsigned cb; 575 /** The structure version. */ 576 unsigned uVersion; 577 void (*pfnComInitialize)(IVirtualBox **virtualBox, ISession **session); 578 void (*pfnComUninitialize)(void); 579 580 void (*pfnComUnallocMem)(void *pv); 581 void (*pfnUtf16Free)(PRUnichar *pwszString); 582 void (*pfnUtf8Free)(char *pszString); 583 584 int (*pfnUtf16ToUtf8)(const PRUnichar *pwszString, char **ppszString); 585 int (*pfnUtf8ToUtf16)(const char *pszString, PRUnichar **ppwszString); 586 587 const char * (*pfnGetEnv)(const char *pszVar); 588 int (*pfnSetEnv)(const char *pszVar, const char *pszValue); 589 /** Tail version, same as uVersion. */ 590 unsigned uEndVersion; 591 } VBOXXPCOMC; 592 /** Pointer to a const VBoxXPCOMC function table. */ 593 typedef VBOXXPCOMC const *PCVBOXXPCOM; 594 595 /** The current interface version. 596 * For use with VBoxGetXPCOMCFunctions and to be found in 597 * VBOXXPCOMC::uVersion. */ 598 #define VBOX_XPCOMC_VERSION 0x00010000U 599 600 VBOXXPCOMC_DECL(PCVBOXXPCOM) VBoxGetXPCOMCFunctions(unsigned uVersion); 601 /** Typedef for VBoxGetXPCOMCFunctions. */ 602 typedef PCVBOXXPCOM (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion); 603 604 /** The symbol name of VBoxGetXPCOMCFunctions. */ 605 #if defined(__APPLE__) || defined(__OS2__) 606 # define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "_VBoxGetXPCOMCFunctions" 607 #else 608 # define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "VBoxGetXPCOMCFunctions" 609 #endif 610 611 612 #ifdef __cplusplus 613 } 614 #endif 615 616 #endif /* !___VirtualBox_CXPCOM_h */ 617 </xsl:text> 313 618 </xsl:template> 314 619 … … 774 1079 <xsl:text> </xsl:text> 775 1080 <xsl:value-of select="../@name" /> 776 <xsl:text> *this_, 1081 <xsl:text> *this_,
</xsl:text> 777 1082 <xsl:for-each select="param [position() != last()]"> 778 1083 <xsl:text> </xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.