/* $Id$ */
/** @file
* IPRT - ASN.1, BOOLEAN Type.
*/
/*
* Copyright (C) 2006-2014 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.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** The false value (DER & CER). */
/** The true value (DER & CER). */
/*
* ASN.1 BOOLEAN - Special Methods.
*/
RTDECL(int) RTAsn1Boolean_InitDefault(PRTASN1BOOLEAN pThis, bool fValue, PCRTASN1ALLOCATORVTABLE pAllocator)
{
RTAsn1Core_InitEx(&pThis->Asn1Core, ASN1_TAG_BOOLEAN, ASN1_TAGCLASS_UNIVERSAL | ASN1_TAGFLAG_PRIMITIVE,
return VINF_SUCCESS;
}
{
/* Since we don't need an allocator, let's automatically initialize the struct. */
if (!RTAsn1Boolean_IsPresent(pThis))
else
return VINF_SUCCESS;
}
/*
* ASN.1 BOOLEAN - Standard Methods.
*/
{
"RTAsn1Boolean",
sizeof(RTASN1BOOLEAN),
0,
NULL,
NULL,
};
{
RTAsn1Core_InitEx(&pThis->Asn1Core, ASN1_TAG_BOOLEAN, ASN1_TAGCLASS_UNIVERSAL | ASN1_TAGFLAG_PRIMITIVE,
return VINF_SUCCESS;
}
RTDECL(int) RTAsn1Boolean_Clone(PRTASN1BOOLEAN pThis, PCRTASN1BOOLEAN pSrc, PCRTASN1ALLOCATORVTABLE pAllocator)
{
if (RTAsn1Boolean_IsPresent(pSrc))
{
int rc;
{
if (RT_FAILURE(rc))
return rc;
}
else
{
/* No value or one of the standard values. */
if (RT_FAILURE(rc))
return rc;
}
}
return VINF_SUCCESS;
}
{
if ( pThis
{
}
}
RTDECL(int) RTAsn1Boolean_Enum(PRTASN1BOOLEAN pThis, PFNRTASN1ENUMCALLBACK pfnCallback, uint32_t uDepth, void *pvUser)
{
Assert(pThis && (!RTAsn1Boolean_IsPresent(pThis) || pThis->Asn1Core.pOps == &g_RTAsn1Boolean_Vtable));
/* No children to enumerate. */
return VINF_SUCCESS;
}
{
Assert(pLeft && (!RTAsn1Boolean_IsPresent(pLeft) || pLeft->Asn1Core.pOps == &g_RTAsn1Boolean_Vtable));
Assert(pRight && (!RTAsn1Boolean_IsPresent(pRight) || pRight->Asn1Core.pOps == &g_RTAsn1Boolean_Vtable));
int iDiff;
if (RTAsn1Boolean_IsPresent(pLeft))
{
else
iDiff = -1;
}
else
return iDiff;
}
RTDECL(int) RTAsn1Boolean_CheckSanity(PCRTASN1BOOLEAN pThis, uint32_t fFlags, PRTERRINFO pErrInfo, const char *pszErrorTag)
{
return VINF_SUCCESS;
}
/*
* Generate code for the associated collection types.
*/
#include <iprt/asn1-generator-internal-header.h>
#include <iprt/asn1-generator-core.h>
#include <iprt/asn1-generator-init.h>
#include <iprt/asn1-generator-sanity.h>