/* $Id$ */
/** @file
* VirtualBox Main - Extension Pack Utilities and definitions, VBoxC, VBoxSVC, ++.
*/
/*
* Copyright (C) 2010-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.
*/
#ifndef ____H_EXTPACKUTIL
#define ____H_EXTPACKUTIL
/** @name VBOX_EXTPACK_DESCRIPTION_NAME
* The name of the description file in an extension pack. */
/** @name VBOX_EXTPACK_DESCRIPTION_NAME
* The name of the manifest file in an extension pack. */
/** @name VBOX_EXTPACK_SIGNATURE_NAME
* The name of the signature file in an extension pack. */
/** @name VBOX_EXTPACK_LICENSE_NAME_PREFIX
* The name prefix of a license file in an extension pack. There can be
* several license files in a pack, the variations being on locale, language
* and format (HTML, RTF, plain text). All extension packages shall include
* a */
/** @name VBOX_EXTPACK_SUFFIX
* The suffix of a extension pack tarball. */
/** The minimum length (strlen) of a extension pack name. */
/** The max length (strlen) of a extension pack name. */
/** The architecture-dependent application data subdirectory where the
* extension packs are installed. Relative to RTPathAppPrivateArch. */
/** The architecture-independent application data subdirectory where the
* certificates are installed. Relative to RTPathAppPrivateNoArch. */
/** The maximum entry name length.
* Play short and safe. */
/**
* Plug-in descriptor.
*/
typedef struct VBOXEXTPACKPLUGINDESC
{
/** The name. */
/** The module name. */
/** The description. */
/** The frontend or component which it plugs into. */
/** Pointer to a plug-in descriptor. */
/**
* Extension pack descriptor
*
* This is the internal representation of the ExtPack.xml.
*/
typedef struct VBOXEXTPACKDESC
{
/** The name. */
/** The description. */
/** The version string. */
/** The edition string. */
/** The internal revision number. */
/** The name of the main module. */
/** The name of the VRDE module, empty if none. */
/** The number of plug-in descriptors. */
/** Pointer to an array of plug-in descriptors. */
/** Whether to show the license prior to installation. */
bool fShowLicense;
/** Pointer to a extension pack descriptor. */
/** Pointer to a const extension pack descriptor. */
RTCString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
RTCString *VBoxExtPackLoadDescFromVfsFile(RTVFSFILE hVfsFile, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
bool VBoxExtPackIsValidName(const char *pszName);
int VBoxExtPackCalcDir(char *pszExtPackDir, size_t cbExtPackDir, const char *pszParentDir, const char *pszName);
bool VBoxExtPackIsValidVersionString(const char *pszVersion);
bool VBoxExtPackIsValidEditionString(const char *pszEdition);
bool VBoxExtPackIsValidModuleString(const char *pszModule);
int VBoxExtPackValidateMember(const char *pszName, RTVFSOBJTYPE enmType, RTVFSOBJ hVfsObj, char *pszError, size_t cbError);
int VBoxExtPackOpenTarFss(RTFILE hTarballFile, char *pszError, size_t cbError, PRTVFSFSSTREAM phTarFss, PRTMANIFEST phFileManifest);
const char *pszTarball, const char *pszTarballDigest,
#endif