summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormongo <mongo@iomega>2016-08-29 16:57:22 -0300
committermongo <mongo@iomega>2016-08-29 16:57:22 -0300
commitb2cadf53d322bc374986f0a44ebb0ca4b2f636ef (patch)
tree1c50d6bf64f5e026b7e8d3c14cf1cb0ab37ed404 /src
parentcf373949505b7a9ca46f22b8f7e09865fa1032e7 (diff)
Added new "debug" configuration parameter
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c2
-rw-r--r--src/conf.c1
-rw-r--r--src/dep_graph.c2
-rw-r--r--src/main.c1
-rw-r--r--src/pipe.c10
5 files changed, 9 insertions, 7 deletions
diff --git a/src/cmds.c b/src/cmds.c
index ca73ad7..7898ba2 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -1005,7 +1005,7 @@ void send_to_interp(wchar_t * oper) {
int pos = -1;
if ((pos = wstr_in_wstr(oper, L"\n")) != -1)
oper[pos] = L'\0';
- sc_info("Interp GOT: %ls", oper);
+ sc_debug("Interp GOT: %ls", oper);
//wprintf(L"Interp GOT: %ls", oper);
}
wcstombs(line, oper, BUFFERSIZE);
diff --git a/src/conf.c b/src/conf.c
index 5cb8546..7f29dbc 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -17,6 +17,7 @@ void store_default_config_values() {
put(user_conf_d, "numeric_zero", "0");
put(user_conf_d, "numeric_decimal", "0");
put(user_conf_d, "overlap", "0");
+ put(user_conf_d, "debug", "1");
// we calc get gmtoffset
#ifdef USELOCALE
diff --git a/src/dep_graph.c b/src/dep_graph.c
index 8915fb4..6ada093 100644
--- a/src/dep_graph.c
+++ b/src/dep_graph.c
@@ -211,7 +211,7 @@ void destroy_vertex(struct ent * ent) {
v_cur = v_cur->next;
}
if (v_cur->ent->row != ent->row || v_cur->ent->col != ent->col) {
- sc_debug("Error while destroying a vertex. Vertex not found! Please rebuild graph");
+ sc_error("Error while destroying a vertex. Vertex not found! Please rebuild graph");
return;
}
v_prev->next = v_cur->next;
diff --git a/src/main.c b/src/main.c
index c18b87a..80320fe 100644
--- a/src/main.c
+++ b/src/main.c
@@ -449,6 +449,7 @@ void winchg() {
#include <stdarg.h>
#include "conf.h"
void sc_msg(char * s, int type, ...) {
+ if (type == DEBUG_MSG && ! atoi(get_conf_value("debug"))) return;
char t[BUFFERSIZE];
va_list args;
va_start(args, type);
diff --git a/src/pipe.c b/src/pipe.c
index 2ab0796..9a28eb7 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -37,7 +37,7 @@ void getnum(int r0, int c0, int rn, int cn, FILE * fd) {
//else
//fwrite(fd, line, strlen(line));
- sc_debug("%s", line);
+ sc_info("%s", line);
if (brokenpipe) {
linelim = -1;
return;
@@ -51,7 +51,7 @@ void getnum(int r0, int c0, int rn, int cn, FILE * fd) {
void getformat(int col, FILE * fd) {
sprintf(line, "%d %d %d\n", fwidth[col], precision[col], realfmt[col]);
//write(fd, line, strlen(line));
- sc_debug("%s", line);
+ sc_info("%s", line);
linelim = -1;
}
@@ -70,7 +70,7 @@ void getfmt(int r0, int c0, int rn, int cn, FILE * fd) {
// strcat(line, "\n");
//write(fd, line, strlen(line));
- sc_debug("%s", line);
+ sc_info("%s", line);
if (brokenpipe) {
linelim = -1;
return;
@@ -95,7 +95,7 @@ void getstring(int r0, int c0, int rn, int cn, FILE * fd) {
// strcat(line, "\n");
//write(fd, line, strlen(line));
- sc_debug("%s", line);
+ sc_info("%s", line);
if (brokenpipe) {
linelim = -1;
return;
@@ -127,7 +127,7 @@ void getexp(int r0, int c0, int rn, int cn, FILE * fd) {
// strcat(line, "\n");
//write(fd, line, strlen(line));
- sc_debug("%s", line);
+ sc_info("%s", line);
if (brokenpipe) {
linelim = -1;
return;