Commit 5597557e 5597557eefc85e1af32cebda56843f21556ef513 by Sergey Poznyakoff

renamed debug_.* symbols to mu_debug_.* to avoid nameclashes.

1 parent 36b014fc
......@@ -63,9 +63,9 @@ main (int argc, char **argv)
}
{
debug_t debug;
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
// debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
// mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
......
......@@ -51,9 +51,9 @@ main (int argc, char **argv)
exit (1);
}
{
debug_t debug;
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
}
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
......
......@@ -72,9 +72,9 @@ main(int argc, char **argv)
/* Debuging Trace. */
{
//debug_t debug;
//mu_debug_t debug;
//mailbox_get_debug (mbox, &debug);
//debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
//mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
if ((status = mailbox_open (mbox, MU_STREAM_READ)) != 0)
......
......@@ -34,20 +34,20 @@ extern "C" {
#endif
struct _debug;
typedef struct _debug* debug_t;
typedef struct _debug* mu_debug_t;
#define MU_DEBUG_TRACE 1
#define MU_DEBUG_PROT 2
extern int debug_create __P ((debug_t *, void *owner));
extern void debug_destroy __P ((debug_t *, void *owner));
extern void * debug_get_owner __P ((debug_t));
extern int debug_set_level __P ((debug_t, size_t level));
extern int debug_get_level __P ((debug_t, size_t *plevel));
extern int debug_print __P ((debug_t debug, size_t level,
extern int mu_debug_create __P ((mu_debug_t *, void *owner));
extern void mu_debug_destroy __P ((mu_debug_t *, void *owner));
extern void * mu_debug_get_owner __P ((mu_debug_t));
extern int mu_debug_set_level __P ((mu_debug_t, size_t level));
extern int mu_debug_get_level __P ((mu_debug_t, size_t *plevel));
extern int mu_debug_print __P ((mu_debug_t debug, size_t level,
const char *format, ...));
extern int debug_printv __P ((debug_t debug, size_t level,
extern int mu_debug_printv __P ((mu_debug_t debug, size_t level,
const char *format, va_list argp));
extern int debug_set_print __P ((debug_t, int (*_print) __P ((debug_t, const char *, va_list)), void *owner));
extern int mu_debug_set_print __P ((mu_debug_t, int (*_print) __P ((mu_debug_t, const char *, va_list)), void *owner));
#ifdef __cplusplus
}
......
......@@ -82,8 +82,8 @@ extern int folder_set_stream __P ((folder_t, stream_t));
/* Notifications. */
extern int folder_get_observable __P ((folder_t, observable_t *));
extern int folder_get_debug __P ((folder_t, debug_t *));
extern int folder_set_debug __P ((folder_t, debug_t));
extern int folder_get_debug __P ((folder_t, mu_debug_t *));
extern int folder_set_debug __P ((folder_t, mu_debug_t));
/* Authentication. */
extern int folder_get_authority __P ((folder_t, authority_t *));
......
......@@ -93,8 +93,8 @@ extern int mailbox_get_property __P ((mailbox_t, property_t *));
extern int mailbox_get_url __P ((mailbox_t, url_t *));
/* For any debuging */
extern int mailbox_get_debug __P ((mailbox_t, debug_t *));
extern int mailbox_set_debug __P ((mailbox_t, debug_t));
extern int mailbox_get_debug __P ((mailbox_t, mu_debug_t *));
extern int mailbox_set_debug __P ((mailbox_t, mu_debug_t));
/* Events. */
extern int mailbox_get_observable __P ((mailbox_t, observable_t *));
......
......@@ -57,8 +57,8 @@ extern int mailer_get_stream __P ((mailer_t, stream_t *));
extern int mailer_set_stream __P ((mailer_t, stream_t));
/* stream settings */
extern int mailer_get_debug __P ((mailer_t, debug_t *));
extern int mailer_set_debug __P ((mailer_t, debug_t));
extern int mailer_get_debug __P ((mailer_t, mu_debug_t *));
extern int mailer_set_debug __P ((mailer_t, mu_debug_t));
extern int mailer_get_observable __P ((mailer_t, observable_t *));
......
......@@ -366,9 +366,9 @@ SCM_DEFINE (mu_message_send, "mu-message-send", 1, 1, 0,
if (SCM_INUM(_mu_scm_debug))
{
debug_t debug = NULL;
mu_debug_t debug = NULL;
mailer_get_debug (mailer, &debug);
debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
status = mailer_open (mailer, MU_STREAM_RDWR);
......
......@@ -371,9 +371,9 @@ mail_send0 (struct send_environ *env, int save_to)
{
if (util_find_env ("verbose")->set)
{
debug_t debug = NULL;
mu_debug_t debug = NULL;
mailer_get_debug (mailer, &debug);
debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
status = mailer_open (mailer, MU_STREAM_RDWR);
if (status == 0)
......
......@@ -27,9 +27,9 @@
#include <debug0.h>
int
debug_create (debug_t *pdebug, void *owner)
mu_debug_create (mu_debug_t *pdebug, void *owner)
{
debug_t debug;
mu_debug_t debug;
if (pdebug == NULL)
return EINVAL;
debug = calloc (sizeof (*debug), 1);
......@@ -41,11 +41,11 @@ debug_create (debug_t *pdebug, void *owner)
}
void
debug_destroy (debug_t *pdebug, void *owner)
mu_debug_destroy (mu_debug_t *pdebug, void *owner)
{
if (pdebug && *pdebug)
{
debug_t debug = *pdebug;
mu_debug_t debug = *pdebug;
if (debug->owner == owner)
{
free (*pdebug);
......@@ -55,13 +55,13 @@ debug_destroy (debug_t *pdebug, void *owner)
}
void *
debug_get_owner (debug_t debug)
mu_debug_get_owner (mu_debug_t debug)
{
return (debug) ? debug->owner : NULL;
}
int
debug_set_level (debug_t debug, size_t level)
mu_debug_set_level (mu_debug_t debug, size_t level)
{
if (debug == NULL)
return EINVAL;
......@@ -70,7 +70,7 @@ debug_set_level (debug_t debug, size_t level)
}
int
debug_get_level (debug_t debug, size_t *plevel)
mu_debug_get_level (mu_debug_t debug, size_t *plevel)
{
if (debug == NULL)
return EINVAL;
......@@ -80,8 +80,8 @@ debug_get_level (debug_t debug, size_t *plevel)
}
int
debug_set_print (debug_t debug, int (*_print)
__P ((debug_t, const char *, va_list)), void *owner)
mu_debug_set_print (mu_debug_t debug, int (*_print)
__P ((mu_debug_t, const char *, va_list)), void *owner)
{
if (debug == NULL)
return EINVAL;
......@@ -94,13 +94,13 @@ debug_set_print (debug_t debug, int (*_print)
/* FIXME: We use a fix size, we should use vasprinf or something
similar to get rid of this arbitrary limitation. */
int
debug_print (debug_t debug, size_t level, const char *format, ...)
mu_debug_print (mu_debug_t debug, size_t level, const char *format, ...)
{
va_list ap;
va_start (ap, format);
debug_printv (debug, level, format, ap);
mu_debug_printv (debug, level, format, ap);
va_end (ap);
......@@ -108,7 +108,7 @@ debug_print (debug_t debug, size_t level, const char *format, ...)
}
int
debug_printv (debug_t debug, size_t level, const char *format, va_list ap)
mu_debug_printv (mu_debug_t debug, size_t level, const char *format, va_list ap)
{
if (debug == NULL || format == NULL)
return EINVAL;
......
......@@ -298,24 +298,24 @@ folder_get_observable (folder_t folder, observable_t *pobservable)
}
int
folder_set_debug (folder_t folder, debug_t debug)
folder_set_debug (folder_t folder, mu_debug_t debug)
{
if (folder == NULL)
return EINVAL;
if (folder->debug)
debug_destroy (&(folder->debug), folder);
mu_debug_destroy (&(folder->debug), folder);
folder->debug = debug;
return 0;
}
int
folder_get_debug (folder_t folder, debug_t *pdebug)
folder_get_debug (folder_t folder, mu_debug_t *pdebug)
{
if (folder == NULL || pdebug == NULL)
return EINVAL;
if (folder->debug == NULL)
{
int status = debug_create (&(folder->debug), folder);
int status = mu_debug_create (&(folder->debug), folder);
if (status != 0)
return status;
}
......
......@@ -42,7 +42,7 @@ struct _debug
char *buffer;
size_t buflen;
void *owner;
int (*_print) __P ((debug_t, const char *, va_list));
int (*_print) __P ((mu_debug_t, const char *, va_list));
};
#ifdef __cplusplus
......
......@@ -46,7 +46,7 @@ struct _folder
ticket_t ticket;
authority_t authority;
observable_t observable;
debug_t debug;
mu_debug_t debug;
stream_t stream;
monitor_t monitor;
url_t url;
......@@ -75,15 +75,15 @@ struct _folder
/* Moro(?)ic kluge. */
#define FOLDER_DEBUG0(folder, type, format) \
if (folder->debug) debug_print (folder->debug, type, format)
if (folder->debug) mu_debug_print (folder->debug, type, format)
#define FOLDER_DEBUG1(folder, type, format, arg1) \
if (folder->debug) debug_print (folder->debug, type, format, arg1)
if (folder->debug) mu_debug_print (folder->debug, type, format, arg1)
#define FOLDER_DEBUG2(folder, type, format, arg1, arg2) \
if (folder->debug) debug_print (folder->debug, type, format, arg1, arg2)
if (folder->debug) mu_debug_print (folder->debug, type, format, arg1, arg2)
#define FOLDER_DEBUG3(folder, type, format, arg1, arg2, arg3) \
if (folder->debug) debug_print (folder->debug, type, format, arg1, arg2, arg3)
if (folder->debug) mu_debug_print (folder->debug, type, format, arg1, arg2, arg3)
#define FOLDER_DEBUG4(folder, type, format, arg1, arg2, arg3, arg4) \
if (folder->debug) debug_print (folder->debug, type, format, arg1, arg2, arg3, arg4)
if (folder->debug) mu_debug_print (folder->debug, type, format, arg1, arg2, arg3, arg4)
#ifdef __cplusplus
}
......
......@@ -52,7 +52,7 @@ struct _mailbox
{
/* Data */
observable_t observable;
debug_t debug;
mu_debug_t debug;
ticket_t ticket;
authority_t authority;
property_t property;
......@@ -99,15 +99,15 @@ if (mbox->observer) observer_notify (mbox->observer, type)
/* Moro(?)ic kluge. */
#define MAILBOX_DEBUG0(mbox, type, format) \
if (mbox->debug) debug_print (mbox->debug, type, format)
if (mbox->debug) mu_debug_print (mbox->debug, type, format)
#define MAILBOX_DEBUG1(mbox, type, format, arg1) \
if (mbox->debug) debug_print (mbox->debug, type, format, arg1)
if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1)
#define MAILBOX_DEBUG2(mbox, type, format, arg1, arg2) \
if (mbox->debug) debug_print (mbox->debug, type, format, arg1, arg2)
if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1, arg2)
#define MAILBOX_DEBUG3(mbox, type, format, arg1, arg2, arg3) \
if (mbox->debug) debug_print (mbox->debug, type, format, arg1, arg2, arg3)
if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1, arg2, arg3)
#define MAILBOX_DEBUG4(mbox, type, format, arg1, arg2, arg3, arg4) \
if (mbox->debug) debug_print (mbox->debug, type, format, arg1, arg2, arg3, arg4)
if (mbox->debug) mu_debug_print (mbox->debug, type, format, arg1, arg2, arg3, arg4)
#ifdef __cplusplus
}
......
......@@ -65,7 +65,7 @@ struct _mailer
{
stream_t stream;
observable_t observable;
debug_t debug;
mu_debug_t debug;
url_t url;
int flags;
monitor_t monitor;
......@@ -88,15 +88,15 @@ if (mailer->observer) observer_notify (mailer->observer, type)
/* Moro(?)ic kluge. */
#define MAILER_DEBUG0(mailer, type, format) \
if (mailer->debug) debug_print (mailer->debug, type, format)
if (mailer->debug) mu_debug_print (mailer->debug, type, format)
#define MAILER_DEBUG1(mailer, type, format, arg1) \
if (mailer->debug) debug_print (mailer->debug, type, format, arg1)
if (mailer->debug) mu_debug_print (mailer->debug, type, format, arg1)
#define MAILER_DEBUG2(mailer, type, format, arg1, arg2) \
if (mailer->debug) debug_print (mailer->debug, type, format, arg1, arg2)
if (mailer->debug) mu_debug_print (mailer->debug, type, format, arg1, arg2)
#define MAILER_DEBUG3(mailer, type, format, arg1, arg2, arg3) \
if (mailer->debug) debug_print (mailer->debug, type, format, arg1, arg2, arg3)
if (mailer->debug) mu_debug_print (mailer->debug, type, format, arg1, arg2, arg3)
#define MAILER_DEBUG4(mailer, type, format, arg1, arg2, arg3, arg4) \
if (mailer->debug) debug_print (mailer->debug, type, format, arg1, arg2, arg3, arg4)
if (mailer->debug) mu_debug_print (mailer->debug, type, format, arg1, arg2, arg3, arg4)
#ifdef __cplusplus
}
......
......@@ -164,7 +164,7 @@ mailbox_destroy (mailbox_t *pmbox)
locker_destroy (&(mbox->locker));
if (mbox->debug)
debug_destroy (&(mbox->debug), mbox);
mu_debug_destroy (&(mbox->debug), mbox);
if (mbox->folder)
folder_destroy (&(mbox->folder));
......@@ -452,24 +452,24 @@ mailbox_get_property (mailbox_t mbox, property_t *pproperty)
}
int
mailbox_set_debug (mailbox_t mbox, debug_t debug)
mailbox_set_debug (mailbox_t mbox, mu_debug_t debug)
{
if (mbox == NULL)
return EINVAL;
if (mbox->debug)
debug_destroy (&(mbox->debug), mbox);
mu_debug_destroy (&(mbox->debug), mbox);
mbox->debug = debug;
return 0;
}
int
mailbox_get_debug (mailbox_t mbox, debug_t *pdebug)
mailbox_get_debug (mailbox_t mbox, mu_debug_t *pdebug)
{
if (mbox == NULL || pdebug == NULL)
return EINVAL;
if (mbox->debug == NULL)
{
int status = debug_create (&(mbox->debug), mbox);
int status = mu_debug_create (&(mbox->debug), mbox);
if (status != 0)
return status;
}
......
......@@ -136,7 +136,7 @@ mailer_destroy (mailer_t *pmailer)
url_destroy (&(mailer->url));
if (mailer->debug)
debug_destroy (&(mailer->debug), mailer);
mu_debug_destroy (&(mailer->debug), mailer);
if (mailer->properties)
{
......@@ -257,23 +257,23 @@ mailer_get_property (mailer_t mailer, property_t *pproperty)
}
int
mailer_set_debug (mailer_t mailer, debug_t debug)
mailer_set_debug (mailer_t mailer, mu_debug_t debug)
{
if (mailer == NULL)
return EINVAL;
debug_destroy (&(mailer->debug), mailer);
mu_debug_destroy (&(mailer->debug), mailer);
mailer->debug = debug;
return 0;
}
int
mailer_get_debug (mailer_t mailer, debug_t *pdebug)
mailer_get_debug (mailer_t mailer, mu_debug_t *pdebug)
{
if (mailer == NULL || pdebug == NULL)
return EINVAL;
if (mailer->debug == NULL)
{
int status = debug_create (&(mailer->debug), mailer);
int status = mu_debug_create (&(mailer->debug), mailer);
if (status != 0)
return status;
}
......
......@@ -85,7 +85,7 @@ struct _address;
typedef struct _address *address_t;
struct _debug;
typedef struct _debug *debug_t;
typedef struct _debug *mu_debug_t;
struct _stream;
typedef struct _stream *stream_t;
......
......@@ -66,9 +66,9 @@ main(int argc, char **argv)
/* Debuging Trace. */
if ( 0 )
{
debug_t debug;
mu_debug_t debug;
mailbox_get_debug (mbox, &debug);
debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
mu_debug_set_level (debug, MU_DEBUG_TRACE|MU_DEBUG_PROT);
}
status = mailbox_open (mbox, MU_STREAM_READ);
......
......@@ -38,7 +38,7 @@
int
mu_copy_debug_level (const mailbox_t from, mailbox_t to)
{
debug_t d = 0;
mu_debug_t d = 0;
size_t level;
int rc;
......@@ -48,13 +48,13 @@ mu_copy_debug_level (const mailbox_t from, mailbox_t to)
rc = mailbox_get_debug (from, &d);
if (!rc)
debug_get_level (d, &level);
mu_debug_get_level (d, &level);
if (!rc)
rc = mailbox_get_debug (to, &d);
if (!rc)
debug_set_level (d, level);
mu_debug_set_level (d, level);
return 0;
}
......@@ -167,7 +167,7 @@ typedef struct sv_interp_ctx_t
FILE*print_stream;
/* mailutils debug handle, we need to destroy it */
debug_t debug;
mu_debug_t debug;
} sv_interp_ctx_t;
typedef struct sv_script_ctx_t
......@@ -212,9 +212,9 @@ void sv_print (sv_interp_ctx_t* ic, int level, const char* fmt, ...)
/* we hook mailutils debug output into our diagnostics using this */
int
sv_mu_debug_print (debug_t d, const char *fmt, va_list ap)
sv_mu_debug_print (mu_debug_t d, const char *fmt, va_list ap)
{
sv_printv(debug_get_owner(d), SV_PRN_MU, fmt, ap);
sv_printv(mu_debug_get_owner(d), SV_PRN_MU, fmt, ap);
return 0;
}
......@@ -731,19 +731,19 @@ main (int argc, char *argv[])
}
if (ic.opt_verbose > 2)
{
if ((res = debug_create(&ic.debug, &ic)))
if ((res = mu_debug_create(&ic.debug, &ic)))
{
fprintf (stderr, "debug_create failed: %s\n", strerror(res));
fprintf (stderr, "mu_debug_create failed: %s\n", strerror(res));
return 1;
}
if ((res = debug_set_level (ic.debug, MU_DEBUG_TRACE | MU_DEBUG_PROT)))
if ((res = mu_debug_set_level (ic.debug, MU_DEBUG_TRACE | MU_DEBUG_PROT)))
{
fprintf (stderr, "debug_set_level failed: %s\n", strerror(res));
fprintf (stderr, "mu_debug_set_level failed: %s\n", strerror(res));
return 1;
}
if ((res = debug_set_print (ic.debug, sv_mu_debug_print, &ic)))
if ((res = mu_debug_set_print (ic.debug, sv_mu_debug_print, &ic)))
{
fprintf (stderr, "debug_set_print failed: %s\n", strerror(res));
fprintf (stderr, "mu_debug_set_print failed: %s\n", strerror(res));
return 1;
}
mailbox_set_debug (mbox, ic.debug);
......