- Timestamp:
- Feb 11, 2009 4:47:53 PM (16 years ago)
- Location:
- trunk/src/VBox/Main/cbinding
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/VBoxXPCOMC.cpp
r16534 r16684 26 26 27 27 #include <iprt/string.h> 28 #include <iprt/env.h> 28 29 #include <VBox/log.h> 29 30 30 31 #include "VirtualBox_XPCOM.h" 32 #include "VBox/com/com.h" 31 33 #include "cbinding.h" 32 34 … … 71 73 } 72 74 75 VBOXXPCOMC_DECL(int) 76 VBoxSetEnv(const char *pszVar, const char *pszValue) 77 { 78 return RTEnvSet(pszVar, pszValue); 79 } 80 81 VBOXXPCOMC_DECL(const char*) 82 VBoxGetEnv(const char *pszVar) 83 { 84 return RTEnvGet(pszVar); 85 } 86 73 87 VBOXXPCOMC_DECL(void) 74 88 VBoxComInitialize(IVirtualBox **virtualBox, ISession **session) … … 82 96 Ivirtualbox = *virtualBox; 83 97 84 rc = NS_InitXPCOM2(&serviceManager, nsnull, nsnull);98 rc = com::Initialize(); 85 99 if (NS_FAILED(rc)) 86 100 { … … 136 150 if (serviceManager) 137 151 NS_RELEASE(serviceManager); // decrement refcount 138 NS_ShutdownXPCOM(nsnull);152 com::Shutdown(); 139 153 Log(("Cbinding: Cleaned up the created IVirtualBox and ISession Objects.\n")); 140 154 } -
trunk/src/VBox/Main/cbinding/cbinding.h
r16497 r16684 56 56 VBOXXPCOMC_DECL(int) VBoxUtf8ToUtf16(const char *pszString, PRUnichar **ppwszString); 57 57 58 /* Getting and Setting the Enviornment Variables */ 59 VBOXXPCOMC_DECL(const char*) VBoxGetEnv(const char *pszVar); 60 VBOXXPCOMC_DECL(int) VBoxSetEnv(const char *pszVar, const char *pszValue); 61 58 62 #ifdef __cplusplus 59 63 } -
trunk/src/VBox/Main/cbinding/makefile.tstLinuxC
r16550 r16684 32 32 33 33 .PHONY: all 34 all: tstLinuxC run34 all: tstLinuxC 35 35 36 36 .PHONY: clean 37 37 clean: 38 rm -f tstLinuxC.o tstLinuxC run38 rm -f tstLinuxC.o tstLinuxC 39 39 40 40 tstLinuxC: tstLinuxC.o … … 43 43 tstLinuxC.o: tstLinuxC.c 44 44 $(CC) $(CFLAGS) -DRT_OS_LINUX -DMOZ_UNICODE $(INCS_XPCOM) -o $@ -c $< 45 46 run:47 echo "env VBOX_XPCOM_HOME=$(PATH_BIN) ./tstLinuxC" > $@48 chmod a+x $@ -
trunk/src/VBox/Main/cbinding/tstLinuxC.c
r16548 r16684 306 306 PRUnichar *homefolderUtf16 = NULL; 307 307 nsresult rc; /* Result code of various function (method) calls. */ 308 FILE *fpsetenv; 309 310 if ((fpsetenv = fopen("/opt/VirtualBox/VBoxXPCOMC.so", "r")) != NULL) { 311 VBoxSetEnv("VBOX_APP_HOME","/opt/VirtualBox/"); 312 fclose (fpsetenv); 313 } 314 if ((fpsetenv = fopen("/usr/lib/virtualbox/VBoxXPCOMC.so", "r")) != NULL) { 315 VBoxSetEnv("VBOX_APP_HOME","/usr/lib/virtualbox/"); 316 fclose (fpsetenv); 317 } 308 318 309 319 printf("Starting Main\n");
Note:
See TracChangeset
for help on using the changeset viewer.