diff options
author | faith <faith> | 2002-04-19 03:00:36 +0000 |
---|---|---|
committer | faith <faith> | 2002-04-19 03:00:36 +0000 |
commit | 8adfd3fcfe53c268e79141cc0b6ffac34865eefb (patch) | |
tree | 8edf5254fd61630bb64e5bbf31c76f44e9c03a37 /xc | |
parent | 0766149b557cce90e870ff8f2ba158d880443126 (diff) |
Provide simplified version for stand-alone software (e.g., xdmxconfig)
Diffstat (limited to 'xc')
-rw-r--r-- | xc/programs/Xserver/hw/dmx/dmxlog.c | 24 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/dmx/dmxlog.h | 11 |
2 files changed, 31 insertions, 4 deletions
diff --git a/xc/programs/Xserver/hw/dmx/dmxlog.c b/xc/programs/Xserver/hw/dmx/dmxlog.c index 9f951424f..78368c9ae 100644 --- a/xc/programs/Xserver/hw/dmx/dmxlog.c +++ b/xc/programs/Xserver/hw/dmx/dmxlog.c @@ -66,6 +66,28 @@ void dmxCloseLogFile(void) } #endif +#ifdef DMX_LOG_STANDALONE +void ErrorF(const char *format, ...) +{ + va_list args; + + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); +} + +void VFatalError(const char *format, va_list args) +{ + vfprintf(stderr, format, args); + exit(1); +} + +void VErrorF(const char *format, va_list args) +{ + vfprintf(stderr, format, args); +} +#endif + static void dmxHeader(dmxLogLevel logLevel, DMXInputInfo *dmxInput, DMXScreenInfo *dmxScreen) { @@ -115,6 +137,7 @@ void dmxLog(dmxLogLevel logLevel, const char *format, ...) va_end(args); } +#ifndef DMX_LOG_STANDALONE void dmxLogOutput(DMXScreenInfo *dmxScreen, const char *format, ...) { va_list args; @@ -190,6 +213,7 @@ void dmxLogVisual(DMXScreenInfo *dmxScreen, XVisualInfo *vi, int defaultVisual) defaultVisual ? " *" : ""); } } +#endif const char *dmxEventName(int type) { diff --git a/xc/programs/Xserver/hw/dmx/dmxlog.h b/xc/programs/Xserver/hw/dmx/dmxlog.h index 5f14bd71c..6c0086936 100644 --- a/xc/programs/Xserver/hw/dmx/dmxlog.h +++ b/xc/programs/Xserver/hw/dmx/dmxlog.h @@ -32,8 +32,8 @@ * */ -#ifndef DMXLOG_H -#define DMXLOG_H +#ifndef _DMXLOG_H_ +#define _DMXLOG_H_ /* Logging levels -- output is tunable with dmxSetLogLevel. */ typedef enum { @@ -48,6 +48,9 @@ typedef enum { extern dmxLogLevel dmxSetLogLevel(dmxLogLevel newLevel); extern dmxLogLevel dmxGetLogLevel(void); extern void dmxLog(dmxLogLevel logLevel, const char *format, ...); +extern const char *dmxEventName(int type); + +#ifndef DMX_LOG_STANDALONE extern void dmxLogOutput(DMXScreenInfo *dmxScreen, const char *format, ...); extern void dmxLogOutputWarning(DMXScreenInfo *dmxScreen, const char *format, ...); @@ -57,6 +60,6 @@ extern void dmxLogVisual(DMXScreenInfo *dmxScreen, XVisualInfo *vi, int defaultVisual); extern void dmxLogAdditional(DMXScreenInfo *dmxScreen, const char *format, ...); -extern const char *dmxEventName(int type); +#endif -#endif /* DMXLOG_H */ +#endif |