33#ifndef __FREEWRL_SND_INTERNAL_H__
34#define __FREEWRL_SND_INTERNAL_H__
37extern const char *freewrl_snd_get_version();
41# define DEBUG_(_expr) _expr
47#define DEBUG_MSG(...) DEBUG_(fprintf(stdout, __VA_ARGS__))
48#define TRACE_MSG(...) DEBUG_(fprintf(stdout, __VA_ARGS__))
49#define WARN_MSG(...) DEBUG_(fprintf(stdout, __VA_ARGS__))
50#define ERROR_MSG(...) DEBUG_(fprintf(stderr, __VA_ARGS__))
53#define DEBUG_FW(...) DEBUG_(printf("FW: " __VA_ARGS__))
59#define DEBUG_ARGS(...) DEBUG_(printf("TEXT: " __VA_ARGS__))
61#define DEBUG_ARGS(...)
67#if defined(FW_DEBUG) && defined(DEBUG_MALLOC)
69# define MALLOC(t,_sz) (t)freewrlMalloc(__LINE__,__FILE__,_sz)
70# define REALLOC(_a,_b) freewrlRealloc(__LINE__,__FILE__,_a,_b)
71# define FREE(_ptr) freewrlFree(__LINE__,__FILE__,_ptr)
72# define STRDUP(_a) freewrlStrdup(__LINE__,__FILE__,_a)
74void *freewrlMalloc(
int line,
char *file,
size_t sz);
75void *freewrlRealloc(
int line,
char *file,
void *ptr,
size_t size);
76void freewrlFree(
int line,
char *file,
void *a);
77void *freewrlStrdup(
int line,
char *file,
char *str);
79# define UNLINK(_fdd) do { \
80 TRACE_MSG("TRACE: unlink %s at %s:%d\n",_fdd,__FILE__,__LINE__); \
84# define ASSERT(_ptr) do { if (!(_ptr)) { \
85 ERROR_MSG("ERROR: assert failed: %s (%s:%d)\n", #_ptr, __FILE__, __LINE__); } \
90# define MALLOC(t,_sz) ((t)malloc(_sz))
91# define REALLOC realloc
94# define STRDUP _strdup
95# define UNLINK _unlink
96# define TEMPNAM _tempnam
100# define TEMPNAM tempnam
102# define ASSERT(_whatever)
108#define FREE_IF_NZ(_ptr) if (_ptr) { \
112 DEBUG_MEM("free, pointer is already null at %s:%d\n", __FILE__, __LINE__); \