24#ifndef MUTT_LIB_BUFFER_H
25#define MUTT_LIB_BUFFER_H
80 if (!buf || !buf->
data)
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
size_t mutt_buffer_addstr_n(struct Buffer *buf, const char *s, size_t len)
Add a string to a Buffer, expanding it if necessary.
size_t mutt_buffer_len(const struct Buffer *buf)
Calculate the length of a Buffer.
struct Buffer * mutt_buffer_init(struct Buffer *buf)
Initialise a new Buffer.
size_t mutt_buffer_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t mutt_buffer_substrcpy(struct Buffer *buf, const char *beg, const char *end)
Copy a partial string into a Buffer.
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
size_t mutt_buffer_insert(struct Buffer *buf, size_t offset, const char *s)
Add a string in the middle of a buffer.
void mutt_buffer_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
size_t mutt_buffer_concatn_path(struct Buffer *dst, const char *dir, size_t dirlen, const char *fname, size_t fnamelen)
Join a directory name and a filename.
int mutt_buffer_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
void mutt_buffer_seek(struct Buffer *buf, size_t offset)
Set current read/write position to offset from beginning.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t mutt_buffer_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
size_t mutt_buffer_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
void mutt_buffer_alloc(struct Buffer *buf, size_t size)
Make sure a buffer can store at least new_size bytes.
char * mutt_buffer_strdup(const struct Buffer *buf)
Copy a Buffer's string.
size_t mutt_buffer_concat_path(struct Buffer *buf, const char *dir, const char *fname)
Join a directory name and a filename.
String manipulation buffer.
char * dptr
Current read/write position.
size_t dsize
Length of data.
char * data
Pointer to data.