Lines Matching refs:pAsn1Core

176 RTDECL(int) RTAsn1ContentAllocZ(PRTASN1CORE pAsn1Core, size_t cb, PCRTASN1ALLOCATORVTABLE pAllocator)
180 AssertPtr(pAsn1Core);
181 AssertReturn(!(pAsn1Core->fFlags & RTASN1CORE_F_ALLOCATED_CONTENT), VERR_INVALID_STATE);
198 pAsn1Core->cb = (uint32_t)cb;
199 pAsn1Core->uData.pv = &pHdr->au64Content[0];
200 pAsn1Core->fFlags |= RTASN1CORE_F_ALLOCATED_CONTENT;
207 RTDECL(int) RTAsn1ContentDup(PRTASN1CORE pAsn1Core, void const *pvSrc, size_t cbSrc, PCRTASN1ALLOCATORVTABLE pAllocator)
209 int rc = RTAsn1ContentAllocZ(pAsn1Core, cbSrc, pAllocator);
211 memcpy((void *)pAsn1Core->uData.pv, pvSrc, cbSrc);
216 RTDECL(int) RTAsn1ContentReallocZ(PRTASN1CORE pAsn1Core, size_t cb, PCRTASN1ALLOCATORVTABLE pAllocator)
219 AssertPtr(pAsn1Core);
228 if (!(pAsn1Core->fFlags & RTASN1CORE_F_ALLOCATED_CONTENT))
229 return RTAsn1ContentAllocZ(pAsn1Core, cb, pAllocator);
232 PRTASN1MEMCONTENT pHdr = RT_FROM_MEMBER(pAsn1Core->uData.pv, RTASN1MEMCONTENT, au64Content);
250 pAsn1Core->uData.pv = &pHdr->au64Content[0];
256 if (pAsn1Core->cb < cb)
257 RT_BZERO((uint8_t *)&pAsn1Core->uData.pu8[pAsn1Core->cb], cb - pAsn1Core->cb);
258 pAsn1Core->cb = (uint32_t)cb;
280 if (pAsn1Core->cb >= cb)
284 memcpy(&pHdrNew->au64Content[0], &pHdr->au64Content[0], pAsn1Core->cb);
285 RT_BZERO((uint8_t *)&pHdrNew->au64Content[0] + pAsn1Core->cb, cb - pAsn1Core->cb);
290 pAsn1Core->uData.pv = &pHdrNew->au64Content[0];
291 pAsn1Core->fFlags |= RTASN1CORE_F_ALLOCATED_CONTENT; /* free cleared it. */
292 pAsn1Core->cb = (uint32_t)cb;
304 RTAsn1ContentFree(pAsn1Core);
309 RTDECL(void) RTAsn1ContentFree(PRTASN1CORE pAsn1Core)
311 if (pAsn1Core)
313 pAsn1Core->cb = 0;
314 if (pAsn1Core->fFlags & RTASN1CORE_F_ALLOCATED_CONTENT)
316 pAsn1Core->fFlags &= ~RTASN1CORE_F_ALLOCATED_CONTENT;
317 AssertReturnVoid(pAsn1Core->uData.pv);
319 PRTASN1MEMCONTENT pHdr = RT_FROM_MEMBER(pAsn1Core->uData.pv, RTASN1MEMCONTENT, au64Content);
325 pAsn1Core->uData.pv = NULL;
335 RTDECL(void) RTAsn1VtDelete(PRTASN1CORE pAsn1Core)
337 if (pAsn1Core)
339 PCRTASN1COREVTABLE pOps = pAsn1Core->pOps;
341 pOps->pfnDtor(pAsn1Core);
356 static DECLCALLBACK(int) rtAsn1VtDeepEnumDepthFirst(PRTASN1CORE pAsn1Core, const char *pszName, uint32_t uDepth, void *pvUser)
358 AssertReturn(pAsn1Core, VINF_SUCCESS);
360 if (pAsn1Core->pOps && pAsn1Core->pOps->pfnEnum)
362 int rc = pAsn1Core->pOps->pfnEnum(pAsn1Core, rtAsn1VtDeepEnumDepthFirst, uDepth, pvUser);
368 return pCtx->pfnCallback(pAsn1Core, pszName, uDepth, pCtx->pvUser);
372 static DECLCALLBACK(int) rtAsn1VtDeepEnumDepthLast(PRTASN1CORE pAsn1Core, const char *pszName, uint32_t uDepth, void *pvUser)
374 AssertReturn(pAsn1Core, VINF_SUCCESS);
377 int rc = pCtx->pfnCallback(pAsn1Core, pszName, uDepth, pCtx->pvUser);
380 if (pAsn1Core->pOps && pAsn1Core->pOps->pfnEnum)
381 rc = pAsn1Core->pOps->pfnEnum(pAsn1Core, rtAsn1VtDeepEnumDepthFirst, uDepth, pvUser);