Commit 755146b4 755146b443774be9fdff992ede4cb921762b9649 by Wojciech Polak

Normalize global namespace. Part 2

1 parent 6178304b
Showing 317 changed files with 1216 additions and 1100 deletions
2005-08-27 Wojciech Polak
Normalize global namespace. Part 2: Symbols defined in header files
mailer.h, message.h, mime.h, monitor.h, observer.h, parse822.h,
property.h, registrar.h, stream.h, tls.h, types.h, url.h.
Files affected:
* auth/gsasl.c, auth/tls.c, comsat/action.c, comsat/comsat.c,
comsat/comsat.h, dotlock/dotlock.c, examples/addr.c,
examples/base64.c, examples/decode2047.c, examples/encode2047.c,
examples/http.c, examples/iconv.c, examples/listop.c,
examples/mailcap.c, examples/mimetest.c, examples/msg-send.c,
examples/mta.c, examples/murun.c, examples/nntpclient.c,
examples/numaddr.c, examples/pop3client.c, examples/sfrom.c,
examples/url-parse.c, frm/common.c, frm/frm.c, frm/frm.h,
frm/from.c, guimb/collect.c, guimb/guimb.h, guimb/util.c,
imap4d/append.c, imap4d/auth_gsasl.c, imap4d/authenticate.c,
imap4d/capability.c, imap4d/copy.c, imap4d/fetch.c, imap4d/imap4d.c,
imap4d/imap4d.h, imap4d/rename.c, imap4d/search.c, imap4d/status.c,
imap4d/store.c, imap4d/sync.c, imap4d/util.c,
include/mailutils/address.h, include/mailutils/attribute.h,
include/mailutils/auth.h, include/mailutils/body.h,
include/mailutils/envelope.h, include/mailutils/filter.h,
include/mailutils/folder.h, include/mailutils/gsasl.h,
include/mailutils/guile.h, include/mailutils/header.h,
include/mailutils/iterator.h, include/mailutils/libsieve.h,
include/mailutils/list.h, include/mailutils/locker.h,
include/mailutils/mailbox.h, include/mailutils/mailcap.h,
include/mailutils/mailer.h, include/mailutils/message.h,
include/mailutils/mime.h, include/mailutils/monitor.h,
include/mailutils/mu_auth.h, include/mailutils/mutil.h,
include/mailutils/nntp.h, include/mailutils/observer.h,
include/mailutils/parse822.h, include/mailutils/pop3.h,
include/mailutils/property.h, include/mailutils/refcount.h,
include/mailutils/registrar.h, include/mailutils/stream.h,
include/mailutils/tls.h, include/mailutils/types.h,
include/mailutils/url.h, include/mailutils/sys/nntp.h,
include/mailutils/sys/pop3.h, lib/mailcap.c, libmu_scm/mu_address.c,
libmu_scm/mu_body.c, libmu_scm/mu_mailbox.c, libmu_scm/mu_message.c,
libmu_scm/mu_mime.c, libmu_scm/mu_port.c, libmu_scm/mu_scm.c,
libsieve/actions.c, libsieve/argp.c, libsieve/comparator.c,
libsieve/load.c, libsieve/prog.c, libsieve/register.c,
libsieve/relational.c, libsieve/require.c, libsieve/runtime.c,
libsieve/sieve.h, libsieve/sieve.l, libsieve/sieve.y, libsieve/tests.c,
libsieve/util.c, libsieve/extensions/list.c, libsieve/extensions/spamd.c,
libsieve/extensions/timestamp.c, libsieve/extensions/vacation.c,
mail/alias.c, mail/alt.c, mail/copy.c, mail/decode.c, mail/delete.c,
mail/edit.c, mail/escape.c, mail/file.c, mail/followup.c, mail/from.c,
mail/hold.c, mail/mail.c, mail/mail.h, mail/mailline.c, mail/mbox.c,
mail/msgset.y, mail/next.c, mail/page.c, mail/pipe.c, mail/previous.c,
mail/print.c, mail/quit.c, mail/reply.c, mail/retain.c, mail/send.c,
mail/size.c, mail/summary.c, mail/tag.c, mail/top.c, mail/touch.c,
mail/undelete.c, mail/util.c, mail/visual.c, mail/write.c,
mail.local/mail.local.h, mail.local/main.c, mail.local/script.c,
mail.remote/mail.remote.c, mailbox/address.c, mailbox/amd.c,
mailbox/attachment.c, mailbox/attribute.c, mailbox/auth.c,
mailbox/body.c, mailbox/envelope.c, mailbox/file_stream.c,
mailbox/filter.c, mailbox/filter_iconv.c, mailbox/filter_rfc822.c,
mailbox/filter_trans.c, mailbox/folder.c, mailbox/header.c,
mailbox/iterator.c, mailbox/list.c, mailbox/locker.c, mailbox/mailbox.c,
mailbox/mailcap.c, mailbox/mailer.c, mailbox/mapfile_stream.c,
mailbox/mbx_default.c, mailbox/memory_stream.c, mailbox/message.c,
mailbox/mime.c, mailbox/monitor.c, mailbox/mu_argp.c, mailbox/mu_auth.c,
mailbox/mutil.c, mailbox/observer.c, mailbox/parse822.c,
mailbox/property.c, mailbox/registrar.c, mailbox/rfc2047.c,
mailbox/sendmail.c, mailbox/smtp.c, mailbox/stream.c, mailbox/tcp.c,
mailbox/ticket.c, mailbox/url.c, mailbox/url_sendmail.c,
mailbox/url_smtp.c, mailbox/wicket.c, mailbox/imap/folder.c,
mailbox/imap/mbox.c, mailbox/imap/url.c, mailbox/include/amd.h,
mailbox/include/attribute0.h, mailbox/include/auth0.h,
mailbox/include/body0.h, mailbox/include/envelope0.h,
mailbox/include/filter0.h, mailbox/include/folder0.h,
mailbox/include/header0.h, mailbox/include/imap0.h,
mailbox/include/iterator0.h, mailbox/include/list0.h,
mailbox/include/mailbox0.h, mailbox/include/mailer0.h,
mailbox/include/message0.h, mailbox/include/mime0.h,
mailbox/include/observer0.h, mailbox/include/property0.h,
mailbox/include/registrar0.h, mailbox/include/stream0.h,
mailbox/include/url0.h, mailbox/maildir/folder.c, mailbox/maildir/mbox.c,
mailbox/mbox/folder.c, mailbox/mbox/mbox.c, mailbox/mbox/mbox0.h,
mailbox/mbox/mboxscan.c, mailbox/mbox/url.c, mailbox/mh/folder.c,
mailbox/mh/mbox.c, mailbox/nntp/folder.c, mailbox/nntp/mbox.c,
mailbox/nntp/nntp0.h, mailbox/nntp/nntp_article.c,
mailbox/nntp/nntp_body.c, mailbox/nntp/nntp_carrier.c,
mailbox/nntp/nntp_connect.c, mailbox/nntp/nntp_destroy.c,
mailbox/nntp/nntp_disconnect.c, mailbox/nntp/nntp_head.c,
mailbox/nntp/nntp_help.c, mailbox/nntp/nntp_ihave.c,
mailbox/nntp/nntp_iterator.c, mailbox/nntp/nntp_list_active.c,
mailbox/nntp/nntp_list_distribpats.c,
mailbox/nntp/nntp_list_distributions.c,
mailbox/nntp/nntp_list_extensions.c, mailbox/nntp/nntp_list_newsgroups.c,
mailbox/nntp/nntp_list_times.c, mailbox/nntp/nntp_newgroups.c,
mailbox/nntp/nntp_newnews.c, mailbox/nntp/nntp_post.c,
mailbox/nntp/nntp_readline.c, mailbox/nntp/nntp_sendline.c,
mailbox/nntp/nntp_stream.c, mailbox/nntp/url.c, mailbox/pop/folder.c,
mailbox/pop/mbox.c, mailbox/pop/pop3_capa.c, mailbox/pop/pop3_carrier.c,
mailbox/pop/pop3_connect.c, mailbox/pop/pop3_destroy.c,
mailbox/pop/pop3_disconnect.c, mailbox/pop/pop3_iterator.c,
mailbox/pop/pop3_lista.c, mailbox/pop/pop3_readline.c,
mailbox/pop/pop3_retr.c, mailbox/pop/pop3_sendline.c,
mailbox/pop/pop3_stls.c, mailbox/pop/pop3_stream.c,
mailbox/pop/pop3_top.c, mailbox/pop/pop3_uidla.c, mailbox/pop/url.c,
messages/messages.c, mh/ali.c, mh/anno.c, mh/comp.c, mh/compcommon.c,
mh/folder.c, mh/forw.c, mh/inc.c, mh/mark.c, mh/mh.h, mh/mh_alias.y,
mh/mh_ctx.c, mh/mh_format.c, mh/mh_init.c, mh/mh_list.c, mh/mh_msgset.c,
mh/mh_stream.c, mh/mh_whatnow.c, mh/mh_whom.c, mh/mhl.c, mh/mhn.c,
mh/mhpath.c, mh/pick.c, mh/pick.h, mh/pick.y, mh/refile.c, mh/repl.c,
mh/rmf.c, mh/rmm.c, mh/scan.c, mh/send.c, mh/sortm.c,
mimeview/mimetypes.y, mimeview/mimeview.c, movemail/movemail.c,
pop3d/apop.c, pop3d/dele.c, pop3d/expire.c, pop3d/extra.c, pop3d/list.c,
pop3d/lock.c, pop3d/pop3d.c, pop3d/pop3d.h, pop3d/quit.c, pop3d/retr.c,
pop3d/rset.c, pop3d/stat.c, pop3d/top.c, pop3d/uidl.c, pop3d/user.c,
readmsg/msglist.c, readmsg/readmsg.c, readmsg/readmsg.h, sieve/sieve.c,
sql/odbc.c,
2005-08-26 Sergey Poznyakoff <gray@gnu.org.ua>
Normalize global namespace. All exportable symbols begin with mu_.
......
......@@ -89,26 +89,26 @@ struct _gsasl_stream {
Gsasl_session_ctx *sess_ctx; /* Context */
int last_err; /* Last Gsasl error code */
stream_t stream; /* I/O stream */
mu_stream_t stream; /* I/O stream */
struct _line_buffer *lb;
};
static void
_gsasl_destroy (stream_t stream)
_gsasl_destroy (mu_stream_t stream)
{
int flags;
struct _gsasl_stream *s = stream_get_owner (stream);
stream_get_flags (stream, &flags);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
mu_stream_get_flags (stream, &flags);
if (!(flags & MU_STREAM_NO_CLOSE))
stream_destroy (&s->stream, stream_get_owner (s->stream));
mu_stream_destroy (&s->stream, mu_stream_get_owner (s->stream));
_auth_lb_destroy (&s->lb);
}
static int
_gsasl_readline (stream_t stream, char *optr, size_t osize,
_gsasl_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
{
struct _gsasl_stream *s = stream_get_owner (stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
int rc;
size_t len, sz;
char *bufp = NULL;
......@@ -128,7 +128,7 @@ _gsasl_readline (stream_t stream, char *optr, size_t osize,
size_t sz;
int status;
status = stream_sequential_read (s->stream, buf, sizeof (buf), &sz);
status = mu_stream_sequential_read (s->stream, buf, sizeof (buf), &sz);
if (status == EINTR)
continue;
else if (status)
......@@ -191,7 +191,7 @@ write_chunk (void *data, char *start, char *end)
gsasl_encode (s->sess_ctx, start, chunk_size, &buf, &len);
status = stream_sequential_write (s->stream, buf, len);
status = mu_stream_sequential_write (s->stream, buf, len);
free (buf);
......@@ -200,11 +200,11 @@ write_chunk (void *data, char *start, char *end)
static int
_gsasl_write (stream_t stream, const char *iptr, size_t isize,
_gsasl_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
{
int rc;
struct _gsasl_stream *s = stream_get_owner (stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
rc = _auth_lb_grow (s->lb, iptr, isize);
if (rc)
......@@ -215,63 +215,63 @@ _gsasl_write (stream_t stream, const char *iptr, size_t isize,
}
static int
_gsasl_flush (stream_t stream)
_gsasl_flush (mu_stream_t stream)
{
struct _gsasl_stream *s = stream_get_owner (stream);
return stream_flush (s->stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
return mu_stream_flush (s->stream);
}
static int
_gsasl_close (stream_t stream)
_gsasl_close (mu_stream_t stream)
{
int flags;
struct _gsasl_stream *s = stream_get_owner (stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
stream_get_flags (stream, &flags);
mu_stream_get_flags (stream, &flags);
if (!(flags & MU_STREAM_NO_CLOSE))
stream_close (s->stream);
mu_stream_close (s->stream);
return 0;
}
static int
_gsasl_open (stream_t stream)
_gsasl_open (mu_stream_t stream)
{
/* Nothing to do */
return 0;
}
int
_gsasl_strerror (stream_t stream, const char **pstr)
_gsasl_strerror (mu_stream_t stream, const char **pstr)
{
struct _gsasl_stream *s = stream_get_owner (stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
*pstr = gsasl_strerror (s->last_err);
return 0;
}
int
_gsasl_get_transport2 (stream_t stream, mu_transport_t *pt, mu_transport_t *pt2)
_gsasl_get_transport2 (mu_stream_t stream, mu_transport_t *pt, mu_transport_t *pt2)
{
struct _gsasl_stream *s = stream_get_owner (stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
*pt2 = NULL; /* FIXME 1 */
*pt = (mu_transport_t) s->stream;
return 0;
}
int
_gsasl_wait (stream_t stream, int *pflags, struct timeval *tvp)
_gsasl_wait (mu_stream_t stream, int *pflags, struct timeval *tvp)
{
int flags;
struct _gsasl_stream *s = stream_get_owner (stream);
struct _gsasl_stream *s = mu_stream_get_owner (stream);
stream_get_flags (stream, &flags);
mu_stream_get_flags (stream, &flags);
if (((*pflags & MU_STREAM_READY_RD) && !(flags & MU_STREAM_READ))
|| ((*pflags & MU_STREAM_READY_WR) && !(flags & MU_STREAM_WRITE)))
return EINVAL;
return stream_wait (s->stream, pflags, tvp);
return mu_stream_wait (s->stream, pflags, tvp);
}
int
mu_gsasl_stream_create (stream_t *stream, stream_t transport,
mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport,
Gsasl_session_ctx *ctx, int flags)
{
struct _gsasl_stream *s;
......@@ -292,24 +292,24 @@ mu_gsasl_stream_create (stream_t *stream, stream_t transport,
s->stream = transport;
s->sess_ctx = ctx;
rc = stream_create (stream, flags|MU_STREAM_NO_CHECK, s);
rc = mu_stream_create (stream, flags|MU_STREAM_NO_CHECK, s);
if (rc)
{
free (s);
return rc;
}
stream_set_open (*stream, _gsasl_open, s);
stream_set_close (*stream, _gsasl_close, s);
stream_set_flush (*stream, _gsasl_flush, s);
stream_set_destroy (*stream, _gsasl_destroy, s);
stream_set_strerror (*stream, _gsasl_strerror, s);
stream_set_wait (*stream, _gsasl_wait, s);
stream_set_get_transport2 (*stream, _gsasl_get_transport2, s);
mu_stream_set_open (*stream, _gsasl_open, s);
mu_stream_set_close (*stream, _gsasl_close, s);
mu_stream_set_flush (*stream, _gsasl_flush, s);
mu_stream_set_destroy (*stream, _gsasl_destroy, s);
mu_stream_set_strerror (*stream, _gsasl_strerror, s);
mu_stream_set_wait (*stream, _gsasl_wait, s);
mu_stream_set_get_transport2 (*stream, _gsasl_get_transport2, s);
if (flags & MU_STREAM_READ)
stream_set_readline (*stream, _gsasl_readline, s);
mu_stream_set_readline (*stream, _gsasl_readline, s);
else
stream_set_write (*stream, _gsasl_write, s);
mu_stream_set_write (*stream, _gsasl_write, s);
_auth_lb_create (&s->lb);
......
......@@ -245,8 +245,8 @@ enum tls_stream_state {
};
struct _tls_stream {
stream_t strin; /* Input stream */
stream_t strout; /* Output stream */
mu_stream_t strin; /* Input stream */
mu_stream_t strout; /* Output stream */
int last_err;
struct _line_buffer *lb;
enum tls_stream_state state;
......@@ -255,9 +255,9 @@ struct _tls_stream {
static void
_tls_destroy (stream_t stream)
_tls_destroy (mu_stream_t stream)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
if (x509_cred)
gnutls_certificate_free_credentials (x509_cred);
if (s->session && s->state == state_closed)
......@@ -270,10 +270,10 @@ _tls_destroy (stream_t stream)
}
static int
_tls_read (stream_t stream, char *optr, size_t osize,
_tls_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc;
if (!stream || s->state != state_open)
......@@ -289,10 +289,10 @@ _tls_read (stream_t stream, char *optr, size_t osize,
}
static int
_tls_readline (stream_t stream, char *optr, size_t osize,
_tls_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc;
char *ptr;
size_t rdsize;
......@@ -328,10 +328,10 @@ _tls_readline (stream_t stream, char *optr, size_t osize,
}
static int
_tls_write (stream_t stream, const char *iptr, size_t isize,
_tls_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc;
if (!stream || s->state != state_open)
......@@ -361,16 +361,16 @@ _tls_write (stream_t stream, const char *iptr, size_t isize,
}
static int
_tls_flush (stream_t stream)
_tls_flush (mu_stream_t stream)
{
struct _tls_stream *s = stream_get_owner (stream);
return stream_flush (s->strout);
struct _tls_stream *s = mu_stream_get_owner (stream);
return mu_stream_flush (s->strout);
}
static int
_tls_close (stream_t stream)
_tls_close (mu_stream_t stream)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
if (s->session && s->state == state_open)
{
gnutls_bye (s->session, GNUTLS_SHUT_RDWR);
......@@ -385,11 +385,11 @@ _tls_close (stream_t stream)
static ssize_t
_tls_stream_pull (gnutls_transport_ptr fd, void *buf, size_t size)
{
stream_t stream = fd;
mu_stream_t stream = fd;
int rc;
size_t rdbytes;
while ((rc = stream_sequential_read (stream, buf, size, &rdbytes)) == EAGAIN)
while ((rc = mu_stream_sequential_read (stream, buf, size, &rdbytes)) == EAGAIN)
;
if (rc)
......@@ -400,10 +400,10 @@ _tls_stream_pull (gnutls_transport_ptr fd, void *buf, size_t size)
static ssize_t
_tls_stream_push (gnutls_transport_ptr fd, const void *buf, size_t size)
{
stream_t stream = fd;
mu_stream_t stream = fd;
int rc;
rc = stream_sequential_write (stream, buf, size);
rc = mu_stream_sequential_write (stream, buf, size);
if (rc)
return -1;
return size;
......@@ -412,9 +412,9 @@ _tls_stream_push (gnutls_transport_ptr fd, const void *buf, size_t size)
static int
_tls_open (stream_t stream)
_tls_open (mu_stream_t stream)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc = 0;
if (!stream || s->state != state_init)
......@@ -500,9 +500,9 @@ prepare_client_session (struct _tls_stream *s)
}
static int
_tls_open_client (stream_t stream)
_tls_open_client (mu_stream_t stream)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc = 0;
switch (s->state)
......@@ -535,43 +535,43 @@ _tls_open_client (stream_t stream)
}
int
_tls_strerror (stream_t stream, const char **pstr)
_tls_strerror (mu_stream_t stream, const char **pstr)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
*pstr = gnutls_strerror (s->last_err);
return 0;
}
int
_tls_get_transport2 (stream_t stream,
_tls_get_transport2 (mu_stream_t stream,
mu_transport_t *pin, mu_transport_t *pout)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
*pin = (mu_transport_t) s->strin;
*pout = (mu_transport_t) s->strout;
return 0;
}
int
_tls_wait (stream_t stream, int *pflags, struct timeval *tvp)
_tls_wait (mu_stream_t stream, int *pflags, struct timeval *tvp)
{
struct _tls_stream *s = stream_get_owner (stream);
struct _tls_stream *s = mu_stream_get_owner (stream);
if ((*pflags & (MU_STREAM_READY_RD|MU_STREAM_READY_WR)) == (MU_STREAM_READY_RD|MU_STREAM_READY_WR))
return EINVAL; /* Sorry, can't wait for both input and output. */
if (*pflags & MU_STREAM_READY_RD)
return stream_wait (s->strin, pflags, tvp);
return mu_stream_wait (s->strin, pflags, tvp);
if (*pflags & MU_STREAM_READY_WR)
return stream_wait (s->strout, pflags, tvp);
return mu_stream_wait (s->strout, pflags, tvp);
return EINVAL;
}
/* FIXME: if strin == strout sequential reads may intefere with
sequential writes (they would share stream->offset). This should
be fixed either in stream.c or here. In particular, tls_stream_create_client
be fixed either in stream.c or here. In particular, mu_tls_stream_create_client
will malfunction */
int
tls_stream_create (stream_t *stream,
stream_t strin, stream_t strout, int flags)
mu_tls_stream_create (mu_stream_t *stream,
mu_stream_t strin, mu_stream_t strout, int flags)
{
struct _tls_stream *s;
int rc;
......@@ -586,23 +586,23 @@ tls_stream_create (stream_t *stream,
s->strin = strin;
s->strout = strout;
rc = stream_create (stream, flags|MU_STREAM_NO_CHECK, s);
rc = mu_stream_create (stream, flags|MU_STREAM_NO_CHECK, s);
if (rc)
{
free (s);
return rc;
}
stream_set_open (*stream, _tls_open, s);
stream_set_close (*stream, _tls_close, s);
stream_set_read (*stream, _tls_read, s);
stream_set_readline (*stream, _tls_readline, s);
stream_set_write (*stream, _tls_write, s);
stream_set_flush (*stream, _tls_flush, s);
stream_set_destroy (*stream, _tls_destroy, s);
stream_set_strerror (*stream, _tls_strerror, s);
stream_set_get_transport2 (*stream, _tls_get_transport2, s);
stream_set_wait (*stream, _tls_wait, s);
mu_stream_set_open (*stream, _tls_open, s);
mu_stream_set_close (*stream, _tls_close, s);
mu_stream_set_read (*stream, _tls_read, s);
mu_stream_set_readline (*stream, _tls_readline, s);
mu_stream_set_write (*stream, _tls_write, s);
mu_stream_set_flush (*stream, _tls_flush, s);
mu_stream_set_destroy (*stream, _tls_destroy, s);
mu_stream_set_strerror (*stream, _tls_strerror, s);
mu_stream_set_get_transport2 (*stream, _tls_get_transport2, s);
mu_stream_set_wait (*stream, _tls_wait, s);
_auth_lb_create (&s->lb);
s->state = state_init;
......@@ -610,8 +610,8 @@ tls_stream_create (stream_t *stream,
}
int
tls_stream_create_client (stream_t *stream,
stream_t strin, stream_t strout, int flags)
mu_tls_stream_create_client (mu_stream_t *stream,
mu_stream_t strin, mu_stream_t strout, int flags)
{
struct _tls_stream *s;
int rc;
......@@ -626,23 +626,23 @@ tls_stream_create_client (stream_t *stream,
s->strin = strin;
s->strout = strout;
rc = stream_create (stream, flags|MU_STREAM_NO_CHECK, s);
rc = mu_stream_create (stream, flags|MU_STREAM_NO_CHECK, s);
if (rc)
{
free (s);
return rc;
}
stream_set_open (*stream, _tls_open_client, s);
stream_set_close (*stream, _tls_close, s);
stream_set_read (*stream, _tls_read, s);
stream_set_readline (*stream, _tls_readline, s);
stream_set_write (*stream, _tls_write, s);
stream_set_flush (*stream, _tls_flush, s);
stream_set_destroy (*stream, _tls_destroy, s);
stream_set_strerror (*stream, _tls_strerror, s);
stream_set_get_transport2 (*stream, _tls_get_transport2, s);
stream_set_wait (*stream, _tls_wait, s);
mu_stream_set_open (*stream, _tls_open_client, s);
mu_stream_set_close (*stream, _tls_close, s);
mu_stream_set_read (*stream, _tls_read, s);
mu_stream_set_readline (*stream, _tls_readline, s);
mu_stream_set_write (*stream, _tls_write, s);
mu_stream_set_flush (*stream, _tls_flush, s);
mu_stream_set_destroy (*stream, _tls_destroy, s);
mu_stream_set_strerror (*stream, _tls_strerror, s);
mu_stream_set_get_transport2 (*stream, _tls_get_transport2, s);
mu_stream_set_wait (*stream, _tls_wait, s);
_auth_lb_create (&s->lb);
s->state = state_init;
......@@ -650,10 +650,10 @@ tls_stream_create_client (stream_t *stream,
}
int
tls_stream_create_client_from_tcp (stream_t *stream, stream_t tcp_str,
mu_tls_stream_create_client_from_tcp (mu_stream_t *stream, mu_stream_t tcp_str,
int flags)
{
return tls_stream_create_client (stream, tcp_str, tcp_str, flags);
return mu_tls_stream_create_client (stream, tcp_str, tcp_str, flags);
}
#endif /* WITH_TLS */
......
......@@ -81,14 +81,14 @@ act_getline (FILE *fp, char **sptr, size_t *size)
}
static int
expand_escape (char **pp, message_t msg, struct obstack *stk)
expand_escape (char **pp, mu_message_t msg, struct obstack *stk)
{
char *p = *pp;
char *start, *sval, *namep;
int len;
header_t hdr;
body_t body;
stream_t stream;
mu_header_t hdr;
mu_body_t body;
mu_stream_t stream;
int rc = 1;
size_t size = 0, lncount = 0;
......@@ -122,7 +122,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
break;
memcpy (namep, start, len);
namep[len] = 0;
if (message_get_header (msg, &hdr) == 0
if (mu_message_get_header (msg, &hdr) == 0
&& mu_header_aget_value (hdr, namep, &sval) == 0)
{
len = strlen (sval);
......@@ -147,7 +147,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
size = 400;
if (lncount == 0)
lncount = maxlines;
if (message_get_body (msg, &body) == 0
if (mu_message_get_body (msg, &body) == 0
&& mu_body_get_stream (body, &stream) == 0)
{
size_t nread;
......@@ -155,7 +155,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
if (!buf)
break;
if (stream_read (stream, buf, size, 0, &nread) == 0)
if (mu_stream_read (stream, buf, size, 0, &nread) == 0)
{
char *q;
......@@ -181,7 +181,7 @@ expand_escape (char **pp, message_t msg, struct obstack *stk)
}
static char *
expand_line (const char *str, message_t msg)
expand_line (const char *str, mu_message_t msg)
{
const char *p;
int c = 0;
......@@ -331,7 +331,7 @@ open_rc (const char *filename, FILE *tty)
}
void
run_user_action (FILE *tty, const char *cr, message_t msg)
run_user_action (FILE *tty, const char *cr, mu_message_t msg)
{
FILE *fp;
int nact = 0;
......
......@@ -193,7 +193,7 @@ sig_hup (int sig)
void
comsat_init ()
{
registrar_record (path_record);
mu_registrar_record (mu_path_record);
gethostname (hostname, sizeof hostname);
......@@ -427,9 +427,9 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
FILE *fp;
const char *cr;
char *blurb;
mailbox_t mbox = NULL, tmp = NULL;
message_t msg;
stream_t stream = NULL;
mu_mailbox_t mbox = NULL, tmp = NULL;
mu_message_t msg;
mu_stream_t stream = NULL;
int status;
off_t size;
size_t count, n;
......@@ -465,7 +465,7 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
return;
}
if ((status = stream_size (stream, &size)))
if ((status = mu_stream_size (stream, &size)))
{
syslog (LOG_ERR, _("Cannot get stream size (mailbox %s): %s"),
path, mu_strerror (status));
......@@ -478,7 +478,7 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
if (!blurb)
return;
stream_read (stream, blurb, size, offset, &n);
mu_stream_read (stream, blurb, size, offset, &n);
blurb[size] = 0;
if ((status = mu_mailbox_create (&tmp, "/dev/null")) != 0
......@@ -489,14 +489,14 @@ notify_user (const char *user, const char *device, const char *path, off_t offse
return;
}
if ((status = memory_stream_create (&stream, 0, 0)))
if ((status = mu_memory_stream_create (&stream, 0, 0)))
{
syslog (LOG_ERR, _("Cannot create temporary stream: %s"),
mu_strerror (status));
return;
}
stream_write (stream, blurb, size, 0, &count);
mu_stream_write (stream, blurb, size, 0, &count);
mu_mailbox_set_stream (tmp, stream);
mu_mailbox_messages_count (tmp, &count);
mu_mailbox_get_message (tmp, 1, &msg);
......
......@@ -79,4 +79,4 @@ extern struct daemon_param daemon_param;
extern void read_config (const char *config_file);
int acl_match (struct sockaddr_in *sa_in);
void run_user_action (FILE *tty, const char *cr, message_t msg);
void run_user_action (FILE *tty, const char *cr, mu_message_t msg);
......
......@@ -126,7 +126,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
int
main (int argc, char *argv[])
{
locker_t locker = 0;
mu_locker_t locker = 0;
int err = 0;
pid_t usergid = getgid ();
pid_t mailgid = getegid ();
......
......@@ -33,7 +33,7 @@ parse (const char *str)
size_t pcount = 0;
int status;
char buf[BUFSIZ];
address_t address = NULL;
mu_address_t address = NULL;
mu_set_user_email_domain ("localhost");
status = mu_address_create (&address, str);
......
......@@ -28,7 +28,7 @@
int
main (int argc, char * argv [])
{
stream_t in, out, flt;
mu_stream_t in, out, flt;
unsigned char buffer;
int c, verbose = 0;
int printable = 0;
......@@ -77,37 +77,37 @@ main (int argc, char * argv [])
}
if (input)
c = file_stream_create (&in, input, MU_STREAM_READ);
c = mu_file_stream_create (&in, input, MU_STREAM_READ);
else
c = stdio_stream_create (&in, stdin, 0);
c = mu_stdio_stream_create (&in, stdin, 0);
assert (c == 0);
assert (mu_filter_create (&flt, in, encoding, mode, MU_STREAM_READ) == 0);
assert (stream_open (in) == 0);
assert (mu_stream_open (in) == 0);
if (output)
c = file_stream_create (&out, output, MU_STREAM_WRITE|MU_STREAM_CREAT);
c = mu_file_stream_create (&out, output, MU_STREAM_WRITE|MU_STREAM_CREAT);
else
c = stdio_stream_create (&out, stdout, 0);
c = mu_stdio_stream_create (&out, stdout, 0);
assert (c == 0);
assert (stream_open (out) == 0);
assert (mu_stream_open (out) == 0);
while (stream_read (flt, &buffer, sizeof (buffer), total, &size) == 0
while (mu_stream_read (flt, &buffer, sizeof (buffer), total, &size) == 0
&& size > 0)
{
if (printable && !ISPRINT (buffer))
{
char outbuf[24];
sprintf (outbuf, "\\%03o", (unsigned int) buffer);
stream_sequential_write (out, outbuf, strlen (outbuf));
mu_stream_sequential_write (out, outbuf, strlen (outbuf));
}
else
stream_sequential_write (out, &buffer, size);
mu_stream_sequential_write (out, &buffer, size);
total += size;
}
stream_sequential_write (out, "\n", 1);
stream_close (in);
stream_close (out);
mu_stream_sequential_write (out, "\n", 1);
mu_stream_close (in);
mu_stream_close (out);
if (verbose)
fprintf (stderr, "total: %lu bytes\n", (unsigned long) total);
return 0;
......
......@@ -63,7 +63,7 @@ main (int argc, char *argv[])
len = strlen (buf);
if (len > 0 && buf[len - 1] == '\n')
buf[len - 1] = 0;
rc = rfc2047_decode ("iso-8859-1", buf, &p);
rc = mu_rfc2047_decode ("iso-8859-1", buf, &p);
printf ("%s=> %s\n", buf, mu_strerror (rc));
if (p)
print (p, printable);
......
......@@ -36,7 +36,7 @@ main (int argc, char *argv[])
len = strlen (buf);
if (len > 0 && buf[len - 1] == '\n')
buf[len - 1] = 0;
rc = rfc2047_encode ("iso-8859-1", "quoted-printable", buf, &p);
rc = mu_rfc2047_encode ("iso-8859-1", "quoted-printable", buf, &p);
printf ("%s=> %s\n", buf, mu_strerror (rc));
if (p)
printf ("%s\n", p);
......
......@@ -35,7 +35,7 @@ size_t io_timeout = 3;
size_t io_attempts = 3;
int
http_stream_wait (stream_t stream, int flags, size_t *attempt)
http_stream_wait (mu_stream_t stream, int flags, size_t *attempt)
{
int rc;
int oflags = flags;
......@@ -45,7 +45,7 @@ http_stream_wait (stream_t stream, int flags, size_t *attempt)
{
tv.tv_sec = io_timeout;
tv.tv_usec = 0;
rc = stream_wait (stream, &oflags, &tv);
rc = mu_stream_wait (stream, &oflags, &tv);
switch (rc) {
case 0:
if (flags & oflags)
......@@ -67,7 +67,7 @@ int
main (int argc, char **argv)
{
int ret, off = 0;
stream_t stream;
mu_stream_t stream;
size_t nb, size;
size_t attempt;
char *url = "www.gnu.org";
......@@ -84,14 +84,14 @@ main (int argc, char **argv)
snprintf (wbuf, sizeof wbuf, "GET %s HTTP/1.0\r\n\r\n",
argc == 3 ? argv[2] : "/");
ret = tcp_stream_create (&stream, url, 80, MU_STREAM_NONBLOCK);
ret = mu_tcp_stream_create (&stream, url, 80, MU_STREAM_NONBLOCK);
if (ret != 0)
{
mu_error ("tcp_stream_create: %s", mu_strerror (ret));
mu_error ("mu_tcp_stream_create: %s", mu_strerror (ret));
exit (EXIT_FAILURE);
}
for (attempt = 0; (ret = stream_open (stream)); )
for (attempt = 0; (ret = mu_stream_open (stream)); )
{
if ((ret == EAGAIN || ret == EINPROGRESS) && attempt < io_attempts)
{
......@@ -99,18 +99,18 @@ main (int argc, char **argv)
if (ret == 0)
continue;
}
mu_error ("stream_open: %s", mu_strerror (ret));
mu_error ("mu_stream_open: %s", mu_strerror (ret));
exit (EXIT_FAILURE);
}
for (attempt = 0, size = strlen (wbuf); size > 0; )
{
ret = stream_write (stream, wbuf + off, strlen (wbuf), 0, &nb);
ret = mu_stream_write (stream, wbuf + off, strlen (wbuf), 0, &nb);
if (ret == 0)
{
if (nb == 0)
{
mu_error("stream_write: wrote 0 bytes");
mu_error("mu_stream_write: wrote 0 bytes");
exit (EXIT_FAILURE);
}
off += nb;
......@@ -130,13 +130,13 @@ main (int argc, char **argv)
}
else
{
mu_error ("stream_write timed out");
mu_error ("mu_stream_write timed out");
exit (EXIT_FAILURE);
}
}
else
{
mu_error ("stream_write: %s", mu_strerror (ret));
mu_error ("mu_stream_write: %s", mu_strerror (ret));
exit (EXIT_FAILURE);
}
}
......@@ -144,7 +144,7 @@ main (int argc, char **argv)
attempt = 0;
for (;;)
{
ret = stream_read (stream, rbuf, sizeof (rbuf), 0, &nb);
ret = mu_stream_read (stream, rbuf, sizeof (rbuf), 0, &nb);
if (ret == 0)
{
if (nb == 0)
......@@ -164,19 +164,19 @@ main (int argc, char **argv)
}
else
{
mu_error ("stream_read: %s", mu_strerror (ret));
mu_error ("mu_stream_read: %s", mu_strerror (ret));
exit (EXIT_FAILURE);
}
}
}
ret = stream_close (stream);
ret = mu_stream_close (stream);
if (ret != 0)
{
mu_error ("stream_close: %s", mu_strerror (ret));
mu_error ("mu_stream_close: %s", mu_strerror (ret));
exit (EXIT_FAILURE);
}
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
exit (EXIT_SUCCESS);
}
......
......@@ -29,8 +29,8 @@ int
main (int argc, char **argv)
{
int rc;
stream_t in, out;
stream_t cvt;
mu_stream_t in, out;
mu_stream_t cvt;
size_t total = 0, size;
char buffer[80];
......@@ -40,27 +40,27 @@ main (int argc, char **argv)
return 1;
}
rc = stdio_stream_create (&in, stdin, 0);
rc = mu_stdio_stream_create (&in, stdin, 0);
assert (rc == 0);
assert (stream_open (in) == 0);
assert (mu_stream_open (in) == 0);
assert (mu_filter_iconv_create (&cvt, in, argv[1], argv[2], 0, mu_fallback_none) == 0);
assert (stream_open (cvt) == 0);
assert (mu_stream_open (cvt) == 0);
rc = stdio_stream_create (&out, stdout, 0);
rc = mu_stdio_stream_create (&out, stdout, 0);
assert (rc == 0);
assert (stream_open (out) == 0);
assert (mu_stream_open (out) == 0);
while ((rc = stream_read (cvt, buffer, sizeof (buffer), total, &size)) == 0
while ((rc = mu_stream_read (cvt, buffer, sizeof (buffer), total, &size)) == 0
&& size > 0)
{
stream_sequential_write (out, buffer, size);
mu_stream_sequential_write (out, buffer, size);
total += size;
}
stream_flush (out);
mu_stream_flush (out);
if (rc)
{
const char *p;
stream_strerror (cvt, &p);
mu_stream_strerror (cvt, &p);
fprintf (stderr, "error: %s / %s\n", mu_strerror (rc), p);
}
return 0;
......
......@@ -37,9 +37,9 @@ lperror (char *text, int rc)
}
void
print (list_t list)
print (mu_list_t list)
{
iterator_t itr;
mu_iterator_t itr;
int rc;
rc = mu_list_get_iterator (list, &itr);
......@@ -59,7 +59,7 @@ print (list_t list)
}
void
next (iterator_t itr, char *arg)
next (mu_iterator_t itr, char *arg)
{
int skip = arg ? strtoul (arg, NULL, 0) : 1;
......@@ -70,7 +70,7 @@ next (iterator_t itr, char *arg)
}
void
delete (list_t list, int argc, char **argv)
delete (mu_list_t list, int argc, char **argv)
{
int rc;
......@@ -89,7 +89,7 @@ delete (list_t list, int argc, char **argv)
}
void
add (list_t list, int argc, char **argv)
add (mu_list_t list, int argc, char **argv)
{
int rc;
......@@ -108,7 +108,7 @@ add (list_t list, int argc, char **argv)
}
void
prep (list_t list, int argc, char **argv)
prep (mu_list_t list, int argc, char **argv)
{
int rc;
......@@ -127,7 +127,7 @@ prep (list_t list, int argc, char **argv)
}
void
ins (list_t list, int argc, char **argv)
ins (mu_list_t list, int argc, char **argv)
{
int rc;
char *item;
......@@ -163,7 +163,7 @@ ins (list_t list, int argc, char **argv)
void
repl (list_t list, int argc, char **argv)
repl (mu_list_t list, int argc, char **argv)
{
int rc;
......@@ -201,7 +201,7 @@ iter (int *pnum, int argc, char **argv)
}
void
find (iterator_t itr, char *arg)
find (mu_iterator_t itr, char *arg)
{
char *text;
......@@ -252,10 +252,10 @@ help ()
}
void
shell (list_t list)
shell (mu_list_t list)
{
int num = 0;
iterator_t itr[NITR];
mu_iterator_t itr[NITR];
int rc;
for (num = 0; num < NITR; num++)
......@@ -343,7 +343,7 @@ string_comp (const void *item, const void *value)
int
main (int argc, char **argv)
{
list_t list;
mu_list_t list;
int rc;
while ((rc = getopt (argc, argv, "h")) != EOF)
......
......@@ -24,12 +24,12 @@
int
main (int argc, char **argv)
{
stream_t stream = NULL;
mu_stream_t stream = NULL;
int status = 0;
char *file = argc == 1 ? "/etc/mailcap" : argv[1];
mu_mailcap_t mailcap = NULL;
status = file_stream_create (&stream, file, MU_STREAM_READ);
status = mu_file_stream_create (&stream, file, MU_STREAM_READ);
if (status)
{
mu_error ("cannot create file stream %s: %s",
......@@ -37,7 +37,7 @@ main (int argc, char **argv)
exit (1);
}
status = stream_open (stream);
status = mu_stream_open (stream);
if (status)
{
mu_error ("cannot open file stream %s: %s",
......
......@@ -31,7 +31,7 @@
#include <mailutils/mailutils.h>
void message_display_parts(message_t msg, int indent);
void message_display_parts(mu_message_t msg, int indent);
char from[256];
char subject[256];
......@@ -59,7 +59,7 @@ print_file (const char *fname, int indent)
int
main (int argc, char **argv)
{
mailbox_t mbox = NULL;
mu_mailbox_t mbox = NULL;
int ret;
size_t i;
size_t count = 0;
......@@ -81,10 +81,10 @@ main (int argc, char **argv)
mailbox_name = argv[i];
/* Registration. */
registrar_record (imap_record);
registrar_record (mbox_record);
registrar_record (path_record);
registrar_record (pop_record);
mu_registrar_record (mu_imap_record);
mu_registrar_record (mu_mbox_record);
mu_registrar_record (mu_path_record);
mu_registrar_record (mu_pop_record);
if ((ret = mu_mailbox_create_default (&mbox, mailbox_name)) != 0)
{
......@@ -113,8 +113,8 @@ main (int argc, char **argv)
for (i = 1; i <= count; ++i)
{
message_t msg;
header_t hdr;
mu_message_t msg;
mu_header_t hdr;
size_t nparts;
size_t msize, nlines;
......@@ -123,19 +123,19 @@ main (int argc, char **argv)
fprintf (stderr, "mu_mailbox_get_message - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_size (msg, &msize)) != 0)
if ((ret = mu_message_size (msg, &msize)) != 0)
{
fprintf (stderr, "message_size - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_size - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_lines (msg, &nlines)) != 0)
if ((ret = mu_message_lines (msg, &nlines)) != 0)
{
fprintf (stderr, "message_lines - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_lines - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_get_header (msg, &hdr)) != 0)
if ((ret = mu_message_get_header (msg, &hdr)) != 0)
{
fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_get_header - %s\n", mu_strerror (ret));
exit (2);
}
mu_header_get_value (hdr, MU_HEADER_FROM, from, sizeof (from), NULL);
......@@ -145,9 +145,9 @@ main (int argc, char **argv)
printf ("From: %s\n", from);
printf ("Subject: %s\n", subject);
if ((ret = message_get_num_parts (msg, &nparts)) != 0)
if ((ret = mu_message_get_num_parts (msg, &nparts)) != 0)
{
fprintf (stderr, "message_get_num_parts - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_get_num_parts - %s\n", mu_strerror (ret));
exit (2);
}
printf ("Number of parts in message - %lu\n",
......@@ -164,23 +164,23 @@ main (int argc, char **argv)
char buf[2048];
void
message_display_parts (message_t msg, int indent)
message_display_parts (mu_message_t msg, int indent)
{
int ret, j;
size_t msize, nlines, nparts, nsubparts;
message_t part;
header_t hdr;
mu_message_t part;
mu_header_t hdr;
char type[256];
char encoding[256];
stream_t str;
body_t body;
mu_stream_t str;
mu_body_t body;
int offset, ismulti;
size_t nbytes;
/* How many parts does the message has? */
if ((ret = message_get_num_parts (msg, &nparts)) != 0)
if ((ret = mu_message_get_num_parts (msg, &nparts)) != 0)
{
fprintf (stderr, "message_get_num_parts - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_get_num_parts - %s\n", mu_strerror (ret));
exit (2);
}
......@@ -189,24 +189,24 @@ message_display_parts (message_t msg, int indent)
its own that can have other subparts(recursive). */
for (j = 1; j <= nparts; j++)
{
if ((ret = message_get_part (msg, j, &part)) != 0)
if ((ret = mu_message_get_part (msg, j, &part)) != 0)
{
fprintf (stderr, "mime_get_part - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_mime_get_part - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_size (part, &msize)) != 0)
if ((ret = mu_message_size (part, &msize)) != 0)
{
fprintf (stderr, "message_size - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_size - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_lines (part, &nlines)) != 0)
if ((ret = mu_message_lines (part, &nlines)) != 0)
{
fprintf (stderr, "message_lines - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_lines - %s\n", mu_strerror (ret));
exit (2);
}
if ((ret = message_get_header (part, &hdr)) != 0)
if ((ret = mu_message_get_header (part, &hdr)) != 0)
{
fprintf (stderr, "message_get_header - %s\n", mu_strerror (ret));
fprintf (stderr, "mu_message_get_header - %s\n", mu_strerror (ret));
exit (2);
}
mu_header_get_value (hdr, MU_HEADER_CONTENT_TYPE, type, sizeof (type),
......@@ -220,19 +220,19 @@ message_display_parts (message_t msg, int indent)
ismulti = 0;
if ((type[0]
&& strncasecmp (type, "message/rfc822", strlen (type)) == 0)
|| (message_is_multipart (part, &ismulti) == 0 && ismulti))
|| (mu_message_is_multipart (part, &ismulti) == 0 && ismulti))
{
if (!ismulti)
{
ret = message_unencapsulate (part, &part, NULL);
ret = mu_message_unencapsulate (part, &part, NULL);
if (ret != 0)
fprintf (stderr, "message_unencapsulate - %s\n",
fprintf (stderr, "mu_message_unencapsulate - %s\n",
mu_strerror (ret));
break;
}
if ((ret = message_get_header (part, &hdr)) != 0)
if ((ret = mu_message_get_header (part, &hdr)) != 0)
{
fprintf (stderr, "message_get_header - %s\n",
fprintf (stderr, "mu_message_get_header - %s\n",
mu_strerror (ret));
exit (2);
}
......@@ -242,14 +242,14 @@ message_display_parts (message_t msg, int indent)
printf ("%*.*sEncapsulated message : %s\t%s\n",
indent, indent, "", from, subject);
printf ("%*.*sBegin\n", indent, indent, "");
if ((ret = message_get_num_parts (part, &nsubparts)) != 0)
if ((ret = mu_message_get_num_parts (part, &nsubparts)) != 0)
{
fprintf (stderr, "mime_get_num_parts - %s\n",
fprintf (stderr, "mu_mime_get_num_parts - %s\n",
mu_strerror (ret));
exit (2);
}
message_display_parts (part, indent+indent_level);
message_destroy (&part, NULL);
mu_message_destroy (&part, NULL);
}
else if (type[0] == '\0'
|| (strncasecmp (type, "text/plain", strlen ("text/plain")) ==
......@@ -259,23 +259,23 @@ message_display_parts (message_t msg, int indent)
{
printf ("%*.*sText Message\n", indent, indent, "");
printf ("%*.*sBegin\n", indent, indent, "");
message_get_body (part, &body);
mu_message_get_body (part, &body);
mu_body_get_stream (body, &str);
mu_filter_create (&str, str, encoding, 0, 0);
offset = 0;
while (stream_readline (str, buf, sizeof (buf), offset, &nbytes) ==
while (mu_stream_readline (str, buf, sizeof (buf), offset, &nbytes) ==
0 && nbytes)
{
printf ("%*.*s%s", indent, indent, "", buf);
offset += nbytes;
}
stream_destroy (&str, NULL);
mu_stream_destroy (&str, NULL);
}
else
{
/* Save the attachements. */
char *fname = NULL;
message_aget_attachment_name (part, &fname);
mu_message_aget_attachment_name (part, &fname);
if (fname == NULL)
fname = mu_tempname (NULL);
......@@ -283,7 +283,7 @@ message_display_parts (message_t msg, int indent)
fname);
printf ("%*.*sBegin\n", indent, indent, "");
/*FIXME: What is the 'data' argument for? */
message_save_attachment (part, NULL, NULL);
mu_message_save_attachment (part, NULL, NULL);
if (print_attachments)
print_file (fname, indent);
free (fname);
......
......@@ -63,11 +63,11 @@ main (int argc, char *argv[])
char *optmailer = "sendmail:";
char *optfrom = 0;
stream_t in = 0;
message_t msg = 0;
mailer_t mailer = 0;
address_t from = 0;
address_t to = 0;
mu_stream_t in = 0;
mu_message_t msg = 0;
mu_mailer_t mailer = 0;
mu_address_t from = 0;
mu_address_t to = 0;
while ((opt = getopt (argc, argv, "hdm:f:")) != -1)
{
......@@ -96,8 +96,8 @@ main (int argc, char *argv[])
}
/* Register mailers. */
registrar_record (smtp_record);
registrar_record (sendmail_record);
mu_registrar_record (mu_smtp_record);
mu_registrar_record (mu_sendmail_record);
if (optfrom)
{
......@@ -111,22 +111,22 @@ main (int argc, char *argv[])
C (mu_address_createv (&to, (const char **) av, -1));
}
C (stdio_stream_create (&in, stdin, MU_STREAM_SEEKABLE));
C (stream_open (in));
C (message_create (&msg, NULL));
C (message_set_stream (msg, in, NULL));
C (mailer_create (&mailer, optmailer));
C (mu_stdio_stream_create (&in, stdin, MU_STREAM_SEEKABLE));
C (mu_stream_open (in));
C (mu_message_create (&msg, NULL));
C (mu_message_set_stream (msg, in, NULL));
C (mu_mailer_create (&mailer, optmailer));
if (optdebug)
{
mu_debug_t debug;
mailer_get_debug (mailer, &debug);
mu_mailer_get_debug (mailer, &debug);
mu_debug_set_level (debug, MU_DEBUG_TRACE | MU_DEBUG_PROT);
}
C (mailer_open (mailer, 0));
C (mu_mailer_open (mailer, 0));
C (mailer_send_message (mailer, msg, from, to));
C (mu_mailer_send_message (mailer, msg, from, to));
return 0;
}
......
......@@ -72,7 +72,7 @@ char *from_person = NULL; /* Set the name of the `from' person */
int read_recipients = 0; /* Read the message for recipients */
int dot = 1; /* Message is terminated by a lone dot on a line */
address_t recipients = NULL;
mu_address_t recipients = NULL;
char *progname;
int mta_stdin (int argc, char **argv);
......@@ -251,15 +251,15 @@ make_tmp (FILE *input, const char *from, char **tempfile)
void
register_handlers ()
{
registrar_record (path_record);
registrar_record (sendmail_record);
registrar_record (smtp_record);
mu_registrar_record (mu_path_record);
mu_registrar_record (mu_sendmail_record);
mu_registrar_record (mu_smtp_record);
}
int
add_recipient (const char *name)
{
address_t addr;
mu_address_t addr;
int status;
status = mu_address_create (&addr, name);
......@@ -272,7 +272,7 @@ add_recipient (const char *name)
/* Convert addr to a comma-separated list of email addresses,
suitable as an argument to RCPT TO command */
char *
address_email_string (address_t addr)
address_email_string (mu_address_t addr)
{
size_t count, i, n, length;
char *value, *p;
......@@ -308,11 +308,11 @@ address_email_string (address_t addr)
}
int
mta_send (message_t msg)
mta_send (mu_message_t msg)
{
size_t n;
char buffer[512];
stream_t stream = NULL;
mu_stream_t stream = NULL;
size_t off = 0, line;
char *value;
......@@ -327,10 +327,10 @@ mta_send (message_t msg)
fprintf (diag, "ENVELOPE TO: %s\n", value);
free (value);
message_get_stream (msg, &stream);
mu_message_get_stream (msg, &stream);
line = 0;
fprintf (diag, "%4lu: ", (unsigned long) line);
while (stream_read (stream, buffer, sizeof buffer - 1, off, &n) == 0
while (mu_stream_read (stream, buffer, sizeof buffer - 1, off, &n) == 0
&& n != 0)
{
size_t i;
......@@ -354,13 +354,13 @@ mta_send (message_t msg)
#define SENDER_WARNING "set sender using -f flag"
int
message_finalize (message_t msg, int warn)
message_finalize (mu_message_t msg, int warn)
{
header_t header = NULL;
mu_header_t header = NULL;
int have_to;
char *value = NULL;
message_get_header (msg, &header);
mu_message_get_header (msg, &header);
if (warn && from_person)
{
......@@ -444,8 +444,8 @@ mta_stdin (int argc, char **argv)
{
int c;
char *tempfile;
mailbox_t mbox;
message_t msg = NULL;
mu_mailbox_t mbox;
mu_message_t msg = NULL;
for (c = 0; c < argc; c++)
{
......@@ -550,8 +550,8 @@ smtp (int fd)
int state, c;
char *buf = NULL;
size_t size = 0;
mailbox_t mbox;
message_t msg;
mu_mailbox_t mbox;
mu_message_t msg;
char *tempfile;
in = fdopen (fd, "r");
......
......@@ -30,15 +30,15 @@
#include <mailutils/argcv.h>
static void
read_and_print (stream_t in, stream_t out)
read_and_print (mu_stream_t in, mu_stream_t out)
{
size_t size;
char buffer[128];
while (stream_sequential_readline (in, buffer, sizeof (buffer), &size) == 0
while (mu_stream_sequential_readline (in, buffer, sizeof (buffer), &size) == 0
&& size > 0)
{
stream_sequential_write (out, buffer, size);
mu_stream_sequential_write (out, buffer, size);
}
}
......@@ -46,7 +46,7 @@ int
main (int argc, char *argv[])
{
int rc;
stream_t stream, out;
mu_stream_t stream, out;
int read_stdin = 0;
int i = 1;
char *cmdline;
......@@ -68,13 +68,13 @@ main (int argc, char *argv[])
assert (mu_argcv_string (argc - i, &argv[i], &cmdline) == 0);
if (read_stdin)
{
stream_t in;
assert (stdio_stream_create (&in, stdin, 0) == 0);
assert (stream_open (in) == 0);
rc = filter_prog_stream_create (&stream, cmdline, in);
mu_stream_t in;
assert (mu_stdio_stream_create (&in, stdin, 0) == 0);
assert (mu_stream_open (in) == 0);
rc = mu_filter_prog_stream_create (&stream, cmdline, in);
}
else
rc = prog_stream_create (&stream, cmdline, flags);
rc = mu_prog_stream_create (&stream, cmdline, flags);
if (rc)
{
fprintf (stderr, "%s: cannot create program filter stream: %s\n",
......@@ -82,7 +82,7 @@ main (int argc, char *argv[])
exit (1);
}
rc = stream_open (stream);
rc = mu_stream_open (stream);
if (rc)
{
fprintf (stderr, "%s: cannot open program filter stream: %s\n",
......@@ -90,14 +90,14 @@ main (int argc, char *argv[])
exit (1);
}
assert (stdio_stream_create (&out, stdout, 0) == 0);
assert (mu_stdio_stream_create (&out, stdout, 0) == 0);
assert (rc == 0);
assert (stream_open (out) == 0);
assert (mu_stream_open (out) == 0);
read_and_print (stream, out);
stream_close (stream);
stream_destroy (&stream, stream_get_owner (stream));
stream_close (out);
stream_destroy (&out, stream_get_owner (stream));
mu_stream_close (stream);
mu_stream_destroy (&stream, mu_stream_get_owner (stream));
mu_stream_close (out);
mu_stream_destroy (&out, mu_stream_get_owner (stream));
return 0;
}
......
......@@ -407,7 +407,7 @@ com_mode_reader (char *arg ARG_UNUSED)
int
com_head (char *arg)
{
stream_t stream = NULL;
mu_stream_t stream = NULL;
int status;
/* No space allowed. */
......@@ -426,9 +426,9 @@ com_head (char *arg)
{
size_t n = 0;
char buf[128];
while ((stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
while ((mu_stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
printf ("%s", buf);
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
}
return status;
}
......@@ -436,7 +436,7 @@ com_head (char *arg)
int
com_body (char *arg)
{
stream_t stream = NULL;
mu_stream_t stream = NULL;
int status;
/* No space allowed. */
......@@ -455,9 +455,9 @@ com_body (char *arg)
{
size_t n = 0;
char buf[128];
while ((stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
while ((mu_stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
printf ("%s", buf);
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
}
return status;
}
......@@ -465,7 +465,7 @@ com_body (char *arg)
int
com_article (char *arg)
{
stream_t stream = NULL;
mu_stream_t stream = NULL;
int status;
/* No space allowed. */
......@@ -484,9 +484,9 @@ com_article (char *arg)
{
size_t n = 0;
char buf[128];
while ((stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
while ((mu_stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
printf ("%s", buf);
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
}
return status;
}
......@@ -564,7 +564,7 @@ int com_list (char *arg)
int
com_list_extensions (char *arg ARG_UNUSED)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_nntp_list_extensions (nntp, &iterator);
if (status == 0)
......@@ -585,7 +585,7 @@ com_list_extensions (char *arg ARG_UNUSED)
int
com_list_active (char *arg)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_nntp_list_active (nntp, arg, &iterator);
if (status == 0)
......@@ -616,7 +616,7 @@ com_list_active (char *arg)
int
com_list_active_times (char *arg)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_nntp_list_active_times (nntp, arg, &iterator);
if (status == 0)
......@@ -663,7 +663,7 @@ com_list_active_times (char *arg)
int
com_list_distributions (char *arg ARG_UNUSED)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_nntp_list_distributions (nntp, arg, &iterator);
if (status == 0)
......@@ -697,7 +697,7 @@ com_list_distributions (char *arg ARG_UNUSED)
int
com_list_distrib_pats (char *arg ARG_UNUSED)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_nntp_list_distrib_pats (nntp, &iterator);
if (status == 0)
......@@ -733,7 +733,7 @@ com_list_distrib_pats (char *arg ARG_UNUSED)
int
com_list_newsgroups (char *arg)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_nntp_list_newsgroups (nntp, arg, &iterator);
if (status == 0)
......@@ -797,7 +797,7 @@ com_next (char *arg ARG_UNUSED)
int
com_newgroups (char *arg)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status;
int year, month, day, hour, min, sec, is_gmt;
year = month = day = hour = min = sec = is_gmt = 0;
......@@ -852,7 +852,7 @@ com_newgroups (char *arg)
int
com_newnews (char *arg)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
char *wildmat;
char gmt[4];
int year, month, day, hour, min, sec, is_gmt;
......@@ -953,7 +953,7 @@ com_ihave (char *arg)
int
com_help (char *arg ARG_UNUSED)
{
stream_t stream = NULL;
mu_stream_t stream = NULL;
int status;
status = mu_nntp_help (nntp, &stream);
......@@ -961,9 +961,9 @@ com_help (char *arg ARG_UNUSED)
{
size_t n = 0;
char buf[128];
while ((stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
while ((mu_stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
printf ("%s", buf);
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
}
return status;
}
......@@ -1030,12 +1030,12 @@ com_connect (char *arg)
status = mu_nntp_create (&nntp);
if (status == 0)
{
stream_t tcp;
mu_stream_t tcp;
if (verbose)
com_verbose ("on");
status =
tcp_stream_create (&tcp, host, port,
mu_tcp_stream_create (&tcp, host, port,
MU_STREAM_READ | MU_STREAM_NO_CHECK);
if (status == 0)
{
......
......@@ -42,7 +42,7 @@
#include <mailutils/libsieve.h>
struct val_ctr { /* Data passed to the counter function */
header_t hdr; /* Headers of the current message */
mu_header_t hdr; /* Headers of the current message */
size_t limit; /* Limit for the number of addresses */
size_t count; /* Number of addresses counted so far */
};
......@@ -61,7 +61,7 @@ _count_items (void *item, void *data)
char *name = item;
struct val_ctr *vp = data;
char *val;
address_t addr;
mu_address_t addr;
size_t count = 0;
if (mu_header_aget_value (vp->hdr, name, &val))
......@@ -78,7 +78,7 @@ _count_items (void *item, void *data)
/* Handler for the numaddr test */
static int
numaddr_test (mu_sieve_machine_t mach, list_t args, list_t tags)
numaddr_test (mu_sieve_machine_t mach, mu_list_t args, mu_list_t tags)
{
mu_sieve_value_t *h, *v;
struct val_ctr vc;
......@@ -110,7 +110,7 @@ numaddr_test (mu_sieve_machine_t mach, list_t args, list_t tags)
}
/* Fill in the val_ctr structure */
message_get_header (mu_sieve_get_message (mach), &vc.hdr);
mu_message_get_header (mu_sieve_get_message (mach), &vc.hdr);
vc.count = 0;
vc.limit = v->v.number;
......
......@@ -401,7 +401,7 @@ com_apop (char *arg)
int
com_capa (char *arg ARG_UNUSED)
{
iterator_t iterator = NULL;
mu_iterator_t iterator = NULL;
int status = mu_pop3_capa (pop3, &iterator);
if (status == 0)
......@@ -424,7 +424,7 @@ com_uidl (char *arg)
int status = 0;
if (arg == NULL || *arg == '\0')
{
iterator_t uidl_iterator = NULL;
mu_iterator_t uidl_iterator = NULL;
status = mu_pop3_uidl_all (pop3, &uidl_iterator);
if (status == 0)
{
......@@ -457,7 +457,7 @@ com_list (char *arg)
int status = 0;
if (arg == NULL || *arg == '\0')
{
iterator_t list_iterator;
mu_iterator_t list_iterator;
status = mu_pop3_list_all (pop3, &list_iterator);
if (status == 0)
{
......@@ -597,7 +597,7 @@ com_rset (char *arg ARG_UNUSED)
int
com_top (char *arg)
{
stream_t stream;
mu_stream_t stream;
unsigned int msgno;
unsigned int lines;
char *space;
......@@ -622,9 +622,9 @@ com_top (char *arg)
{
size_t n = 0;
char buf[128];
while ((stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
while ((mu_stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
printf ("%s", buf);
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
}
return status;
}
......@@ -632,7 +632,7 @@ com_top (char *arg)
int
com_retr (char *arg)
{
stream_t stream;
mu_stream_t stream;
unsigned int msgno;
int status;
......@@ -646,9 +646,9 @@ com_retr (char *arg)
{
size_t n = 0;
char buf[128];
while ((stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
while ((mu_stream_readline (stream, buf, sizeof buf, 0, &n) == 0) && n)
printf ("%s", buf);
stream_destroy (&stream, NULL);
mu_stream_destroy (&stream, NULL);
}
return status;
}
......@@ -670,12 +670,12 @@ com_connect (char *arg)
status = mu_pop3_create (&pop3);
if (status == 0)
{
stream_t tcp;
mu_stream_t tcp;
if (verbose)
com_verbose ("on");
status =
tcp_stream_create (&tcp, host, port,
mu_tcp_stream_create (&tcp, host, port,
MU_STREAM_READ | MU_STREAM_NO_CHECK);
if (status == 0)
{
......
......@@ -29,7 +29,7 @@ main (int argc, const char **argv)
{
char *from;
char *subject;
mailbox_t mbox;
mu_mailbox_t mbox;
size_t msgno, total = 0;
int status;
......@@ -54,11 +54,11 @@ main (int argc, const char **argv)
for (msgno = 1; msgno <= total; msgno++)
{
message_t msg;
header_t hdr;
mu_message_t msg;
mu_header_t hdr;
if ((status = mu_mailbox_get_message (mbox, msgno, &msg)) != 0
|| (status = message_get_header (msg, &hdr)) != 0)
|| (status = mu_message_get_header (msg, &hdr)) != 0)
{
mu_error ("Error message: %s", mu_strerror (status));
exit (EXIT_FAILURE);
......
......@@ -28,7 +28,7 @@ main ()
char buffer[1024];
long port = 0;
int len = sizeof (buffer);
url_t u = NULL;
mu_url_t u = NULL;
while (fgets (str, sizeof (str), stdin) != NULL)
{
......@@ -37,13 +37,13 @@ main ()
str[strlen (str) - 1] = '\0'; /* chop newline */
if (strspn (str, " \t") == strlen (str))
continue; /* skip empty lines */
if ((rc = url_create (&u, str)) != 0)
if ((rc = mu_url_create (&u, str)) != 0)
{
fprintf (stderr, "url_create %s ERROR: [%d] %s",
fprintf (stderr, "mu_url_create %s ERROR: [%d] %s",
str, rc, mu_strerror (rc));
exit (1);
}
if ((rc = url_parse (u)) != 0)
if ((rc = mu_url_parse (u)) != 0)
{
printf ("%s => FAILED: [%d] %s\n",
str, rc, mu_strerror (rc));
......@@ -51,31 +51,31 @@ main ()
}
printf ("%s => SUCCESS\n", str);
url_get_scheme (u, buffer, len, NULL);
mu_url_get_scheme (u, buffer, len, NULL);
printf ("\tscheme <%s>\n", buffer);
url_get_user (u, buffer, len, NULL);
mu_url_get_user (u, buffer, len, NULL);
printf ("\tuser <%s>\n", buffer);
url_get_passwd (u, buffer, len, NULL);
mu_url_get_passwd (u, buffer, len, NULL);
printf ("\tpasswd <%s>\n", buffer);
url_get_auth (u, buffer, len, NULL);
mu_url_get_auth (u, buffer, len, NULL);
printf ("\tauth <%s>\n", buffer);
url_get_host (u, buffer, len, NULL);
mu_url_get_host (u, buffer, len, NULL);
printf ("\thost <%s>\n", buffer);
url_get_port (u, &port);
mu_url_get_port (u, &port);
printf ("\tport %ld\n", port);
url_get_path (u, buffer, len, NULL);
mu_url_get_path (u, buffer, len, NULL);
printf ("\tpath <%s>\n", buffer);
url_get_query (u, buffer, len, NULL);
mu_url_get_query (u, buffer, len, NULL);
printf ("\tquery <%s>\n", buffer);
url_destroy (&u);
mu_url_destroy (&u);
}
return 0;
......
......@@ -367,7 +367,7 @@ rfc2047_decode_wrapper (char *buf, size_t buflen)
if (strcmp (charset, "ASCII") == 0)
return strdup (buf);
rc = rfc2047_decode (charset, buf, &tmp);
rc = mu_rfc2047_decode (charset, buf, &tmp);
if (rc)
{
if (frm_debug)
......@@ -381,7 +381,7 @@ rfc2047_decode_wrapper (char *buf, size_t buflen)
/* Retrieve the Personal Name from the header To: or From: */
static int
get_personal (header_t hdr, const char *field, char **personal)
get_personal (mu_header_t hdr, const char *field, char **personal)
{
char *hfield;
int status;
......@@ -389,7 +389,7 @@ get_personal (header_t hdr, const char *field, char **personal)
status = mu_header_aget_value_unfold (hdr, field, &hfield);
if (status == 0)
{
address_t address = NULL;
mu_address_t address = NULL;
char *s;
mu_address_create (&address, hfield);
......@@ -421,7 +421,7 @@ static size_t msg_index; /* Index (1-based) of the current
/* Observable action is being called on discovery of each message. */
/* FIXME: The format of the display is poorly done, please correct. */
static int
action (observer_t o, size_t type)
action (mu_observer_t o, size_t type)
{
int status;
......@@ -429,16 +429,16 @@ action (observer_t o, size_t type)
{
case MU_EVT_MESSAGE_ADD:
{
mailbox_t mbox = observer_get_owner (o);
message_t msg = NULL;
header_t hdr = NULL;
attribute_t attr = NULL;
mu_mailbox_t mbox = mu_observer_get_owner (o);
mu_message_t msg = NULL;
mu_header_t hdr = NULL;
mu_attribute_t attr = NULL;
msg_index++;
mu_mailbox_get_message (mbox, msg_index, &msg);
message_get_attribute (msg, &attr);
message_get_header (msg, &hdr);
mu_message_get_attribute (msg, &attr);
mu_message_get_header (msg, &hdr);
if (!select_message (msg_index, msg))
break;
......@@ -460,7 +460,7 @@ action (observer_t o, size_t type)
format_field ("(none)");
}
if (show_field) /* FIXME: This should be also rfc2047_decode. */
if (show_field) /* FIXME: This should be also mu_rfc2047_decode. */
{
char *hfield;
status = mu_header_aget_value_unfold (hdr, show_field, &hfield);
......@@ -506,16 +506,16 @@ action (observer_t o, size_t type)
}
static void
frm_abort (mailbox_t *mbox)
frm_abort (mu_mailbox_t *mbox)
{
int status;
if ((status = mu_mailbox_close (*mbox)) != 0)
{
url_t url;
mu_url_t url;
mu_error (_("Could not close mailbox `%s': %s"),
url_to_string (url), mu_strerror (status));
mu_url_to_string (url), mu_strerror (status));
exit (3);
}
......@@ -525,7 +525,7 @@ frm_abort (mailbox_t *mbox)
/* Scan the mailbox MAILBOX_NAME using FUN as the selection function.
FUN takes as its argument message number and the message itself
(message_t). It returns non-zero if that message is to be displayed
(mu_message_t). It returns non-zero if that message is to be displayed
and zero otherwise.
Upon finishing scanning, the function places the overall number of
......@@ -534,9 +534,9 @@ frm_abort (mailbox_t *mbox)
void
frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
{
mailbox_t mbox;
mu_mailbox_t mbox;
int status;
url_t url;
mu_url_t url;
status = mu_mailbox_create_default (&mbox, mailbox_name);
if (status != 0)
......@@ -565,37 +565,37 @@ frm_scan (char *mailbox_name, frm_select_t fun, size_t *total)
else if (status != 0)
{
mu_error (_("Could not open mailbox `%s': %s"),
url_to_string (url), mu_strerror (status));
mu_url_to_string (url), mu_strerror (status));
frm_abort (&mbox);
}
else
{
observer_t observer;
observable_t observable;
mu_observer_t observer;
mu_observable_t observable;
select_message = fun;
msg_index = 0;
observer_create (&observer, mbox);
observer_set_action (observer, action, mbox);
mu_observer_create (&observer, mbox);
mu_observer_set_action (observer, action, mbox);
mu_mailbox_get_observable (mbox, &observable);
observable_attach (observable, MU_EVT_MESSAGE_ADD, observer);
mu_observable_attach (observable, MU_EVT_MESSAGE_ADD, observer);
status = mu_mailbox_scan (mbox, 1, total);
if (status != 0)
{
mu_error (_("Could not scan mailbox `%s': %s."),
url_to_string (url), mu_strerror (status));
mu_url_to_string (url), mu_strerror (status));
frm_abort (&mbox);
}
observable_detach (observable, observer);
observer_destroy (&observer, mbox);
mu_observable_detach (observable, observer);
mu_observer_destroy (&observer, mbox);
if ((status = mu_mailbox_close (mbox)) != 0)
{
mu_error (_("Could not close mailbox `%s': %s"),
url_to_string (url), mu_strerror (status));
mu_url_to_string (url), mu_strerror (status));
exit (3);
}
}
......
......@@ -236,13 +236,13 @@ static struct
static int selected;
static int
frm_select (size_t index, message_t msg)
frm_select (size_t index, mu_message_t msg)
{
header_t hdr = NULL;
attribute_t attr = NULL;
mu_header_t hdr = NULL;
mu_attribute_t attr = NULL;
message_get_attribute (msg, &attr);
message_get_header (msg, &hdr);
mu_message_get_attribute (msg, &attr);
mu_message_get_header (msg, &hdr);
if (mu_attribute_is_read (attr))
counter.read++;
......
......@@ -65,7 +65,7 @@
#include <mailutils/mutil.h>
#include <mailutils/mime.h>
typedef int (*frm_select_t) (size_t index, message_t msg);
typedef int (*frm_select_t) (size_t index, mu_message_t msg);
extern char *show_field; /* Show this header field instead of the default
`From: Subject:' pair. -f option */
......
......@@ -80,7 +80,7 @@ static const char *capa[] = {
};
static int
from_select (size_t index, message_t msg)
from_select (size_t index, mu_message_t msg)
{
if (count_only)
return 0;
......@@ -88,9 +88,9 @@ from_select (size_t index, message_t msg)
if (sender_option)
{
int rc = 0;
header_t hdr = NULL;
mu_header_t hdr = NULL;
char *sender;
message_get_header (msg, &hdr);
mu_message_get_header (msg, &hdr);
if (mu_header_aget_value_unfold (hdr, MU_HEADER_FROM, &sender) == 0)
{
......
......@@ -20,7 +20,7 @@
char *temp_filename;
FILE *temp_file;
mailbox_t mbox;
mu_mailbox_t mbox;
void
collect_open_default ()
......@@ -132,7 +132,7 @@ int
collect_output ()
{
size_t i, count = 0;
mailbox_t outbox = NULL;
mu_mailbox_t outbox = NULL;
int saved_umask;
if (!temp_filename)
......@@ -156,11 +156,11 @@ collect_output ()
mu_mailbox_messages_count (mbox, &count);
for (i = 1; i <= count; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mu_message_t msg = NULL;
mu_attribute_t attr = NULL;
mu_mailbox_get_message (mbox, i, &msg);
message_get_attribute (msg, &attr);
mu_message_get_attribute (msg, &attr);
if (!mu_attribute_is_deleted (attr))
{
mu_attribute_set_recent (attr);
......@@ -191,7 +191,7 @@ collect_drop_mailbox ()
}
SCM
guimb_catch_body (void *data, mailbox_t unused)
guimb_catch_body (void *data, mu_mailbox_t unused)
{
struct guimb_data *gd = data;
if (gd->program_file)
......@@ -211,7 +211,7 @@ guimb_catch_handler (void *unused, SCM tag, SCM throw_args)
}
int
guimb_exit (void *unused1, mailbox_t unused2)
guimb_exit (void *unused1, mu_mailbox_t unused2)
{
int rc = collect_output ();
collect_drop_mailbox ();
......
......@@ -51,10 +51,10 @@ extern char *program_file;
extern char *program_expr;
extern char *user_name;
extern char *default_mailbox;
extern mailbox_t mbox;
extern mu_mailbox_t mbox;
extern size_t nmesg;
extern size_t current_mesg_no;
extern message_t current_message;
extern mu_message_t current_message;
extern int debug_guile;
extern char *maildir;
......@@ -74,6 +74,6 @@ struct guimb_data
char *program_expr;
};
SCM guimb_catch_body (void *data, mailbox_t unused);
SCM guimb_catch_body (void *data, mu_mailbox_t unused);
SCM guimb_catch_handler (void *unused, SCM tag, SCM throw_args);
int guimb_exit (void *unused1, mailbox_t unused2);
int guimb_exit (void *unused1, mu_mailbox_t unused2);
......
......@@ -33,18 +33,18 @@ util_error (char *fmt, ...)
char *
util_get_sender (int msgno)
{
header_t header = NULL;
address_t addr = NULL;
message_t msg = NULL;
mu_header_t header = NULL;
mu_address_t addr = NULL;
mu_message_t msg = NULL;
char buffer[512];
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_header (msg, &header);
mu_message_get_header (msg, &header);
if (mu_header_get_value (header, MU_HEADER_FROM, buffer, sizeof (buffer), NULL)
|| mu_address_create (&addr, buffer))
{
envelope_t env = NULL;
message_get_envelope (msg, &env);
mu_envelope_t env = NULL;
mu_message_get_envelope (msg, &env);
if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL)
|| mu_address_create (&addr, buffer))
{
......
......@@ -25,7 +25,7 @@ imap4d_append (struct imap4d_command *command, char *arg)
char *sp;
char *mboxname;
int flags = 0;
mailbox_t dest_mbox = NULL;
mu_mailbox_t dest_mbox = NULL;
int status;
mboxname = util_getword (arg, &sp);
......@@ -62,40 +62,40 @@ imap4d_append (struct imap4d_command *command, char *arg)
}
static int
_append_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
_append_date (mu_envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
{
message_t msg = mu_envelope_get_owner (envelope);
struct tm **tm = message_get_owner (msg);
mu_message_t msg = mu_envelope_get_owner (envelope);
struct tm **tm = mu_message_get_owner (msg);
strftime (buf, len, "%a %b %d %H:%M:%S %Y", *tm);
return 0;
}
static int
_append_sender (envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
_append_sender (mu_envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
{
strncpy (buf, "GNU-imap4d", len);
return 0;
}
int
imap4d_append0 (mailbox_t mbox, int flags, char *text)
imap4d_append0 (mu_mailbox_t mbox, int flags, char *text)
{
stream_t stream;
mu_stream_t stream;
int rc = 0;
size_t len = 0;
message_t msg = 0;
mu_message_t msg = 0;
struct tm *tm;
time_t t;
envelope_t env;
mu_envelope_t env;
if (message_create (&msg, &tm))
if (mu_message_create (&msg, &tm))
return 1;
if (memory_stream_create (&stream, 0, MU_STREAM_RDWR)
|| stream_open (stream))
if (mu_memory_stream_create (&stream, 0, MU_STREAM_RDWR)
|| mu_stream_open (stream))
{
message_destroy (&msg, &tm);
mu_message_destroy (&msg, &tm);
return 1;
}
......@@ -116,25 +116,25 @@ imap4d_append0 (mailbox_t mbox, int flags, char *text)
}
tm = gmtime(&t);
stream_write (stream, text, strlen (text), len, &len);
message_set_stream (msg, stream, &tm);
mu_stream_write (stream, text, strlen (text), len, &len);
mu_message_set_stream (msg, stream, &tm);
mu_envelope_create (&env, msg);
mu_envelope_set_date (env, _append_date, msg);
mu_envelope_set_sender (env, _append_sender, msg);
message_set_envelope (msg, env, &tm);
mu_message_set_envelope (msg, env, &tm);
rc = mu_mailbox_append_message (mbox, msg);
if (rc == 0 && flags)
{
size_t num = 0;
attribute_t attr = NULL;
mu_attribute_t attr = NULL;
mu_mailbox_messages_count (mbox, &num);
mu_mailbox_get_message (mbox, num, &msg);
message_get_attribute (msg, &attr);
mu_message_get_attribute (msg, &attr);
mu_attribute_set_flags (attr, flags);
}
message_destroy (&msg, &tm);
mu_message_destroy (&msg, &tm);
return rc;
}
......
......@@ -29,7 +29,7 @@ static Gsasl_session_ctx *sess_ctx;
static void auth_gsasl_capa_init (int disable);
static int
create_gsasl_stream (stream_t *newstr, stream_t transport, int flags)
create_gsasl_stream (mu_stream_t *newstr, mu_stream_t transport, int flags)
{
int rc;
......@@ -41,10 +41,10 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags)
return RESP_NO;
}
if ((rc = stream_open (*newstr)) != 0)
if ((rc = mu_stream_open (*newstr)) != 0)
{
const char *p;
if (stream_strerror (*newstr, &p))
if (mu_stream_strerror (*newstr, &p))
p = mu_strerror (rc);
syslog (LOG_ERR, _("cannot open SASL input stream: %s"), p);
return RESP_NO;
......@@ -56,7 +56,7 @@ create_gsasl_stream (stream_t *newstr, stream_t transport, int flags)
int
gsasl_replace_streams (void *self, void *data)
{
stream_t *s = data;
mu_stream_t *s = data;
util_set_input (s[0]);
util_set_output (s[1]);
......@@ -122,8 +122,8 @@ auth_gsasl (struct imap4d_command *command,
if (sess_ctx)
{
stream_t tmp, new_in, new_out;
stream_t *s;
mu_stream_t tmp, new_in, new_out;
mu_stream_t *s;
util_get_input (&tmp);
if (create_gsasl_stream (&new_in, tmp, MU_STREAM_READ))
......@@ -131,11 +131,11 @@ auth_gsasl (struct imap4d_command *command,
util_get_output (&tmp);
if (create_gsasl_stream (&new_out, tmp, MU_STREAM_WRITE))
{
stream_destroy (&new_in, stream_get_owner (new_in));
mu_stream_destroy (&new_in, mu_stream_get_owner (new_in));
return RESP_NO;
}
s = calloc (2, sizeof (stream_t));
s = calloc (2, sizeof (mu_stream_t));
s[0] = new_in;
s[1] = new_out;
util_register_event (STATE_NONAUTH, STATE_AUTH,
......
......@@ -23,7 +23,7 @@ struct imap_auth {
imap4d_auth_handler_fp handler;
};
static list_t imap_auth_list;
static mu_list_t imap_auth_list;
static int
comp (const void *item, const void *data)
......
......@@ -18,7 +18,7 @@
#include "imap4d.h"
static list_t capa_list;
static mu_list_t capa_list;
static int
comp (const void *item, const void *data)
......
......@@ -51,7 +51,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
char *sp = NULL;
size_t *set = NULL;
int n = 0;
mailbox_t cmbox = NULL;
mu_mailbox_t cmbox = NULL;
msgset = util_getword (arg, &sp);
name = util_getword (NULL, &sp);
......@@ -91,7 +91,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
size_t i;
for (i = 0; i < n; i++)
{
message_t msg = NULL;
mu_message_t msg = NULL;
size_t msgno = (isuid) ? uid_to_msgno (set[i]) : set[i];
if (msgno && mu_mailbox_get_message (mbox, msgno, &msg) == 0)
mu_mailbox_append_message (cmbox, msg);
......
......@@ -22,7 +22,7 @@
# include <mailutils/gsasl.h>
#endif
mailbox_t mbox;
mu_mailbox_t mbox;
char *homedir;
int state = STATE_NONAUTH;
int debug_mode = 0;
......
......@@ -154,7 +154,7 @@ struct imap4d_command
#define IMAP_CAPA_XTLSREQUIRED "XTLSREQUIRED"
extern struct imap4d_command imap4d_command_table[];
extern mailbox_t mbox;
extern mu_mailbox_t mbox;
extern char *homedir;
extern char *rootdir;
extern int state;
......@@ -172,7 +172,7 @@ extern char *strtok_r (char *s, const char *delim, char **save_ptr);
/* Imap4 commands */
extern int imap4d_append (struct imap4d_command *, char *);
extern int imap4d_append0 (mailbox_t mbox, int flags, char *text);
extern int imap4d_append0 (mu_mailbox_t mbox, int flags, char *text);
extern int imap4d_authenticate (struct imap4d_command *, char *);
extern void imap4d_auth_capability (void);
extern int imap4d_capability (struct imap4d_command *, char *);
......@@ -212,13 +212,13 @@ extern int imap4d_version (struct imap4d_command *, char *);
extern int imap4d_idle (struct imap4d_command *, char *);
/* Shared between fetch and store */
extern void fetch_flags0 (const char *prefix, message_t msg, int isuid);
extern void fetch_flags0 (const char *prefix, mu_message_t msg, int isuid);
/* Synchronisation on simultaneous access. */
extern int imap4d_sync (void);
extern int imap4d_sync_flags (size_t);
extern size_t uid_to_msgno (size_t);
extern void imap4d_set_observer (mailbox_t mbox);
extern void imap4d_set_observer (mu_mailbox_t mbox);
/* Signal handling. */
extern RETSIGTYPE imap4d_sigchld (int);
......@@ -277,18 +277,18 @@ extern char *util_localname (void);
extern int util_wcard_match (const char *string, const char *pattern,
const char *delim);
void util_print_flags (attribute_t attr);
void util_print_flags (mu_attribute_t attr);
int util_attribute_to_type (const char *item, int *type);
int util_type_to_attribute (int type, char **attr_str);
int util_attribute_matches_flag (attribute_t attr, const char *item);
int util_uidvalidity (mailbox_t smbox, unsigned long *uidvp);
int util_attribute_matches_flag (mu_attribute_t attr, const char *item);
int util_uidvalidity (mu_mailbox_t smbox, unsigned long *uidvp);
void util_setio (FILE*, FILE*);
void util_flush_output (void);
void util_get_input (stream_t *pstr);
void util_get_output (stream_t *pstr);
void util_set_input (stream_t str);
void util_set_output (stream_t str);
void util_get_input (mu_stream_t *pstr);
void util_get_output (mu_stream_t *pstr);
void util_set_input (mu_stream_t str);
void util_set_output (mu_stream_t str);
int util_wait_input (int);
void util_register_event (int old_state, int new_state,
......
......@@ -68,8 +68,8 @@ imap4d_rename (struct imap4d_command *command, char *arg)
leaving INBOX empty. */
if (strcasecmp (oldname, "INBOX") == 0)
{
mailbox_t newmbox = NULL;
mailbox_t inbox = NULL;
mu_mailbox_t newmbox = NULL;
mu_mailbox_t inbox = NULL;
char *name;
if (S_ISDIR(newst.st_mode))
......@@ -97,12 +97,12 @@ imap4d_rename (struct imap4d_command *command, char *arg)
mu_mailbox_messages_count (inbox, &total);
for (no = 1; no <= total; no++)
{
message_t message;
mu_message_t message;
if (mu_mailbox_get_message (inbox, no, &message) == 0)
{
attribute_t attr = NULL;
mu_attribute_t attr = NULL;
mu_mailbox_append_message (newmbox, message);
message_get_attribute (message, &attr);
mu_message_get_attribute (message, &attr);
mu_attribute_set_deleted (attr);
}
}
......
......@@ -175,7 +175,7 @@ struct parsebuf
/* Execution time only: */
size_t msgno; /* Number of current message */
message_t msg; /* Current message */
mu_message_t msg; /* Current message */
};
static void put_code (struct parsebuf *pb, inst_t inst);
......@@ -285,7 +285,7 @@ do_search (struct parsebuf *pb)
if (pb->isuid)
{
size_t uid;
message_get_uid (pb->msg, &uid);
mu_message_get_uid (pb->msg, &uid);
util_send (" %d", uid);
}
else
......@@ -662,9 +662,9 @@ static int
_scan_header (struct parsebuf *pb, char *name, char *value)
{
char buffer[512];
header_t header = NULL;
mu_header_t header = NULL;
message_get_header (pb->msg, &header);
mu_message_get_header (pb->msg, &header);
if (!mu_header_get_value (header, name, buffer, sizeof(buffer), NULL))
{
return util_strcasestr (buffer, value) != NULL;
......@@ -677,9 +677,9 @@ static int
_header_date (struct parsebuf *pb, time_t *timep)
{
char buffer[512];
header_t header = NULL;
mu_header_t header = NULL;
message_get_header (pb->msg, &header);
mu_message_get_header (pb->msg, &header);
if (!mu_header_get_value (header, "Date", buffer, sizeof(buffer), NULL)
&& util_parse_822_date (buffer, timep))
return 0;
......@@ -691,11 +691,11 @@ static int
_scan_header_all (struct parsebuf *pb, char *text)
{
char buffer[512];
header_t header = NULL;
mu_header_t header = NULL;
size_t fcount = 0;
int i, rc;
message_get_header (pb->msg, &header);
mu_message_get_header (pb->msg, &header);
mu_header_get_field_count (header, &fcount);
for (i = rc = 0; i < fcount; i++)
{
......@@ -709,21 +709,21 @@ _scan_header_all (struct parsebuf *pb, char *text)
static int
_scan_body (struct parsebuf *pb, char *text)
{
body_t body = NULL;
stream_t stream = NULL;
mu_body_t body = NULL;
mu_stream_t stream = NULL;
size_t size = 0, lines = 0;
char buffer[128];
size_t n = 0;
off_t offset = 0;
int rc;
message_get_body (pb->msg, &body);
mu_message_get_body (pb->msg, &body);
mu_body_size (body, &size);
mu_body_lines (body, &lines);
mu_body_get_stream (body, &stream);
rc = 0;
while (rc == 0
&& stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0
&& mu_stream_read (stream, buffer, sizeof(buffer)-1, offset, &n) == 0
&& n > 0)
{
buffer[n] = 0;
......@@ -791,9 +791,9 @@ cond_before (struct parsebuf *pb)
time_t t = (time_t)_search_arg (pb);
time_t mesg_time;
char buffer[512];
envelope_t env;
mu_envelope_t env;
message_get_envelope (pb->msg, &env);
mu_message_get_envelope (pb->msg, &env);
mu_envelope_date (env, buffer, sizeof (buffer), NULL);
util_parse_ctime_date (buffer, &mesg_time);
_search_push (pb, mesg_time < t);
......@@ -815,11 +815,11 @@ void
cond_from (struct parsebuf *pb)
{
char *s = _search_arg (pb);
envelope_t env;
mu_envelope_t env;
char buffer[512];
int rc = 0;
message_get_envelope (pb->msg, &env);
mu_message_get_envelope (pb->msg, &env);
if (mu_envelope_sender (env, buffer, sizeof (buffer), NULL) == 0)
rc = util_strcasestr (buffer, s) != NULL;
_search_push (pb, _scan_header (pb, "from", s));
......@@ -838,9 +838,9 @@ void
cond_keyword (struct parsebuf *pb)
{
char *s = _search_arg (pb);
attribute_t attr = NULL;
mu_attribute_t attr = NULL;
message_get_attribute (pb->msg, &attr);
mu_message_get_attribute (pb->msg, &attr);
_search_push (pb, util_attribute_matches_flag (attr, s));
}
......@@ -850,7 +850,7 @@ cond_larger (struct parsebuf *pb)
int n = (int) _search_arg (pb);
size_t size = 0;
message_size (pb->msg, &size);
mu_message_size (pb->msg, &size);
_search_push (pb, size > n);
}
......@@ -860,9 +860,9 @@ cond_on (struct parsebuf *pb)
time_t t = (time_t)_search_arg (pb);
time_t mesg_time;
char buffer[512];
envelope_t env;
mu_envelope_t env;
message_get_envelope (pb->msg, &env);
mu_message_get_envelope (pb->msg, &env);
mu_envelope_date (env, buffer, sizeof (buffer), NULL);
util_parse_ctime_date (buffer, &mesg_time);
_search_push (pb, t <= mesg_time && mesg_time <= t + 86400);
......@@ -904,9 +904,9 @@ cond_since (struct parsebuf *pb)
time_t t = (time_t)_search_arg (pb);
time_t mesg_time;
char buffer[512];
envelope_t env;
mu_envelope_t env;
message_get_envelope (pb->msg, &env);
mu_message_get_envelope (pb->msg, &env);
mu_envelope_date (env, buffer, sizeof (buffer), NULL);
util_parse_ctime_date (buffer, &mesg_time);
_search_push (pb, mesg_time >= t);
......@@ -918,7 +918,7 @@ cond_smaller (struct parsebuf *pb)
int n = (int) _search_arg (pb);
size_t size = 0;
message_size (pb->msg, &size);
mu_message_size (pb->msg, &size);
_search_push (pb, size < n);
}
......@@ -949,7 +949,7 @@ cond_uid (struct parsebuf *pb)
size_t uid = 0;
int i, rc;
message_get_uid (pb->msg, &uid);
mu_message_get_uid (pb->msg, &uid);
for (i = rc = 0; rc == 0 && i < n; i++)
rc = set[i] == uid;
......
......@@ -22,13 +22,13 @@
*
*/
typedef int (*status_funcp) (mailbox_t);
typedef int (*status_funcp) (mu_mailbox_t);
static int status_messages (mailbox_t);
static int status_recent (mailbox_t);
static int status_uidnext (mailbox_t);
static int status_uidvalidity (mailbox_t);
static int status_unseen (mailbox_t);
static int status_messages (mu_mailbox_t);
static int status_recent (mu_mailbox_t);
static int status_uidnext (mu_mailbox_t);
static int status_uidvalidity (mu_mailbox_t);
static int status_unseen (mu_mailbox_t);
struct status_table {
char *name;
......@@ -60,7 +60,7 @@ imap4d_status (struct imap4d_command *command, char *arg)
char *name;
char *mailbox_name;
const char *delim = "/";
mailbox_t smbox = NULL;
mu_mailbox_t smbox = NULL;
int status;
int count = 0;
char *err_msg = NULL;
......@@ -129,7 +129,7 @@ imap4d_status (struct imap4d_command *command, char *arg)
}
static int
status_messages (mailbox_t smbox)
status_messages (mu_mailbox_t smbox)
{
size_t total = 0;
mu_mailbox_messages_count (smbox, &total);
......@@ -138,7 +138,7 @@ status_messages (mailbox_t smbox)
}
static int
status_recent (mailbox_t smbox)
status_recent (mu_mailbox_t smbox)
{
size_t recent = 0;
mu_mailbox_messages_recent (smbox, &recent);
......@@ -147,7 +147,7 @@ status_recent (mailbox_t smbox)
}
static int
status_uidnext (mailbox_t smbox)
status_uidnext (mu_mailbox_t smbox)
{
size_t uidnext = 1;
mu_mailbox_uidnext (smbox, &uidnext);
......@@ -156,7 +156,7 @@ status_uidnext (mailbox_t smbox)
}
static int
status_uidvalidity (mailbox_t smbox)
status_uidvalidity (mu_mailbox_t smbox)
{
unsigned long uidvalidity = 0;
util_uidvalidity (smbox, &uidvalidity);
......@@ -168,7 +168,7 @@ status_uidvalidity (mailbox_t smbox)
number of the first unseen message, the unseeen item in the response the
status command indicates the quantity of unseen messages. */
static int
status_unseen (mailbox_t smbox)
status_unseen (mu_mailbox_t smbox)
{
size_t total = 0;
size_t unseen = 0;
......@@ -176,10 +176,10 @@ status_unseen (mailbox_t smbox)
mu_mailbox_messages_count (smbox, &total);
for (i = 1; i <= total; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mu_message_t msg = NULL;
mu_attribute_t attr = NULL;
mu_mailbox_get_message (smbox, i, &msg);
message_get_attribute (msg, &attr);
mu_message_get_attribute (msg, &attr);
if (!mu_attribute_is_seen (attr) && !mu_attribute_is_read (attr))
unseen++;
}
......
......@@ -101,8 +101,8 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen)
for (i = 0; i < n; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mu_message_t msg = NULL;
mu_attribute_t attr = NULL;
char *items = strdup (sp); /* Don't use the orignal list. */
int first = 1;
size_t msgno;
......@@ -112,7 +112,7 @@ imap4d_store0 (char *arg, int isuid, char *resp, size_t resplen)
if (msgno)
{
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_attribute (msg, &attr);
mu_message_get_attribute (msg, &attr);
/* Get the fetch command names. */
while (*items && *items != ')')
......
......@@ -27,7 +27,7 @@ struct _uid_table
size_t uid;
size_t msgno;
int notify;
attribute_t attr;
mu_attribute_t attr;
};
static struct _uid_table *uid_table;
......@@ -48,13 +48,13 @@ add_flag (char **pbuf, const char *f)
}
static void
notify_flag (size_t msgno, attribute_t oattr)
notify_flag (size_t msgno, mu_attribute_t oattr)
{
message_t msg = NULL;
attribute_t nattr = NULL;
mu_message_t msg = NULL;
mu_attribute_t nattr = NULL;
int status ;
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_attribute (msg, &nattr);
mu_message_get_attribute (msg, &nattr);
status = mu_attribute_is_equal (oattr, nattr);
if (status == 0)
......@@ -186,16 +186,16 @@ reset_uids (void)
mu_mailbox_messages_count (mbox, &total);
for (i = 1; i <= total; i++)
{
message_t msg = NULL;
attribute_t attr = NULL;
mu_message_t msg = NULL;
mu_attribute_t attr = NULL;
size_t uid = 0;
uid_table = realloc (uid_table, sizeof (*uid_table) *
(uid_table_count + 1));
if (!uid_table)
imap4d_bye (ERR_NO_MEM);
mu_mailbox_get_message (mbox, i, &msg);
message_get_attribute (msg, &attr);
message_get_uid (msg, &uid);
mu_message_get_attribute (msg, &attr);
mu_message_get_uid (msg, &uid);
uid_table[uid_table_count].uid = uid;
uid_table[uid_table_count].msgno = i;
uid_table[uid_table_count].notify = 0;
......@@ -227,10 +227,10 @@ notify (void)
for (i = 1; i <= total; i++)
{
message_t msg = NULL;
mu_message_t msg = NULL;
size_t uid = 0;
mu_mailbox_get_message (mbox, i, &msg);
message_get_uid (msg, &uid);
mu_message_get_uid (msg, &uid);
notify_uid (uid);
}
notify_deleted ();
......@@ -263,10 +263,10 @@ imap4d_sync_flags (size_t msgno)
for (i = 0; i < uid_table_count; i++)
if (uid_table[i].msgno == msgno)
{
message_t msg = NULL;
attribute_t attr = NULL;
mu_message_t msg = NULL;
mu_attribute_t attr = NULL;
mu_mailbox_get_message (mbox, msgno, &msg);
message_get_attribute (msg, &attr);
mu_message_get_attribute (msg, &attr);
mu_attribute_copy (uid_table[i].attr, attr);
break;
}
......@@ -276,7 +276,7 @@ imap4d_sync_flags (size_t msgno)
static int mailbox_corrupt;
static int
action (observer_t observer, size_t type)
action (mu_observer_t observer, size_t type)
{
switch (type)
{
......@@ -292,15 +292,15 @@ action (observer_t observer, size_t type)
}
void
imap4d_set_observer (mailbox_t mbox)
imap4d_set_observer (mu_mailbox_t mbox)
{
observer_t observer;
observable_t observable;
mu_observer_t observer;
mu_observable_t observable;
observer_create (&observer, mbox);
observer_set_action (observer, action, mbox);
mu_observer_create (&observer, mbox);
mu_observer_set_action (observer, action, mbox);
mu_mailbox_get_observable (mbox, &observable);
observable_attach (observable, MU_EVT_MAILBOX_CORRUPT|MU_EVT_MAILBOX_DESTROY,
mu_observable_attach (observable, MU_EVT_MAILBOX_CORRUPT|MU_EVT_MAILBOX_DESTROY,
observer);
mailbox_corrupt = 0;
}
......
......@@ -19,8 +19,8 @@
#include "imap4d.h"
static stream_t istream;
static stream_t ostream;
static mu_stream_t istream;
static mu_stream_t ostream;
static int add2set (size_t **, int *, unsigned long);
static const char *sc2string (int);
......@@ -178,9 +178,9 @@ util_msgset (char *s, size_t ** set, int *n, int isuid)
/* If it is a uid sequence, override max with the UID. */
if (isuid)
{
message_t msg = NULL;
mu_message_t msg = NULL;
mu_mailbox_get_message (mbox, max, &msg);
message_get_uid (msg, &max);
mu_message_get_uid (msg, &max);
}
*n = 0;
......@@ -363,7 +363,7 @@ util_send (const char *format, ...)
if (daemon_param.transcript)
syslog (LOG_DEBUG, "sent: %s", buf);
status = stream_sequential_write (ostream, buf, strlen (buf));
status = mu_stream_sequential_write (ostream, buf, strlen (buf));
free (buf);
return status;
......@@ -417,7 +417,7 @@ util_out (int rc, const char *format, ...)
if (daemon_param.transcript)
syslog (LOG_DEBUG, "sent: %s", buf);
status = stream_sequential_write (ostream, buf, strlen (buf));
status = mu_stream_sequential_write (ostream, buf, strlen (buf));
free (buf);
free (tempbuf);
return status;
......@@ -458,9 +458,9 @@ util_finish (struct imap4d_command *command, int rc, const char *format, ...)
if (daemon_param.transcript)
syslog (LOG_DEBUG, "sent: %s\r\n", buf);
stream_sequential_write (ostream, buf, strlen (buf));
mu_stream_sequential_write (ostream, buf, strlen (buf));
free (buf);
stream_sequential_write (ostream, "\r\n", 2);
mu_stream_sequential_write (ostream, "\r\n", 2);
/* Reset the state. */
if (rc == RESP_OK)
......@@ -504,7 +504,7 @@ imap4d_readline (void)
int rc;
alarm (daemon_param.timeout);
rc = stream_sequential_readline (istream, buffer, sizeof (buffer), &sz);
rc = mu_stream_sequential_readline (istream, buffer, sizeof (buffer), &sz);
if (sz == 0)
{
syslog (LOG_INFO, _("Unexpected eof on input"));
......@@ -513,7 +513,7 @@ imap4d_readline (void)
else if (rc)
{
const char *p;
if (stream_strerror (istream, &p))
if (mu_stream_strerror (istream, &p))
p = strerror (errno);
syslog (LOG_INFO, _("Error reading from input file: %s"), p);
......@@ -733,7 +733,7 @@ util_parse_822_date (char *date, time_t * timep)
mu_timezone tz;
const char *p = date;
if (parse822_date_time (&p, date + strlen (date), &tm, &tz) == 0)
if (mu_parse822_date_time (&p, date + strlen (date), &tm, &tz) == 0)
{
*timep = mu_tm2time (&tm, &tz);
return 0;
......@@ -834,7 +834,7 @@ util_type_to_attribute (int type, char **attr_str)
}
void
util_print_flags (attribute_t attr)
util_print_flags (mu_attribute_t attr)
{
int i;
int flags = 0;
......@@ -860,7 +860,7 @@ util_print_flags (attribute_t attr)
}
int
util_attribute_matches_flag (attribute_t attr, const char *item)
util_attribute_matches_flag (mu_attribute_t attr, const char *item)
{
int flags = 0, mask = 0;
......@@ -1084,14 +1084,14 @@ util_wcard_match (const char *string, const char *pattern, const char *delim)
first sees if it is asked to operate upon an already opened mailbox
and if so, returns the previously computed value. */
int
util_uidvalidity (mailbox_t smbox, unsigned long *uidvp)
util_uidvalidity (mu_mailbox_t smbox, unsigned long *uidvp)
{
url_t mbox_url = NULL;
url_t smbox_url = NULL;
mu_url_t mbox_url = NULL;
mu_url_t smbox_url = NULL;
mu_mailbox_get_url (mbox, &mbox_url);
mu_mailbox_get_url (smbox, &smbox_url);
if (strcmp (url_to_string (mbox_url), url_to_string (smbox_url)) == 0)
if (strcmp (mu_url_to_string (mbox_url), mu_url_to_string (smbox_url)) == 0)
smbox = mbox;
return mu_mailbox_uidvalidity (smbox, uidvp);
}
......@@ -1105,31 +1105,31 @@ util_setio (FILE *in, FILE *out)
setvbuf (in, NULL, _IOLBF, 0);
setvbuf (out, NULL, _IOLBF, 0);
if (stdio_stream_create (&istream, in, MU_STREAM_NO_CLOSE)
|| stdio_stream_create (&ostream, out, MU_STREAM_NO_CLOSE))
if (mu_stdio_stream_create (&istream, in, MU_STREAM_NO_CLOSE)
|| mu_stdio_stream_create (&ostream, out, MU_STREAM_NO_CLOSE))
imap4d_bye (ERR_NO_OFILE);
}
void
util_get_input (stream_t *pstr)
util_get_input (mu_stream_t *pstr)
{
*pstr = istream;
}
void
util_get_output (stream_t *pstr)
util_get_output (mu_stream_t *pstr)
{
*pstr = ostream;
}
void
util_set_input (stream_t str)
util_set_input (mu_stream_t str)
{
istream = str;
}
void
util_set_output (stream_t str)
util_set_output (mu_stream_t str)
{
ostream = str;
}
......@@ -1147,7 +1147,7 @@ util_wait_input (int timeout)
tv.tv_sec = timeout;
tv.tv_usec = 0;
status = stream_wait (istream, &wflags, &tv);
status = mu_stream_wait (istream, &wflags, &tv);
if (status)
{
syslog (LOG_ERR, _("Cannot poll input stream: %s"),
......@@ -1160,7 +1160,7 @@ util_wait_input (int timeout)
void
util_flush_output ()
{
stream_flush (ostream);
mu_stream_flush (ostream);
}
int
......@@ -1173,17 +1173,17 @@ util_is_master ()
int
imap4d_init_tls_server ()
{
stream_t stream;
mu_stream_t stream;
int rc;
rc = tls_stream_create (&stream, istream, ostream, 0);
rc = mu_tls_stream_create (&stream, istream, ostream, 0);
if (rc)
return 0;
if (stream_open (stream))
if (mu_stream_open (stream))
{
const char *p;
stream_strerror (stream, &p);
mu_stream_strerror (stream, &p);
syslog (LOG_ERR, _("Cannot open TLS stream: %s"), p);
return 0;
}
......@@ -1193,7 +1193,7 @@ imap4d_init_tls_server ()
}
#endif /* WITH_TLS */
static list_t atexit_list;
static mu_list_t atexit_list;
void
util_atexit (void (*fp) (void))
......@@ -1215,13 +1215,13 @@ util_bye ()
{
int rc = istream != ostream;
stream_close (istream);
stream_destroy (&istream, stream_get_owner (istream));
mu_stream_close (istream);
mu_stream_destroy (&istream, mu_stream_get_owner (istream));
if (rc)
{
stream_close (ostream);
stream_destroy (&ostream, stream_get_owner (ostream));
mu_stream_close (ostream);
mu_stream_destroy (&ostream, mu_stream_get_owner (ostream));
}
mu_list_do (atexit_list, atexit_run, 0);
......@@ -1234,7 +1234,7 @@ struct state_event {
void *data;
};
static list_t event_list;
static mu_list_t event_list;
void
util_register_event (int old_state, int new_state,
......@@ -1274,7 +1274,7 @@ util_run_events (int old_state, int new_state)
if (event_list)
{
struct state_event ev;
iterator_t itr;
mu_iterator_t itr;
ev.old_state = old_state;
ev.new_state = new_state;
......
......@@ -25,52 +25,52 @@
extern "C" {
#endif
extern int mu_address_create (address_t *, const char *);
extern int mu_address_createv (address_t *, const char *v[], size_t);
extern void mu_address_destroy (address_t *);
extern int mu_address_create (mu_address_t *, const char *);
extern int mu_address_createv (mu_address_t *, const char *v[], size_t);
extern void mu_address_destroy (mu_address_t *);
extern address_t mu_address_dup (address_t src);
extern mu_address_t mu_address_dup (mu_address_t src);
/* Set FROM to null, after adding its addresses to TO. */
extern int mu_address_concatenate (address_t to, address_t* from);
extern int mu_address_concatenate (mu_address_t to, mu_address_t* from);
extern int mu_address_get_nth
(address_t addr, size_t no, address_t *pret);
(mu_address_t addr, size_t no, mu_address_t *pret);
extern int mu_address_get_email
(address_t, size_t, char *, size_t, size_t *);
(mu_address_t, size_t, char *, size_t, size_t *);
extern int mu_address_get_local_part
(address_t, size_t, char *, size_t, size_t *);
(mu_address_t, size_t, char *, size_t, size_t *);
extern int mu_address_get_domain
(address_t, size_t, char *, size_t, size_t *);
(mu_address_t, size_t, char *, size_t, size_t *);
extern int mu_address_get_personal
(address_t, size_t, char *, size_t, size_t *);
(mu_address_t, size_t, char *, size_t, size_t *);
extern int mu_address_get_comments
(address_t, size_t, char *, size_t, size_t *);
(mu_address_t, size_t, char *, size_t, size_t *);
extern int mu_address_get_route
(address_t, size_t, char *, size_t, size_t *);
(mu_address_t, size_t, char *, size_t, size_t *);
extern int mu_address_aget_email
(address_t, size_t, char **);
(mu_address_t, size_t, char **);
extern int mu_address_aget_local_part
(address_t addr, size_t no, char **buf);
(mu_address_t addr, size_t no, char **buf);
extern int mu_address_aget_domain
(address_t addr, size_t no, char **buf);
(mu_address_t addr, size_t no, char **buf);
extern int mu_address_aget_personal
(address_t addr, size_t no, char **buf);
(mu_address_t addr, size_t no, char **buf);
extern int mu_address_is_group
(address_t, size_t, int*);
(mu_address_t, size_t, int*);
extern int mu_address_to_string (address_t, char *, size_t, size_t *);
extern int mu_address_get_count (address_t, size_t *);
extern int mu_address_get_group_count (address_t, size_t *);
extern int mu_address_get_email_count (address_t, size_t *);
extern int mu_address_get_unix_mailbox_count (address_t, size_t *);
extern int mu_address_to_string (mu_address_t, char *, size_t, size_t *);
extern int mu_address_get_count (mu_address_t, size_t *);
extern int mu_address_get_group_count (mu_address_t, size_t *);
extern int mu_address_get_email_count (mu_address_t, size_t *);
extern int mu_address_get_unix_mailbox_count (mu_address_t, size_t *);
extern int mu_address_contains_email (address_t addr, const char *email);
extern int mu_address_union (address_t *a, address_t b);
extern int mu_address_contains_email (mu_address_t addr, const char *email);
extern int mu_address_union (mu_address_t *a, mu_address_t b);
extern size_t mu_address_format_string (address_t addr, char *buf, size_t buflen);
extern size_t mu_address_format_string (mu_address_t addr, char *buf, size_t buflen);
#ifdef __cplusplus
}
......
......@@ -45,58 +45,58 @@ extern "C" {
#define MU_ATTRIBUTE_IS_UNREAD(f) \
((f) == 0 || ! ((f) & MU_ATTRIBUTE_READ))
extern int mu_attribute_create (attribute_t *, void *);
extern void mu_attribute_destroy (attribute_t *, void *);
extern void * mu_attribute_get_owner (attribute_t);
extern int mu_attribute_is_modified (attribute_t);
extern int mu_attribute_clear_modified (attribute_t);
extern int mu_attribute_set_modified (attribute_t attr);
extern int mu_attribute_is_userflag (attribute_t, int);
extern int mu_attribute_is_seen (attribute_t);
extern int mu_attribute_is_answered (attribute_t);
extern int mu_attribute_is_flagged (attribute_t);
extern int mu_attribute_is_deleted (attribute_t);
extern int mu_attribute_is_draft (attribute_t);
extern int mu_attribute_is_recent (attribute_t);
extern int mu_attribute_is_read (attribute_t);
extern int mu_attribute_set_userflag (attribute_t, int);
extern int mu_attribute_set_seen (attribute_t);
extern int mu_attribute_set_answered (attribute_t);
extern int mu_attribute_set_flagged (attribute_t);
extern int mu_attribute_set_deleted (attribute_t);
extern int mu_attribute_set_draft (attribute_t);
extern int mu_attribute_set_recent (attribute_t);
extern int mu_attribute_set_read (attribute_t);
extern int mu_attribute_unset_userflag (attribute_t, int);
extern int mu_attribute_unset_seen (attribute_t);
extern int mu_attribute_unset_answered (attribute_t);
extern int mu_attribute_unset_flagged (attribute_t);
extern int mu_attribute_unset_deleted (attribute_t);
extern int mu_attribute_unset_draft (attribute_t);
extern int mu_attribute_unset_recent (attribute_t);
extern int mu_attribute_unset_read (attribute_t);
extern int mu_attribute_get_flags (attribute_t, int *);
extern int mu_attribute_set_flags (attribute_t, int);
extern int mu_attribute_unset_flags (attribute_t, int);
extern int mu_attribute_set_set_flags (attribute_t,
int (*_set_flags) (attribute_t, int),
extern int mu_attribute_create (mu_attribute_t *, void *);
extern void mu_attribute_destroy (mu_attribute_t *, void *);
extern void * mu_attribute_get_owner (mu_attribute_t);
extern int mu_attribute_is_modified (mu_attribute_t);
extern int mu_attribute_clear_modified (mu_attribute_t);
extern int mu_attribute_set_modified (mu_attribute_t attr);
extern int mu_attribute_is_userflag (mu_attribute_t, int);
extern int mu_attribute_is_seen (mu_attribute_t);
extern int mu_attribute_is_answered (mu_attribute_t);
extern int mu_attribute_is_flagged (mu_attribute_t);
extern int mu_attribute_is_deleted (mu_attribute_t);
extern int mu_attribute_is_draft (mu_attribute_t);
extern int mu_attribute_is_recent (mu_attribute_t);
extern int mu_attribute_is_read (mu_attribute_t);
extern int mu_attribute_set_userflag (mu_attribute_t, int);
extern int mu_attribute_set_seen (mu_attribute_t);
extern int mu_attribute_set_answered (mu_attribute_t);
extern int mu_attribute_set_flagged (mu_attribute_t);
extern int mu_attribute_set_deleted (mu_attribute_t);
extern int mu_attribute_set_draft (mu_attribute_t);
extern int mu_attribute_set_recent (mu_attribute_t);
extern int mu_attribute_set_read (mu_attribute_t);
extern int mu_attribute_unset_userflag (mu_attribute_t, int);
extern int mu_attribute_unset_seen (mu_attribute_t);
extern int mu_attribute_unset_answered (mu_attribute_t);
extern int mu_attribute_unset_flagged (mu_attribute_t);
extern int mu_attribute_unset_deleted (mu_attribute_t);
extern int mu_attribute_unset_draft (mu_attribute_t);
extern int mu_attribute_unset_recent (mu_attribute_t);
extern int mu_attribute_unset_read (mu_attribute_t);
extern int mu_attribute_get_flags (mu_attribute_t, int *);
extern int mu_attribute_set_flags (mu_attribute_t, int);
extern int mu_attribute_unset_flags (mu_attribute_t, int);
extern int mu_attribute_set_set_flags (mu_attribute_t,
int (*_set_flags) (mu_attribute_t, int),
void *);
extern int mu_attribute_set_unset_flags (attribute_t,
int (*_unset_flags) (attribute_t, int),
extern int mu_attribute_set_unset_flags (mu_attribute_t,
int (*_unset_flags) (mu_attribute_t, int),
void *);
extern int mu_attribute_set_get_flags (attribute_t,
int (*_get_flags) (attribute_t, int *),
extern int mu_attribute_set_get_flags (mu_attribute_t,
int (*_get_flags) (mu_attribute_t, int *),
void *);
extern int mu_attribute_is_equal (attribute_t, attribute_t att2);
extern int mu_attribute_is_equal (mu_attribute_t, mu_attribute_t att2);
extern int mu_attribute_copy (attribute_t, attribute_t);
extern int mu_attribute_copy (mu_attribute_t, mu_attribute_t);
extern int mu_attribute_to_string (attribute_t, char *, size_t, size_t *);
extern int mu_attribute_to_string (mu_attribute_t, char *, size_t, size_t *);
extern int mu_string_to_flags (const char *, int *);
#ifdef __cplusplus
......
......@@ -25,36 +25,36 @@
extern "C" {
#endif
extern int mu_ticket_create (ticket_t *, void *owner);
extern void mu_ticket_destroy (ticket_t *, void *owner);
extern int mu_ticket_set_destroy (ticket_t, void (*) (ticket_t), void *);
extern void *mu_ticket_get_owner (ticket_t);
extern int mu_ticket_set_pop (ticket_t,
int (*_pop) (ticket_t, url_t, const char *, char **), void *);
extern int mu_ticket_pop (ticket_t, url_t, const char *, char **);
extern int mu_ticket_set_data (ticket_t, void *, void *owner);
extern int mu_ticket_get_data (ticket_t, void **);
extern int mu_authority_create (authority_t *, ticket_t, void *);
extern void mu_authority_destroy (authority_t *, void *);
extern void *mu_authority_get_owner (authority_t);
extern int mu_authority_set_ticket (authority_t, ticket_t);
extern int mu_authority_get_ticket (authority_t, ticket_t *);
extern int mu_authority_authenticate (authority_t);
extern int mu_authority_set_authenticate (authority_t,
int (*_authenticate) (authority_t), void *);
extern int mu_authority_create_null (authority_t *pauthority, void *owner);
extern int mu_wicket_create (wicket_t *, const char *);
extern void mu_wicket_destroy (wicket_t *);
extern int mu_wicket_set_filename (wicket_t, const char *);
extern int mu_wicket_get_filename (wicket_t, char *, size_t, size_t *);
extern int mu_wicket_set_ticket (wicket_t,
int (*) (wicket_t, const char *,
const char *, ticket_t *));
extern int mu_wicket_get_ticket (wicket_t, ticket_t *, const char *, const char *);
extern int mu_ticket_create (mu_ticket_t *, void *owner);
extern void mu_ticket_destroy (mu_ticket_t *, void *owner);
extern int mu_ticket_set_destroy (mu_ticket_t, void (*) (mu_ticket_t), void *);
extern void *mu_ticket_get_owner (mu_ticket_t);
extern int mu_ticket_set_pop (mu_ticket_t,
int (*_pop) (mu_ticket_t, mu_url_t, const char *, char **), void *);
extern int mu_ticket_pop (mu_ticket_t, mu_url_t, const char *, char **);
extern int mu_ticket_set_data (mu_ticket_t, void *, void *owner);
extern int mu_ticket_get_data (mu_ticket_t, void **);
extern int mu_authority_create (mu_authority_t *, mu_ticket_t, void *);
extern void mu_authority_destroy (mu_authority_t *, void *);
extern void *mu_authority_get_owner (mu_authority_t);
extern int mu_authority_set_ticket (mu_authority_t, mu_ticket_t);
extern int mu_authority_get_ticket (mu_authority_t, mu_ticket_t *);
extern int mu_authority_authenticate (mu_authority_t);
extern int mu_authority_set_authenticate (mu_authority_t,
int (*_authenticate) (mu_authority_t), void *);
extern int mu_authority_create_null (mu_authority_t *pauthority, void *owner);
extern int mu_wicket_create (mu_wicket_t *, const char *);
extern void mu_wicket_destroy (mu_wicket_t *);
extern int mu_wicket_set_filename (mu_wicket_t, const char *);
extern int mu_wicket_get_filename (mu_wicket_t, char *, size_t, size_t *);
extern int mu_wicket_set_ticket (mu_wicket_t,
int (*) (mu_wicket_t, const char *,
const char *, mu_ticket_t *));
extern int mu_wicket_get_ticket (mu_wicket_t, mu_ticket_t *, const char *, const char *);
#ifdef __cplusplus
}
......
......@@ -25,23 +25,23 @@
extern "C" {
#endif
extern int mu_body_create (body_t *, void *owner);
extern void mu_body_destroy (body_t *, void *owner);
extern void * mu_body_get_owner (body_t);
extern int mu_body_is_modified (body_t);
extern int mu_body_clear_modified (body_t);
extern int mu_body_get_stream (body_t, stream_t *);
extern int mu_body_set_stream (body_t, stream_t, void *owner);
extern int mu_body_get_filename (body_t, char *, size_t, size_t *);
extern int mu_body_size (body_t, size_t*);
extern int mu_body_set_size (body_t,
int (*_size) (body_t, size_t*), void *owner);
extern int mu_body_lines (body_t, size_t *);
extern int mu_body_set_lines (body_t,
int (*_lines) (body_t, size_t*), void *owner);
extern int mu_body_create (mu_body_t *, void *owner);
extern void mu_body_destroy (mu_body_t *, void *owner);
extern void * mu_body_get_owner (mu_body_t);
extern int mu_body_is_modified (mu_body_t);
extern int mu_body_clear_modified (mu_body_t);
extern int mu_body_get_stream (mu_body_t, mu_stream_t *);
extern int mu_body_set_stream (mu_body_t, mu_stream_t, void *owner);
extern int mu_body_get_filename (mu_body_t, char *, size_t, size_t *);
extern int mu_body_size (mu_body_t, size_t*);
extern int mu_body_set_size (mu_body_t,
int (*_size) (mu_body_t, size_t*), void *owner);
extern int mu_body_lines (mu_body_t, size_t *);
extern int mu_body_set_lines (mu_body_t,
int (*_lines) (mu_body_t, size_t*), void *owner);
#ifdef __cplusplus
}
......
......@@ -25,17 +25,17 @@
extern "C" { /*}*/
#endif
int mu_envelope_create (envelope_t *, void *);
void mu_envelope_destroy (envelope_t *, void *);
void * mu_envelope_get_owner (envelope_t);
int mu_envelope_set_sender (envelope_t,
int (*_sender) (envelope_t, char *, size_t, size_t*),
int mu_envelope_create (mu_envelope_t *, void *);
void mu_envelope_destroy (mu_envelope_t *, void *);
void * mu_envelope_get_owner (mu_envelope_t);
int mu_envelope_set_sender (mu_envelope_t,
int (*_sender) (mu_envelope_t, char *, size_t, size_t*),
void *);
int mu_envelope_sender (envelope_t, char *, size_t, size_t *);
int mu_envelope_set_date (envelope_t,
int (*_date) (envelope_t, char *, size_t , size_t *),
int mu_envelope_sender (mu_envelope_t, char *, size_t, size_t *);
int mu_envelope_set_date (mu_envelope_t,
int (*_date) (mu_envelope_t, char *, size_t , size_t *),
void *);
int mu_envelope_date (envelope_t, char *, size_t, size_t *);
int mu_envelope_date (mu_envelope_t, char *, size_t, size_t *);
#ifdef __cplusplus
}
......
......@@ -37,26 +37,26 @@ extern "C" {
struct mu_filter_record
{
const char *name;
int (*_filter) (filter_t);
int (*_filter) (mu_filter_t);
void *data;
/* Stub function return the fields. */
int (*_is_filter) (filter_record_t, const char *);
int (*_get_filter) (filter_record_t, int (*(*_filter)) (filter_t));
int (*_is_filter) (mu_filter_record_t, const char *);
int (*_get_filter) (mu_filter_record_t, int (*(*_filter)) (mu_filter_t));
};
extern int mu_filter_create (stream_t *, stream_t, const char*, int, int);
extern int mu_filter_get_list (list_t *);
extern int mu_filter_create (mu_stream_t *, mu_stream_t, const char*, int, int);
extern int mu_filter_get_list (mu_list_t *);
/* List of defaults. */
extern filter_record_t mu_rfc822_filter;
extern filter_record_t mu_qp_filter; /* quoted-printable. */
extern filter_record_t mu_base64_filter;
extern filter_record_t mu_binary_filter;
extern filter_record_t mu_bit8_filter;
extern filter_record_t mu_bit7_filter;
extern filter_record_t mu_rfc_2047_Q_filter;
extern mu_filter_record_t mu_rfc822_filter;
extern mu_filter_record_t mu_qp_filter; /* quoted-printable. */
extern mu_filter_record_t mu_base64_filter;
extern mu_filter_record_t mu_binary_filter;
extern mu_filter_record_t mu_bit8_filter;
extern mu_filter_record_t mu_bit7_filter;
extern mu_filter_record_t mu_rfc_2047_Q_filter;
enum mu_iconv_fallback_mode {
mu_fallback_none,
......@@ -64,7 +64,7 @@ enum mu_iconv_fallback_mode {
mu_fallback_copy_octal
};
extern int mu_filter_iconv_create (stream_t *s, stream_t transport,
extern int mu_filter_iconv_create (mu_stream_t *s, mu_stream_t transport,
const char *fromcode, const char *tocode,
int flags,
enum mu_iconv_fallback_mode fallback_mode);
......
......@@ -39,44 +39,44 @@ struct mu_folder_list
};
/* Constructor/destructor and possible types. */
extern int mu_folder_create (folder_t *, const char *);
extern void mu_folder_destroy (folder_t *);
extern int mu_folder_create (mu_folder_t *, const char *);
extern void mu_folder_destroy (mu_folder_t *);
extern int mu_folder_open (folder_t, int flag);
extern int mu_folder_close (folder_t);
extern int mu_folder_open (mu_folder_t, int flag);
extern int mu_folder_close (mu_folder_t);
extern int mu_folder_delete (folder_t, const char *);
extern int mu_folder_rename (folder_t, const char *, const char *);
extern int mu_folder_subscribe (folder_t, const char *);
extern int mu_folder_unsubscribe (folder_t, const char *);
extern int mu_folder_list (folder_t, const char *, const char *,
extern int mu_folder_delete (mu_folder_t, const char *);
extern int mu_folder_rename (mu_folder_t, const char *, const char *);
extern int mu_folder_subscribe (mu_folder_t, const char *);
extern int mu_folder_unsubscribe (mu_folder_t, const char *);
extern int mu_folder_list (mu_folder_t, const char *, const char *,
struct mu_folder_list *);
extern int mu_folder_lsub (folder_t, const char *, const char *,
extern int mu_folder_lsub (mu_folder_t, const char *, const char *,
struct mu_folder_list *);
extern int mu_folder_list_destroy (struct mu_folder_list *);
/* Stream settings. */
extern int mu_folder_get_stream (folder_t, stream_t *);
extern int mu_folder_set_stream (folder_t, stream_t);
extern int mu_folder_get_stream (mu_folder_t, mu_stream_t *);
extern int mu_folder_set_stream (mu_folder_t, mu_stream_t);
/* Notifications. */
extern int mu_folder_get_observable (folder_t, observable_t *);
extern int mu_folder_get_observable (mu_folder_t, mu_observable_t *);
/* Debug. */
extern int mu_folder_has_debug (folder_t folder);
extern int mu_folder_get_debug (folder_t, mu_debug_t *);
extern int mu_folder_set_debug (folder_t, mu_debug_t);
extern int mu_folder_has_debug (mu_folder_t folder);
extern int mu_folder_get_debug (mu_folder_t, mu_debug_t *);
extern int mu_folder_set_debug (mu_folder_t, mu_debug_t);
/* Authentication. */
extern int mu_folder_get_authority (folder_t, authority_t *);
extern int mu_folder_set_authority (folder_t, authority_t);
extern int mu_folder_get_authority (mu_folder_t, mu_authority_t *);
extern int mu_folder_set_authority (mu_folder_t, mu_authority_t);
/* URL. */
extern int mu_folder_get_url (folder_t, url_t *);
extern int mu_folder_set_url (folder_t, url_t);
extern int mu_folder_get_url (mu_folder_t, mu_url_t *);
extern int mu_folder_set_url (mu_folder_t, mu_url_t);
/* FIXME: not implemented */
extern int mu_folder_decrement (folder_t);
extern int mu_folder_decrement (mu_folder_t);
#ifdef __cplusplus
......
......@@ -21,7 +21,7 @@
#include <gsasl.h>
int mu_gsasl_stream_create (stream_t *stream, stream_t transport,
int mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport,
Gsasl_session_ctx *ctx,
int flags);
......
......@@ -45,13 +45,13 @@ extern SCM scm_long2num (long val);
typedef struct
{
int debug_guile;
mailbox_t mbox;
mu_mailbox_t mbox;
char *user_name;
int (*init) (void *data);
SCM (*catch_body) (void *data, mailbox_t mbox);
SCM (*catch_body) (void *data, mu_mailbox_t mbox);
SCM (*catch_handler) (void *data, SCM tag, SCM throw_args);
int (*next) (void *data, mailbox_t mbox);
int (*exit) (void *data, mailbox_t mbox);
int (*next) (void *data, mu_mailbox_t mbox);
int (*exit) (void *data, mu_mailbox_t mbox);
void *data;
} mu_guimb_param_t;
......@@ -64,23 +64,23 @@ extern void mu_set_variable (const char *name, SCM value);
extern void mu_scm_init (void);
extern void mu_scm_mailbox_init (void);
extern SCM mu_scm_mailbox_create (mailbox_t mbox);
extern SCM mu_scm_mailbox_create (mu_mailbox_t mbox);
extern int mu_scm_is_mailbox (SCM scm);
extern void mu_scm_message_init (void);
extern SCM mu_scm_message_create (SCM owner, message_t msg);
extern SCM mu_scm_message_create (SCM owner, mu_message_t msg);
extern int mu_scm_is_message (SCM scm);
extern const message_t mu_scm_message_get (SCM MESG);
extern const mu_message_t mu_scm_message_get (SCM MESG);
extern int mu_scm_is_body (SCM scm);
extern void mu_scm_body_init (void);
extern SCM mu_scm_body_create (SCM mesg, body_t body);
extern SCM mu_scm_body_create (SCM mesg, mu_body_t body);
extern void mu_scm_address_init (void);
extern void mu_scm_logger_init (void);
extern void mu_scm_port_init (void);
extern SCM mu_port_make_from_stream (SCM msg, stream_t stream, long mode);
extern SCM mu_port_make_from_stream (SCM msg, mu_stream_t stream, long mode);
extern void mu_scm_mime_init (void);
extern void mu_scm_message_add_owner (SCM MESG, SCM owner);
......
......@@ -72,65 +72,65 @@ extern "C" {
/* Mime support header attribute */
extern int mu_header_create (header_t *, const char *, size_t, void *);
extern void mu_header_destroy (header_t *, void *);
extern void *mu_header_get_owner (header_t);
extern int mu_header_create (mu_header_t *, const char *, size_t, void *);
extern void mu_header_destroy (mu_header_t *, void *);
extern void *mu_header_get_owner (mu_header_t);
extern int mu_header_is_modified (header_t);
extern int mu_header_clear_modified (header_t);
extern int mu_header_is_modified (mu_header_t);
extern int mu_header_clear_modified (mu_header_t);
/* Set and get field values by field name. */
extern int mu_header_set_value (header_t, const char *, const char *, int);
extern int mu_header_get_value (header_t, const char *, char *, size_t, size_t *);
extern int mu_header_aget_value (header_t, const char *, char **);
extern int mu_header_set_value (mu_header_t, const char *, const char *, int);
extern int mu_header_get_value (mu_header_t, const char *, char *, size_t, size_t *);
extern int mu_header_aget_value (mu_header_t, const char *, char **);
/* Get field values as an address_t. */
extern int mu_header_get_address (header_t, const char *, address_t *);
/* Get field values as an mu_address_t. */
extern int mu_header_get_address (mu_header_t, const char *, mu_address_t *);
/* Set and get field values by field index (1-based). */
extern int mu_header_get_field_count (header_t, size_t *count);
extern int mu_header_get_field_value (header_t, size_t index, char *, size_t, size_t *);
extern int mu_header_get_field_name (header_t, size_t index, char *, size_t, size_t *);
extern int mu_header_aget_field_value (header_t, size_t index, char **);
extern int mu_header_aget_field_name (header_t, size_t index, char **);
extern int mu_header_get_field_count (mu_header_t, size_t *count);
extern int mu_header_get_field_value (mu_header_t, size_t index, char *, size_t, size_t *);
extern int mu_header_get_field_name (mu_header_t, size_t index, char *, size_t, size_t *);
extern int mu_header_aget_field_value (mu_header_t, size_t index, char **);
extern int mu_header_aget_field_name (mu_header_t, size_t index, char **);
extern int mu_header_get_value_unfold (header_t header, const char *name,
extern int mu_header_get_value_unfold (mu_header_t header, const char *name,
char *buffer, size_t buflen,
size_t *pn);
extern int mu_header_aget_value_unfold (header_t header, const char *name,
extern int mu_header_aget_value_unfold (mu_header_t header, const char *name,
char **pvalue);
extern int mu_header_get_field_value_unfold (header_t header, size_t num,
extern int mu_header_get_field_value_unfold (mu_header_t header, size_t num,
char *buf, size_t buflen,
size_t *nwritten);
extern int mu_header_aget_field_value_unfold (header_t header, size_t num,
extern int mu_header_aget_field_value_unfold (mu_header_t header, size_t num,
char **pvalue);
extern int mu_header_get_stream (header_t, stream_t *);
extern int mu_header_set_stream (header_t, stream_t, void *);
extern int mu_header_get_stream (mu_header_t, mu_stream_t *);
extern int mu_header_set_stream (mu_header_t, mu_stream_t, void *);
extern int mu_header_size (header_t, size_t *);
extern int mu_header_lines (header_t, size_t *);
extern int mu_header_size (mu_header_t, size_t *);
extern int mu_header_lines (mu_header_t, size_t *);
extern int mu_header_set_set_value (header_t,
int (*_set_value) (header_t, const char *, const char *, int),
extern int mu_header_set_set_value (mu_header_t,
int (*_set_value) (mu_header_t, const char *, const char *, int),
void *);
extern int mu_header_set_get_value (header_t,
int (*_get_value) (header_t, const char *, char *, size_t, size_t *),
extern int mu_header_set_get_value (mu_header_t,
int (*_get_value) (mu_header_t, const char *, char *, size_t, size_t *),
void *);
extern int mu_header_set_get_fvalue (header_t,
int (*_get_value) (header_t, const char *, char *, size_t, size_t *),
extern int mu_header_set_get_fvalue (mu_header_t,
int (*_get_value) (mu_header_t, const char *, char *, size_t, size_t *),
void *);
extern int mu_header_set_size (header_t,
int (*_size) (header_t, size_t *), void *);
extern int mu_header_set_size (mu_header_t,
int (*_size) (mu_header_t, size_t *), void *);
extern int mu_header_set_lines (header_t,
int (*_lines) (header_t, size_t *), void *);
extern int mu_header_set_lines (mu_header_t,
int (*_lines) (mu_header_t, size_t *), void *);
extern int mu_header_set_fill (header_t,
int (*_fill) (header_t, char *, size_t, off_t, size_t *), void *owner);
extern int mu_header_set_fill (mu_header_t,
int (*_fill) (mu_header_t, char *, size_t, off_t, size_t *), void *owner);
#ifdef __cplusplus
......
......@@ -25,29 +25,29 @@
extern "C" {
#endif
extern int mu_iterator_create (iterator_t *, void *);
extern int mu_iterator_dup (iterator_t *piterator, iterator_t orig);
extern void mu_iterator_destroy (iterator_t *);
extern int mu_iterator_first (iterator_t);
extern int mu_iterator_next (iterator_t);
extern int mu_iterator_current (iterator_t, void * const *pitem);
extern int mu_iterator_is_done (iterator_t);
extern int mu_iterator_attach (iterator_t *root, iterator_t iterator);
extern int mu_iterator_detach (iterator_t *root, iterator_t iterator);
extern void mu_iterator_advance (iterator_t iterator, void *e);
extern int mu_iterator_create (mu_iterator_t *, void *);
extern int mu_iterator_dup (mu_iterator_t *piterator, mu_iterator_t orig);
extern void mu_iterator_destroy (mu_iterator_t *);
extern int mu_iterator_first (mu_iterator_t);
extern int mu_iterator_next (mu_iterator_t);
extern int mu_iterator_current (mu_iterator_t, void * const *pitem);
extern int mu_iterator_is_done (mu_iterator_t);
extern int mu_iterator_attach (mu_iterator_t *root, mu_iterator_t iterator);
extern int mu_iterator_detach (mu_iterator_t *root, mu_iterator_t iterator);
extern void mu_iterator_advance (mu_iterator_t iterator, void *e);
extern int mu_iterator_set_first (iterator_t, int (*first) (void *));
extern int mu_iterator_set_next (iterator_t, int (*next) (void *));
extern int mu_iterator_set_getitem (iterator_t,
extern int mu_iterator_set_first (mu_iterator_t, int (*first) (void *));
extern int mu_iterator_set_next (mu_iterator_t, int (*next) (void *));
extern int mu_iterator_set_getitem (mu_iterator_t,
int (*getitem) (void *, void **));
extern int mu_iterator_set_finished_p (iterator_t,
extern int mu_iterator_set_finished_p (mu_iterator_t,
int (*finished_p) (void *));
extern int mu_iterator_set_dup (iterator_t itr,
extern int mu_iterator_set_dup (mu_iterator_t itr,
int (dup) (void **ptr, void *data));
extern int mu_iterator_set_destroy (iterator_t itr,
int (destroy) (iterator_t, void *data));
extern int mu_iterator_set_curitem_p (iterator_t itr,
extern int mu_iterator_set_destroy (mu_iterator_t itr,
int (destroy) (mu_iterator_t, void *data));
extern int mu_iterator_set_curitem_p (mu_iterator_t itr,
int (*curitem_p) (void *, void *));
#ifdef __cplusplus
......
......@@ -38,14 +38,14 @@ typedef struct {
} mu_sieve_locus_t;
typedef int (*mu_sieve_handler_t) (mu_sieve_machine_t mach,
list_t args, list_t tags);
mu_list_t args, mu_list_t tags);
typedef int (*mu_sieve_printf_t) (void *data, const char *fmt, va_list ap);
typedef int (*mu_sieve_parse_error_t) (void *data,
const char *filename, int lineno,
const char *fmt, va_list ap);
typedef void (*mu_sieve_action_log_t) (void *data,
const mu_sieve_locus_t *locus,
size_t msgno, message_t msg,
size_t msgno, mu_message_t msg,
const char *action,
const char *fmt, va_list ap);
......@@ -55,7 +55,7 @@ typedef int (*mu_sieve_comparator_t) (const char *, const char *);
typedef int (*mu_sieve_retrieve_t) (void *item, void *data, int idx, char **pval);
typedef void (*mu_sieve_destructor_t) (void *data);
typedef int (*mu_sieve_tag_checker_t) (const char *name,
list_t tags, list_t args);
mu_list_t tags, mu_list_t args);
typedef enum {
SVT_VOID,
......@@ -75,7 +75,7 @@ typedef struct {
union {
char *string;
size_t number;
list_t list;
mu_list_t list;
mu_sieve_runtime_tag_t *tag;
void *ptr;
} v;
......@@ -118,15 +118,15 @@ typedef struct {
#define MU_SIEVE_DRY_RUN 0x0008
extern int mu_sieve_yydebug;
extern list_t mu_sieve_include_path;
extern list_t mu_sieve_library_path;
extern mu_list_t mu_sieve_include_path;
extern mu_list_t mu_sieve_library_path;
/* Memory allocation functions */
void *mu_sieve_alloc (size_t size);
void *mu_sieve_palloc (list_t *pool, size_t size);
void *mu_sieve_prealloc (list_t *pool, void *ptr, size_t size);
void mu_sieve_pfree (list_t *pool, void *ptr);
char *mu_sieve_pstrdup (list_t *pool, const char *str);
void *mu_sieve_palloc (mu_list_t *pool, size_t size);
void *mu_sieve_prealloc (mu_list_t *pool, void *ptr, size_t size);
void mu_sieve_pfree (mu_list_t *pool, void *ptr);
char *mu_sieve_pstrdup (mu_list_t *pool, const char *str);
void *mu_sieve_malloc (mu_sieve_machine_t mach, size_t size);
char *mu_sieve_mstrdup (mu_sieve_machine_t mach, const char *str);
......@@ -134,7 +134,7 @@ void *mu_sieve_mrealloc (mu_sieve_machine_t mach, void *ptr, size_t size);
void mu_sieve_mfree (mu_sieve_machine_t mach, void *ptr);
mu_sieve_value_t *mu_sieve_value_create (mu_sieve_data_type type, void *data);
void mu_sieve_slist_destroy (list_t *plist);
void mu_sieve_slist_destroy (mu_list_t *plist);
/* Symbol space functions */
mu_sieve_register_t *mu_sieve_test_lookup (mu_sieve_machine_t mach,
......@@ -164,18 +164,18 @@ mu_sieve_comparator_t mu_sieve_comparator_lookup (mu_sieve_machine_t mach,
const char *name,
int matchtype);
mu_sieve_comparator_t mu_sieve_get_comparator (mu_sieve_machine_t mach, list_t tags);
mu_sieve_comparator_t mu_sieve_get_comparator (mu_sieve_machine_t mach, mu_list_t tags);
int mu_sieve_str_to_relcmp (const char *str,
mu_sieve_relcmp_t *test, mu_sieve_relcmpn_t *stest);
mu_sieve_relcmp_t mu_sieve_get_relcmp (mu_sieve_machine_t mach, list_t tags);
mu_sieve_relcmp_t mu_sieve_get_relcmp (mu_sieve_machine_t mach, mu_list_t tags);
void mu_sieve_require (list_t slist);
int mu_sieve_tag_lookup (list_t taglist, char *name, mu_sieve_value_t **arg);
void mu_sieve_require (mu_list_t slist);
int mu_sieve_tag_lookup (mu_list_t taglist, char *name, mu_sieve_value_t **arg);
int mu_sieve_load_ext (mu_sieve_machine_t mach, const char *name);
int mu_sieve_match_part_checker (const char *name, list_t tags, list_t args);
int mu_sieve_match_part_checker (const char *name, mu_list_t tags, mu_list_t args);
/* Operations in value lists */
mu_sieve_value_t *mu_sieve_value_get (list_t vlist, size_t index);
mu_sieve_value_t *mu_sieve_value_get (mu_list_t vlist, size_t index);
int mu_sieve_vlist_do (mu_sieve_value_t *val, mu_list_action_t *ac, void *data);
int mu_sieve_vlist_compare (mu_sieve_value_t *a, mu_sieve_value_t *b,
mu_sieve_comparator_t comp, mu_sieve_relcmp_t test,
......@@ -192,11 +192,11 @@ int mu_sieve_machine_add_destructor (mu_sieve_machine_t mach,
/* Functions for accessing sieve machine internals */
void *mu_sieve_get_data (mu_sieve_machine_t mach);
message_t mu_sieve_get_message (mu_sieve_machine_t mach);
mu_message_t mu_sieve_get_message (mu_sieve_machine_t mach);
size_t mu_sieve_get_message_num (mu_sieve_machine_t mach);
int mu_sieve_get_debug_level (mu_sieve_machine_t mach);
ticket_t mu_sieve_get_ticket (mu_sieve_machine_t mach);
mailer_t mu_sieve_get_mailer (mu_sieve_machine_t mach);
mu_ticket_t mu_sieve_get_ticket (mu_sieve_machine_t mach);
mu_mailer_t mu_sieve_get_mailer (mu_sieve_machine_t mach);
int mu_sieve_get_locus (mu_sieve_machine_t mach, mu_sieve_locus_t *);
char *mu_sieve_get_daemon_email (mu_sieve_machine_t mach);
const char *mu_sieve_get_identifier (mu_sieve_machine_t mach);
......@@ -206,11 +206,11 @@ 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_logger (mu_sieve_machine_t mach, mu_sieve_action_log_t logger);
void mu_sieve_set_ticket (mu_sieve_machine_t mach, ticket_t ticket);
void mu_sieve_set_mailer (mu_sieve_machine_t mach, mailer_t mailer);
void mu_sieve_set_ticket (mu_sieve_machine_t mach, mu_ticket_t ticket);
void mu_sieve_set_mailer (mu_sieve_machine_t mach, mu_mailer_t mailer);
void mu_sieve_set_daemon_email (mu_sieve_machine_t mach, const char *email);
int mu_sieve_get_message_sender (message_t msg, char **ptext);
int mu_sieve_get_message_sender (mu_message_t msg, char **ptext);
/* Logging and diagnostic functions */
......@@ -219,7 +219,7 @@ void mu_sieve_debug (mu_sieve_machine_t mach, const char *fmt, ...);
void mu_sieve_log_action (mu_sieve_machine_t mach, const char *action,
const char *fmt, ...);
void mu_sieve_abort (mu_sieve_machine_t mach);
int mu_stream_printf (stream_t stream, size_t *off, const char *fmt, ...);
int mu_stream_printf (mu_stream_t stream, size_t *off, const char *fmt, ...);
void mu_sieve_arg_error (mu_sieve_machine_t mach, int n);
int mu_sieve_is_dry_run (mu_sieve_machine_t mach);
......@@ -228,8 +228,8 @@ const char *mu_sieve_type_str (mu_sieve_data_type type);
/* Principal entry points */
int mu_sieve_compile (mu_sieve_machine_t mach, const char *name);
int mu_sieve_mailbox (mu_sieve_machine_t mach, mailbox_t mbox);
int mu_sieve_message (mu_sieve_machine_t mach, message_t message);
int mu_sieve_mailbox (mu_sieve_machine_t mach, mu_mailbox_t mbox);
int mu_sieve_message (mu_sieve_machine_t mach, mu_message_t message);
int mu_sieve_disass (mu_sieve_machine_t mach);
/* Command line handling */
......
......@@ -25,30 +25,30 @@
extern "C" {
#endif
extern int mu_list_create (list_t *);
extern void mu_list_destroy (list_t *);
extern int mu_list_append (list_t, void *item);
extern int mu_list_prepend (list_t, void *item);
extern int mu_list_insert (list_t list, void *item, void *new_item,
extern int mu_list_create (mu_list_t *);
extern void mu_list_destroy (mu_list_t *);
extern int mu_list_append (mu_list_t, void *item);
extern int mu_list_prepend (mu_list_t, void *item);
extern int mu_list_insert (mu_list_t list, void *item, void *new_item,
int insert_before);
extern int mu_list_is_empty (list_t);
extern int mu_list_count (list_t, size_t *pcount);
extern int mu_list_remove (list_t, void *item);
extern int mu_list_replace (list_t list, void *old_item, void *new_item);
extern int mu_list_get (list_t, size_t _index, void **pitem);
extern int mu_list_to_array (list_t list, void **array, size_t count, size_t *pcount);
extern int mu_list_locate (list_t list, void *item, void **ret_item);
extern int mu_list_get_iterator (list_t, iterator_t *);
extern int mu_list_is_empty (mu_list_t);
extern int mu_list_count (mu_list_t, size_t *pcount);
extern int mu_list_remove (mu_list_t, void *item);
extern int mu_list_replace (mu_list_t list, void *old_item, void *new_item);
extern int mu_list_get (mu_list_t, size_t _index, void **pitem);
extern int mu_list_to_array (mu_list_t list, void **array, size_t count, size_t *pcount);
extern int mu_list_locate (mu_list_t list, void *item, void **ret_item);
extern int mu_list_get_iterator (mu_list_t, mu_iterator_t *);
typedef int mu_list_action_t (void* item, void* cbdata);
extern int mu_list_do (list_t list, mu_list_action_t * action, void *cbdata);
extern int mu_list_do (mu_list_t list, mu_list_action_t * action, void *cbdata);
typedef int (*mu_list_comparator_t) (const void*, const void*);
extern mu_list_comparator_t mu_list_set_comparator (list_t, mu_list_comparator_t);
extern mu_list_comparator_t mu_list_set_comparator (mu_list_t, mu_list_comparator_t);
extern int mu_list_set_destroy_item (list_t list, void (*destoy_item) (void *));
extern int mu_list_set_destroy_item (mu_list_t list, void (*destoy_item) (void *));
#ifdef __cplusplus
......
......@@ -87,27 +87,27 @@ extern void mu_locker_set_default_expire_timeout (time_t t);
extern void mu_locker_set_default_external_program (char *path);
/* A flags of 0 means that the default will be used. */
extern int mu_locker_create (locker_t *, const char *filename, int flags);
extern void mu_locker_destroy (locker_t *);
extern int mu_locker_create (mu_locker_t *, const char *filename, int flags);
extern void mu_locker_destroy (mu_locker_t *);
/* Time is measured in seconds. */
extern int mu_locker_set_flags (locker_t, int);
extern int mu_locker_set_expire_time (locker_t, int);
extern int mu_locker_set_retries (locker_t, int);
extern int mu_locker_set_retry_sleep (locker_t, int);
extern int mu_locker_set_external (locker_t, const char* program);
extern int mu_locker_get_flags (locker_t, int*);
extern int mu_locker_get_expire_time (locker_t, int*);
extern int mu_locker_get_retries (locker_t, int*);
extern int mu_locker_get_retry_sleep (locker_t, int*);
extern int mu_locker_get_external (locker_t, char**);
extern int mu_locker_lock (locker_t);
extern int mu_locker_touchlock (locker_t);
extern int mu_locker_unlock (locker_t);
extern int mu_locker_remove_lock (locker_t);
extern int mu_locker_set_flags (mu_locker_t, int);
extern int mu_locker_set_expire_time (mu_locker_t, int);
extern int mu_locker_set_retries (mu_locker_t, int);
extern int mu_locker_set_retry_sleep (mu_locker_t, int);
extern int mu_locker_set_external (mu_locker_t, const char* program);
extern int mu_locker_get_flags (mu_locker_t, int*);
extern int mu_locker_get_expire_time (mu_locker_t, int*);
extern int mu_locker_get_retries (mu_locker_t, int*);
extern int mu_locker_get_retry_sleep (mu_locker_t, int*);
extern int mu_locker_get_external (mu_locker_t, char**);
extern int mu_locker_lock (mu_locker_t);
extern int mu_locker_touchlock (mu_locker_t);
extern int mu_locker_unlock (mu_locker_t);
extern int mu_locker_remove_lock (mu_locker_t);
#ifdef __cplusplus
}
......
......@@ -34,58 +34,58 @@ const char *mu_folder_directory (void);
int mu_construct_user_mailbox_url (char **pout, const char *name);
/* Constructor/destructor and possible types. */
extern int mu_mailbox_create (mailbox_t *, const char *);
extern void mu_mailbox_destroy (mailbox_t *);
extern int mu_mailbox_create_default (mailbox_t *, const char *);
extern int mu_mailbox_open (mailbox_t, int flag);
extern int mu_mailbox_close (mailbox_t);
extern int mu_mailbox_flush (mailbox_t mbox, int expunge);
extern int mu_mailbox_get_folder (mailbox_t, folder_t *);
extern int mu_mailbox_set_folder (mailbox_t, folder_t);
extern int mu_mailbox_uidvalidity (mailbox_t, unsigned long *);
extern int mu_mailbox_uidnext (mailbox_t, size_t *);
extern int mu_mailbox_create (mu_mailbox_t *, const char *);
extern void mu_mailbox_destroy (mu_mailbox_t *);
extern int mu_mailbox_create_default (mu_mailbox_t *, const char *);
extern int mu_mailbox_open (mu_mailbox_t, int flag);
extern int mu_mailbox_close (mu_mailbox_t);
extern int mu_mailbox_flush (mu_mailbox_t mbox, int expunge);
extern int mu_mailbox_get_folder (mu_mailbox_t, mu_folder_t *);
extern int mu_mailbox_set_folder (mu_mailbox_t, mu_folder_t);
extern int mu_mailbox_uidvalidity (mu_mailbox_t, unsigned long *);
extern int mu_mailbox_uidnext (mu_mailbox_t, size_t *);
/* Messages. */
extern int mu_mailbox_get_message (mailbox_t, size_t msgno, message_t *);
extern int mu_mailbox_append_message (mailbox_t, message_t);
extern int mu_mailbox_messages_count (mailbox_t, size_t *);
extern int mu_mailbox_messages_recent (mailbox_t, size_t *);
extern int mu_mailbox_message_unseen (mailbox_t, size_t *);
extern int mu_mailbox_expunge (mailbox_t);
extern int mu_mailbox_save_attributes (mailbox_t);
extern int mu_mailbox_get_message (mu_mailbox_t, size_t msgno, mu_message_t *);
extern int mu_mailbox_append_message (mu_mailbox_t, mu_message_t);
extern int mu_mailbox_messages_count (mu_mailbox_t, size_t *);
extern int mu_mailbox_messages_recent (mu_mailbox_t, size_t *);
extern int mu_mailbox_message_unseen (mu_mailbox_t, size_t *);
extern int mu_mailbox_expunge (mu_mailbox_t);
extern int mu_mailbox_save_attributes (mu_mailbox_t);
/* Update and scanning. */
extern int mu_mailbox_get_size (mailbox_t, off_t *size);
extern int mu_mailbox_is_updated (mailbox_t);
extern int mu_mailbox_scan (mailbox_t, size_t no, size_t *count);
extern int mu_mailbox_get_size (mu_mailbox_t, off_t *size);
extern int mu_mailbox_is_updated (mu_mailbox_t);
extern int mu_mailbox_scan (mu_mailbox_t, size_t no, size_t *count);
/* Mailbox Stream. */
extern int mu_mailbox_set_stream (mailbox_t, stream_t);
extern int mu_mailbox_get_stream (mailbox_t, stream_t *);
extern int mu_mailbox_set_stream (mu_mailbox_t, mu_stream_t);
extern int mu_mailbox_get_stream (mu_mailbox_t, mu_stream_t *);
/* Lock settings. */
extern int mu_mailbox_get_locker (mailbox_t, locker_t *);
extern int mu_mailbox_set_locker (mailbox_t, locker_t);
extern int mu_mailbox_get_locker (mu_mailbox_t, mu_locker_t *);
extern int mu_mailbox_set_locker (mu_mailbox_t, mu_locker_t);
/* Property. */
extern int mu_mailbox_get_flags (mailbox_t, int *);
extern int mu_mailbox_get_property (mailbox_t, property_t *);
extern int mu_mailbox_get_flags (mu_mailbox_t, int *);
extern int mu_mailbox_get_property (mu_mailbox_t, mu_property_t *);
/* URL. */
extern int mu_mailbox_get_url (mailbox_t, url_t *);
extern int mu_mailbox_get_url (mu_mailbox_t, mu_url_t *);
/* For any debuging */
extern int mu_mailbox_has_debug (mailbox_t);
extern int mu_mailbox_get_debug (mailbox_t, mu_debug_t *);
extern int mu_mailbox_set_debug (mailbox_t, mu_debug_t);
extern int mu_mailbox_has_debug (mu_mailbox_t);
extern int mu_mailbox_get_debug (mu_mailbox_t, mu_debug_t *);
extern int mu_mailbox_set_debug (mu_mailbox_t, mu_debug_t);
/* Events. */
extern int mu_mailbox_get_observable (mailbox_t, observable_t *);
extern int mu_mailbox_get_observable (mu_mailbox_t, mu_observable_t *);
/* Locking */
extern int mu_mailbox_lock (mailbox_t mbox);
extern int mu_mailbox_unlock (mailbox_t mbox);
extern int mu_mailbox_lock (mu_mailbox_t mbox);
extern int mu_mailbox_unlock (mu_mailbox_t mbox);
#ifdef __cplusplus
}
......
......@@ -29,7 +29,7 @@ extern "C" {
#endif
/* Create a mailcap from stream. */
int mu_mailcap_create (mu_mailcap_t * mailcap, stream_t stream);
int mu_mailcap_create (mu_mailcap_t * mailcap, mu_stream_t stream);
/* Destroy mailcap object. */
void mu_mailcap_destroy (mu_mailcap_t * mailcap);
......
......@@ -29,33 +29,33 @@ extern "C" {
#define MAILER_FLAG_DEBUG_DATA 0x0001
/* A url of NULL will cause the default to be used. */
extern int mailer_create (mailer_t *, const char *url);
extern void mailer_destroy (mailer_t *);
extern int mailer_open (mailer_t, int flags);
extern int mailer_close (mailer_t);
extern int mailer_send_message (mailer_t, message_t, address_t from, address_t to);
extern int mu_mailer_create (mu_mailer_t *, const char *url);
extern void mu_mailer_destroy (mu_mailer_t *);
extern int mu_mailer_open (mu_mailer_t, int flags);
extern int mu_mailer_close (mu_mailer_t);
extern int mu_mailer_send_message (mu_mailer_t, mu_message_t, mu_address_t from, mu_address_t to);
/* Called to set or get the default mailer url. */
extern int mailer_set_url_default (const char* url);
extern int mailer_get_url_default (const char** url);
extern int mu_mailer_set_url_default (const char* url);
extern int mu_mailer_get_url_default (const char** url);
/* Accessor functions. */
extern int mailer_get_property (mailer_t, property_t *);
extern int mailer_get_stream (mailer_t, stream_t *);
extern int mailer_set_stream (mailer_t, stream_t);
extern int mailer_get_debug (mailer_t, mu_debug_t *);
extern int mailer_set_debug (mailer_t, mu_debug_t);
extern int mailer_get_observable (mailer_t, observable_t *);
extern int mailer_get_url (mailer_t, url_t *);
extern int mu_mailer_get_property (mu_mailer_t, mu_property_t *);
extern int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *);
extern int mu_mailer_set_stream (mu_mailer_t, mu_stream_t);
extern int mu_mailer_get_debug (mu_mailer_t, mu_debug_t *);
extern int mu_mailer_set_debug (mu_mailer_t, mu_debug_t);
extern int mu_mailer_get_observable (mu_mailer_t, mu_observable_t *);
extern int mu_mailer_get_url (mu_mailer_t, mu_url_t *);
/* Utility functions, primarily for use of implementing concrete mailers. */
/* A valid from address_t contains a single address that has a qualified
/* A valid from mu_address_t contains a single address that has a qualified
email address. */
extern int mailer_check_from (address_t from);
/* A valid to address_t contains 1 or more addresses, that are
extern int mu_mailer_check_from (mu_address_t from);
/* A valid to mu_address_t contains 1 or more addresses, that are
qualified email addresses. */
extern int mailer_check_to (address_t to);
extern int mu_mailer_check_to (mu_address_t to);
#ifdef __cplusplus
}
......
......@@ -26,90 +26,90 @@ extern "C" {
#endif
/* A message is considered to be a container for:
header_t, body_t, and its attribute_t. */
mu_header_t, mu_body_t, and its mu_attribute_t. */
extern int message_create (message_t *, void *owner);
extern void message_destroy (message_t *, void *owner);
extern int mu_message_create (mu_message_t *, void *owner);
extern void mu_message_destroy (mu_message_t *, void *owner);
extern int message_create_copy (message_t *to, message_t from);
extern int mu_message_create_copy (mu_message_t *to, mu_message_t from);
extern void * message_get_owner (message_t);
extern int message_is_modified (message_t);
extern int message_clear_modified (message_t);
extern int message_get_mailbox (message_t, mailbox_t *);
extern int message_set_mailbox (message_t, mailbox_t, void *);
extern void * mu_message_get_owner (mu_message_t);
extern int mu_message_is_modified (mu_message_t);
extern int mu_message_clear_modified (mu_message_t);
extern int mu_message_get_mailbox (mu_message_t, mu_mailbox_t *);
extern int mu_message_set_mailbox (mu_message_t, mu_mailbox_t, void *);
extern int message_ref (message_t);
#define message_unref(msg) message_destroy (&msg, NULL)
extern int mu_message_ref (mu_message_t);
#define message_unref(msg) mu_message_destroy (&msg, NULL)
extern int message_get_envelope (message_t, envelope_t *);
extern int message_set_envelope (message_t, envelope_t, void *);
extern int mu_message_get_envelope (mu_message_t, mu_envelope_t *);
extern int mu_message_set_envelope (mu_message_t, mu_envelope_t, void *);
extern int message_get_header (message_t, header_t *);
extern int message_set_header (message_t, header_t, void *);
extern int mu_message_get_header (mu_message_t, mu_header_t *);
extern int mu_message_set_header (mu_message_t, mu_header_t, void *);
extern int message_get_body (message_t, body_t *);
extern int message_set_body (message_t, body_t, void *);
extern int mu_message_get_body (mu_message_t, mu_body_t *);
extern int mu_message_set_body (mu_message_t, mu_body_t, void *);
extern int message_get_stream (message_t, stream_t *);
extern int message_set_stream (message_t, stream_t, void *);
extern int mu_message_get_stream (mu_message_t, mu_stream_t *);
extern int mu_message_set_stream (mu_message_t, mu_stream_t, void *);
extern int message_get_attribute (message_t, attribute_t *);
extern int message_set_attribute (message_t, attribute_t, void *);
extern int mu_message_get_attribute (mu_message_t, mu_attribute_t *);
extern int mu_message_set_attribute (mu_message_t, mu_attribute_t, void *);
extern int message_get_observable (message_t, observable_t *);
extern int mu_message_get_observable (mu_message_t, mu_observable_t *);
extern int message_is_multipart (message_t, int *);
extern int message_set_is_multipart (message_t,
int (*_is_multipart) (message_t, int *),
extern int mu_message_is_multipart (mu_message_t, int *);
extern int mu_message_set_is_multipart (mu_message_t,
int (*_is_multipart) (mu_message_t, int *),
void *);
extern int message_size (message_t, size_t *);
extern int message_set_size (message_t,
int (*_size) (message_t, size_t *),
extern int mu_message_size (mu_message_t, size_t *);
extern int mu_message_set_size (mu_message_t,
int (*_size) (mu_message_t, size_t *),
void *owner);
extern int message_lines (message_t, size_t *);
extern int message_set_lines (message_t,
int (*_lines) (message_t, size_t *),
extern int mu_message_lines (mu_message_t, size_t *);
extern int mu_message_set_lines (mu_message_t,
int (*_lines) (mu_message_t, size_t *),
void *owner);
extern int message_get_num_parts (message_t, size_t *nparts);
extern int message_set_get_num_parts (message_t,
int (*_get_num_parts) (message_t,
extern int mu_message_get_num_parts (mu_message_t, size_t *nparts);
extern int mu_message_set_get_num_parts (mu_message_t,
int (*_get_num_parts) (mu_message_t,
size_t *),
void *owner);
extern int message_get_part (message_t, size_t, message_t *);
extern int message_set_get_part (message_t,
int (*_get_part) (message_t, size_t,
message_t *),
extern int mu_message_get_part (mu_message_t, size_t, mu_message_t *);
extern int mu_message_set_get_part (mu_message_t,
int (*_get_part) (mu_message_t, size_t,
mu_message_t *),
void *owner);
extern int message_get_uidl (message_t, char *, size_t, size_t *);
extern int message_set_uidl (message_t,
int (*_get_uidl) (message_t, char *,
extern int mu_message_get_uidl (mu_message_t, char *, size_t, size_t *);
extern int mu_message_set_uidl (mu_message_t,
int (*_get_uidl) (mu_message_t, char *,
size_t, size_t *),
void *owner);
extern int message_get_uid (message_t, size_t *);
extern int message_set_uid (message_t,
int (*_get_uid) (message_t, size_t *),
extern int mu_message_get_uid (mu_message_t, size_t *);
extern int mu_message_set_uid (mu_message_t,
int (*_get_uid) (mu_message_t, size_t *),
void *owner);
/* misc functions */
extern int message_create_attachment (const char *content_type,
extern int mu_message_create_attachment (const char *content_type,
const char *encoding,
const char *filename,
message_t *newmsg);
extern int message_save_attachment (message_t msg,
mu_message_t *newmsg);
extern int mu_message_save_attachment (mu_message_t msg,
const char *filename, void **data);
extern int message_encapsulate (message_t msg, message_t *newmsg, void **data);
extern int message_unencapsulate (message_t msg, message_t *newmsg, void **data);
extern int mu_message_encapsulate (mu_message_t msg, mu_message_t *newmsg, void **data);
extern int mu_message_unencapsulate (mu_message_t msg, mu_message_t *newmsg, void **data);
extern int message_get_attachment_name (message_t, char *name, size_t bufsz, size_t* sz);
extern int message_aget_attachment_name (message_t, char **name);
extern int mu_message_get_attachment_name (mu_message_t, char *name, size_t bufsz, size_t* sz);
extern int mu_message_aget_attachment_name (mu_message_t, char **name);
extern int message_save_to_mailbox (message_t msg, ticket_t ticket,
extern int mu_message_save_to_mailbox (mu_message_t msg, mu_ticket_t ticket,
mu_debug_t debug, const char *toname);
......
......@@ -31,21 +31,21 @@
extern "C" {
#endif
int mime_create (mime_t *pmime, message_t msg, int flags);
void mime_destroy (mime_t *pmime);
int mime_is_multipart (mime_t mime);
int mime_get_num_parts (mime_t mime, size_t *nparts);
int mu_mime_create (mu_mime_t *pmime, mu_message_t msg, int flags);
void mu_mime_destroy (mu_mime_t *pmime);
int mu_mime_is_multipart (mu_mime_t mime);
int mu_mime_get_num_parts (mu_mime_t mime, size_t *nparts);
int mime_get_part (mime_t mime, size_t part, message_t *msg);
int mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t *msg);
int mime_add_part (mime_t mime, message_t msg);
int mu_mime_add_part (mu_mime_t mime, mu_message_t msg);
int mime_get_message (mime_t mime, message_t *msg);
int mu_mime_get_message (mu_mime_t mime, mu_message_t *msg);
int rfc2047_decode (const char *tocode, const char *fromstr,
int mu_rfc2047_decode (const char *tocode, const char *fromstr,
char **ptostr);
int rfc2047_encode (const char *charset, const char *encoding,
int mu_rfc2047_encode (const char *charset, const char *encoding,
const char *text, char **result);
#ifdef __cplusplus
......
......@@ -25,28 +25,28 @@
extern "C" {
#endif
struct _monitor
struct mu__monitor
{
void *data;
void *owner;
int allocated;
int flags;
};
typedef struct _monitor *monitor_t;
typedef struct mu__monitor *mu_monitor_t;
#define MU_MONITOR_PTHREAD 0
#define MU_MONITOR_INITIALIZER {0, 0, 0, 0}
extern int monitor_create (monitor_t *, int flags, void *owner);
extern void monitor_destroy (monitor_t *, void *owner);
extern void *monitor_get_owner (monitor_t);
extern int mu_monitor_create (mu_monitor_t *, int flags, void *owner);
extern void mu_monitor_destroy (mu_monitor_t *, void *owner);
extern void *mu_monitor_get_owner (mu_monitor_t);
extern int monitor_rdlock (monitor_t);
extern int monitor_wrlock (monitor_t);
extern int monitor_unlock (monitor_t);
extern int monitor_wait (monitor_t);
extern int monitor_notify (monitor_t);
extern int mu_monitor_rdlock (mu_monitor_t);
extern int mu_monitor_wrlock (mu_monitor_t);
extern int mu_monitor_unlock (mu_monitor_t);
extern int mu_monitor_wait (mu_monitor_t);
extern int mu_monitor_notify (mu_monitor_t);
#ifdef __cplusplus
}
......
......@@ -51,7 +51,7 @@ struct mu_auth_module {
void *auth_by_uid_data;
};
extern int mu_auth_runlist (list_t flist,
extern int mu_auth_runlist (mu_list_t flist,
struct mu_auth_data **return_data,
const void *key, void *data);
extern struct mu_auth_data *
......
......@@ -106,15 +106,15 @@ extern char * mu_getcwd (void);
extern int mu_spawnvp(const char* prog, const char* const av[], int* stat);
typedef void *(*mu_retrieve_fp) (void *);
extern void mu_register_retriever (list_t *pflist, mu_retrieve_fp fun);
extern void * mu_retrieve (list_t flist, void *data);
extern void mu_register_retriever (mu_list_t *pflist, mu_retrieve_fp fun);
extern void * mu_retrieve (mu_list_t flist, void *data);
extern int mu_unroll_symlink (char *out, size_t outsz, const char *in);
extern char * mu_expand_path_pattern (const char *pattern, const char *username);
extern int mu_rfc2822_references (message_t msg, char **pstr);
extern int mu_rfc2822_in_reply_to (message_t msg, char **pstr);
extern int mu_rfc2822_references (mu_message_t msg, char **pstr);
extern int mu_rfc2822_in_reply_to (mu_message_t msg, char **pstr);
/* Find NEEDLE in the HAYSTACK. Case insensitive comparison */
extern char *mu_strcasestr (const char *haystack, const char *needle);
......@@ -133,7 +133,7 @@ struct timeval;
extern int mu_fd_wait (int fd, int *pflags, struct timeval *tvp);
extern int mu_decode_filter (stream_t *pfilter, stream_t input,
extern int mu_decode_filter (mu_stream_t *pfilter, mu_stream_t input,
const char *filter_type,
const char *fromcode, const char *tocode);
......
......@@ -35,8 +35,8 @@ typedef struct _mu_nntp* mu_nntp_t;
extern int mu_nntp_create (mu_nntp_t *nntp);
extern void mu_nntp_destroy (mu_nntp_t *nntp);
extern int mu_nntp_set_carrier (mu_nntp_t nntp, stream_t carrier);
extern int mu_nntp_get_carrier (mu_nntp_t nntp, stream_t *pcarrier);
extern int mu_nntp_set_carrier (mu_nntp_t nntp, mu_stream_t carrier);
extern int mu_nntp_get_carrier (mu_nntp_t nntp, mu_stream_t *pcarrier);
extern int mu_nntp_connect (mu_nntp_t nntp);
extern int mu_nntp_disconnect (mu_nntp_t nntp);
......@@ -53,7 +53,7 @@ extern int mu_nntp_mode_reader (mu_nntp_t nntp);
/* An iterator is return with the multi-line answer. It is the responsibility
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_list_extensions (mu_nntp_t nntp, iterator_t *iterator);
extern int mu_nntp_list_extensions (mu_nntp_t nntp, mu_iterator_t *iterator);
extern int mu_nntp_quit (mu_nntp_t nntp);
......@@ -77,22 +77,22 @@ extern int mu_nntp_next (mu_nntp_t nntp,
other commands are permitted until the stream is destroyed. */
extern int mu_nntp_article (mu_nntp_t nntp, unsigned long number,
unsigned long *pnum, char **mid,
stream_t *stream);
mu_stream_t *stream);
extern int mu_nntp_article_id (mu_nntp_t nntp, const char *id,
unsigned long *pnum, char **mid,
stream_t *stream);
mu_stream_t *stream);
extern int mu_nntp_head (mu_nntp_t nntp, unsigned long number,
unsigned long *pnum, char **mid,
stream_t *stream);
mu_stream_t *stream);
extern int mu_nntp_head_id (mu_nntp_t nntp, const char *name,
unsigned long *pnum, char **mid,
stream_t *stream);
mu_stream_t *stream);
extern int mu_nntp_body (mu_nntp_t nntp, unsigned long number,
unsigned long *pnum, char **mid,
stream_t *stream);
mu_stream_t *stream);
extern int mu_nntp_body_id (mu_nntp_t nntp, const char *id,
unsigned long *pnum, char **mid,
stream_t *stream);
mu_stream_t *stream);
/* The argument mid is allocated with malloc(3). The caller is responsible
to call free(3) */
......@@ -108,7 +108,7 @@ extern int mu_nntp_date (mu_nntp_t nntp, unsigned int *year,
/* The caller must call stream_destoy() when done, no other commands are
permitted until the stream is destroyed. */
extern int mu_nntp_help (mu_nntp_t nntp, stream_t *stream);
extern int mu_nntp_help (mu_nntp_t nntp, mu_stream_t *stream);
/* An iterator is return with the multi-line answer. It is the responsibility
......@@ -117,7 +117,7 @@ extern int mu_nntp_newgroups (mu_nntp_t nntp, unsigned int year,
unsigned int month, unsigned int day,
unsigned int hour, unsigned int minute,
unsigned int second, int is_gmt,
iterator_t *iterator);
mu_iterator_t *iterator);
/* A iterator is return with the multi-line answer. It is the responsibility
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
......@@ -125,27 +125,27 @@ extern int mu_nntp_newnews (mu_nntp_t nntp, const char *wildmat,
unsigned int year, unsigned int month,
unsigned int day, unsigned int hour,
unsigned int minute, unsigned int second,
int is_gmt, iterator_t *iterator);
int is_gmt, mu_iterator_t *iterator);
extern int mu_nntp_post (mu_nntp_t nntp, stream_t stream);
extern int mu_nntp_post (mu_nntp_t nntp, mu_stream_t stream);
extern int mu_nntp_ihave (mu_nntp_t nntp, const char *mid,
stream_t stream);
mu_stream_t stream);
/* A iterator is return with the multi-line answer. It is the responsibility
of the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_nntp_list_active (mu_nntp_t nntp, const char *wildmat,
iterator_t *iterator);
mu_iterator_t *iterator);
extern int mu_nntp_list_active_times (mu_nntp_t nntp,
const char *wildmat,
iterator_t *iterator);
mu_iterator_t *iterator);
extern int mu_nntp_list_distributions (mu_nntp_t nntp,
const char *wildmat,
iterator_t *iterator);
extern int mu_nntp_list_distrib_pats (mu_nntp_t nntp, iterator_t *iterator);
mu_iterator_t *iterator);
extern int mu_nntp_list_distrib_pats (mu_nntp_t nntp, mu_iterator_t *iterator);
extern int mu_nntp_list_newsgroups (mu_nntp_t nntp,
const char *wildmat,
iterator_t *iterator);
mu_iterator_t *iterator);
/* Parse the list active response.
......
......@@ -37,23 +37,23 @@ extern "C" {
#define MU_OBSERVER_NO_CHECK 1
extern int observer_create (observer_t *, void *owner);
extern void observer_destroy (observer_t *, void *owner);
extern void * observer_get_owner (observer_t);
extern int observer_action (observer_t, size_t type);
extern int observer_set_action (observer_t,
int (*_action) (observer_t, size_t),
extern int mu_observer_create (mu_observer_t *, void *owner);
extern void mu_observer_destroy (mu_observer_t *, void *owner);
extern void * mu_observer_get_owner (mu_observer_t);
extern int mu_observer_action (mu_observer_t, size_t type);
extern int mu_observer_set_action (mu_observer_t,
int (*_action) (mu_observer_t, size_t),
void *owner);
extern int observer_set_destroy (observer_t,
int (*_destroy) (observer_t), void *owner);
extern int observer_set_flags (observer_t, int flags);
extern int observable_create (observable_t *, void *owner);
extern void observable_destroy (observable_t *, void *owner);
extern void * observable_get_owner (observable_t);
extern int observable_attach (observable_t, size_t type, observer_t observer);
extern int observable_detach (observable_t, observer_t observer);
extern int observable_notify (observable_t, int type);
extern int mu_observer_set_destroy (mu_observer_t,
int (*_destroy) (mu_observer_t), void *owner);
extern int mu_observer_set_flags (mu_observer_t, int flags);
extern int mu_observable_create (mu_observable_t *, void *owner);
extern void mu_observable_destroy (mu_observable_t *, void *owner);
extern void * mu_observable_get_owner (mu_observable_t);
extern int mu_observable_attach (mu_observable_t, size_t type, mu_observer_t observer);
extern int mu_observable_detach (mu_observable_t, mu_observer_t observer);
extern int mu_observable_notify (mu_observable_t, int type);
#ifdef __cplusplus
}
......
......@@ -37,49 +37,49 @@ extern "C" {
/* From RFC 822, 3.3 Lexical Tokens */
extern int parse822_is_char (char c);
extern int parse822_is_digit (char c);
extern int parse822_is_ctl (char c);
extern int parse822_is_space (char c);
extern int parse822_is_htab (char c);
extern int parse822_is_lwsp_char (char c);
extern int parse822_is_special (char c);
extern int parse822_is_atom_char (char c);
extern int parse822_is_q_text (char c);
extern int parse822_is_d_text (char c);
extern int parse822_is_smtp_q (char c);
extern int parse822_skip_crlf (const char** p, const char* e);
extern int parse822_skip_lwsp_char (const char** p, const char* e);
extern int parse822_skip_lwsp (const char** p, const char* e);
extern int parse822_skip_comments (const char** p, const char* e);
extern int parse822_skip_nl (const char** p, const char* e);
extern int parse822_digits (const char** p, const char* e, int min, int max, int* digits);
extern int parse822_special (const char** p, const char* e, char c);
extern int parse822_comment (const char** p, const char* e, char** comment);
extern int parse822_atom (const char** p, const char* e, char** atom);
extern int parse822_quoted_pair (const char** p, const char* e, char** qpair);
extern int parse822_quoted_string (const char** p, const char* e, char** qstr);
extern int parse822_word (const char** p, const char* e, char** word);
extern int parse822_phrase (const char** p, const char* e, char** phrase);
extern int parse822_d_text (const char** p, const char* e, char** dtext);
extern int mu_parse822_is_char (char c);
extern int mu_parse822_is_digit (char c);
extern int mu_parse822_is_ctl (char c);
extern int mu_parse822_is_space (char c);
extern int mu_parse822_is_htab (char c);
extern int mu_parse822_is_lwsp_char (char c);
extern int mu_parse822_is_special (char c);
extern int mu_parse822_is_atom_char (char c);
extern int mu_parse822_is_q_text (char c);
extern int mu_parse822_is_d_text (char c);
extern int mu_parse822_is_smtp_q (char c);
extern int mu_parse822_skip_crlf (const char** p, const char* e);
extern int mu_parse822_skip_lwsp_char (const char** p, const char* e);
extern int mu_parse822_skip_lwsp (const char** p, const char* e);
extern int mu_parse822_skip_comments (const char** p, const char* e);
extern int mu_parse822_skip_nl (const char** p, const char* e);
extern int mu_parse822_digits (const char** p, const char* e, int min, int max, int* digits);
extern int mu_parse822_special (const char** p, const char* e, char c);
extern int mu_parse822_comment (const char** p, const char* e, char** comment);
extern int mu_parse822_atom (const char** p, const char* e, char** atom);
extern int mu_parse822_quoted_pair (const char** p, const char* e, char** qpair);
extern int mu_parse822_quoted_string (const char** p, const char* e, char** qstr);
extern int mu_parse822_word (const char** p, const char* e, char** word);
extern int mu_parse822_phrase (const char** p, const char* e, char** phrase);
extern int mu_parse822_d_text (const char** p, const char* e, char** dtext);
/* From RFC 822, 6.1 Address Specification Syntax */
extern int parse822_address_list (address_t* a, const char* s);
extern int parse822_mail_box (const char** p, const char* e, address_t* a);
extern int parse822_group (const char** p, const char* e, address_t* a);
extern int parse822_address (const char** p, const char* e, address_t* a);
extern int parse822_route_addr (const char** p, const char* e, address_t* a);
extern int parse822_route (const char** p, const char* e, char** route);
extern int parse822_addr_spec (const char** p, const char* e, address_t* a);
extern int parse822_unix_mbox (const char** p, const char* e, address_t* a);
extern int parse822_local_part (const char** p, const char* e, char** local_part);
extern int parse822_domain (const char** p, const char* e, char** domain);
extern int parse822_sub_domain (const char** p, const char* e, char** sub_domain);
extern int parse822_domain_ref (const char** p, const char* e, char** domain_ref);
extern int parse822_domain_literal (const char** p, const char* e, char** domain_literal);
extern int mu_parse822_address_list (mu_address_t* a, const char* s);
extern int mu_parse822_mail_box (const char** p, const char* e, mu_address_t* a);
extern int mu_parse822_group (const char** p, const char* e, mu_address_t* a);
extern int mu_parse822_address (const char** p, const char* e, mu_address_t* a);
extern int mu_parse822_route_addr (const char** p, const char* e, mu_address_t* a);
extern int mu_parse822_route (const char** p, const char* e, char** route);
extern int mu_parse822_addr_spec (const char** p, const char* e, mu_address_t* a);
extern int mu_parse822_unix_mbox (const char** p, const char* e, mu_address_t* a);
extern int mu_parse822_local_part (const char** p, const char* e, char** local_part);
extern int mu_parse822_domain (const char** p, const char* e, char** domain);
extern int mu_parse822_sub_domain (const char** p, const char* e, char** sub_domain);
extern int mu_parse822_domain_ref (const char** p, const char* e, char** domain_ref);
extern int mu_parse822_domain_literal (const char** p, const char* e, char** domain_literal);
/* RFC 822 Quoting Functions
* Various elements must be quoted if then contain non-safe characters. What
......@@ -88,18 +88,18 @@ extern int parse822_domain_literal (const char** p, const char* e, char** domain
* quoted if no unsafe characters were in the raw string.
*/
extern int parse822_quote_string (char** quoted, const char* raw);
extern int parse822_quote_local_part (char** quoted, const char* raw);
extern int mu_parse822_quote_string (char** quoted, const char* raw);
extern int mu_parse822_quote_local_part (char** quoted, const char* raw);
extern int parse822_field_body (const char** p, const char *e, char** fieldbody);
extern int parse822_field_name (const char** p, const char *e, char** fieldname);
extern int mu_parse822_field_body (const char** p, const char *e, char** fieldbody);
extern int mu_parse822_field_name (const char** p, const char *e, char** fieldname);
/***** From RFC 822, 5.1 Date and Time Specification Syntax *****/
extern int parse822_day (const char** p, const char* e, int* day);
extern int parse822_date (const char** p, const char* e, int* day, int* mon, int* year);
extern int parse822_time (const char** p, const char* e, int* h, int* m, int* s, int* tz, const char** tz_name);
extern int parse822_date_time (const char** p, const char* e, struct tm* tm, mu_timezone* tz);
extern int mu_parse822_day (const char** p, const char* e, int* day);
extern int mu_parse822_date (const char** p, const char* e, int* day, int* mon, int* year);
extern int mu_parse822_time (const char** p, const char* e, int* h, int* m, int* s, int* tz, const char** tz_name);
extern int mu_parse822_date_time (const char** p, const char* e, struct tm* tm, mu_timezone* tz);
#ifdef __cplusplus
......
......@@ -36,8 +36,8 @@ typedef struct _mu_pop3* mu_pop3_t;
extern int mu_pop3_create (mu_pop3_t *pop3);
extern void mu_pop3_destroy (mu_pop3_t *pop3);
extern int mu_pop3_set_carrier (mu_pop3_t pop3, stream_t carrier);
extern int mu_pop3_get_carrier (mu_pop3_t pop3, stream_t *pcarrier);
extern int mu_pop3_set_carrier (mu_pop3_t pop3, mu_stream_t carrier);
extern int mu_pop3_get_carrier (mu_pop3_t pop3, mu_stream_t *pcarrier);
extern int mu_pop3_connect (mu_pop3_t pop3);
extern int mu_pop3_disconnect (mu_pop3_t pop3);
......@@ -54,7 +54,7 @@ extern int mu_pop3_stls (mu_pop3_t pop3);
/* It is the responsability of the caller to call mu_iterator_destroy() when done
with the iterator. The items return by the iterator are of type "const char *",
no processing is done on the item except the removal of the trailing newline. */
extern int mu_pop3_capa (mu_pop3_t pop3, iterator_t *iterator);
extern int mu_pop3_capa (mu_pop3_t pop3, mu_iterator_t *iterator);
extern int mu_pop3_dele (mu_pop3_t pop3, unsigned int mesgno);
......@@ -62,7 +62,7 @@ extern int mu_pop3_list (mu_pop3_t pop3, unsigned int mesgno, size_t *m
/* An iterator is return with the multi-line answer. It is the responsability of
the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_pop3_list_all (mu_pop3_t pop3, iterator_t *piterator);
extern int mu_pop3_list_all (mu_pop3_t pop3, mu_iterator_t *piterator);
extern int mu_pop3_noop (mu_pop3_t pop3);
......@@ -71,23 +71,23 @@ extern int mu_pop3_pass (mu_pop3_t pop3, const char *pass);
extern int mu_pop3_quit (mu_pop3_t pop3);
/* A stream is return with the multi-line answer. It is the responsability of
the caller to call stream_destroy() to dipose of the stream. */
extern int mu_pop3_retr (mu_pop3_t pop3, unsigned int mesgno, stream_t *pstream);
the caller to call mu_stream_destroy() to dipose of the stream. */
extern int mu_pop3_retr (mu_pop3_t pop3, unsigned int mesgno, mu_stream_t *pstream);
extern int mu_pop3_rset (mu_pop3_t pop3);
extern int mu_pop3_stat (mu_pop3_t pop3, unsigned int *count, size_t *octets);
/* A stream is return with the multi-line answer. It is the responsability of
the caller to call stream_destroy() to dipose of the stream. */
extern int mu_pop3_top (mu_pop3_t pop3, unsigned int mesgno, unsigned int lines, stream_t *pstream);
the caller to call mu_stream_destroy() to dipose of the stream. */
extern int mu_pop3_top (mu_pop3_t pop3, unsigned int mesgno, unsigned int lines, mu_stream_t *pstream);
/* The uidl is malloc and return in puidl, it is the responsability of caller
to free() the uild when done. */
extern int mu_pop3_uidl (mu_pop3_t pop3, unsigned int mesgno, char **puidl);
/* An iterator is return with the multi-line answer. It is the responsability of
the caller to call mu_iterator_destroy() to dispose of the iterator. */
extern int mu_pop3_uidl_all (mu_pop3_t pop3, iterator_t *piterator);
extern int mu_pop3_uidl_all (mu_pop3_t pop3, mu_iterator_t *piterator);
extern int mu_pop3_user (mu_pop3_t pop3, const char *user);
......
......@@ -27,18 +27,18 @@
extern "C" {
#endif
extern int property_create (property_t *, void *);
extern void property_destroy (property_t *, void *);
extern void *property_get_owner (property_t);
extern int mu_property_create (mu_property_t *, void *);
extern void mu_property_destroy (mu_property_t *, void *);
extern void *mu_property_get_owner (mu_property_t);
extern int property_set_value (property_t, const char *, const char *, int);
extern int property_get_value (property_t, const char *, char *, size_t,
extern int mu_property_set_value (mu_property_t, const char *, const char *, int);
extern int mu_property_get_value (mu_property_t, const char *, char *, size_t,
size_t *);
/* Helper functions. */
extern int property_set (property_t, const char *);
extern int property_unset (property_t, const char *);
extern int property_is_set (property_t, const char *);
extern int mu_property_set (mu_property_t, const char *);
extern int mu_property_unset (mu_property_t, const char *);
extern int mu_property_is_set (mu_property_t, const char *);
#ifdef __cplusplus
}
......
......@@ -29,7 +29,7 @@ extern "C" {
struct _mu_refcount
{
unsigned int ref;
monitor_t lock;
mu_monitor_t lock;
};
extern int mu_refcount_create (mu_refcount_t *);
......
......@@ -26,77 +26,77 @@ extern "C" {
#endif
/* Public Interface, to allow static initialization. */
struct _record
struct mu__record
{
int priority; /* Higher priority records are scanned first */
const char *scheme;
int (*_url) (url_t);
int (*_mailbox) (mailbox_t);
int (*_mailer) (mailer_t);
int (*_folder) (folder_t);
int (*_url) (mu_url_t);
int (*_mailbox) (mu_mailbox_t);
int (*_mailer) (mu_mailer_t);
int (*_folder) (mu_folder_t);
void *data; /* back pointer. */
/* Stub functions to override. The default is to return the fields. */
int (*_is_scheme) (record_t, const char *, int);
int (*_get_url) (record_t, int (*(*_url)) (url_t));
int (*_get_mailbox) (record_t, int (*(*_mailbox)) (mailbox_t));
int (*_get_mailer) (record_t, int (*(*_mailer)) (mailer_t));
int (*_get_folder) (record_t, int (*(*_folder)) (folder_t));
int (*_is_scheme) (mu_record_t, const char *, int);
int (*_get_url) (mu_record_t, int (*(*_url)) (mu_url_t));
int (*_get_mailbox) (mu_record_t, int (*(*_mailbox)) (mu_mailbox_t));
int (*_get_mailer) (mu_record_t, int (*(*_mailer)) (mu_mailer_t));
int (*_get_folder) (mu_record_t, int (*(*_folder)) (mu_folder_t));
};
/* Registration. */
extern int registrar_get_iterator (iterator_t *);
extern int registrar_get_list (list_t *) __attribute__ ((deprecated));
extern int mu_registrar_get_iterator (mu_iterator_t *);
extern int mu_registrar_get_list (mu_list_t *) __attribute__ ((deprecated));
extern int registrar_lookup (const char *name, record_t *precord, int flags);
extern int registrar_record (record_t);
extern int unregistrar_record (record_t);
extern int mu_registrar_lookup (const char *name, mu_record_t *precord, int flags);
extern int mu_registrar_record (mu_record_t);
extern int mu_unregistrar_record (mu_record_t);
/* Scheme. */
extern int record_is_scheme (record_t, const char *, int flags);
extern int record_set_scheme (record_t, const char *);
extern int record_set_is_scheme (record_t,
int (*_is_scheme) (record_t, const char *, int));
extern int mu_record_is_scheme (mu_record_t, const char *, int flags);
extern int mu_record_set_scheme (mu_record_t, const char *);
extern int mu_record_set_is_scheme (mu_record_t,
int (*_is_scheme) (mu_record_t, const char *, int));
/* Url. */
extern int record_get_url (record_t, int (*(*)) (url_t));
extern int record_set_url (record_t, int (*) (url_t));
extern int record_set_get_url (record_t,
int (*_get_url) (record_t, int (*(*)) (url_t)));
extern int mu_record_get_url (mu_record_t, int (*(*)) (mu_url_t));
extern int mu_record_set_url (mu_record_t, int (*) (mu_url_t));
extern int mu_record_set_get_url (mu_record_t,
int (*_get_url) (mu_record_t, int (*(*)) (mu_url_t)));
/* Mailbox. */
extern int record_get_mailbox (record_t, int (*(*)) (mailbox_t));
extern int record_set_mailbox (record_t, int (*) (mailbox_t));
extern int record_set_get_mailbox (record_t,
int (*_get_mailbox) (record_t, int (*(*)) (mailbox_t)));
extern int mu_record_get_mailbox (mu_record_t, int (*(*)) (mu_mailbox_t));
extern int mu_record_set_mailbox (mu_record_t, int (*) (mu_mailbox_t));
extern int mu_record_set_get_mailbox (mu_record_t,
int (*_get_mailbox) (mu_record_t, int (*(*)) (mu_mailbox_t)));
/* Mailer. */
extern int record_get_mailer (record_t,
int (*(*)) (mailer_t));
extern int record_set_mailer (record_t, int (*) (mailer_t));
extern int record_set_get_mailer (record_t,
int (*_get_mailer) (record_t, int (*(*)) (mailer_t)));
extern int mu_record_get_mailer (mu_record_t,
int (*(*)) (mu_mailer_t));
extern int mu_record_set_mailer (mu_record_t, int (*) (mu_mailer_t));
extern int mu_record_set_get_mailer (mu_record_t,
int (*_get_mailer) (mu_record_t, int (*(*)) (mu_mailer_t)));
/* Folder. */
extern int record_get_folder (record_t, int (*(*)) (folder_t));
extern int record_set_folder (record_t, int (*) (folder_t));
extern int record_set_get_folder (record_t,
int (*_get_folder) (record_t, int (*(*)) (folder_t)));
extern int mu_record_get_folder (mu_record_t, int (*(*)) (mu_folder_t));
extern int mu_record_set_folder (mu_record_t, int (*) (mu_folder_t));
extern int mu_record_set_get_folder (mu_record_t,
int (*_get_folder) (mu_record_t, int (*(*)) (mu_folder_t)));
/* Records provided by the library. */
/* Remote Folder "imap://" */
extern record_t imap_record;
extern mu_record_t mu_imap_record;
/* Remote Mailbox POP3, pop:// */
extern record_t pop_record;
extern mu_record_t mu_pop_record;
/* Remote newsgroup NNTP, nntp:// */
extern record_t nntp_record;
extern mu_record_t mu_nntp_record;
/* Local Mailbox Unix Mailbox, "mbox:" */
extern record_t mbox_record;
extern mu_record_t mu_mbox_record;
/* Local Folder/Mailbox, / */
extern record_t path_record;
extern mu_record_t mu_path_record;
/* Local MH, "mh:" */
extern record_t mh_record;
extern mu_record_t mu_mh_record;
/* Maildir, "maildir:" */
extern record_t maildir_record;
extern mu_record_t mu_maildir_record;
#define MU_IMAP_PRIO 100
#define MU_POP_PRIO 200
......@@ -110,39 +110,39 @@ extern record_t maildir_record;
#define MU_SENDMAIL_PRIO 10000
/* SMTP mailer, "smtp://" */
extern record_t smtp_record;
extern mu_record_t mu_smtp_record;
/* Sendmail, "sendmail:" */
extern record_t sendmail_record;
extern mu_record_t mu_sendmail_record;
#define mu_register_all_mbox_formats() do {\
registrar_record (path_record);\
registrar_record (mbox_record);\
registrar_record (pop_record);\
registrar_record (imap_record);\
registrar_record (mh_record);\
registrar_record (maildir_record);\
mu_registrar_record (mu_path_record);\
mu_registrar_record (mu_mbox_record);\
mu_registrar_record (mu_pop_record);\
mu_registrar_record (mu_imap_record);\
mu_registrar_record (mu_mh_record);\
mu_registrar_record (mu_maildir_record);\
} while (0)
#define mu_register_local_mbox_formats() do {\
registrar_record (path_record);\
registrar_record (mbox_record);\
registrar_record (mh_record);\
registrar_record (maildir_record);\
mu_registrar_record (mu_path_record);\
mu_registrar_record (mu_mbox_record);\
mu_registrar_record (mu_mh_record);\
mu_registrar_record (mu_maildir_record);\
} while (0)
#define mu_register_remote_mbox_formats() do {\
registrar_record (pop_record);\
registrar_record (imap_record);\
registrar_record (nntp_record);\
mu_registrar_record (mu_pop_record);\
mu_registrar_record (mu_imap_record);\
mu_registrar_record (mu_nntp_record);\
} while (0)
#define mu_register_all_mailer_formats() do {\
registrar_record (sendmail_record);\
registrar_record (smtp_record);\
mu_registrar_record (mu_sendmail_record);\
mu_registrar_record (mu_smtp_record);\
} while (0)
#define mu_register_extra_formats() do {\
registrar_record (nntp_record);\
mu_registrar_record (mu_nntp_record);\
} while (0)
#define mu_register_all_formats() do {\
......