libtriple: add lt_debug() for controllable debug output

This commit is contained in:
Stefan Seyfried
2010-08-08 14:00:09 +02:00
parent 061225db9b
commit b5503037f0
3 changed files with 23 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ noinst_LIBRARIES = libtriple.a
AM_CPPFLAGS = -fno-rtti -fno-exceptions
libtriple_a_SOURCES = \
lt_debug.cpp \
dmx_td.cpp \
video_td.cpp \
audio_td.cpp \

18
libtriple/lt_debug.cpp Normal file
View File

@@ -0,0 +1,18 @@
/* libtriple debug functions */
#include <stdarg.h>
#include <stdio.h>
int cnxt_debug = 0;
void lt_debug(const char *fmt, ...)
{
if (! cnxt_debug)
return;
va_list args;
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
}

4
libtriple/lt_debug.h Normal file
View File

@@ -0,0 +1,4 @@
#ifndef __LT_DEBUG_H
#define __LT_DEBUG_H
void lt_debug(const char *fmt, ...);
#endif