--- imapfilter/account.c 2003/07/31 15:46:02 1.1 +++ imapfilter/account.c 2004/02/09 17:34:56 1.6 @@ -1,7 +1,10 @@ #include +#include #include #include #include +#include /* IEEE Std 1003.1-2001 non-conformance. */ +#include #include "config.h" #include "imapfilter.h" @@ -14,7 +17,7 @@ account_t *accounts = NULL; /* First node of accounts linked list. */ mboxgrp_t *mboxgrps = NULL; /* First node of mailbox-groups tree. */ -static account_t *cur_acct = NULL; /* Current account. */ +account_t *cur_acct = NULL; /* Current account. */ void init_account(account_t * node); @@ -63,9 +66,7 @@ strncat(node->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, KEY_LEN - 1)); -#ifdef DEBUG - fprintf(stderr, "debug: ACCOUNT: '%s'\n", node->key); -#endif + debug("ACCOUNT: '%s'\n", node->key); if (m[3].rm_so != -1) { strncat(node->username, line + m[3].rm_so, @@ -78,9 +79,7 @@ if (string_decode(node->username)) return ERROR_CONFIG_PARSE; -#ifdef DEBUG - fprintf(stderr, "debug: USERNAME: '%s'\n", node->username); -#endif + debug("USERNAME: '%s'\n", node->username); if (m[4].rm_so != -1) { strncat(node->password, line + m[4].rm_so, @@ -92,25 +91,19 @@ } else flags |= FLAG_BLANK_PASSWORD; -#ifdef DEBUG - fprintf(stderr, "debug: PASSWORD: '%s'\n", node->password); -#endif + debug("PASSWORD: '%s'\n", node->password); strncat(node->server, line + m[6].rm_so, min(m[6].rm_eo - m[6].rm_so, SERVER_LEN - 1)); -#ifdef DEBUG - fprintf(stderr, "debug: SERVER: '%s'\n", node->server); -#endif + debug("SERVER: '%s'\n", node->server); if (m[7].rm_so != -1) { n = min(m[7].rm_eo - m[7].rm_so - 1, 5); xstrncpy(p, line + m[7].rm_so + 1, n); p[n] = '\0'; node->port = strtoul(p, NULL, 10); -#ifdef DEBUG - fprintf(stderr, "debug: PORT: %d\n", node->port); -#endif + debug("PORT: %d\n", node->port); } if (m[8].rm_so != -1) { if (m[7].rm_so == -1) @@ -184,9 +177,7 @@ strncat(node->key, line + m[1].rm_so, min(m[1].rm_eo - m[1].rm_so, KEY_LEN - 1)); -#ifdef DEBUG - fprintf(stderr, "debug: FOLDER: '%s'\n", node->key); -#endif + debug("FOLDER: '%s'\n", node->key); strncat(mboxs, line + m[2].rm_so, min(m[2].rm_eo - m[2].rm_so, LINE_MAX - 1)); @@ -259,9 +250,7 @@ strncat(node->name, s, MBOX_NAME_LEN - 1); -#ifdef DEBUG - fprintf(stderr, "debug: MBOX: '%s'\n", node->name); -#endif + debug("MBOX: '%s'\n", node->name); APPEND_LINKED_LIST(cur_acct->mboxes, node, mbox); @@ -329,9 +318,7 @@ while ((c = strchr(c, '/'))) *(c++) = delim; -#ifdef DEBUG - fprintf(stderr, "debug: MAILBOX: '%s'\n", m); -#endif + debug("MAILBOX: '%s'\n", m); return m; }