Browse Source

lavu/bprint: add av_bprint_reset().

tags/n0.11
Clément Bœsch 13 years ago
parent
commit
9548deeea9
3 changed files with 14 additions and 1 deletions
  1. +1
    -1
      libavutil/avutil.h
  2. +8
    -0
      libavutil/bprint.c
  3. +5
    -0
      libavutil/bprint.h

+ 1
- 1
libavutil/avutil.h View File

@@ -153,7 +153,7 @@
*/

#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 50
#define LIBAVUTIL_VERSION_MINOR 51
#define LIBAVUTIL_VERSION_MICRO 100

#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \


+ 8
- 0
libavutil/bprint.c View File

@@ -119,6 +119,14 @@ void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
av_bprint_grow(buf, n);
}

void av_bprint_clear(AVBPrint *buf)
{
if (buf->len) {
*buf->str = 0;
buf->len = 0;
}
}

int av_bprint_finalize(AVBPrint *buf, char **ret_str)
{
unsigned real_size = FFMIN(buf->len + 1, buf->size);


+ 5
- 0
libavutil/bprint.h View File

@@ -109,6 +109,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).
*


Loading…
Cancel
Save