diff options
author | lostd <lostd@2f30.org> | 2014-10-08 11:36:17 +0300 |
---|---|---|
committer | lostd <lostd@2f30.org> | 2014-10-08 11:36:17 +0300 |
commit | da09d92b25a3da5d763e1365cb33fe6b72fb2e79 (patch) | |
tree | 44f68366d6a7b1fa61ebcf1bcb4ca5e6f07ffd10 | |
parent | 0deba427a92c654253d66cf84ba88f56ccd7b589 (diff) | |
download | nnn-da09d92b25a3da5d763e1365cb33fe6b72fb2e79.tar.gz |
Use dprintf(3) for debugging
-rw-r--r-- | noice.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -14,11 +14,14 @@ #include <unistd.h> #ifdef DEBUG -#define DPRINTF_D(x) printw(#x "=%d\n", x) -#define DPRINTF_S(x) printw(#x "=%s\n", x) -#define DPRINTF_P(x) printw(#x "=0x%p\n", x) +#define DEBUG_FD 8 +#define DPRINTF_D(x) dprintf(DEBUG_FD, #x "=%d\n", x) +#define DPRINTF_U(x) dprintf(DEBUG_FD, #x "=%u\n", x) +#define DPRINTF_S(x) dprintf(DEBUG_FD, #x "=%s\n", x) +#define DPRINTF_P(x) dprintf(DEBUG_FD, #x "=0x%p\n", x) #else #define DPRINTF_D(x) +#define DPRINTF_U(x) #define DPRINTF_S(x) #define DPRINTF_P(x) #endif /* DEBUG */ @@ -355,6 +358,9 @@ nochange: pathnew = malloc(strlen(path) + 1 + strlen(name) + 1); sprintf(pathnew, "%s/%s", path, name); + + DPRINTF_S(name); + DPRINTF_U(type); DPRINTF_S(pathnew); again: @@ -426,7 +432,6 @@ again: free(pathnew); goto redraw; default: - DPRINTF_D(dents[cur]->d_type); printmsg("Unsupported file"); goto nochange; } |