Allow giving alphanumeric channels (Prepare for IMTS)

This commit is contained in:
Andreas Eversberg
2019-07-20 18:11:17 +02:00
parent b266b0f743
commit d6579c1244
34 changed files with 177 additions and 177 deletions

View File

@@ -94,7 +94,7 @@ void get_win_size(int *w, int *h)
*w = MAX_DISPLAY_WIDTH - 1;
}
void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, int chan, const char *fmt, ...)
void _printdebug(const char *file, const char __attribute__((unused)) *function, int line, int cat, int level, const char *kanal, const char *fmt, ...)
{
char buffer[4096], *b = buffer;
int s = sizeof(buffer) - 1;
@@ -107,9 +107,9 @@ void _printdebug(const char *file, const char __attribute__((unused)) *function,
buffer[sizeof(buffer) - 1] = '\0';
/* if chan is used, prefix the channel number */
if (num_kanal > 1 && chan >= 0) {
sprintf(buffer, "(chan %d) ", chan);
/* if kanal is used, prefix the channel number */
if (num_kanal > 1 && kanal) {
sprintf(buffer, "(chan %s) ", kanal);
b = strchr(buffer, '\0');
s -= strlen(buffer);
}

View File

@@ -30,9 +30,9 @@
void get_win_size(int *w, int *h);
#define PDEBUG(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, -1, fmt, ## arg)
#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, int chan, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 7, 8)));
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);