Added fprintf function.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user