move debug.c
authorPierre Habouzit <madcoder@debian.org>
Sat, 11 Nov 2006 23:23:24 +0000 (00:23 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 11 Nov 2006 23:23:24 +0000 (00:23 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
65 files changed:
alias.c
attach.c
commands.c
complete.c
compress.c
copy.c
from.c
handler.c
hcache.c
headers.c
imap/auth.c
imap/auth_anon.c
imap/auth_cram.c
imap/auth_gss.c
imap/auth_login.c
imap/auth_sasl.c
imap/browse.c
imap/command.c
imap/imap.c
imap/message.c
imap/util.c
init.c
init.h
lib-crypt/crypt-gpgme.c
lib-crypt/gnupgparse.c
lib-crypt/pgp.c
lib-crypt/pgpinvoke.c
lib-crypt/pgpkey.c
lib-crypt/pgpmicalg.c
lib-crypt/smime.c
lib-lib/Makefile.am
lib-lib/buffer.c
lib-lib/debug.c [new file with mode: 0644]
lib-lib/debug.h [new file with mode: 0644]
lib-lib/file.c
lib-mime/rfc822parse.c
lib-network/mutt_socket.c
lib-network/mutt_ssl.c
lib-ui/color.c
lib-ui/curs_lib.c
lib-ui/curs_main.c
lib.c
lib/Makefile.am
lib/debug.c [deleted file]
lib/debug.h [deleted file]
main.c
mbox.c
mh.c
mutt_idna.c
mutt_sasl.c
muttlib.c
mx.c
nntp/newsrc.c
nntp/nntp.c
pager.c
pop/pop.c
pop/pop_auth.c
pop/pop_lib.c
postpone.c
query.c
rfc1524.c
rfc3676.c
send.c
sendlib.c
state.c

diff --git a/alias.c b/alias.c
index e8f109b..cf4dc5e 100644 (file)
--- a/alias.c
+++ b/alias.c
 #include <lib-lib/file.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
 #include "lib/rx.h"
-#include "lib/debug.h"
 
 #include "mutt.h"
 #include "mutt_idna.h"
index 3fbe7d2..67f2aa4 100644 (file)
--- a/attach.c
+++ b/attach.c
 # include "config.h"
 #endif
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/file.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include "mx.h"
 #include <lib-crypt/crypt.h>
 
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-
 int mutt_get_tmp_attachment (BODY * a)
 {
   char type[STRING];
index b1ae870..3ad59c8 100644 (file)
 # include "config.h"
 #endif
 
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <utime.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/file.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/ascii.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include "buffy.h"
 #endif
 
-#include "lib/debug.h"
-
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <utime.h>
-
 /* The folder the user last saved to.  Used by ci_save_message() */
 static char LastSaveFolder[_POSIX_PATH_MAX] = "";
 
index 5e66da8..b9d1088 100644 (file)
 # include "config.h"
 #endif
 
+#include <dirent.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#include <lib-lib/str.h>
+#include <lib-lib/file.h>
+#include <lib-lib/debug.h>
+
 #include "mutt.h"
 #include "mx.h"
 #include <imap/imap.h>
 #include "nntp.h"
 #endif
 
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include "lib/debug.h"
-
-#include <dirent.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-
 /* given a partial pathname, this routine fills in as much of the rest of the
  * path as is unique.
  *
index dcf6143..fd8b97d 100644 (file)
@@ -7,10 +7,16 @@
  * please see the file GPL in the top level source directory.
  */
 
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 
 #include "mx.h"
 #include "mbox.h"
 
-#include "lib/debug.h"
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
 typedef struct {
   const char *close;            /* close-hook  command */
   const char *open;             /* open-hook   command */
diff --git a/copy.c b/copy.c
index 97b73c0..2c653e1 100644 (file)
--- a/copy.c
+++ b/copy.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <unistd.h>
+
 #include <lib-lib/macros.h>
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/file.h>
 #include <lib-lib/ascii.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <unistd.h>             /* needed for SEEK_SET under SunOS 4.1.4 */
-
 static int address_header_decode (char **str);
 static int copy_delete_attach (BODY * b, FILE * fpin, FILE * fpout,
                                char *date);
diff --git a/from.c b/from.c
index 64686fc..eafdfe6 100644 (file)
--- a/from.c
+++ b/from.c
 # include "config.h"
 #endif
 
+#include <ctype.h>
+#include <string.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <string.h>
-
 static const char *next_word(const char *s)
 {
     while (*s && !ISSPACE(*s))
index a2b3e9d..1c5d6fa 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -23,6 +23,7 @@
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -41,7 +42,6 @@
 #include "attach.h"
 #include "lib.h"
 
-#include "lib/debug.h"
 
 typedef int handler_f (BODY *, STATE *);
 typedef handler_f *handler_t;
index e089bf1..af044b9 100644 (file)
--- a/hcache.c
+++ b/hcache.c
@@ -42,6 +42,7 @@
 
 #include <lib-lib/mem.h>
 #include <lib-hash/hash.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -50,8 +51,6 @@
 #include "mx.h"
 #include "lib.h"
 
-#include "lib/debug.h"
-
 static struct header_cache {
 #if defined(HAVE_QDBM)
   VILLA *db;
index e4709ac..ecb5756 100644 (file)
--- a/headers.c
+++ b/headers.c
 # include "config.h"
 #endif
 
+#include <sys/stat.h>
+#include <string.h>
+#include <ctype.h>
+
 #include <lib-lib/macros.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
-#include "lib/debug.h"
-
-#include <sys/stat.h>
-#include <string.h>
-#include <ctype.h>
-
 void mutt_edit_headers (const char *editor,
                         const char *body,
                         HEADER * msg, char *fcc, size_t fcclen)
index 04fe671..74aee4c 100644 (file)
 #endif
 
 #include <lib-lib/mem.h>
+#include <lib-lib/debug.h>
 
 #include <lib-lib/macros.h>
 #include <lib-lib/ascii.h>
-#include "lib/debug.h"
 
 #include "mutt.h"
 #include "imap_private.h"
index 2c5b3fa..7c2dfba 100644 (file)
@@ -18,7 +18,7 @@
 #include "auth.h"
 
 #include <lib-lib/macros.h>
-#include "lib/debug.h"
+#include <lib-lib/debug.h>
 
 /* this is basically a stripped-down version of the cram-md5 method. */
 imap_auth_res_t imap_auth_anon (IMAP_DATA * idata, const char *method)
index 14772b0..0438a82 100644 (file)
@@ -21,8 +21,8 @@
 #define MD5_DIGEST_LEN 16
 
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 #include <lib-hash/hash.h>
-#include "lib/debug.h"
 
 /* forward declarations */
 static void hmac_md5 (const char *password, char *challenge,
index ff51d89..197a18e 100644 (file)
@@ -18,7 +18,7 @@
 #include "auth.h"
 
 #include <lib-lib/macros.h>
-#include "lib/debug.h"
+#include <lib-lib/debug.h>
 
 #include <netinet/in.h>
 
index 27e2156..a6b78dc 100644 (file)
@@ -14,7 +14,7 @@
 #endif
 
 #include <lib-lib/macros.h>
-#include "lib/debug.h"
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "imap_private.h"
index 4d9df26..b8b1e3c 100644 (file)
@@ -22,7 +22,7 @@
 #include "auth.h"
 
 #include <lib-lib/macros.h>
-#include "lib/debug.h"
+#include <lib-lib/debug.h>
 
 #include <sasl/sasl.h>
 #include <sasl/saslutil.h>
index 03586bc..65f94f2 100644 (file)
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/enter.h>
 
-#include "lib/debug.h"
 
 #include "mutt.h"
 #include "imap_private.h"
index af4c2b2..6968334 100644 (file)
@@ -19,8 +19,8 @@
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
-#include "lib/debug.h"
 
 #include "mutt.h"
 #include "message.h"
index 005c15f..48f1dc4 100644 (file)
@@ -19,6 +19,7 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/buffer.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "mx.h"
@@ -33,7 +34,6 @@
 #include "buffy.h"
 
 #include <lib-lib/macros.h>
-#include "lib/debug.h"
 
 #include <unistd.h>
 #include <ctype.h>
index 525f008..ba49cd1 100644 (file)
@@ -21,6 +21,7 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/buffer.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 
@@ -36,7 +37,6 @@
 
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
-#include "lib/debug.h"
 
 #if HAVE_STDINT_H
 #include <stdint.h>
index 8c294d2..6088321 100644 (file)
@@ -23,7 +23,7 @@
 #include <lib-network/mutt_ssl.h>
 
 #include <lib-lib/macros.h>
-#include "lib/debug.h"
+#include <lib-lib/debug.h>
 
 #include <stdlib.h>
 #include <ctype.h>
diff --git a/init.c b/init.c
index ce6054e..d7eef24 100644 (file)
--- a/init.c
+++ b/init.c
@@ -21,6 +21,7 @@
 #include <lib-lib/macros.h>
 #include <lib-lib/buffer.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 
@@ -46,7 +47,6 @@
 
 #include "lib/rx.h"
 #include "lib/list.h"
-#include "lib/debug.h"
 
 #include <ctype.h>
 #include <stdlib.h>
diff --git a/init.h b/init.h
index d76776e..1c93283 100644 (file)
--- a/init.h
+++ b/init.h
 # include "sort.h"
 #endif
 
+#include <lib-lib/debug.h>
+
 #include "buffy.h"
 #include "mutt.h"
 #include "version.h"
-#include "lib/debug.h"
 
 #ifndef _MAKEDOC
 #define DT_MASK         0x0f
index f20d052..8d8fb96 100644 (file)
@@ -23,6 +23,7 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -38,7 +39,6 @@
 #include "recvattach.h"
 #include "sort.h"
 
-#include "lib/debug.h"
 
 #include <sys/wait.h>
 #include <string.h>
index dff28ca..6b3a7d9 100644 (file)
@@ -36,6 +36,7 @@
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/date.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -43,7 +44,6 @@
 #include "pgp.h"
 #include "charset.h"
 
-#include "lib/debug.h"
 
 /****************
  * Read the GNUPG keys.  For now we read the complete keyring by
index b69bc9b..e90943d 100644 (file)
@@ -32,6 +32,7 @@
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "handler.h"
@@ -39,7 +40,6 @@
 #include "copy.h"
 #include "attach.h"
 
-#include "lib/debug.h"
 
 #include <sys/wait.h>
 #include <string.h>
index 0314412..f5d45e9 100644 (file)
@@ -29,6 +29,7 @@
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -38,7 +39,6 @@
 #include "mutt_idna.h"
 #include "pgp.h"
 
-#include "lib/debug.h"
 
 /*
  * The actual command line formatter.
index b8ceda5..ae3e49b 100644 (file)
@@ -17,6 +17,7 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -30,7 +31,6 @@
 #include "pager.h"
 #include "sort.h"
 
-#include "lib/debug.h"
 
 #include <string.h>
 #include <ctype.h>
index 1c322be..959ac36 100644 (file)
 #include <ctype.h>
 
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
-#include "lib/debug.h"
-
 static struct {
   short id;
   const char *name;
index 78d360d..5c4cf77 100644 (file)
@@ -17,6 +17,7 @@
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -28,7 +29,6 @@
 #include "handler.h"
 #include "copy.h"
 
-#include "lib/debug.h"
 
 #include <sys/wait.h>
 #include <string.h>
index 716d64b..dd9b5b8 100644 (file)
@@ -3,8 +3,8 @@ noinst_LIBRARIES = liblib.a
 liblib_a_SOURCES = mem.h str.h ascii.h buffer.h hash.h list.h file.h mapping.h \
                          str.c ascii.c buffer.c hash.c list.c file.c mapping.c \
                   \
-                  date.h                                                      \
-                  date.c
+                  date.h debug.h                                              \
+                  date.c debug.c
 
 noinst_HEADERS   = mem.h str.h ascii.h buffer.h hash.h list.h file.h mapping.h \
                   date.c
index 47e58ba..6feb958 100644 (file)
@@ -35,8 +35,7 @@
 #include "ascii.h"
 #include "buffer.h"
 #include "file.h"
-
-#include "lib/debug.h"
+#include "debug.h"
 
 #include "mutt.h"
 
diff --git a/lib-lib/debug.c b/lib-lib/debug.c
new file mode 100644 (file)
index 0000000..bdf8b0c
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ *
+ *  Copyright Â© 2006 Pierre Habouzit
+ */
+/*
+ * written for mutt-ng by:
+ * Rocco Rutte <pdmef@cs.tu-berlin.de>
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if DEBUG
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <time.h>
+
+#include "str.h"
+#include "file.h"
+#include "debug.h"
+
+#include "mutt.h"
+#include "globals.h"
+
+short DebugLevel = -1;
+FILE* DebugFile = NULL;
+
+void debug_setlevel(short level) {
+    DebugLevel = level;
+}
+
+void debug_start(const char* basedir) {
+    time_t t;
+    int i;
+    char buf[_POSIX_PATH_MAX];
+    char buf2[_POSIX_PATH_MAX];
+
+    if (DebugLevel < DEBUG_MIN_LEVEL || DebugLevel > DEBUG_MAX_LEVEL
+    || !basedir || !*basedir)
+        return;
+    /* rotate the old debug logs */
+    for (i = 3; i >= 0; i--) {
+        snprintf(buf, sizeof (buf), "%s/.madmuttdebug%d", NONULL(basedir), i);
+        snprintf(buf2, sizeof (buf2), "%s/.madmuttdebug%d", NONULL(basedir), i + 1);
+        rename (buf, buf2);
+    }
+
+    if ((DebugFile = safe_fopen (buf, "w")) != NULL) {
+        t = time (NULL);
+        setbuf(DebugFile, NULL);   /* don't buffer the debugging output! */
+        fprintf(DebugFile,
+                "Madmutt %s started at %s\nDebugging at level %d\n\n",
+                MUTT_VERSION, asctime (localtime (&t)), DebugLevel);
+    }
+}
+
+void _debug_print_intro(const char* file, int line, const char *function, int level) {
+    if (!DebugFile || DebugLevel < DEBUG_MIN_LEVEL || DebugLevel > DEBUG_MAX_LEVEL)
+        return;
+    fprintf(DebugFile, "[%d:%s:%d", level, NONULL(file), line);
+    if (function && *function)
+        fprintf(DebugFile, ":%s()", function);
+    fprintf(DebugFile, "] ");
+}
+
+void _debug_print_msg (const char* fmt, ...) {
+    va_list ap;
+
+    if (!DebugFile || DebugLevel < 0)
+        return;
+    va_start(ap, fmt);
+    vfprintf(DebugFile, fmt, ap);
+    va_end(ap);
+}
+
+#endif /* DEBUG */
diff --git a/lib-lib/debug.h b/lib-lib/debug.h
new file mode 100644 (file)
index 0000000..ece3823
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful, but
+ *  WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ *
+ *  Copyright Â© 2006 Pierre Habouzit
+ */
+/*
+ * written for mutt-ng by:
+ * Rocco Rutte <pdmef@cs.tu-berlin.de>
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+
+/* generic interface for debug messages */
+
+#ifndef _LIB_DEBUG_H
+#define _LIB_DEBUG_H
+
+#include <stdio.h>
+
+#define DEBUG_MIN_LEVEL         1
+#define DEBUG_MIN_LEVEL_S       "1"
+#define DEBUG_MAX_LEVEL         5
+#define DEBUG_MAX_LEVEL_S       "5"
+
+#ifdef DEBUG
+
+extern short DebugLevel;
+extern FILE* DebugFile;
+
+void debug_setlevel (short);
+void debug_start (const char*);
+
+void _debug_print_intro (const char*, int, const char*, int);
+void _debug_print_msg (const char*, ...);
+
+/*
+ * the debug_print() macro will (in the end) print debug messages of the
+ * following format:
+ *
+ *      (file:line:function:level): message
+ *
+ * for GCC and:
+ *
+ *      (file:line:level): message
+ *
+ * otherwise
+ */
+#ifdef __GNUC__
+
+#define debug_print(level,msg)                                      \
+    do {                                                            \
+        if (DebugLevel >= level) {                                  \
+            _debug_print_intro (__FILE__,__LINE__,__func__,level);  \
+            _debug_print_msg msg;                                   \
+        }                                                           \
+    } while(0)
+
+#else /* __GNUC__ */
+
+#define debug_print(level,msg)                                      \
+    do {                                                            \
+        if (DebugLevel >= level) {                                  \
+            _debug_print_intro (__FILE__,__LINE__,NULL,level);      \
+            _debug_print_msg msg;                                   \
+        }                                                           \
+    } while(0)
+
+#endif /* !__GNUC__ */
+
+#else /* DEBUG */
+
+/*
+ * without debug support, we don't need these
+ * (this also kills the dozens of #ifdef for debug...
+ */
+#define debug_start(basedir)
+#define debug_setlevel(level)
+#define debug_print(level,msg)
+
+#endif /* !DEBUG */
+
+#endif /* !_LIB_DEBUG_H */
index 7809db3..22bb68c 100644 (file)
@@ -37,8 +37,7 @@
 #include "mem.h"
 #include "str.h"
 #include "file.h"
-
-#include "../lib/debug.h"
+#include "debug.h"
 
 #ifndef O_NOFOLLOW
 #  define O_NOFOLLOW  0
index 35df8d1..732a046 100644 (file)
 #include <lib-lib/macros.h>
 #include <lib-lib/buffer.h>
 #include <lib-lib/date.h>
+#include <lib-lib/debug.h>
 
 #include "recvattach.h"
 #include "url.h"
 
-#include "lib/debug.h"
 
 #include "mime.h"
 
index 664f61f..e3874d1 100644 (file)
@@ -16,6 +16,7 @@
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "globals.h"
@@ -27,7 +28,6 @@
 
 #include "mutt_idna.h"
 
-#include "lib/debug.h"
 
 #include <unistd.h>
 #include <netinet/in.h>
index 315ba52..b247377 100644 (file)
@@ -23,6 +23,7 @@
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
@@ -31,7 +32,6 @@
 #include "mutt_socket.h"
 #include "mutt_ssl.h"
 
-#include "lib/debug.h"
 
 #if OPENSSL_VERSION_NUMBER >= 0x00904000L
 #define READ_X509_KEY(fp, key) PEM_read_X509(fp, key, NULL, NULL)
index 20fb8b0..2f286f4 100644 (file)
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/buffer.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include "curses.h"
 
 #include "mutt.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
 /* globals */
 int *ColorQuote;
 int ColorQuoteUsed;
index 2eb7415..318ee85 100644 (file)
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-
-#include "curses.h"
-#include "menu.h"
-#include "enter.h"
-
-#include "mutt.h"
-#include "pager.h"
-#include "mbyte.h"
-
-#include "lib/debug.h"
-
 #include <wchar.h>
 #include <termios.h>
 #include <sys/types.h>
 #include <langinfo.h>
 #endif
 
+#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
+#include <lib-lib/debug.h>
+
+#include "curses.h"
+#include "menu.h"
+#include "enter.h"
+
+#include "mutt.h"
+#include "pager.h"
+#include "mbyte.h"
+
 /* not possible to unget more than one char under some curses libs, and it
  * is impossible to unget function keys in SLang, so roll our own input
  * buffering routines.
index 1d2be6d..0fd125a 100644 (file)
 # include "config.h"
 #endif
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <errno.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include <pop/pop.h>
 
 #include "mutt_sasl.h"
 #endif
 
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <errno.h>
-
 static const char *No_mailbox_is_open = N_("No mailbox is open.");
 static const char *There_are_no_messages = N_("There are no messages.");
 static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
diff --git a/lib.c b/lib.c
index 33d377f..2d0ec11 100644 (file)
--- a/lib.c
+++ b/lib.c
 #include <lib-lib/macros.h>
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
+#include <lib-lib/debug.h>
 
 #include "lib.h"
 
-#include "lib/debug.h"
 
 static struct sysexits
 {
index 775d21e..e76c232 100644 (file)
@@ -5,9 +5,8 @@ AR=@AR@
 AUTOMAKE_OPTIONS = foreign
 
 noinst_LIBRARIES = libsane.a
-noinst_HEADERS = list.h rx.h debug.h
+noinst_HEADERS = list.h rx.h
 
-libsane_a_SOURCES = list.c rx.h debug.h \
-                   list.h rx.c debug.c
+libsane_a_SOURCES = list.c rx.h list.h rx.c
 
 -include ../cflags.mk
diff --git a/lib/debug.c b/lib/debug.c
deleted file mode 100644 (file)
index 4d4d393..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * written for mutt-ng by:
- * Rocco Rutte <pdmef@cs.tu-berlin.de>
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#if DEBUG
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <time.h>
-
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include "debug.h"
-
-#include "mutt.h"
-#include "globals.h"
-
-short DebugLevel = -1;
-FILE* DebugFile = NULL;
-
-void debug_setlevel (short level) {
-  DebugLevel = level;
-}
-
-void debug_start (const char* basedir) {
-  time_t t;
-  int i;
-  char buf[_POSIX_PATH_MAX];
-  char buf2[_POSIX_PATH_MAX];
-
-  if (DebugLevel < DEBUG_MIN_LEVEL || DebugLevel > DEBUG_MAX_LEVEL
-      || !basedir || !*basedir)
-    return;
-  /* rotate the old debug logs */
-  for (i = 3; i >= 0; i--) {
-    snprintf (buf, sizeof (buf), "%s/.madmuttdebug%d", NONULL (basedir), i);
-    snprintf (buf2, sizeof (buf2), "%s/.madmuttdebug%d", NONULL (basedir), i + 1);
-    rename (buf, buf2);
-  }
-  if ((DebugFile = safe_fopen (buf, "w")) != NULL) {
-    t = time (NULL);
-    setbuf (DebugFile, NULL);   /* don't buffer the debugging output! */
-    fprintf (DebugFile,
-             "Madmutt %s started at %s\nDebugging at level %d\n\n",
-             MUTT_VERSION, asctime (localtime (&t)), DebugLevel);
-  }
-}
-
-void _debug_print_intro (const char* file, int line, const char* function, int level) {
-  if (!DebugFile || DebugLevel < DEBUG_MIN_LEVEL || DebugLevel > DEBUG_MAX_LEVEL)
-    return;
-  fprintf (DebugFile, "[%d:%s:%d", level, NONULL(file), line);
-  if (function && *function)
-    fprintf (DebugFile, ":%s()", function);
-  fprintf (DebugFile, "] ");
-}
-
-void _debug_print_msg (const char* fmt, ...) {
-  va_list ap;
-
-  if (!DebugFile || DebugLevel < 0)
-    return;
-  va_start (ap, fmt);
-  vfprintf (DebugFile, fmt, ap);
-  va_end (ap);
-}
-
-#endif /* DEBUG */
diff --git a/lib/debug.h b/lib/debug.h
deleted file mode 100644 (file)
index 61a1411..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * written for mutt-ng by:
- * Rocco Rutte <pdmef@cs.tu-berlin.de>
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-
-/* generic interface for debug messages */
-
-#ifndef _LIB_DEBUG_H
-#define _LIB_DEBUG_H
-
-#include <stdio.h>
-
-#define DEBUG_MIN_LEVEL         1
-#define DEBUG_MIN_LEVEL_S       "1"
-#define DEBUG_MAX_LEVEL         5
-#define DEBUG_MAX_LEVEL_S       "5"
-
-#ifdef DEBUG
-
-extern short DebugLevel;
-extern FILE* DebugFile;
-
-void debug_setlevel (short);
-void debug_start (const char*);
-
-void _debug_print_intro (const char*, int, const char*, int);
-void _debug_print_msg (const char*, ...);
-
-/*
- * the debug_print() macro will (in the end) print debug messages of the
- * following format:
- *
- *      (file:line:function:level): message
- *
- * for GCC and:
- *
- *      (file:line:level): message
- *
- * otherwise
- */
-#ifdef __GNUC__
-#define debug_print(level,msg) do { \
-  if (DebugLevel >= level) { \
-    _debug_print_intro (__FILE__,__LINE__,__FUNCTION__,level); \
-    _debug_print_msg msg; \
-  } \
-} while(0)
-#else /* __GNUC__ */
-#define debug_print(level,msg) do { \
-  if (DebugLevel >= level) { \
-    _debug_print_intro (__FILE__,__LINE__,NULL,level); \
-    _debug_print_msg msg; \
-  } \
-} while(0)
-#endif /* !__GNUC__ */
-
-#else /* DEBUG */
-
-/*
- * without debug support, we don't need these
- * (this also kills the dozens of #ifdef for debug...
- */
-#define debug_start(basedir)
-#define debug_setlevel(level)
-#define debug_print(level,msg)
-
-#endif /* !DEBUG */
-
-#endif /* !_LIB_DEBUG_H */
diff --git a/main.c b/main.c
index 4ea396f..29197df 100644 (file)
--- a/main.c
+++ b/main.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <locale.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/utsname.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 
 #include "mutt_idna.h"
 #include "xterm.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <locale.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/utsname.h>
-
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
diff --git a/mbox.c b/mbox.c
index 267cd7b..d4d3a08 100644 (file)
--- a/mbox.c
+++ b/mbox.c
 # include "config.h"
 #endif
 
+#include <sys/stat.h>
+#include <dirent.h>
+#include <string.h>
+#include <utime.h>
+#include <sys/file.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "mx.h"
 #include "copy.h"
 #include "compress.h"
 
-#include "lib/debug.h"
-
-#include <sys/stat.h>
-#include <dirent.h>
-#include <string.h>
-#include <utime.h>
-#include <sys/file.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-
 /* struct used by mutt_sync_mailbox() to store new offsets */
 struct m_update_t {
   short valid;
diff --git a/mh.c b/mh.c
index f108bf9..5a68171 100644 (file)
--- a/mh.c
+++ b/mh.c
 # include "config.h"
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-
-#include "mutt.h"
-#include "mx.h"
-#include "mh.h"
-#include "mbox.h"
-#include "copy.h"
-#include "buffy.h"
-#include "sort.h"
-#include "thread.h"
-#include "hcache.h"
-
-#include "lib/debug.h"
-
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <sys/time.h>
 #endif
 
+#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
+#include <lib-lib/debug.h>
+
+#include "mutt.h"
+#include "mx.h"
+#include "mh.h"
+#include "mbox.h"
+#include "copy.h"
+#include "buffy.h"
+#include "sort.h"
+#include "thread.h"
+#include "hcache.h"
+
 struct maildir {
   HEADER *h;
   char *canon_fname;
index 1419dd9..bab9f8f 100644 (file)
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "charset.h"
 #include "mutt_idna.h"
 
-#include "lib/debug.h"
-
 /* The low-level interface we use. */
 
 #ifndef HAVE_LIBIDN
index d5738b6..bb91271 100644 (file)
 # include "config.h"
 #endif
 
+#include <errno.h>
+#include <netdb.h>
+#include <sasl/sasl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
 #include <lib-lib/mem.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "account.h"
 #include "mutt_sasl.h"
 #include <lib-network/mutt_socket.h>
 
-#include "lib/debug.h"
-
-#include <errno.h>
-#include <netdb.h>
-#include <sasl/sasl.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-
 static int getnameinfo_err (int ret)
 {
   int err;
index c8339ef..f901549 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <time.h>
+#include <sys/types.h>
+#include <utime.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/buffer.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-crypt/crypt.h>
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <time.h>
-#include <sys/types.h>
-#include <utime.h>
-
 #define SW              (option(OPTMBOXPANE)?SidebarWidth:0)
 
 BODY *mutt_new_body (void)
diff --git a/mx.c b/mx.c
index a63b28f..5f18ac1 100644 (file)
--- a/mx.c
+++ b/mx.c
 # include "config.h"
 #endif
 
+#include <dirent.h>
+#include <fcntl.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <utime.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include <lib-crypt/crypt.h>
 
 #include "lib/list.h"
-#include "lib/debug.h"
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <utime.h>
 
 static list2_t* MailboxFormats = NULL;
 #define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
index 40160c1..97703d7 100644 (file)
 #include <config.h>
 #endif
 
+#include <unistd.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <libgen.h>
+#include <sys/stat.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/file.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include "nntp.h"
 #include "rfc1524.h"
 
-#include "lib/debug.h"
-
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <libgen.h>
-#include <sys/stat.h>
-
 void nntp_add_to_list (NNTP_SERVER * s, NNTP_DATA * d)
 {
   LIST *l;
index 00ba407..159d2e1 100644 (file)
@@ -17,6 +17,7 @@
 #include <lib-lib/str.h>
 #include <lib-lib/file.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
@@ -33,7 +34,6 @@
 
 #include <lib-crypt/crypt.h>
 
-#include "lib/debug.h"
 
 #include <unistd.h>
 #include <string.h>
diff --git a/pager.c b/pager.c
index 044d2dc..f0d366d 100644 (file)
--- a/pager.c
+++ b/pager.c
 # include "config.h"
 #endif
 
+#include <wchar.h>
+#include <sys/stat.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-crypt/crypt.h>
 
 #include "lib/rx.h"
-#include "lib/debug.h"
-
-#include <wchar.h>
-#include <sys/stat.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
 
 #define ISHEADER(x) ((x) == MT_COLOR_HEADER || (x) == MT_COLOR_HDEFAULT)
 
index 999d3b1..572c79e 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <unistd.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/file.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 
 #include "pop.h"
 #include <lib-crypt/crypt.h>
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <unistd.h>
-
 /* write line to file */
 static int fetch_message (char *line, void *file)
 {
index fdea7c3..adb47d7 100644 (file)
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-hash/hash.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "mx.h"
 #include "pop.h"
 
-#include "lib/debug.h"
 
 #include <string.h>
 #include <unistd.h>
index e462a6a..a8dfe5c 100644 (file)
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "mx.h"
 # include <lib-network/mutt_ssl.h>
 #endif
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <unistd.h>
-#include <ctype.h>
-
 /* given an POP mailbox name, return host, port, username and password */
 int pop_parse_path (const char *path, ACCOUNT * acct)
 {
index 311ea28..945a704 100644 (file)
 # include "config.h"
 #endif
 
+#include <ctype.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/stat.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include <imap/imap.h>
 #include <imap/mx_imap.h>
 
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/stat.h>
-
 static struct mapping_t PostponeHelp[] = {
   {N_("Exit"),  OP_EXIT},
   {N_("Del"),   OP_DELETE},
diff --git a/query.c b/query.c
index 5509aac..c3fe53c 100644 (file)
--- a/query.c
+++ b/query.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
 #include <lib-lib/mapping.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/menu.h>
 
 #include "mutt_idna.h"
 #include "sort.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
 typedef struct query {
   address_t *addr;
   char *name;
index 9b745b4..cd089fc 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <unistd.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include "rfc1524.h"
 #include "attach.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <unistd.h>
-
 /* The command semantics include the following:
  * %s is the filename that contains the mail body data
  * %t is the content type, like text/plain
index f1cd2e3..d578190 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -25,6 +25,7 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-ui/curses.h>
 
@@ -33,8 +34,6 @@
 #include "state.h"
 #include "lib.h"
 
-#include "lib/debug.h"
-
 #define FLOWED_MAX 77
 
 static int get_quote_level (char *line)
diff --git a/send.c b/send.c
index 613be76..2cf6550 100644 (file)
--- a/send.c
+++ b/send.c
 # include "config.h"
 #endif
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <dirent.h>
+#include <time.h>
+#include <sys/types.h>
+#include <utime.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include "url.h"
 #include "attach.h"
 
-#include "lib/debug.h"
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <dirent.h>
-#include <time.h>
-#include <sys/types.h>
-#include <utime.h>
-
 #ifdef USE_NNTP
 #include "nntp.h"
 #endif
index 8aad968..2afe601 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <sys/utsname.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/file.h>
+#include <lib-lib/debug.h>
 
 #include <lib-mime/mime.h>
 
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
-#include "lib/debug.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <sys/utsname.h>
-
 #ifdef USE_LIBESMTP
 # include "mutt_libesmtp.h"
 #endif /* USE_LIBESMTP */
diff --git a/state.c b/state.c
index 656f816..c4e2997 100644 (file)
--- a/state.c
+++ b/state.c
 #include <stdlib.h>
 #include <stdio.h>
 
+#include <lib-lib/debug.h>
+
 #include "mutt.h"
 #include "state.h"
 #include "rfc3676.h"
 
-#include "lib/debug.h"
-
 static void state_prefix_put (const char *d, size_t dlen, STATE * s)
 {
   if (s->prefix)