From 596b8fbbbf65cef227ce60216a57d4bbfd627099 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Jan 2009 10:32:08 -0700 Subject: [PATCH] mesa: added _mesa_fprintf() wrapper --- src/mesa/main/imports.c | 15 ++++++++++++++- src/mesa/main/imports.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 5cf1a2baa46..0c2c894eef0 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -955,9 +955,22 @@ _mesa_printf( const char *fmtString, ... ) va_start( args, fmtString ); vsnprintf(s, MAXSTRING, fmtString, args); va_end( args ); - fprintf(stderr,"%s", s); + fprintf(stderr, "%s", s); } +/** Wrapper around fprintf(), using vsprintf() for the formatting. */ +void +_mesa_fprintf( FILE *f, const char *fmtString, ... ) +{ + char s[MAXSTRING]; + va_list args; + va_start( args, fmtString ); + vsnprintf(s, MAXSTRING, fmtString, args); + va_end( args ); + fprintf(f, "%s", s); +} + + /** Wrapper around vsprintf() */ int _mesa_vsprintf( char *str, const char *fmt, va_list args ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 13b571d1cbc..ec270a0cb30 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -773,6 +773,9 @@ _mesa_snprintf( char *str, size_t size, const char *fmt, ... ); extern void _mesa_printf( const char *fmtString, ... ); +extern void +_mesa_fprintf( FILE *f, const char *fmtString, ... ); + extern int _mesa_vsprintf( char *str, const char *fmt, va_list args ); -- 2.30.2