summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-22 10:32:08 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-03-13 17:38:40 -0700
commit4d9b8e0f938911d6ce8492959b5483467dce83b0 (patch)
tree4ea7197322e066128455d1d4469fa489c42072d6
parentc1b71f46b5a79257cab2731ee9fbfd70ca1d4205 (diff)
mesa: added _mesa_fprintf() wrapper (cherry picked from commit 596b8fbbbf65cef227ce60216a57d4bbfd627099)
-rw-r--r--src/mesa/main/imports.c15
-rw-r--r--src/mesa/main/imports.h3
2 files changed, 17 insertions, 1 deletions
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 d71d59c7a0c..e560bc0599e 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -774,6 +774,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 );