Added fprintf function.

This commit is contained in:
skarg
2008-07-15 14:53:04 +00:00
parent 21be109e10
commit a889733e2b
2 changed files with 19 additions and 5 deletions
+4 -2
View File
@@ -40,9 +40,11 @@
#include "bacdef.h" #include "bacdef.h"
#if DEBUG_ENABLED #if DEBUG_ENABLED
void debug_printf(char *fmt, ...); void debug_printf(const char * format, ...);
void debug_fprintf(FILE * stream, const char * format, ...)
#else #else
static void debug_printf(char *fmt, ...) {} static void debug_printf(const char * format, ...) {}
static void debug_fprintf(FILE * stream, const char * format, ...) {}
#endif #endif
#endif #endif
+15 -3
View File
@@ -38,14 +38,26 @@
#include <stdlib.h> /* Standard Library */ #include <stdlib.h> /* Standard Library */
#include <stdarg.h> #include <stdarg.h>
void debug_printf(char *fmt, ...) void debug_printf(const char * format, ...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, format);
vfprintf(stdout, fmt, ap); vfprintf(stdout, format, ap);
va_end(ap); va_end(ap);
fflush(stdout); fflush(stdout);
return; return;
} }
void debug_fprintf(FILE * stream, const char * format, ...)
{
va_list ap;
va_start(ap, format);
vfprintf(stream, format, ap);
va_end(ap);
fflush(stream);
return;
}