VirtualBox

Changeset 95624 in vbox for trunk/include


Ignore:
Timestamp:
Jul 13, 2022 8:31:41 PM (2 years ago)
Author:
vboxsync
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/include/iprt
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asn1-generator-pass.h

    r95594 r95624  
    865865# define RTASN1TMPL_END_SETCORE()                                                   RTASN1TMPL_SEMICOLON_DUMMY()
    866866
     867# define RTASN1TMPL_MEMBER_OPT_ITAG_EX(a_Name, a_Type, a_Api, a_uTag, a_fClue, a_Constraints) \
     868RTASN1TMPL_DECL(int) RT_CONCAT3(RTASN1TMPL_EXT_NAME,_Set,a_Name)(RT_CONCAT(P,RTASN1TMPL_TYPE) pThis, RT_CONCAT(PC,a_Type) pSrc,\
     869                                                                 PCRTASN1ALLOCATORVTABLE pAllocator) \
     870{ \
     871    AssertPtr(pThis); AssertPtr(pSrc); Assert(RT_CONCAT(a_Api,_IsPresent)(pSrc)); \
     872    if (RT_CONCAT(a_Api,_IsPresent)(&pThis->a_Name)) \
     873        RT_CONCAT(a_Api,_Delete)(&pThis->a_Name); \
     874    \
     875    int rc = RT_CONCAT(a_Api,_Clone)(&pThis->a_Name, pSrc, pAllocator); \
     876    if (RT_SUCCESS(rc)) \
     877    { \
     878        RTAsn1Core_ResetImplict(RT_CONCAT(a_Api,_GetAsn1Core)(&pThis->a_Name)); /* probably not needed */ \
     879        rc = RTAsn1Core_SetTagAndFlags(RT_CONCAT(a_Api,_GetAsn1Core)(&pThis->a_Name), \
     880                                       a_uTag, RTASN1TMPL_ITAG_F_EXPAND(a_fClue)); \
     881    } \
     882    return rc; \
     883} RTASN1TMPL_SEMICOLON_DUMMY()
     884
     885# define RTASN1TMPL_MEMBER_OPT_XTAG_EX(a_TnNm, a_CtxTagN, a_Name, a_Type, a_Api, a_uTag, a_Constraints) \
     886RTASN1TMPL_DECL(int) RT_CONCAT3(RTASN1TMPL_EXT_NAME,_Set,a_Name)(RT_CONCAT(P,RTASN1TMPL_TYPE) pThis, RT_CONCAT(PC,a_Type) pSrc,\
     887                                                                 PCRTASN1ALLOCATORVTABLE pAllocator) \
     888{ \
     889    AssertPtr(pThis); AssertPtr(pSrc); Assert(RT_CONCAT(a_Api,_IsPresent)(pSrc)); \
     890    if (RTASN1CORE_IS_PRESENT(&pThis->a_TnNm.a_CtxTagN.Asn1Core)) \
     891        RT_CONCAT(a_Api,_Delete)(&pThis->a_TnNm.a_Name); \
     892    \
     893    int rc = RT_CONCAT3(RTAsn1ContextTag,a_uTag,_Init)(&pThis->a_TnNm.a_CtxTagN, \
     894                                                       &RT_CONCAT5(g_,RTASN1TMPL_INT_NAME,_XTAG_,a_Name,_Vtable), \
     895                                                       pAllocator); \
     896    if (RT_SUCCESS(rc)) \
     897    { \
     898        rc = RT_CONCAT(a_Api,_Clone)(&pThis->a_TnNm.a_Name, pSrc, pAllocator); \
     899        if (RT_SUCCESS(rc)) \
     900            RTAsn1Core_ResetImplict(RT_CONCAT(a_Api,_GetAsn1Core)(&pThis->a_TnNm.a_Name)); \
     901    } \
     902    return rc; \
     903} RTASN1TMPL_SEMICOLON_DUMMY()
    867904
    868905# define RTASN1TMPL_BEGIN_PCHOICE() RTASN1TMPL_SEMICOLON_DUMMY()
  • trunk/include/iprt/asn1.h

    r95596 r95624  
    11071107
    11081108RTDECL(int) RTAsn1ObjId_InitFromString(PRTASN1OBJID pThis, const char *pszObjId, PCRTASN1ALLOCATORVTABLE pAllocator);
     1109RTDECL(int) RTAsn1ObjId_SetFromString(PRTASN1OBJID pThis, const char *pszObjId, PCRTASN1ALLOCATORVTABLE pAllocator);
    11091110
    11101111/**
     
    11851186#define RTASN1BITSTRING_GET_BYTE_SIZE(a_pBitString)  ( ((a_pBitString)->cBits + 7U) >> 3 )
    11861187
     1188RTDECL(int) RTAsn1BitString_InitWithData(PRTASN1BITSTRING pThis, void const *pvSrc, uint32_t cSrcBits,
     1189                                         PCRTASN1ALLOCATORVTABLE pAllocator);
    11871190RTDECL(int) RTAsn1BitString_DecodeAsn1Ex(PRTASN1CURSOR pCursor, uint32_t fFlags, uint32_t cMaxBits, PRTASN1BITSTRING pThis,
    11881191                                         const char *pszErrorTag);
  • trunk/include/iprt/crypto/spc.h

    r95613 r95624  
    293293typedef RTCRSPCSTRING const *PCRTCRSPCSTRING;
    294294RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCSTRING, RTDECL, RTCrSpcString, Dummy.Asn1Core);
     295
     296RTDECL(int) RTCrSpcString_SetUcs2(PRTCRSPCSTRING pThis, PCRTASN1STRING pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
     297RTDECL(int) RTCrSpcString_SetAscii(PRTCRSPCSTRING pThis, PCRTASN1STRING pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
    295298
    296299
     
    351354RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCLINK, RTDECL, RTCrSpcLink, Dummy.Asn1Core);
    352355
     356RTDECL(int) RTCrSpcLink_SetUrl(PRTCRSPCLINK pThis, PCRTASN1STRING pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
     357RTDECL(int) RTCrSpcLink_SetMoniker(PRTCRSPCLINK pThis, PCRTCRSPCSERIALIZEDOBJECT pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
     358RTDECL(int) RTCrSpcLink_SetFile(PRTCRSPCLINK pThis, PCRTCRSPCSTRING pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
     359
    353360
    354361#if 0 /** @todo Might not be the correct bit order. */
     
    389396typedef RTCRSPCPEIMAGEDATA const *PCRTCRSPCPEIMAGEDATA;
    390397RTASN1TYPE_STANDARD_PROTOTYPES(RTCRSPCPEIMAGEDATA, RTDECL, RTCrSpcPeImageData, SeqCore.Asn1Core);
     398
     399RTDECL(int) RTCrSpcPeImageData_SetFlags(PRTCRSPCPEIMAGEDATA pThis, PCRTASN1BITSTRING pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
     400RTDECL(int) RTCrSpcPeImageData_SetFile(PRTCRSPCPEIMAGEDATA pThis, PCRTCRSPCLINK pToClone, PCRTASN1ALLOCATORVTABLE pAllocator);
    391401
    392402/** The object ID for SpcPeImageData. */
  • trunk/include/iprt/mangling.h

    r95596 r95624  
    30813081# define RTAsn1BitString_GetAsUInt64                    RT_MANGLER(RTAsn1BitString_GetAsUInt64)
    30823082# define RTAsn1BitString_Init                           RT_MANGLER(RTAsn1BitString_Init)
     3083# define RTAsn1BitString_InitWithData                   RT_MANGLER(RTAsn1BitString_InitWithData)
    30833084# define RTAsn1BitString_AreContentBitsValid            RT_MANGLER(RTAsn1BitString_AreContentBitsValid)
    30843085# define RTAsn1BitString_RefreshContent                 RT_MANGLER(RTAsn1BitString_RefreshContent)
     
    32063207# define RTAsn1ObjId_Init                               RT_MANGLER(RTAsn1ObjId_Init)
    32073208# define RTAsn1ObjId_InitFromString                     RT_MANGLER(RTAsn1ObjId_InitFromString)
     3209# define RTAsn1ObjId_SetFromString                      RT_MANGLER(RTAsn1ObjId_SetFromString)
    32083210# define RTAsn1ObjId_StartsWith                         RT_MANGLER(RTAsn1ObjId_StartsWith)
    32093211# define RTAsn1SeqOfObjIds_CheckSanity                  RT_MANGLER(RTAsn1SeqOfObjIds_CheckSanity)
     
    36273629# define RTCrSpcIndirectDataContent_DecodeAsn1          RT_MANGLER(RTCrSpcIndirectDataContent_DecodeAsn1)
    36283630# define RTCrSpcLink_DecodeAsn1                         RT_MANGLER(RTCrSpcLink_DecodeAsn1)
     3631# define RTCrSpcPeImageData_SetFile                     RT_MANGLER(RTCrSpcPeImageData_SetFile)
     3632# define RTCrSpcPeImageData_SetFlags                    RT_MANGLER(RTCrSpcPeImageData_SetFlags)
    36293633# define RTCrSpcPeImageData_DecodeAsn1                  RT_MANGLER(RTCrSpcPeImageData_DecodeAsn1)
    36303634# define RTCrSpcSerializedObjectAttribute_DecodeAsn1    RT_MANGLER(RTCrSpcSerializedObjectAttribute_DecodeAsn1)
     
    36403644# define RTCrSpcIndirectDataContent_Enum                RT_MANGLER(RTCrSpcIndirectDataContent_Enum)
    36413645# define RTCrSpcIndirectDataContent_GetPeImageObjAttrib RT_MANGLER(RTCrSpcIndirectDataContent_GetPeImageObjAttrib)
     3646# define RTCrSpcLink_SetFile                            RT_MANGLER(RTCrSpcLink_SetFile)
     3647# define RTCrSpcLink_SetMoniker                         RT_MANGLER(RTCrSpcLink_SetMoniker)
     3648# define RTCrSpcLink_SetUrl                             RT_MANGLER(RTCrSpcLink_SetUrl)
    36423649# define RTCrSpcLink_Compare                            RT_MANGLER(RTCrSpcLink_Compare)
    36433650# define RTCrSpcLink_Delete                             RT_MANGLER(RTCrSpcLink_Delete)
     
    36663673# define RTCrSpcIndirectDataContent_Clone               RT_MANGLER(RTCrSpcIndirectDataContent_Clone)
    36673674# define RTCrSpcIndirectDataContent_Init                RT_MANGLER(RTCrSpcIndirectDataContent_Init)
     3675# define RTCrSpcString_SetAscii                         RT_MANGLER(RTCrSpcString_SetAscii)
     3676# define RTCrSpcString_SetUcs2                          RT_MANGLER(RTCrSpcString_SetUcs2)
    36683677# define RTCrSpcLink_Clone                              RT_MANGLER(RTCrSpcLink_Clone)
    36693678# define RTCrSpcLink_Init                               RT_MANGLER(RTCrSpcLink_Init)
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