diff options
author | mongo <mongo@iomega> | 2016-08-29 16:57:22 -0300 |
---|---|---|
committer | mongo <mongo@iomega> | 2016-08-29 16:57:22 -0300 |
commit | b2cadf53d322bc374986f0a44ebb0ca4b2f636ef (patch) | |
tree | 1c50d6bf64f5e026b7e8d3c14cf1cb0ab37ed404 /src | |
parent | cf373949505b7a9ca46f22b8f7e09865fa1032e7 (diff) |
Added new "debug" configuration parameter
Diffstat (limited to 'src')
-rw-r--r-- | src/cmds.c | 2 | ||||
-rw-r--r-- | src/conf.c | 1 | ||||
-rw-r--r-- | src/dep_graph.c | 2 | ||||
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/pipe.c | 10 |
5 files changed, 9 insertions, 7 deletions
@@ -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); @@ -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; @@ -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); @@ -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; |