VBoxXPCOMC.cpp revision c7814cf6e1240a519cbec0441e033d0e2470ed00
/* $Id$ */
/** @file VBoxXPCOMC.cpp
* Utility functions to use with the C binding for XPCOM.
*/
/*
* Copyright (C) 2009-2012 Oracle Corporation
*
* 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.
*/
#define LOG_GROUP LOG_GROUP_MAIN
#include <nsMemory.h>
#include <nsIServiceManager.h>
#include <nsEventQueueUtils.h>
#include "VBoxCAPI.h"
using namespace std;
static void VBoxComUninitialize(void);
static int
{
}
static int
{
}
static void
{
}
static void
VBoxUtf8Free(char *pszString)
{
}
static void
VBoxComUnallocMem(void *ptr)
{
if (ptr)
{
}
}
static void
{
*ppVirtualBox = NULL;
/* convert the string representation of UUID to nsIID type */
return;
{
return;
}
{
return;
}
{
return;
}
(void **)ppVirtualBox);
{
return;
}
Log(("Cbinding: IVirtualBox object created.\n"));
(void **)ppSession);
{
return;
}
Log(("Cbinding: ISession object created.\n"));
/* Store ppSession & ppVirtualBox so that VBoxComUninitialize
* can later take care of them while cleanup
*/
}
static void
{
/* stub that always fails. */
*ppVirtualBox = NULL;
}
static void
VBoxComUninitialize(void)
{
if (Session)
if (Ivirtualbox)
if (eventQ)
if (manager)
Log(("Cbinding: Cleaned up the created IVirtualBox and ISession Objects.\n"));
}
static void
{
*eventQueue = eventQ;
}
static uint32_t
VBoxVersion(void)
{
return version;
}
VBoxGetXPCOMCFunctions(unsigned uVersion)
{
/*
* The current interface version.
*/
static const VBOXXPCOMC s_Functions =
{
sizeof(VBOXXPCOMC),
};
return &s_Functions;
/*
* Legacy interface version 1.0.
*/
static const struct VBOXXPCOMCV1
{
/** The size of the structure. */
unsigned cb;
/** The structure version. */
unsigned uVersion;
unsigned int (*pfnGetVersion)(void);
void (*pfnComUninitialize)(void);
void (*pfnComUnallocMem)(void *pv);
void (*pfnUtf8Free)(char *pszString);
/** Tail version, same as uVersion. */
unsigned uEndVersion;
} s_Functions_v1_0 =
{
sizeof(s_Functions_v1_0),
0x00010000U,
0x00010000U
};
return (PCVBOXXPCOM)&s_Functions_v1_0;
/*
* Unsupported interface version.
*/
return NULL;
}
/* vim: set ts=4 sw=4 et: */