1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

fix runtime debugging macros

Sadly, configure --enable-debug defines the macro DEBUG which conflicts
with the level1 debugging output macro. Rename them to DBG() and DBG2().
This commit is contained in:
Phil Sutter 2008-12-07 19:47:57 +01:00
parent e2c49531f3
commit 1a4e4b3b69
2 changed files with 11 additions and 11 deletions

View File

@ -1672,7 +1672,7 @@ int imap_command(int sockfd, const char *command, char *response, const char *ve
return -1;
}
}
DEBUG2("imap_command() received: %s", response);
DBGP2("imap_command() received: %s", response);
response[numbytes] = '\0';
if (strstr(response, verify) == NULL) {
return -1;
@ -1788,7 +1788,7 @@ void *imap_thread(void *arg)
break;
}
recvbuf[numbytes] = '\0';
DEBUG2("imap_thread() received: %s", recvbuf);
DBGP2("imap_thread() received: %s", recvbuf);
if (strstr(recvbuf, "* OK") != recvbuf) {
ERR("IMAP connection failed, probably not an IMAP server");
fail++;
@ -1868,7 +1868,7 @@ void *imap_thread(void *arg)
break;
}
recvbuf[numbytes] = '\0';
DEBUG2("imap_thread() received: %s", recvbuf);
DBGP2("imap_thread() received: %s", recvbuf);
if (strlen(recvbuf) > 2) {
unsigned long messages, recent;
char *buf = recvbuf;
@ -1964,7 +1964,7 @@ void *imap_thread(void *arg)
}
}
recvbuf[numbytes] = '\0';
DEBUG2("imap_thread() received: %s", recvbuf);
DBGP2("imap_thread() received: %s", recvbuf);
if (strstr(recvbuf, "a3 OK") == NULL) {
ERR("IMAP logout failed: %s", recvbuf);
fail++;
@ -2005,7 +2005,7 @@ int pop3_command(int sockfd, const char *command, char *response, const char *ve
return -1;
}
}
DEBUG2("pop3_command() received: %s", response);
DBGP2("pop3_command() received: %s", response);
response[numbytes] = '\0';
if (strstr(response, verify) == NULL) {
return -1;
@ -2086,7 +2086,7 @@ void *pop3_thread(void *arg)
fail++;
break;
}
DEBUG2("pop3_thread received: %s", recvbuf);
DBGP2("pop3_thread received: %s", recvbuf);
recvbuf[numbytes] = '\0';
if (strstr(recvbuf, "+OK ") != recvbuf) {
ERR("POP3 connection failed, probably not a POP3 server");
@ -4343,7 +4343,7 @@ static int handle_template_object(struct text_object_list **list,
for (i = 0; i < argcnt; i++) {
char *tmp;
tmp = backslash_escape(argsp[i], NULL, 0);
DEBUG2("%s: substituted arg '%s' to '%s'", tmpl, argsp[i], tmp);
DBGP2("%s: substituted arg '%s' to '%s'", tmpl, argsp[i], tmp);
sprintf(argsp[i], "%s", tmp);
free(tmp);
}
@ -4351,7 +4351,7 @@ static int handle_template_object(struct text_object_list **list,
p = template_dup = strdup(template[template_idx]);
eval_text = backslash_escape(template[template_idx], argsp, argcnt);
DEBUG("substituted %s, output is '%s'", tmpl, eval_text);
DBGP("substituted %s, output is '%s'", tmpl, eval_text);
eval_list = extract_variable_text_internal(eval_text, allow_threaded);
if (eval_list) {

View File

@ -119,14 +119,14 @@ extern unsigned int text_buffer_size;
/* debugging output */
extern int global_debug_level;
#define __DBG(level, ...) \
#define __DBGP(level, ...) \
if (global_debug_level > level) { \
fprintf(stderr, "DEBUG(%d) [" __FILE__ ":%d]: ", level, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
fprintf(stderr, "\n"); \
}
#define DEBUG(...) __DBG(0, __VA_ARGS__)
#define DEBUG2(...) __DBG(1, __VA_ARGS__)
#define DBGP(...) __DBGP(0, __VA_ARGS__)
#define DBGP2(...) __DBGP(1, __VA_ARGS__)
struct net_stat {
const char *dev;