VirtualBox

Ignore:
Timestamp:
Jul 13, 2022 8:31:41 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152265
Message:

IPRT/RTAsn1,RTCrSpc: Generate setter functions for RTASN1TMPL_MEMBER_OPT_XTAG_EX and RTASN1TMPL_MEMBER_OPT_ITAG_EX members. Added setter prototypes to the spc.h header. bugref:8691

Location:
trunk/src/VBox/Runtime/common/asn1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp

    r93115 r95624  
    345345
    346346
     347RTDECL(int) RTAsn1BitString_InitWithData(PRTASN1BITSTRING pThis, void const *pvSrc, uint32_t cSrcBits,
     348                                         PCRTASN1ALLOCATORVTABLE pAllocator)
     349{
     350    RTAsn1BitString_Init(pThis, pAllocator);
     351    Assert(pThis->pEncapsulated == NULL);
     352
     353    uint32_t cbToCopy = (cSrcBits + 7) / 8;
     354    int rc = RTAsn1ContentAllocZ(&pThis->Asn1Core, cbToCopy + 1, pAllocator);
     355    if (RT_SUCCESS(rc))
     356    {
     357        pThis->cBits    = cSrcBits;
     358        uint8_t *pbDst  = (uint8_t *)pThis->Asn1Core.uData.pu8;
     359        pThis->uBits.pv = pbDst + 1;
     360        *pbDst = 8 - (cSrcBits & 7); /* unused bits */
     361        memcpy(pbDst + 1, pvSrc, cbToCopy);
     362    }
     363    return rc;
     364}
     365
     366
    347367RTDECL(int) RTAsn1BitString_Clone(PRTASN1BITSTRING pThis, PCRTASN1BITSTRING pSrc, PCRTASN1ALLOCATORVTABLE pAllocator)
    348368{
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-core.cpp

    r93115 r95624  
    137137RTDECL(int) RTAsn1Core_CloneContent(PRTASN1CORE pThis, PCRTASN1CORE pSrc, PCRTASN1ALLOCATORVTABLE pAllocator)
    138138{
    139     return rtAsn1Core_CloneEx(pThis, pSrc, pAllocator, true /*fConpyContent*/);
     139    return rtAsn1Core_CloneEx(pThis, pSrc, pAllocator, true /*fCopyContent*/);
    140140}
    141141
     
    143143RTDECL(int) RTAsn1Core_CloneNoContent(PRTASN1CORE pThis, PCRTASN1CORE pSrc)
    144144{
    145     return rtAsn1Core_CloneEx(pThis, pSrc, NULL, false /*fConpyContent*/);
     145    return rtAsn1Core_CloneEx(pThis, pSrc, NULL, false /*fCopyContent*/);
    146146}
    147147
  • trunk/src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp

    r93115 r95624  
    337337
    338338
     339RTDECL(int) RTAsn1ObjId_SetFromString(PRTASN1OBJID pThis, const char *pszObjId, PCRTASN1ALLOCATORVTABLE pAllocator)
     340{
     341    RTAsn1ObjId_Delete(pThis);
     342    int rc = RTAsn1ObjId_InitFromString(pThis, pszObjId, pAllocator);
     343    if (RT_FAILURE(rc))
     344        RTAsn1ObjId_Init(pThis, pAllocator);
     345    return rc;
     346}
     347
     348
    339349RTDECL(int) RTAsn1ObjId_CompareWithString(PCRTASN1OBJID pThis, const char *pszRight)
    340350{
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette