Ace_Buffer_Append()
Abstract
Appends data to a specified buffer.
Syntax
Ace_Buffer_Append (buffer_ptr, data, data_len)
| Argument | Type | Description |
|---|---|---|
buffer_ptr |
AceT_Buffer * |
Buffer to receive appended data. |
data |
void * |
Data to append to the specified buffer. |
data_len |
int |
Amount of data to append, in bytes. |
Return Type
PrgT_Compcode
PrgC_Compcode_Success if the data is successfully appended; PrgC_Compcode_Failure otherwise.
Header
ace_client_api.h
Example
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);
}