34 for (i = 1; i <=
size; i++) {
36 for (j = i - 1; j > 0; j--)
37 p[j] = p[j] + p[j - 1];
38 for (j = 0; j <= i; j++)
48 struct tm testtime = { .tm_year = 100, .tm_mon = 11, .tm_mday = 20 };
52 printf(
"Short text in unlimited buffer: %u/%u\n", (
unsigned)strlen(b.str), b.len);
53 printf(
"%s\n", b.str);
58 printf(
"Long text in unlimited buffer: %u/%u\n", (
unsigned)strlen(b.str), b.len);
63 printf(
"Long text in limited buffer: %u/%u\n", (
unsigned)strlen(b.str), b.len);
68 printf(
"Short text in automatic buffer: %u/%u\n", (
unsigned)strlen(b.str), b.len);
72 printf(
"Long text in automatic buffer: %u/%u\n", (
unsigned)strlen(b.str)/8*8, b.len);
77 printf(
"Long text count only buffer: %u/%u\n", (
unsigned)strlen(b.str), b.len);
81 printf(
"Long text count only buffer: %u/%u\n", (
unsigned)strlen(buf), b.len);
85 printf(
"strftime full: %u/%u \"%s\"\n", (
unsigned)strlen(buf), b.len, b.str);
90 printf(
"strftime truncated: %u/%u \"%s\"\n", (
unsigned)strlen(buf), b.len, b.str);
void av_bprintf(AVBPrint *buf, const char *fmt,...)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size)
Init a print buffer using a pre-existing buffer.
#define AV_BPRINT_SIZE_COUNT_ONLY
#define AV_BPRINT_SIZE_UNLIMITED
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define FF_ARRAY_ELEMS(a)
#define AV_BPRINT_SIZE_AUTOMATIC
static void bprint_pascal(AVBPrint *b, unsigned size)
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm)
Append a formatted date and time to a print buffer.