[Home] [ToC] [Up] [Prev] [Next]
The iHTML library buffer services provide operations on a data type called a "IHBuffer," allowing for the collection and manipulation of blocks of arbitrary byte data.
typedef struct ih_buffer { int length; char* buffer; } *IHBufferP;
This type is used to hold and manipulate arbitrary binary data. Its two public fields are read-only, defining the current number of bytes in the buffer and pointing to a block of memory that can be examined for their values.
IHBufferP buffer = IH_AllocBuffer(int
size, const char* data)
(int)
size
(const char*)
data
(IHBufferP)
A newly allocated
data buffer.
This routine allocates a new IHBufferP, which is a structure used to hold arbitrary binary data. The argument size indicates the initial size of the buffer, and data is the initial data for it. Possible values for these parameters are:
IHBufferP buffer =
IH_AppendBuffer(IHBufferP old, int
size, const char* data)
(IHBufferP)
old
(int)
size
(const char*)
data
(IHBufferP)
The new
data buffer.
Append new data to an existing IHBufferP. The parameters operate the same as those for IH_AllocBuffer(); this function can be thought of as allocating a new buffer using the second and third parameters, and appending it to the buffer specified by the first.
The return value is the new buffer -- note that this may be different than the originally supplied buffer; always update to the returned buffer pointer.
void IH_FreeBuffer(IHBufferP
buffer)
(IHBufferP)
buffer
Deallocate a data buffer that was previously allocated with BR_AllocBuffer().
[Home] [ToC] [Up] [Prev] [Next]
Dianne Kyra Hackborn <hackbod@angryredplanet.com> | Last modified: Tue Oct 8 04:04:04 PDT 1996 |