X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Favio.h;h=910e4f1b48713c15cb1ab64202d4bb618a78382a;hb=a82f8f2f10d0a4d8072919a8e4bdc1c39f4d27b8;hp=dcb8dcdf93ade80ba2bb767f2f008fb26ac168cc;hpb=6a3bdf3148864224c8ef8025e8744f6dd2126303;p=ffmpeg diff --git a/libavformat/avio.h b/libavformat/avio.h index dcb8dcdf93a..910e4f1b487 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -574,6 +574,23 @@ int avio_feof(AVIOContext *s); /** @warning Writes up to 4 KiB per call */ int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); +/** + * Write a NULL terminated array of strings to the context. + * Usually you don't need to use this function directly but its macro wrapper, + * avio_print. + */ +void avio_print_string_array(AVIOContext *s, const char *strings[]); + +/** + * Write strings (const char *) to the context. + * This is a convenience macro around avio_print_string_array and it + * automatically creates the string array from the variable argument list. + * For simple string concatenations this function is more performant than using + * avio_printf since it does not need a temporary buffer. + */ +#define avio_print(s, ...) \ + avio_print_string_array(s, (const char*[]){__VA_ARGS__, NULL}) + /** * Force flushing of buffered data. *