27#ifndef AVUTIL_BPRINT_H
28#define AVUTIL_BPRINT_H
48#define FF_PAD_STRUCTURE(name, size, ...) \
49struct ff_pad_helper_##name { __VA_ARGS__ }; \
50typedef struct name { \
52 char reserved_padding[size - sizeof(struct ff_pad_helper_##name)]; \
98 char reserved_internal_buffer[1];
118#define AV_BPRINT_SIZE_AUTOMATIC 1
125#define AV_BPRINT_SIZE_COUNT_ONLY 0
205 unsigned char **mem,
unsigned *actual_size);
Macro definitions for various function/variable attributes.
#define av_printf_format(fmtpos, attrpos)
#define AV_BPRINT_SIZE_UNLIMITED
Buffer will be reallocated as necessary, with an amortized linear cost.
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags)
Escape the content in src and append it to dstbuf.
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Init a print buffer.
void av_bprint_get_buffer(AVBPrint *buf, unsigned size, unsigned char **mem, unsigned *actual_size)
Allocate bytes in the buffer for external use.
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm)
Append a formatted date and time to a print buffer.
#define FF_PAD_STRUCTURE(name, size,...)
Define a structure with extra padding to a fixed size This helps ensuring binary compatibility with f...
void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size)
Append data to a print buffer.
void av_bprintf(AVBPrint *buf, const char *fmt,...) av_printf_format(2
Append a formatted string to a print buffer.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
void void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg)
Append a formatted string to a print buffer.
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
Init a print buffer using a pre-existing buffer.
Buffer to print data progressively.
unsigned len
length so far
unsigned size
allocated memory