27 #define _BYTEBUFFER_H 1
35 #define BYTEBUFFER_STARTSIZE 512
36 #define BYTEBUFFER_STATICSIZE 1024
69 void bytebuffer_append_bulk(
bytebuffer_t *
s,
void * start,
size_t size);
70 void bytebuffer_append_int(
bytebuffer_t *buf,
const int val,
int swap);
71 void bytebuffer_append_double(
bytebuffer_t *buf,
const double val,
int swap);
void bytebuffer_destroy_buffer(bytebuffer_t *s)
Free the bytebuffer_t and all memory managed within it.
void bytebuffer_append_varint(bytebuffer_t *s, const int64_t val)
Writes a signed varInt to the buffer.
#define BYTEBUFFER_STATICSIZE
void bytebuffer_append_bytebuffer(bytebuffer_t *write_to, bytebuffer_t *write_from)
Writes a uint8_t value to the buffer.
void bytebuffer_init_with_size(bytebuffer_t *b, size_t size)
Allocate just the internal buffer of an existing bytebuffer_t struct.
size_t bytebuffer_getlength(const bytebuffer_t *s)
Returns the length of the current buffer.
void bytebuffer_append_byte(bytebuffer_t *s, const uint8_t val)
Writes a uint8_t value to the buffer.
void bytebuffer_append_uvarint(bytebuffer_t *s, const uint64_t val)
Writes a unsigned varInt to the buffer.
uint8_t * bytebuffer_get_buffer_copy(const bytebuffer_t *s, size_t *buffer_length)
Returns a copy of the internal buffer.
const uint8_t * bytebuffer_get_buffer(const bytebuffer_t *s, size_t *buffer_length)
Returns a read-only reference to the internal buffer.