Commit 2ab4baad authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Check HAVE_VFPRINTF, and substitute another log function if we don't

have a vfprintf.
parent 9515c142
/* /*
* $Id: log.c,v 0.8 1993/10/12 22:20:54 ceder Exp $ * $Id: log.c,v 0.9 1993/10/13 00:07:50 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* File created by ceder 1990-05-25. * File created by ceder 1990-05-25.
*/ */
static char *rcsid = "$Id: log.c,v 0.8 1993/10/12 22:20:54 ceder Exp $"; static char *rcsid = "$Id: log.c,v 0.9 1993/10/13 00:07:50 ceder Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -43,6 +43,7 @@ USE(rcsid); ...@@ -43,6 +43,7 @@ USE(rcsid);
* Add a string to the log file. * Add a string to the log file.
*/ */
#ifdef HAVE_VFPRINTF
extern void extern void
log (const char * format, ...) log (const char * format, ...)
{ {
...@@ -70,3 +71,23 @@ logv (const char *format, va_list AP) ...@@ -70,3 +71,23 @@ logv (const char *format, va_list AP)
fflush(stderr); fflush(stderr);
} }
#else /* !HAVE_VFPRINTF */
extern void
log (const char * format,
int a, int b, int c, int d, int e, int f, int g)
{
time_t clock;
struct tm *t;
time(&clock);
t = localtime(&clock);
fprintf(stderr, "%04d-%02d-%02d %02d:%02d:%02d ",
t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
t->tm_hour, t->tm_min, t->tm_sec);
fprintf(stderr, format, a, b, c, d, e, f, g);
fflush(stderr);
}
#endif /* !HAVE_VFPRINTF */
/* /*
* $Id: log.h,v 0.3 1991/09/15 10:31:32 linus Exp $ * $Id: log.h,v 0.4 1993/10/13 00:06:35 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association. * Copyright (C) 1991 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se. * Please mail bug reports to bug-lyskom@lysator.liu.se.
*/ */
/* /*
* $Id: log.h,v 0.3 1991/09/15 10:31:32 linus Exp $ * $Id: log.h,v 0.4 1993/10/13 00:06:35 ceder Exp $
* *
* log.h * log.h
* *
...@@ -37,12 +37,18 @@ ...@@ -37,12 +37,18 @@
* Add a string to the log file. * Add a string to the log file.
*/ */
#ifdef HAVE_VFPRINTF
extern void extern void
log (const char * format, ...); log (const char * format, ...);
#ifdef _STDARG_H extern void
extern void logv (const char * format, va_list AP);
logv (const char * format, va_list AP);
#endif #else /* !HAVE_VFPRINTF */
extern void
log (const char * format, ...);
#endif /* !HAVE_VFPRINTF */
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment