Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

sobj_buffer.c File Reference


Detailed Description

Implementation of the methods of struct sobj_buffer.

#include <stdlib.h>
#include <string.h>
#include "sobject_p.h"

Include dependency graph for sobj_buffer.c:

Include dependency graph

Functions

void sobj_buffer_init (struct sobj_buffer *sobj_buffer)
 Initialize a byte buffer instance.
void sobj_buffer_deinit (struct sobj_buffer *sobj_buffer)
 De-initialize a byte buffer instance.
void sobj_buffer_clear (struct sobj_buffer *sobj_buffer)
 Clear a byte buffer instance.
size_t sobj_buffer_length (const struct sobj_buffer *sobj_buffer)
 Return the length of a byte buffer.
const unsigned char * sobj_buffer_bytes (const struct sobj_buffer *sobj_buffer)
 Return a pointer to the byte array held by a byte buffer instance.
unsigned char * sobj_buffer_append (struct sobj_buffer *sobj_buffer, ptrdiff_t count)
 Append to a byte buffer.
unsigned char * sobj_buffer_insert (struct sobj_buffer *sobj_buffer, size_t offset, ptrdiff_t count)
 Insert data into a byte buffer.
void sobj_buffer_putc (struct sobj_buffer *sobj_buffer, unsigned char x)
 Append a single character to the end of a byte buffer.
void sobj_buffer_puts (struct sobj_buffer *sobj_buffer, const char *string)
 Append a null-terminated string to the end of a buffer.
void sobj_buffer_truncate (struct sobj_buffer *sobj_buffer, size_t length)
 Truncate a buffer instance to the specified size.
void sobj_buffer_remove (struct sobj_buffer *sobj_buffer, size_t offset, ptrdiff_t count)
 Remove a sequence of bytes from the buffer.
size_t sobj_buffer_line_start (const struct sobj_buffer *sobj_buffer)
 Find the beginning of the current line.

Function Documentation

unsigned char* sobj_buffer_insert struct sobj_buffer sobj_buffer,
size_t  offset,
ptrdiff_t  count
 

Insert data into a byte buffer.

Parameters:
sobj_buffer The byte buffer instance.
offset The offset of the insert position. If this is larger than the buffer size, then the specified data is appended to the buffer.
count The number of bytes to be inserted.
Returns:
A pointer to the first byte of the bytes inserted.


Generated on Sat Jul 23 16:04:49 2005 for sobject by  doxygen 1.3.9.1