⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pgpliteral.c

📁 vc环境下的pgp源码
💻 C
字号:
/*
 * pgpLiteral.c -- create a literal packet
 *
 * Written by:	Derek Atkins <warlord@MIT.EDU>
 *
 * $Id: pgpLiteral.c,v 1.10 1997/09/18 01:35:24 lloyd Exp $
 */
#include "pgpConfig.h"

#include <stdio.h>
#include <string.h>

#include "pgpAddHdr.h"
#include "pgpLiteral.h"
#include "pgpPktByte.h"
#include "pgpPipeline.h"
#include "pgpMem.h"

PGPPipeline **
pgpLiteralCreate (
	PGPContextRef		cdkContext,
	PGPPipeline **		head,
	PgpVersion			version,
	PGPFifoDesc const *	fd,
	PGPByte				type,
	PGPByte *			name,
	PGPByte				len,
	PGPUInt32			timestamp)
{
	PGPByte header[261];	/* Maximum size of a literal header */
	int i;
	PGPPipeline **mod;

	if (!head)
		return NULL;

	header[0] = type;
	header[1] = len;
	memcpy (header+2, name, len);
	len += 2;
	for (i=3; i > 0; i--) {
		header[len+i] = (PGPByte) (timestamp & 0xff);
		timestamp >>= 8;
	}

	mod = pgpAddHeaderCreate ( cdkContext,
			head, version, fd, PKTBYTE_LITERAL, 0, header, len+4);

	pgpClearMemory( header,  sizeof (header));
	if (mod)
		(*head)->name = "Literal Module";

	return mod;
}

⌨️ 快捷键说明

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