[Vortex] Problem when calling vortex_connection_close
Robert M. Münch
robert.muench at robertmuench.de
Wed Apr 30 08:36:07 CEST 2008
On Tue, 29 Apr 2008 02:11:10 +0200, Jens Alfke <jens at mooseyard.com> wrote:
> Maybe something's wrong with that glue code, then, because the numbers
> being printed look bogus. Could you post the code?
Hi, sure. Here is the code I use (maybe it can be added to the library as
an option for the Win32 DLL builds):
void odprintf(const char *format, ...){
char buf[4096], *p = buf;
va_list args;
int n;
va_start(args, format);
n = _vsnprintf(p, sizeof buf - 3, format, args); // buf-3 is room for
CR/LF/NUL
va_end(args);
p += (n < 0) ? sizeof buf - 3 : n;
while ( p > buf && isspace(p[-1]) )
*--p = '\0';
*p++ = '\r';
*p++ = '\n';
*p = '\0';
OutputDebugString(buf);
}
void xp_vortex_log(const char *domain, VortexDebugLevel log_level, const
char *message, va_list args){
odprintf(message, args);
}
The last function is used for registering a new log-handler. Robert
More information about the Vortex
mailing list