Ace_Buffer_Append()

摘要

向指定缓冲区追加数据。

语法

Ace_Buffer_Append (buffer_ptr, data, data_len)
参数 类型 说明
buffer_ptr AceT_Buffer * 接收追加数据的缓冲区。
data void * 要追加到指定缓冲区的数据。
data_len int 要追加的数据量(以字节计)。

返回类型

PrgT_Compcode

数据成功追加时返回 PrgC_Compcode_Success,否则返回 PrgC_Compcode_Failure。

头文件

ace_client_api.h

示例

if (last_byte_index >= first_byte_index)
	{
	// one contiguous section
	Ace_Buffer_Append (buffer_ptr, historyBuffer + first_byte_index,
		last_byte_index - first_byte_index + 1);
	processed_bytes = (unsigned char *) Ace_Buffer_Data_Get (buffer_ptr,
		&num_processed_bytes);
	}
else if (last_byte_index == first_byte_index - 1)
	{
	// no decompressed data
	processed_bytes = PRGC_NIL;
	num_processed_bytes = 0;
	}
else
	{
	// two sections
	Ace_Buffer_Append (buffer_ptr, historyBuffer + first_byte_index,
		bufferLen - first_byte_index);
	Ace_Buffer_Append (buffer_ptr, historyBuffer, last_byte_index + 1);
	processed_bytes = (unsigned char *) Ace_Buffer_Data_Get (buffer_ptr,
		&num_processed_bytes);
	}

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com