extern int debuglevel;
extern char *debugfile_cmdline;
extern int debuglevel_cmdline;
-void mutt_debug(int level, const char *fmt, ...);
-#else
-#define mutt_debug(...) do { } while (0)
#endif
AUTOMAKE_OPTIONS = 1.6 foreign
-EXTRA_DIST = lib.h lib_ascii.h lib_base64.h lib_date.h lib_exit.h lib_md5.h lib_memory.h lib_message.h lib_sha1.h
+EXTRA_DIST = lib.h lib_ascii.h lib_base64.h lib_date.h lib_debug.h lib_exit.h lib_md5.h lib_memory.h lib_message.h lib_sha1.h
AM_CPPFLAGS = -I$(top_srcdir)
noinst_LIBRARIES = liblib.a
noinst_HEADERS =
-liblib_a_SOURCES = lib_ascii.c lib_base64.c lib_date.c lib_exit.c lib_md5.c lib_memory.c lib_message.c lib_sha1.c
+liblib_a_SOURCES = lib_ascii.c lib_base64.c lib_date.c lib_debug.c lib_exit.c lib_md5.c lib_memory.c lib_message.c lib_sha1.c
* -# @subpage ascii
* -# @subpage base64
* -# @subpage date
+ * -# @subpage debug
* -# @subpage exit
* -# @subpage md5
* -# @subpage memory
#include "lib_ascii.h"
#include "lib_base64.h"
#include "lib_date.h"
+#include "lib_debug.h"
#include "lib_exit.h"
#include "lib_md5.h"
#include "lib_memory.h"
--- /dev/null
+/**
+ * @file
+ * Debug messages
+ *
+ * @authors
+ * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @page debug Debug messages
+ *
+ * Output debugging messages, suitable for a developer.
+ *
+ * | Function | Description
+ * | :----------- | :--------------------------------
+ * | mutt_debug() | Output some debugging information
+ */
+
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+
+/**
+ * mutt_debug - Output some debugging information
+ * @param level Debug level
+ * @param fmt printf-like formatting string
+ * @param ... Arguments to be formatted
+ *
+ * This stub function ignores the logging level and outputs all information to
+ * stderr.
+ */
+void mutt_debug(int level, const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
--- /dev/null
+/**
+ * @file
+ * Debug messages
+ *
+ * @authors
+ * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _LIB_DEBUG_H
+#define _LIB_DEBUG_H
+
+#include <limits.h>
+
+#ifdef DEBUG
+void mutt_debug(int level, const char *fmt, ...);
+#else
+#define mutt_debug(...) do { } while (0)
+#endif
+
+#endif /* _LIB_DEBUG_H */
lib/lib_ascii.c
lib/lib_base64.c
lib/lib_date.c
+lib/lib_debug.c
lib/lib_exit.c
lib/lib_md5.c
lib/lib_memory.c