summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2007-01-02 17:10:34 +0000
committerThomas Roessler <roessler@does-not-exist.org>2007-01-02 17:10:34 +0000
commit739faa1e780f3df14460e50c0e807e4271a8ec9c (patch)
tree57a4cebb405c4efb3a0bf5ecab73a8000e96eee3 /lib.h
parentf09f75d89e2bfeca2920362ec0844e1f6f2924a6 (diff)
add debug harness to lib.c functions, and a bunch of dprint's
to safe_rename().
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index eb3ba33c..952a1b4e 100644
--- a/lib.h
+++ b/lib.h
@@ -98,11 +98,36 @@
* A non-mutt "implementation" (ahem) can be found in extlib.c.
*/
+
# ifndef _EXTLIB_C
extern void (*mutt_error) (const char *, ...);
# endif
+
+# ifdef _LIB_C
+# define MUTT_LIB_WHERE
+# define MUTT_LIB_INITVAL(x) = x
+# else
+# define MUTT_LIB_WHERE extern
+# define MUTT_LIB_INITVAL(x)
+# endif
+
void mutt_exit (int);
+
+# ifdef DEBUG
+
+MUTT_LIB_WHERE FILE *debugfile MUTT_LIB_INITVAL(0);
+MUTT_LIB_WHERE int debuglevel MUTT_LIB_INITVAL(0);
+
+# define dprint(N,X) do { if(debuglevel>=N && debugfile) fprintf X; } while (0)
+
+# else
+
+# define dprint(N,X)
+
+# endif
+
+
/* Exit values used in send_msg() */
#define S_ERR 127
#define S_BKG 126
@@ -124,6 +149,7 @@ char *safe_strdup (const char *);
const char *mutt_stristr (const char *, const char *);
const char *mutt_basename (const char *);
+int compare_stat (struct stat *, struct stat *);
int mutt_copy_stream (FILE *, FILE *);
int mutt_copy_bytes (FILE *, FILE *, size_t);
int mutt_rx_sanitize_string (char *, size_t, const char *);
@@ -133,8 +159,8 @@ int mutt_strncasecmp (const char *, const char *, size_t);
int mutt_strncmp (const char *, const char *, size_t);
int mutt_strcoll (const char *, const char *);
int safe_open (const char *, int);
-int safe_symlink (const char *, const char *);
int safe_rename (const char *, const char *);
+int safe_symlink (const char *, const char *);
int safe_fclose (FILE **);
size_t mutt_quote_filename (char *, size_t, const char *);