X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Fbprint.h;h=60e464e10bd2b045f65856966e256fe75de27996;hb=465a72b4b4ad1366b47436506a1352ee0c0ef232;hp=c5d750df8bcc4ae7dd6dc8fae0a0775971275bca;hpb=109650b34b3b516d00bef94e5f1521c21bd3c3de;p=ffmpeg diff --git a/libavutil/bprint.h b/libavutil/bprint.h index c5d750df8bc..60e464e10bd 100644 --- a/libavutil/bprint.h +++ b/libavutil/bprint.h @@ -99,6 +99,17 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); #define AV_BPRINT_SIZE_AUTOMATIC 1 #define AV_BPRINT_SIZE_COUNT_ONLY 0 +/** + * Init a print buffer using a pre-existing buffer. + * + * The buffer will not be reallocated. + * + * @param buf buffer structure to init + * @param buffer byte buffer to use for the string data + * @param size size of buffer + */ +void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size); + /** * Append a formated string to a print buffer. */ @@ -109,6 +120,11 @@ void av_bprintf(AVBPrint *buf, const char *fmt, ...) av_printf_format(2, 3); */ void av_bprint_chars(AVBPrint *buf, char c, unsigned n); +/** + * Reset the string to "" but keep internal allocated data. + */ +void av_bprint_clear(AVBPrint *buf); + /** * Test if the print buffer is complete (not truncated). *