/* * See the COPYING file for the terms of usage and distribution. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifdef HAVE_STDARG_H # include #else # ifdef HAVE_VARARGS_H # include # endif #endif #include "sd/error.h" #include "sd/sd_xplatform.h" static const TCHAR version[] = _T("$Id$"); int sd_debug(const TCHAR *fmt, ...) { va_list args; int r; if (!_tgetenv(_T("SD_DEBUG"))) return 0; r = _ftprintf(stderr, _T("[DEBUG] ")); va_start(args, fmt); r += _vftprintf(stderr, fmt, args); va_end(args); r += _ftprintf(stderr, _T("\n")); return r; } int sd_error(const TCHAR *fmt, ...) { va_list args; int r; if (!_tgetenv(_T("SD_ERROR"))) return 0; r = _ftprintf(stderr, _T("[ERROR] ")); va_start(args, fmt); r += _vftprintf(stderr, fmt, args); va_end(args); r += _ftprintf(stderr, _T("\n")); return r; }