aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2016-05-15 20:31:42 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2016-05-15 20:37:06 +0200
commit7aa2445b475ce4802157ede96602abe9732d77c7 (patch)
treeca4299598f2755c77368d249e108a7f8d02c5725 /src/common
parentadc3270dc0578c79044750de6b570e3c0c84f686 (diff)
Move amplitude (level) debugging to debug.c
Diffstat (limited to 'src/common')
-rw-r--r--src/common/debug.c14
-rw-r--r--src/common/debug.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/src/common/debug.c b/src/common/debug.c
index 2749241..aaaa6b4 100644
--- a/src/common/debug.c
+++ b/src/common/debug.c
@@ -70,3 +70,17 @@ void _printdebug(const char *file, const char *function, int line, int cat, int
fflush(stdout);
}
+const char *debug_amplitude(double level)
+{
+ static char text[42];
+
+ strcpy(text, " : ");
+ if (level > 1.0)
+ level = 1.0;
+ if (level < -1.0)
+ level = -1.0;
+ text[20 + (int)(level * 20)] = '*';
+
+ return text;
+}
+
diff --git a/src/common/debug.h b/src/common/debug.h
index f0b0232..53aa9bf 100644
--- a/src/common/debug.h
+++ b/src/common/debug.h
@@ -19,5 +19,7 @@
#define PDEBUG(cat, level, fmt, arg...) _printdebug(__FILE__, __FUNCTION__, __LINE__, cat, level, fmt, ## arg)
void _printdebug(const char *file, const char *function, int line, int cat, int level, const char *fmt, ...);
+const char *debug_amplitude(double level);
+
extern int debuglevel;