1 | /* $Revision: 16497 $ */
|
---|
2 | /** @file cbinding.h
|
---|
3 | * C binding for XPCOM.
|
---|
4 | */
|
---|
5 |
|
---|
6 | #ifndef ___cbinding_h
|
---|
7 | #define ___cbinding_h
|
---|
8 |
|
---|
9 | /*
|
---|
10 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
11 | *
|
---|
12 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | * available from http://www.virtualbox.org. This file is free software;
|
---|
14 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | * General Public License (GPL) as published by the Free Software
|
---|
16 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 | *
|
---|
20 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
21 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
22 | * additional information or have any questions.
|
---|
23 | */
|
---|
24 |
|
---|
25 | #ifdef __cplusplus
|
---|
26 | # include "VirtualBox_XPCOM.h"
|
---|
27 | #else
|
---|
28 | # include "VirtualBox_CXPCOM.h"
|
---|
29 | #endif
|
---|
30 |
|
---|
31 | #ifdef IN_VBOXXPCOMC
|
---|
32 | # define VBOXXPCOMC_DECL(type) PR_EXPORT(type)
|
---|
33 | #else
|
---|
34 | # define VBOXXPCOMC_DECL(type) PR_IMPORT(type)
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #ifdef __cplusplus
|
---|
38 | extern "C" {
|
---|
39 | #endif
|
---|
40 |
|
---|
41 | /* Initialize/Uninitialize XPCOM. */
|
---|
42 | VBOXXPCOMC_DECL(void) VBoxComInitialize(IVirtualBox **virtualBox, ISession **session);
|
---|
43 | VBOXXPCOMC_DECL(void) VBoxComUninitialize(void);
|
---|
44 |
|
---|
45 | /* Deallocation functions. */
|
---|
46 | VBOXXPCOMC_DECL(void) VBoxComUnallocMem(void *ptr);
|
---|
47 | VBOXXPCOMC_DECL(void) VBoxUtf16Free(PRUnichar *pwszString);
|
---|
48 | VBOXXPCOMC_DECL(void) VBoxUtf8Free(char *pszString);
|
---|
49 |
|
---|
50 | /* Converting to and from ASCII. */
|
---|
51 | VBOXXPCOMC_DECL(const char *) VBoxConvertPRUnichartoAscii(PRUnichar *src);
|
---|
52 | VBOXXPCOMC_DECL(const PRUnichar *) VBoxConvertAsciitoPRUnichar(char *src);
|
---|
53 |
|
---|
54 | /* Converting to and from UTF-8 and UTF-16. */
|
---|
55 | VBOXXPCOMC_DECL(int) VBoxUtf16ToUtf8(const PRUnichar *pwszString, char **ppszString);
|
---|
56 | VBOXXPCOMC_DECL(int) VBoxUtf8ToUtf16(const char *pszString, PRUnichar **ppwszString);
|
---|
57 |
|
---|
58 | #ifdef __cplusplus
|
---|
59 | }
|
---|
60 | #endif
|
---|
61 |
|
---|
62 | #endif /* !___cbinding_h */
|
---|
63 |
|
---|