cbinding.h revision 9446711dd04e377f0de8160e1a191ad33d2032f1
/* $Revision$ */
/** @file cbinding.h
* C binding for XPCOM.
*/
/*
* Copyright (C) 2009 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ___VBoxXPCOMC_cbinding_h
#define ___VBoxXPCOMC_cbinding_h
#ifndef MOZ_UNICODE
# define MOZ_UNICODE
#endif
#ifdef __cplusplus
# include "VirtualBox_XPCOM.h"
#else
# include "VirtualBox_CXPCOM.h"
#endif
#ifdef IN_VBOXXPCOMC
#else
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Initialize/Uninitialize XPCOM. */
VBOXXPCOMC_DECL(void) VBoxComUninitialize(void);
/* Deallocation functions. */
/* Converting to and from UTF-8 and UTF-16. */
/* Getting and setting the environment variables. */
/**
* Function table for dynamic linking.
* Use VBoxGetFunctions() to obtain the pointer to it.
*/
typedef struct VBOXXPCOMC
{
/** The size of the structure. */
unsigned cb;
/** The structure version. */
unsigned uVersion;
void (*pfnComUninitialize)(void);
void (*pfnComUnallocMem)(void *pv);
void (*pfnUtf8Free)(char *pszString);
/** Tail version, same as uVersion. */
unsigned uEndVersion;
} VBOXXPCOMC;
/** Pointer to a const VBoxXPCOMC function table. */
typedef VBOXXPCOMC const *PCVBOXXPCOM;
/** The current interface version.
* For use with VBoxGetXPCOMCFunctions and to be found in
* VBOXXPCOMC::uVersion. */
#define VBOX_XPCOMC_VERSION 0x00010000U
/** Typedef for VBoxGetXPCOMCFunctions. */
/** The symbol name of VBoxGetXPCOMCFunctions. */
# define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "_VBoxGetXPCOMCFunctions"
#else
# define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "VBoxGetXPCOMCFunctions"
#endif
#ifdef __cplusplus
}
#endif
#endif /* !___VBoxXPCOMC_cbinding_h */