diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2020-09-13 20:57:07 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2020-12-29 11:18:33 +0100 |
commit | ab8fef45d6bc4ca53b71fa82c52c8df73fea0a7f (patch) | |
tree | ca9c3d46c5611cdbef92a2189e65f199b717f6c2 /src/libdebug/debug.h | |
parent | ec0042ae7020ee7c4d6242db64fdf395b57a20c7 (diff) |
Add libraries from Osmocom-Analog
Diffstat (limited to 'src/libdebug/debug.h')
-rw-r--r-- | src/libdebug/debug.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/libdebug/debug.h b/src/libdebug/debug.h new file mode 100644 index 0000000..fb25374 --- /dev/null +++ b/src/libdebug/debug.h @@ -0,0 +1,32 @@ + +#define DEBUG_DEBUG 0 /* debug info, not for normal use */ +#define DEBUG_INFO 1 /* all info about process */ +#define DEBUG_NOTICE 2 /* something unexpected happens */ +#define DEBUG_ERROR 3 /* there is an error with this software */ + +#define DOPTIONS 0 +#define DDSP 1 +#define DSIP 2 +#define DCC 3 + +void get_win_size(int *w, int *h); + +#define PDEBUG(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, NULL, fmt, ## arg) +#define PDEBUG_CHAN(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, CHAN, fmt, ## arg) +void _printdebug(const char *file, const char *function, int line, int cat, int level, const char *chan_str, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 7, 8))); + +const char *debug_amplitude(double level); +const char *debug_db(double level_db); + +void debug_list_cat(void); +int parse_debug_opt(const char *opt); + +extern int debuglevel; + +extern void (*clear_console_text)(void); +extern void (*print_console_text)(void); + +extern int debug_limit_scroll; + +const char *debug_hex(const uint8_t *data, int len); + |