x509cmsmemoryfuncs.c

来自「可以实现对邮件的加密解密以及签名」· C语言 代码 · 共 50 行

C
50
字号
/*____________________________________________________________________________
	Copyright (C) 2002 PGP Corporation
	All rights reserved.

	$Id: x509CMSMemoryFuncs.c,v 1.6 2002/08/06 20:11:06 dallen Exp $
____________________________________________________________________________*/
#include "x509CMS.h"

#include "pgpMemoryMgr.h"

PKIMemoryMgr X509CMSMemoryMgr = {
    NULL,
    x509CMSAllocProc,
    x509CMSReallocProc,
    x509CMSDeallocProc
};

void *
x509CMSAllocProc (
        PKIMemoryMgr    *mem,
        size_t          requestSize
)
{
    return (PGPNewData ((PGPMemoryMgrRef) mem->customValue, requestSize, 0)); 
}

int
x509CMSDeallocProc (
        PKIMemoryMgr    *mem,
        void            *allocation
)
{
	(void) mem;
	
	/* PGPFreeData asserts on null */
	if( allocation )
		PGPFreeData (allocation);
    return 0;
}

int
x509CMSReallocProc (
	PKIMemoryMgr	*mem,
	void		**allocation,
	size_t		requestSize)
{
    PGPReallocData ((PGPMemoryMgrRef) mem->customValue, allocation, requestSize, 0);
    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?