mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
move lt_debug to common/ subdirectory
Origin commit data
------------------
Branch: master
Commit: 08c393bddf
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-02-11 (Sat, 11 Feb 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@
|
||||
/configure
|
||||
/depcomp
|
||||
/install-sh
|
||||
/common/Makefile.in
|
||||
/libspark/Makefile.in
|
||||
/libtriple/Makefile.in
|
||||
/ltmain.sh
|
||||
|
10
Makefile.am
10
Makefile.am
@@ -1,16 +1,18 @@
|
||||
noinst_LIBRARIES = libstb-hal.a
|
||||
libneutrino_hal_a_SOURCES =
|
||||
SUBDIRS =
|
||||
libstb_hal_a_SOURCES =
|
||||
SUBDIRS = common
|
||||
|
||||
libstb_hal_a_LIBADD = \
|
||||
common/lt_debug.o
|
||||
|
||||
# there has to be a better way to do this...
|
||||
if BOXTYPE_TRIPLE
|
||||
SUBDIRS += libtriple
|
||||
libstb_hal_a_LIBADD = \
|
||||
libstb_hal_a_LIBADD += \
|
||||
libtriple/audio_td.o \
|
||||
libtriple/ca.o \
|
||||
libtriple/dmx_td.o \
|
||||
libtriple/init_td.o \
|
||||
libtriple/lt_debug.o \
|
||||
libtriple/lt_dfbinput.o \
|
||||
libtriple/playback_td.o \
|
||||
libtriple/pwrmngr.o \
|
||||
|
6
common/Makefile.am
Normal file
6
common/Makefile.am
Normal file
@@ -0,0 +1,6 @@
|
||||
noinst_LIBRARIES = libcommon.a
|
||||
|
||||
AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
|
||||
libcommon_a_SOURCES = \
|
||||
lt_debug.cpp
|
@@ -18,6 +18,7 @@ TUXBOX_APPS_LIB_PKGCONFIG(DIRECTFB, directfb)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
common/Makefile
|
||||
libtriple/Makefile
|
||||
libspark/Makefile
|
||||
])
|
||||
|
@@ -1,4 +1,5 @@
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/common \
|
||||
@DIRECTFB_CFLAGS@
|
||||
|
||||
noinst_LIBRARIES = libspark.a
|
||||
@@ -7,7 +8,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
|
||||
libspark_a_SOURCES = \
|
||||
lt_dfbinput.cpp \
|
||||
lt_debug.cpp \
|
||||
dmx.cpp \
|
||||
ca.cpp \
|
||||
video.cpp \
|
||||
|
@@ -1,4 +1,5 @@
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir)/common \
|
||||
@DIRECTFB_CFLAGS@
|
||||
|
||||
noinst_LIBRARIES = libtriple.a
|
||||
@@ -7,7 +8,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing
|
||||
|
||||
libtriple_a_SOURCES = \
|
||||
lt_dfbinput.cpp \
|
||||
lt_debug.cpp \
|
||||
dmx_td.cpp \
|
||||
ca.cpp \
|
||||
video_td.cpp \
|
||||
|
@@ -1,76 +0,0 @@
|
||||
/* libtriple debug functions */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int cnxt_debug = 0; /* compat, unused */
|
||||
|
||||
int debuglevel = -1;
|
||||
|
||||
static const char* lt_facility[] = {
|
||||
"audio ",
|
||||
"video ",
|
||||
"demux ",
|
||||
"play ",
|
||||
"power ",
|
||||
"init ",
|
||||
"ca ",
|
||||
"record",
|
||||
NULL
|
||||
};
|
||||
|
||||
void _lt_info(int facility, const void *func, const char *fmt, ...)
|
||||
{
|
||||
/* %p does print "(nil)" instead of 0x00000000 for NULL */
|
||||
fprintf(stderr, "[LT:%08lx:%s] ", (long) func, lt_facility[facility]);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
void _lt_debug(int facility, const void *func, const char *fmt, ...)
|
||||
{
|
||||
if (debuglevel < 0)
|
||||
fprintf(stderr, "lt_debug: debuglevel not initialized!\n");
|
||||
|
||||
if (! ((1 << facility) & debuglevel))
|
||||
return;
|
||||
|
||||
fprintf(stderr, "[LT:%08lx:%s] ", (long)func, lt_facility[facility]);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void lt_debug_init(void)
|
||||
{
|
||||
int i = 0;
|
||||
char *tmp = getenv("TRIPLE_DEBUG");
|
||||
if (! tmp)
|
||||
debuglevel = 0;
|
||||
else
|
||||
debuglevel = (int) strtol(tmp, NULL, 0);
|
||||
|
||||
if (debuglevel == 0)
|
||||
{
|
||||
fprintf(stderr, "libtriple debug options can be set by exporting TRIPLE_DEBUG.\n");
|
||||
fprintf(stderr, "The following values (or bitwise OR combinations) are valid:\n");
|
||||
while (lt_facility[i]) {
|
||||
fprintf(stderr, "\tcomponent: %s 0x%02x\n", lt_facility[i], 1 << i);
|
||||
i++;
|
||||
}
|
||||
fprintf(stderr, "\tall components: 0x%02x\n", (1 << i) - 1);
|
||||
} else {
|
||||
fprintf(stderr, "libtriple debug is active for the following components:\n");
|
||||
while (lt_facility[i]) {
|
||||
if (debuglevel & (1 << i))
|
||||
fprintf(stderr, "%s ", lt_facility[i]);
|
||||
i++;
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
#ifndef __LT_DEBUG_H
|
||||
#define __LT_DEBUG_H
|
||||
|
||||
#define TRIPLE_DEBUG_AUDIO 0
|
||||
#define TRIPLE_DEBUG_VIDEO 1
|
||||
#define TRIPLE_DEBUG_DEMUX 2
|
||||
#define TRIPLE_DEBUG_PLAYBACK 3
|
||||
#define TRIPLE_DEBUG_PWRMNGR 4
|
||||
#define TRIPLE_DEBUG_INIT 5
|
||||
#define TRIPLE_DEBUG_CA 6
|
||||
#define TRIPLE_DEBUG_RECORD 7
|
||||
#define TRIPLE_DEBUG_ALL ((1<<8)-1)
|
||||
|
||||
extern int debuglevel;
|
||||
|
||||
void _lt_debug(int facility, const void *, const char *fmt, ...);
|
||||
void _lt_info(int facility, const void *, const char *fmt, ...);
|
||||
void lt_debug_init(void);
|
||||
#endif
|
Reference in New Issue
Block a user