the asumptions were of course, incorrect
[convexer.git] / cxr / cxr_log.h
1 #ifndef CXR_LOG_H
2 #define CXR_LOG_H
3
4 #include <stdarg.h>
5 #include <stdio.h>
6
7 #include "cxr_types.h"
8
9 static void (*cxr_log_func)(const char *str);
10 static void (*cxr_line_func)( v3f p0, v3f p1, v4f colour );
11
12 static void cxr_log( const char *fmt, ... )
13 {
14 char buf[512];
15
16 va_list args;
17 va_start( args, fmt );
18 vsnprintf( buf, sizeof(buf)-1, fmt, args );
19 va_end(args);
20
21 if( cxr_log_func )
22 cxr_log_func( buf );
23
24 fputs(buf,stdout);
25 }
26
27
28 #endif /* CXR_LOG_H */