Go to the source code of this file.
Classes | |
| struct | GiBuffer |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT void | gi_buffer_init (GiBuffer *buffer) |
| LIBGIFT_EXPORT void | gi_buffer_initex (GiBuffer *buffer, void *buf, size_t siz, size_t len, bool rsz) |
| LIBGIFT_EXPORT void | gi_buffer_finish (GiBuffer *buffer) |
| LIBGIFT_EXPORT bool | gi_buffer_grow (GiBuffer *buffer, size_t grown) |
| LIBGIFT_EXPORT bool | gi_buffer_shrink (GiBuffer *buffer, size_t shrunk) |
| LIBGIFT_EXPORT bool | gi_buffer_double (GiBuffer *buffer) |
| LIBGIFT_EXPORT bool | gi_buffer_resize (GiBuffer *buffer, size_t size) |
| LIBGIFT_EXPORT bool | gi_buffer_minsize (GiBuffer *buffer, size_t minsize) |
| LIBGIFT_EXPORT size_t | gi_buffer_handy (GiBuffer *buffer) |
| LIBGIFT_EXPORT bool | gi_buffer_append (GiBuffer *buffer, const void *buf, size_t siz) |
| LIBGIFT_EXPORT bool | gi_buffer_prepend (GiBuffer *buffer, const void *buf, size_t siz) |
| LIBGIFT_EXPORT bool | gi_buffer_truncate (GiBuffer *buffer, size_t len) |
| LIBGIFT_EXPORT void * | gi_buffer_tail (GiBuffer *buffer) |
| LIBGIFT_EXPORT void * | gi_buffer_head (GiBuffer *buffer) |
|
||||||||||||||||
|
Append `siz' bytes from the user-supplied data buffer `buf' to the internal data buffer object.
|
|
|
Attempt to allocate at least twice as much total space as is currently allocated to the buffer.
|
|
|
Destroy any internally allocated data blocks. This function is optional depending on whether or not you actually want to clean up the internal memory buffer. |
|
||||||||||||
|
Guarantee that at least `grown' additional bytes will be available in the buffer. This does not actually guarantee that the buffer will be resized, simply that if the call succeeds, the difference between the total size and the current length will be at least `grown' bytes.
|
|
|
Access the total number of trailing bytes in the buffer currently unused.
|
|
|
Access the first byte found in the data buffer. This may return NULL if the data buffer has not been allocated, or if there is no data written. |
|
|
Initialize a buffer object. This may allocate data to the object which can be cleaned up by gi_buffer_finish. |
|
||||||||||||||||||||||||
|
Initialize the buffer object with a user-supplied data buffer. All writes through this interface will be applied to the user-supplied object.
|
|
||||||||||||
|
Resize the data buffer to at least `size' total bytes.
|
|
||||||||||||||||
|
Similar to gi_buffer_append, except that the data will be prepended to the beginning of the data buffer. The entire length of the buffer is shifted back `siz' bytes. |
|
||||||||||||
|
Resize the data buffer to exactly `size' total bytes. This may result in an implicit truncation of the buffer's length if there is not space available after the resize.
|
|
||||||||||||
|
Constrict the buffer by at most `shrunk' bytes. Less than `shrunk' bytes may be reduced. The buffer's length will be adjusted similar to using gi_buffer_truncate with the param `buffer->len - shrunk'.
|
|
|
Access the last byte found in the data buffer. This is the last byte with user-supplied data written to it, and will return NULL if the buffer is allocated, but has no data written. |
|
||||||||||||
|
Truncate the size and length of the data buffer. If `len' is larger than the current length, the buffer will be resized and all bytes between the old length and new will be filled with zeroes. If `len' is shorter than the current length, the buffer's length will be rolled back and the data buffer may have been reduced in size.
|
1.3.7