manifest2.cpp revision db22a92f701bfcc17823963d6c8b745f68d44e30
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * IPRT - Manifest, the core.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright (C) 2010 Oracle Corporation
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * available from http://www.virtualbox.org. This file is free software;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * General Public License (GPL) as published by the Free Software
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * The contents of this file may alternatively be used under the terms
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * of the Common Development and Distribution License Version 1.0
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * VirtualBox OSE distribution, in which case the provisions of the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * CDDL are applicable instead of those of the GPL.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * You may elect to license modified versions of this file under the
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * terms and conditions of either the GPL or the CDDL or both.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*******************************************************************************
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync* Header Files *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync*******************************************************************************/
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*******************************************************************************
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync* Structures and Typedefs *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync*******************************************************************************/
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Manifest attribute.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Used both for entries and manifest attributes.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The string space core (szName). */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The property value. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The attribute type if applicable, RTMANIFEST_ATTR_UNKNOWN if not. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The normalized property name that StrCore::pszString points at. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Pointer to a manifest attribute. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Manifest entry.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The string space core (szName). */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The entry attributes (hashes, checksums, size, etc) -
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * RTMANIFESTATTR. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The normalized entry name that StrCore::pszString points at. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** Pointer to a manifest entry. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Manifest handle data.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** Magic value (RTMANIFEST_MAGIC). */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** The number of references to this manifest. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** Manifest attributes - RTMANIFESTATTR. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync /** String space of the entries covered by this manifest -
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * RTMANIFESTENTRY. */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/** The value of RTMANIFESTINT::u32Magic. */
if (!pThis)
return VERR_NO_MEMORY;
return VINF_SUCCESS;
return cRefs;
if (!cRefs)
return cRefs;
return VERR_NOT_IMPLEMENTED;
RTDECL(int) RTManifestEqualsEx(RTMANIFEST hManifest1, RTMANIFEST hManifest2, const char * const *papszIgnoreEntries,
return VINF_SUCCESS;
return VERR_NOT_EQUAL;
return VERR_NOT_IMPLEMENTED;
return RTManifestEqualsEx(hManifest1, hManifest2, NULL /*papszIgnoreEntries*/, NULL /*papszIgnoreAttrs*/, NULL, 0);
static int rtManifestSetAttrWorker(PRTSTRSPACE pAttributes, const char *pszAttr, const char *pszValue, uint32_t fType)
char *pszValueCopy;
return rc;
if (pAttr)
if (!pAttr)
return VERR_NO_MEMORY;
AssertFailed();
return VERR_INTERNAL_ERROR_4;
return VINF_SUCCESS;
RTDECL(int) RTManifestSetAttr(RTMANIFEST hManifest, const char *pszAttr, const char *pszValue, uint32_t fType)
if (!pStrCore)
return VWRN_NOT_FOUND;
return VINF_SUCCESS;
static int rtManifestValidateNameEntry(const char *pszEntry, bool *pfNeedNormalization, size_t *pcchEntry)
int rc;
bool fNeedNormalization = false;
if (!uc)
fNeedNormalization = true;
if (pfNeedNormalization)
if (pcchEntry)
return rc;
char ch;
pszEntry++;
static int rtManifestGetEntry(RTMANIFESTINT *pThis, const char *pszEntry, bool fNeedNormalization, size_t cchEntry,
if (!fNeedNormalization)
return VERR_NO_TMP_MEMORY;
bool fNeedNormalization;
if (!pEntry)
return VERR_NO_MEMORY;
if (fNeedNormalization)
return VERR_INTERNAL_ERROR_4;
return rc;
RTDECL(int) RTManifestEntryUnsetAttr(RTMANIFEST hManifest, const char *pszEntry, const char *pszAttr)
bool fNeedNormalization;
return rc;
bool fNeedNormalization;
if (pEntry)
if (fNeedNormalization)
return rc;
bool fNeedNormalization;
return rc;
return VERR_NOT_IMPLEMENTED;
return VERR_NOT_IMPLEMENTED;