summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-11-28 09:14:22 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-11-28 09:14:22 +0000
commit10b6c2ccdcc056a8584ad0ada471cfaba38cec13 (patch)
treed5cf44ca79e6c16dd8fed1da44f399b93a5b2e78
parent61c80aeff4b66b9394e3a73b2a404e365e19e868 (diff)
downloadmailutils-10b6c2ccdcc056a8584ad0ada471cfaba38cec13.tar.gz
mailutils-10b6c2ccdcc056a8584ad0ada471cfaba38cec13.tar.bz2
Introduce "global debug settings". Mailutils objects are supposed
to set their default mu_debug_t objects basing on these settings. * include/mailutils/Makefile.am: Add debug.hin. Build debug.h from it. * include/mailutils/debug.hm4: New file. * include/mailutils/debug.h: Remove generated file. * scripts/Makefile.am (EXTRA_DIST): Add debugdef.m4 * scripts/debugdef.m4: New file. * include/mailutils/gocs.h (struct mu_gocs_debug): New data type. (mu_gocs_register_std): Argument is const. (mu_gocs_debug_init): New function. * include/mailutils/libargp.h (mu_debug_cmdline): New extern. * include/mailutils/libcfg.h (mu_debug_cfg_capa): New extern. * libargp/cmdline.c: Add mu_debug_cmdline * libargp/common.c: Add debug settings. * libargp/mu_argp.c (struct cap_buf.capa): Remove const qualifier. * libcfg/common.c (mu_locking_param): Remove superfluous `lock-' prefix from the statement names. (mu_debug_param): New parameter group. * libcfg/init.c: Add mu_debug_param. * mailbox/gocs.c (mu_gocs_debug_init): New function. * mailbox/Makefile.am (libmailutils_la_SOURCES): Add gdebug.c * mailbox/gdebug.c: New file * mailbox/debug.c (mu_debug_printf, mu_debug_vprintf) (mu_debug_check_level): New functions. (mu_debug_printv, mu_debug_print): Rewrite using new basic calls. * comsat/comsat.c, dotlock/dotlock.c, examples/muauth.c, mail.remote/mail.remote.c: Add debug capability. * frm/frm.c, frm/from.c, guimb/main.c, imap4d/imap4d.c, mail/mail.c, mail.local/main.c, messages/messages.c, pop3d/pop3d.c, readmsg/readmsg.c: Add locking and debug capabilities. * examples/mimetest.c, examples/msg-send.c, frm/common.c, libargp/auth.c, libmu_scm/mu_message.c, mail/send.c, mh/send.c, mimeview/mimeview.c, movemail/movemail.c, sieve/sieve.c: Update invocation of mu_debug_set_level. * libproto/imap/folder.c, libproto/imap/mbox.c, libproto/include/folder0.h, libproto/include/mailbox0.h, libproto/include/mailer0.h, libproto/mailer/sendmail.c, libproto/mailer/smtp.c, libproto/mbox/mbox.c, libproto/nntp/folder.c, libproto/nntp/nntp_debug.c, libproto/pop/mbox.c, libproto/pop/pop3_debug.c, mailbox/amd.c, mailbox/mailer.c, mailbox/message.c, mailbox/mu_auth.c: Use MU_DEBUG[0-9] for debugging. * mailbox/muerror.c: Include string.h * mailbox/syslog.c (syslog_to_n): Remove unused variable. * mailbox/assoc.c (struct _mu_assoc_elem): name is not const. * mailbox/cfg_lexer.c: Quoted strings can be continued to the following line either by using a trailing backslash or by concatenating strings together, as in C. * mailbox/mailbox.c (_create_mailbox): Initialize debug object using global "mailbox" level. (mu_mailbox_create): Fix bug introduced on 2007-11-26. * include/mailutils/libsieve.h (mu_sieve_set_debug_level): Change prototype. (mu_sieve_set_debug_object): New prototype. * libsieve/sieve.y (mu_sieve_machine_init): Initialize debug object from "sieve" global level. (mu_sieve_set_debug_level): Set only debug_level. (mu_sieve_set_debug_object): New function. * maidag/maidag.c: Remove explicit setting of debug object. Add "debug" group, which provides the required functionality. (set_debug_flags): Likewise. This function and the corresponding command line option are fading out in favor of global debug settings.
-rw-r--r--ChangeLog76
-rw-r--r--comsat/comsat.c2
-rw-r--r--dotlock/dotlock.c1
-rw-r--r--examples/mimetest.c2
-rw-r--r--examples/msg-send.c2
-rw-r--r--examples/muauth.c1
-rw-r--r--frm/common.c2
-rw-r--r--frm/frm.c2
-rw-r--r--frm/from.c2
-rw-r--r--guimb/main.c2
-rw-r--r--imap4d/imap4d.c2
-rw-r--r--include/mailutils/Makefile.am7
-rw-r--r--include/mailutils/debug.h58
-rw-r--r--include/mailutils/debug.hm491
-rw-r--r--include/mailutils/gocs.h14
-rw-r--r--include/mailutils/libargp.h1
-rw-r--r--include/mailutils/libcfg.h1
-rw-r--r--include/mailutils/libsieve.h4
-rw-r--r--libargp/auth.c2
-rw-r--r--libargp/cmdline.c1
-rw-r--r--libargp/common.c70
-rw-r--r--libargp/mu_argp.c2
-rw-r--r--libcfg/common.c52
-rw-r--r--libcfg/init.c1
-rw-r--r--libmu_scm/mu_message.c2
-rw-r--r--libproto/imap/folder.c73
-rw-r--r--libproto/imap/mbox.c58
-rw-r--r--libproto/include/folder0.h12
-rw-r--r--libproto/include/mailbox0.h12
-rw-r--r--libproto/include/mailer0.h14
-rw-r--r--libproto/mailer/sendmail.c47
-rw-r--r--libproto/mailer/smtp.c23
-rw-r--r--libproto/mbox/mbox.c20
-rw-r--r--libproto/nntp/folder.c4
-rw-r--r--libproto/nntp/nntp_debug.c9
-rw-r--r--libproto/pop/mbox.c69
-rw-r--r--libproto/pop/pop3_debug.c9
-rw-r--r--libsieve/sieve.y16
-rw-r--r--maidag/maidag.c33
-rw-r--r--mail.local/main.c11
-rw-r--r--mail.remote/mail.remote.c3
-rw-r--r--mail/mail.c4
-rw-r--r--mail/send.c3
-rw-r--r--mailbox/Makefile.am1
-rw-r--r--mailbox/amd.c2
-rw-r--r--mailbox/assoc.c4
-rw-r--r--mailbox/cfg_lexer.c70
-rw-r--r--mailbox/debug.c68
-rw-r--r--mailbox/gdebug.c193
-rw-r--r--mailbox/gocs.c24
-rw-r--r--mailbox/mailbox.c40
-rw-r--r--mailbox/mailer.c20
-rw-r--r--mailbox/message.c38
-rw-r--r--mailbox/mu_auth.c58
-rw-r--r--mailbox/muerror.c1
-rw-r--r--mailbox/syslog.c2
-rw-r--r--messages/messages.c2
-rw-r--r--mh/send.c2
-rw-r--r--mimeview/mimeview.c1
-rw-r--r--movemail/movemail.c2
-rw-r--r--pop3d/pop3d.c2
-rw-r--r--readmsg/readmsg.c4
-rw-r--r--scripts/Makefile.am9
-rw-r--r--scripts/debugdef.m456
-rw-r--r--sieve/sieve.c11
65 files changed, 968 insertions, 462 deletions
diff --git a/ChangeLog b/ChangeLog
index 69998d3c9..daeccd2b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,79 @@
+2007-11-28 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ Introduce "global debug settings". Mailutils objects are supposed
+ to set their default mu_debug_t objects basing on these settings.
+
+ * include/mailutils/Makefile.am: Add debug.hin. Build debug.h from
+ it.
+ * include/mailutils/debug.hm4: New file.
+ * include/mailutils/debug.h: Remove generated file.
+ * scripts/Makefile.am (EXTRA_DIST): Add debugdef.m4
+ * scripts/debugdef.m4: New file.
+
+ * include/mailutils/gocs.h (struct mu_gocs_debug): New data type.
+ (mu_gocs_register_std): Argument is const.
+ (mu_gocs_debug_init): New function.
+ * include/mailutils/libargp.h (mu_debug_cmdline): New extern.
+ * include/mailutils/libcfg.h (mu_debug_cfg_capa): New extern.
+ * libargp/cmdline.c: Add mu_debug_cmdline
+ * libargp/common.c: Add debug settings.
+ * libargp/mu_argp.c (struct cap_buf.capa): Remove const qualifier.
+ * libcfg/common.c (mu_locking_param): Remove superfluous `lock-'
+ prefix from the statement names.
+ (mu_debug_param): New parameter group.
+ * libcfg/init.c: Add mu_debug_param.
+ * mailbox/gocs.c (mu_gocs_debug_init): New function.
+
+ * mailbox/Makefile.am (libmailutils_la_SOURCES): Add gdebug.c
+ * mailbox/gdebug.c: New file
+ * mailbox/debug.c (mu_debug_printf, mu_debug_vprintf)
+ (mu_debug_check_level): New functions.
+ (mu_debug_printv, mu_debug_print): Rewrite using new basic calls.
+
+ * comsat/comsat.c, dotlock/dotlock.c, examples/muauth.c,
+ mail.remote/mail.remote.c: Add debug capability.
+ * frm/frm.c, frm/from.c, guimb/main.c, imap4d/imap4d.c,
+ mail/mail.c, mail.local/main.c, messages/messages.c,
+ pop3d/pop3d.c, readmsg/readmsg.c: Add locking and debug capabilities.
+
+ * examples/mimetest.c, examples/msg-send.c, frm/common.c,
+ libargp/auth.c, libmu_scm/mu_message.c, mail/send.c, mh/send.c,
+ mimeview/mimeview.c, movemail/movemail.c, sieve/sieve.c: Update
+ invocation of mu_debug_set_level.
+
+ * libproto/imap/folder.c, libproto/imap/mbox.c,
+ libproto/include/folder0.h, libproto/include/mailbox0.h,
+ libproto/include/mailer0.h, libproto/mailer/sendmail.c,
+ libproto/mailer/smtp.c, libproto/mbox/mbox.c,
+ libproto/nntp/folder.c, libproto/nntp/nntp_debug.c,
+ libproto/pop/mbox.c, libproto/pop/pop3_debug.c, mailbox/amd.c,
+ mailbox/mailer.c, mailbox/message.c, mailbox/mu_auth.c: Use
+ MU_DEBUG[0-9] for debugging.
+
+ * mailbox/muerror.c: Include string.h
+ * mailbox/syslog.c (syslog_to_n): Remove unused variable.
+ * mailbox/assoc.c (struct _mu_assoc_elem): name is not const.
+ * mailbox/cfg_lexer.c: Quoted strings can be continued to the
+ following line either by using a trailing backslash or by
+ concatenating strings together, as in C.
+ * mailbox/mailbox.c (_create_mailbox): Initialize debug object
+ using global "mailbox" level.
+ (mu_mailbox_create): Fix bug introduced on 2007-11-26.
+
+ * include/mailutils/libsieve.h (mu_sieve_set_debug_level): Change
+ prototype.
+ (mu_sieve_set_debug_object): New prototype.
+ * libsieve/sieve.y (mu_sieve_machine_init): Initialize debug
+ object from "sieve" global level.
+ (mu_sieve_set_debug_level): Set only debug_level.
+ (mu_sieve_set_debug_object): New function.
+
+ * maidag/maidag.c: Remove explicit setting of debug object. Add
+ "debug" group, which provides the required functionality.
+ (set_debug_flags): Likewise. This function and the corresponding
+ command line option are fading out in favor of global debug
+ settings.
+
2007-11-26 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac (MU_APP_LIBRARIES): Load libmuaux after libmuargp
diff --git a/comsat/comsat.c b/comsat/comsat.c
index 009d039ff..b0a8b815f 100644
--- a/comsat/comsat.c
+++ b/comsat/comsat.c
@@ -77,8 +77,10 @@ static struct argp argp = {
static const char *comsat_argp_capa[] = {
"daemon",
"common",
+ "debug",
"logging",
"mailbox",
+ "locking",
"license",
NULL
};
diff --git a/dotlock/dotlock.c b/dotlock/dotlock.c
index ccb66dcf6..b6abf2efb 100644
--- a/dotlock/dotlock.c
+++ b/dotlock/dotlock.c
@@ -134,6 +134,7 @@ struct mu_cfg_param dotlock_cfg_param[] = {
const char *dotlock_capa[] = {
"license",
"common",
+ "debug",
NULL
};
diff --git a/examples/mimetest.c b/examples/mimetest.c
index d25422c8a..be23e4caa 100644
--- a/examples/mimetest.c
+++ b/examples/mimetest.c
@@ -100,7 +100,7 @@ main (int argc, char **argv)
{
mu_debug_t debug;
mu_mailbox_get_debug (mbox, &debug);
- mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
+ mu_debug_set_level (debug, MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT));
}
/* Open the mailbox for reading only. */
diff --git a/examples/msg-send.c b/examples/msg-send.c
index a4a6ef293..b150e2e15 100644
--- a/examples/msg-send.c
+++ b/examples/msg-send.c
@@ -121,7 +121,7 @@ main (int argc, char *argv[])
{
mu_debug_t debug;
mu_mailer_get_debug (mailer, &debug);
- mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
+ mu_debug_set_level (debug, MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT));
}
C (mu_mailer_open (mailer, 0));
diff --git a/examples/muauth.c b/examples/muauth.c
index 2961e1db8..2fc5b152b 100644
--- a/examples/muauth.c
+++ b/examples/muauth.c
@@ -36,6 +36,7 @@ static const char *capa[] = {
"auth",
"license",
"common",
+ "debug",
NULL
};
diff --git a/frm/common.c b/frm/common.c
index 9ce88791d..a96783a17 100644
--- a/frm/common.c
+++ b/frm/common.c
@@ -554,7 +554,7 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
{
mu_debug_t debug;
mu_mailbox_get_debug (mbox, &debug);
- mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
+ mu_debug_set_level (debug, MU_DEBUG_LEVEL_UPTO (MU_DEBUG_PROT));
}
mu_mailbox_get_url (mbox, &url);
diff --git a/frm/frm.c b/frm/frm.c
index 70c9368ec..d2ebc01c8 100644
--- a/frm/frm.c
+++ b/frm/frm.c
@@ -218,6 +218,8 @@ static const char *frm_argp_capa[] = {
"common",
"license",
"mailbox",
+ "locking",
+ "debug",
NULL
};
diff --git a/frm/from.c b/frm/from.c
index b55805c68..a14738d36 100644
--- a/frm/from.c
+++ b/frm/from.c
@@ -71,8 +71,10 @@ static struct argp argp = {
static const char *capa[] = {
"common",
+ "debug",
"license",
"mailbox",
+ "locking",
#ifdef WITH_TLS
"tls",
#endif
diff --git a/guimb/main.c b/guimb/main.c
index a86c26f52..a5f954e15 100644
--- a/guimb/main.c
+++ b/guimb/main.c
@@ -139,7 +139,9 @@ static struct argp argp = {
static const char *guimb_argp_capa[] = {
"common",
+ "debug",
"mailbox",
+ "locking",
"license",
NULL
};
diff --git a/imap4d/imap4d.c b/imap4d/imap4d.c
index 5ac591c1a..1946e7840 100644
--- a/imap4d/imap4d.c
+++ b/imap4d/imap4d.c
@@ -89,7 +89,9 @@ static const char *imap4d_capa[] = {
"daemon",
"auth",
"common",
+ "debug",
"mailbox",
+ "locking",
"logging",
"license",
NULL
diff --git a/include/mailutils/Makefile.am b/include/mailutils/Makefile.am
index a0bcc7260..93497ec43 100644
--- a/include/mailutils/Makefile.am
+++ b/include/mailutils/Makefile.am
@@ -18,11 +18,14 @@
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
-BUILT_SOURCES=errno.h
-EXTRA_DIST=errno.hin types.hin
+BUILT_SOURCES=errno.h debug.h
+EXTRA_DIST=errno.hin debug.hm4 types.hin
errno.h: $(top_srcdir)/mailbox/errors errno.hin
$(AWK) -f $(top_srcdir)/scripts/generr.awk $^ > $@
+debug.h: $(top_srcdir)/scripts/debugdef.m4 debug.hm4
+ m4 $(top_srcdir)/scripts/debugdef.m4 debug.hm4 > debug.h
+
types.h: $(top_srcdir)/include/mailutils/types.hin Makefile
sed 's/MU_OFF_TYPE/$(MU_OFF_TYPE)/' $(top_srcdir)/include/mailutils/types.hin > $@
DISTCLEANFILES = types.h
diff --git a/include/mailutils/debug.h b/include/mailutils/debug.h
deleted file mode 100644
index 78e82ebba..000000000
--- a/include/mailutils/debug.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 3 of the License, or (at your option) any later version.
-
- This library 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301 USA */
-
-#ifndef _MAILUTILS_DEBUG_H
-#define _MAILUTILS_DEBUG_H
-
-#include <stdarg.h>
-
-#include <mailutils/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define MU_DEBUG_ERROR 0x0001
-#define MU_DEBUG_TRACE 0x0002
-#define MU_DEBUG_PROT 0x0004
-
-extern int mu_debug_create (mu_debug_t *, void *owner);
-extern void mu_debug_destroy (mu_debug_t *, void *owner);
-extern void * mu_debug_get_owner (mu_debug_t);
-extern int mu_debug_set_level (mu_debug_t, size_t level);
-extern int mu_debug_get_level (mu_debug_t, size_t *plevel);
-extern int mu_debug_print (mu_debug_t debug, size_t level,
- const char *format, ...) MU_PRINTFLIKE(3,4);
-extern int mu_debug_printv (mu_debug_t debug, size_t level,
- const char *format, va_list argp);
-
-typedef int (*mu_debug_printer_fp) (mu_debug_t, size_t level, const char *buf);
-
-extern int mu_debug_set_print (mu_debug_t,
- mu_debug_printer_fp printer,
- void *owner);
-extern mu_debug_printer_fp mu_debug_default_printer;
-
-int mu_debug_syslog_printer (mu_debug_t, size_t, const char *);
-int mu_debug_stderr_printer (mu_debug_t, size_t, const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _MAILUTILS_DEBUG_H */
diff --git a/include/mailutils/debug.hm4 b/include/mailutils/debug.hm4
new file mode 100644
index 000000000..bdcbcd0f9
--- /dev/null
+++ b/include/mailutils/debug.hm4
@@ -0,0 +1,91 @@
+/* GNU Mailutils -- a suite of utilities for electronic mail -*- c -*-
+ Copyright (C) 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301 USA */
+
+#ifndef _MAILUTILS_DEBUG_H
+#define _MAILUTILS_DEBUG_H
+
+#include <stdarg.h>
+
+#include <mailutils/types.h>
+
+#define MU_DEBUG(d,l,s) MU_DEBUG1(d,l,"%s",s)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MU_DEBUG_ERROR 0
+#define MU_DEBUG_TRACE0 1
+#define MU_DEBUG_TRACE MU_DEBUG_TRACE0
+#define MU_DEBUG_TRACE1 2
+#define MU_DEBUG_TRACE2 3
+#define MU_DEBUG_TRACE3 4
+#define MU_DEBUG_TRACE4 5
+#define MU_DEBUG_TRACE5 6
+#define MU_DEBUG_TRACE6 7
+#define MU_DEBUG_TRACE7 8
+
+#define MU_DEBUG_PROT 9
+
+#define MU_DEBUG_LEVEL_MASK(lev) (1 << (lev))
+#define MU_DEBUG_LEVEL_UPTO(lev) ((1 << ((lev)+1)) - 1)
+
+#define MU_DEBUG_INHERIT 0xf0000
+#define MU_DEBUG_EXTRACT_LEVEL(s) ((s) & ~MU_DEBUG_INHERIT)
+
+int mu_debug_create (mu_debug_t *, void *owner);
+void mu_debug_destroy (mu_debug_t *, void *owner);
+void *mu_debug_get_owner (mu_debug_t);
+int mu_debug_set_level (mu_debug_t, size_t level);
+int mu_debug_get_level (mu_debug_t, size_t *plevel);
+int mu_debug_print (mu_debug_t debug, size_t level,
+ const char *format, ...) MU_PRINTFLIKE(3,4);
+int mu_debug_printv (mu_debug_t debug, size_t level,
+ const char *format, va_list ap);
+int mu_debug_check_level (mu_debug_t debug, size_t level);
+
+int mu_debug_printf (mu_debug_t debug, size_t level, const char *format, ...)
+ MU_PRINTFLIKE(3,4);
+
+int mu_debug_vprintf (mu_debug_t debug, size_t level, const char *format,
+ va_list ap);
+
+extern int mu_debug_line_info;
+
+typedef int (*mu_debug_printer_fp) (mu_debug_t, size_t level, const char *buf);
+
+extern int mu_debug_set_print (mu_debug_t,
+ mu_debug_printer_fp printer,
+ void *owner);
+extern mu_debug_printer_fp mu_debug_default_printer;
+
+int mu_debug_syslog_printer (mu_debug_t, size_t, const char *);
+int mu_debug_stderr_printer (mu_debug_t, size_t, const char *);
+
+unsigned mu_global_debug_level (const char *object_name);
+int mu_global_debug_set_level (const char *object_name, unsigned level);
+int mu_global_debug_clear_level (const char *object_name);
+int mu_global_debug_from_string (const char *string, const char *errpfx);
+
+forloop(`i',1,11,`MKDEBUG(i)')
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MAILUTILS_DEBUG_H */
diff --git a/include/mailutils/gocs.h b/include/mailutils/gocs.h
index 43bb5fca8..da7ebe929 100644
--- a/include/mailutils/gocs.h
+++ b/include/mailutils/gocs.h
@@ -41,7 +41,14 @@ struct mu_gocs_logging
int facility;
char *tag;
};
-
+
+struct mu_gocs_debug
+{
+ char *string;
+ char *errpfx;
+ int line_info;
+};
+
struct mu_gocs_mailbox
{
char *mail_spool;
@@ -84,7 +91,7 @@ extern int log_facility; /* FIXME: 1. Belongs elsewhere;
typedef int (*gocs_init_fp) (void *data);
void mu_gocs_register (char *capa, gocs_init_fp init);
-void mu_gocs_register_std (char *name);
+void mu_gocs_register_std (const char *name);
void mu_gocs_store (char *capa, void *data);
void mu_gocs_flush (void);
int mu_gocs_enumerate (mu_list_action_t action, void *data);
@@ -95,7 +102,8 @@ int mu_gocs_daemon_init (void *data);
int mu_gocs_source_email_init (void *data);
int mu_gocs_mailer_init (void *data);
int mu_gocs_logging_init (void *data);
-
+int mu_gocs_debug_init (void *data);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/mailutils/libargp.h b/include/mailutils/libargp.h
index c99050564..56f761748 100644
--- a/include/mailutils/libargp.h
+++ b/include/mailutils/libargp.h
@@ -51,6 +51,7 @@ extern struct mu_cmdline_capa mu_address_cmdline;
extern struct mu_cmdline_capa mu_mailer_cmdline;
extern struct mu_cmdline_capa mu_daemon_cmdline;
extern struct mu_cmdline_capa mu_sieve_cmdline;
+extern struct mu_cmdline_capa mu_debug_cmdline;
extern struct mu_cmdline_capa mu_pam_cmdline;
extern struct mu_cmdline_capa mu_gsasl_cmdline;
diff --git a/include/mailutils/libcfg.h b/include/mailutils/libcfg.h
index 9bc43cd5b..657ebabca 100644
--- a/include/mailutils/libcfg.h
+++ b/include/mailutils/libcfg.h
@@ -86,6 +86,7 @@ extern struct mu_cfg_capa mu_locking_cfg_capa;
extern struct mu_cfg_capa mu_address_cfg_capa;
extern struct mu_cfg_capa mu_mailer_cfg_capa;
extern struct mu_cfg_capa mu_logging_cfg_capa;
+extern struct mu_cfg_capa mu_debug_cfg_capa;
extern struct mu_cfg_capa mu_gsasl_cfg_capa;
extern struct mu_cfg_capa mu_pam_cfg_capa;
extern struct mu_cfg_capa mu_radius_cfg_capa;
diff --git a/include/mailutils/libsieve.h b/include/mailutils/libsieve.h
index a8e301a97..e311d5c9f 100644
--- a/include/mailutils/libsieve.h
+++ b/include/mailutils/libsieve.h
@@ -227,8 +227,8 @@ void mu_sieve_set_error (mu_sieve_machine_t mach,
void mu_sieve_set_parse_error (mu_sieve_machine_t mach,
mu_sieve_parse_error_t p);
void mu_sieve_set_debug (mu_sieve_machine_t mach, mu_sieve_printf_t debug);
-void mu_sieve_set_debug_level (mu_sieve_machine_t mach, mu_debug_t dbg,
- int level);
+void mu_sieve_set_debug_object (mu_sieve_machine_t mach, mu_debug_t dbg);
+void mu_sieve_set_debug_level (mu_sieve_machine_t mach, int level);
void mu_sieve_set_logger (mu_sieve_machine_t mach,
mu_sieve_action_log_t logger);
void mu_sieve_set_ticket (mu_sieve_machine_t mach, mu_ticket_t ticket);
diff --git a/libargp/auth.c b/libargp/auth.c
index e0b5d86dc..783248667 100644
--- a/libargp/auth.c
+++ b/libargp/auth.c
@@ -71,7 +71,7 @@ auth_set_debug ()
mu_debug_t debug = NULL, prev;
mu_debug_create