summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth/gsasl.c5
-rw-r--r--auth/tls.c3
-rw-r--r--examples/addr.c2
-rw-r--r--imap4d/namespace.c1
-rw-r--r--lib/mu_dbm.c4
-rw-r--r--mail/util.c2
-rw-r--r--mailbox/address.c26
-rw-r--r--mailbox/amd.c15
-rw-r--r--mailbox/attachment.c25
-rw-r--r--mailbox/attribute.c9
-rw-r--r--mailbox/auth.c8
-rw-r--r--mailbox/body.c11
-rw-r--r--mailbox/debug.c5
-rw-r--r--mailbox/envelope.c5
-rw-r--r--mailbox/file_stream.c8
-rw-r--r--mailbox/filter.c11
-rw-r--r--mailbox/filter_trans.c7
-rw-r--r--mailbox/folder.c27
-rw-r--r--mailbox/header.c22
-rw-r--r--mailbox/imap/folder.c7
-rw-r--r--mailbox/imap/mbox.c11
-rw-r--r--mailbox/iterator.c17
-rw-r--r--mailbox/list.c23
-rw-r--r--mailbox/mailcap.c27
-rw-r--r--mailbox/mailer.c28
-rw-r--r--mailbox/mapfile_stream.c7
-rw-r--r--mailbox/mbox/folder.c7
-rw-r--r--mailbox/mbox/mbox.c10
-rw-r--r--mailbox/mbox/url.c5
-rw-r--r--mailbox/mbx_default.c4
-rw-r--r--mailbox/memory_stream.c5
-rw-r--r--mailbox/message.c35
-rw-r--r--mailbox/mime.c7
-rw-r--r--mailbox/monitor.c6
-rw-r--r--mailbox/mu_auth.c2
-rw-r--r--mailbox/observer.c8
-rw-r--r--mailbox/pop/mbox.c4
-rw-r--r--mailbox/pop/pop3_capa.c6
-rw-r--r--mailbox/pop/pop3_carrier.c6
-rw-r--r--mailbox/pop/pop3_list.c4
-rw-r--r--mailbox/pop/pop3_lista.c4
-rw-r--r--mailbox/pop/pop3_retr.c4
-rw-r--r--mailbox/pop/pop3_stat.c4
-rw-r--r--mailbox/pop/pop3_timeout.c4
-rw-r--r--mailbox/pop/pop3_top.c7
-rw-r--r--mailbox/pop/pop3_uidl.c4
-rw-r--r--mailbox/pop/pop3_uidla.c6
-rw-r--r--mailbox/property.c5
-rw-r--r--mailbox/refcount.c4
-rw-r--r--mailbox/registrar.c21
-rw-r--r--mailbox/rfc2047.c16
-rw-r--r--mailbox/sendmail.c20
-rw-r--r--mailbox/smtp.c12
-rw-r--r--mailbox/stream.c16
-rw-r--r--mailbox/tcp.c10
-rw-r--r--mailbox/ticket.c13
-rw-r--r--mailbox/url.c10
-rw-r--r--mailbox/wicket.c4
-rw-r--r--mh/mh_ctx.c8
59 files changed, 372 insertions, 225 deletions
diff --git a/auth/gsasl.c b/auth/gsasl.c
index 5d9bd86c3..eed55e7fa 100644
--- a/auth/gsasl.c
+++ b/auth/gsasl.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <mailutils/argp.h>
#include <mailutils/error.h>
+#include <mailutils/errno.h>
#include <mailutils/mu_auth.h>
#include <mailutils/nls.h>
#include <mailutils/stream.h>
@@ -288,7 +289,7 @@ gsasl_stream_create (stream_t *stream, int fd,
int rc;
if (stream == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
if ((flags & ~(MU_STREAM_READ|MU_STREAM_WRITE))
|| (flags & (MU_STREAM_READ|MU_STREAM_WRITE)) ==
diff --git a/auth/tls.c b/auth/tls.c
index a166e1c4f..b50ec41e8 100644
--- a/auth/tls.c
+++ b/auth/tls.c
@@ -32,6 +32,7 @@
#include <mailutils/tls.h>
#include <mailutils/nls.h>
#include <mailutils/stream.h>
+#include <mailutils/errno.h>
#include <lbuf.h>
@@ -521,7 +522,7 @@ tls_stream_create (stream_t *stream, int in_fd, int out_fd, int flags)
int rc;
if (stream == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
s = calloc (1, sizeof (*s));
if (s == NULL)
diff --git a/examples/addr.c b/examples/addr.c
index 8c42d1126..ed0affca4 100644
--- a/examples/addr.c
+++ b/examples/addr.c
@@ -23,7 +23,7 @@
#include <mailutils/errno.h>
#include <mailutils/mutil.h>
-#define EPARSE ENOENT
+#define EPARSE MU_ERR_NOENT
static int
parse (const char *str)
diff --git a/imap4d/namespace.c b/imap4d/namespace.c
index b208de2ea..83afc76b6 100644
--- a/imap4d/namespace.c
+++ b/imap4d/namespace.c
@@ -170,7 +170,6 @@ char *
namespace_checkfullpath (char *name, const char *pattern, const char *delim)
{
struct namespace_info info;
- url_t url = NULL;
char *p, *path = NULL;
char *scheme = NULL;
diff --git a/lib/mu_dbm.c b/lib/mu_dbm.c
index 618d2a901..22c812b5d 100644
--- a/lib/mu_dbm.c
+++ b/lib/mu_dbm.c
@@ -275,7 +275,7 @@ mu_dbm_firstkey (DBM_FILE db)
key.data = NULL;
key.size = 0;
if (ret == DB_NOTFOUND)
- errno = ENOENT;
+ errno = MU_ERR_NOENT;
else
errno = ret;
}
@@ -299,7 +299,7 @@ mu_dbm_nextkey (DBM_FILE db, DBM_DATUM pkey /*unused*/)
key.data = NULL;
key.size = 0;
if (ret == DB_NOTFOUND)
- errno = ENOENT;
+ errno = MU_ERR_NOENT;
else
errno = ret;
}
diff --git a/mail/util.c b/mail/util.c
index 06c55e5c9..6fb16388f 100644
--- a/mail/util.c
+++ b/mail/util.c
@@ -1269,7 +1269,7 @@ util_get_message (mailbox_t mbox, size_t msgno, message_t *msg)
if (msgno > total)
{
util_error_range (msgno);
- return ENOENT;
+ return MU_ERR_NOENT;
}
status = mailbox_get_message (mbox, msgno, msg);
diff --git a/mailbox/address.c b/mailbox/address.c
index 5a2ce4650..5a7c75ec6 100644
--- a/mailbox/address.c
+++ b/mailbox/address.c
@@ -206,7 +206,7 @@ address_get_nth (address_t addr, size_t no, address_t *pret)
{
address_t subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
*pret = address_dup (subaddr);
return 0;
}
@@ -223,7 +223,7 @@ address_get_personal (address_t addr, size_t no, char *buf, size_t len,
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
i = mu_cpystr (buf, subaddr->personal, len);
if (n)
@@ -243,7 +243,7 @@ address_get_comments (address_t addr, size_t no, char *buf, size_t len,
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
i = mu_cpystr (buf, subaddr->comments, len);
if (n)
@@ -263,7 +263,7 @@ address_get_email (address_t addr, size_t no, char *buf, size_t len,
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
i = mu_cpystr (buf, subaddr->email, len);
if (n)
@@ -348,7 +348,7 @@ address_aget_personal (address_t addr, size_t no, char **buf)
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
if (subaddr->personal)
{
@@ -372,7 +372,7 @@ address_aget_comments (address_t addr, size_t no, char **buf)
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
if (subaddr->comments)
{
@@ -396,7 +396,7 @@ address_aget_email (address_t addr, size_t no, char **buf)
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
if (subaddr->email)
{
@@ -421,7 +421,7 @@ address_aget_local_part (address_t addr, size_t no, char **buf)
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
if (subaddr->local_part)
{
@@ -446,7 +446,7 @@ address_aget_domain (address_t addr, size_t no, char **buf)
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
if (subaddr->domain)
{
@@ -472,7 +472,7 @@ address_get_local_part (address_t addr, size_t no, char *buf, size_t len,
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
i = mu_cpystr (buf, subaddr->local_part, len);
if (n)
@@ -492,7 +492,7 @@ address_get_domain (address_t addr, size_t no, char *buf, size_t len,
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
i = mu_cpystr (buf, subaddr->domain, len);
if (n)
@@ -512,7 +512,7 @@ address_get_route (address_t addr, size_t no, char *buf, size_t len,
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
i = mu_cpystr (buf, subaddr->route, len);
if (n)
@@ -554,7 +554,7 @@ address_is_group (address_t addr, size_t no, int *yes)
subaddr = _address_get_nth (addr, no);
if (!subaddr)
- return ENOENT;
+ return MU_ERR_NOENT;
if (yes)
*yes = _address_is_group (subaddr);
diff --git a/mailbox/amd.c b/mailbox/amd.c
index a8ba0ff71..a2951bc97 100644
--- a/mailbox/amd.c
+++ b/mailbox/amd.c
@@ -55,6 +55,7 @@
#include <mailutils/debug.h>
#include <mailutils/envelope.h>
#include <mailutils/error.h>
+#include <mailutils/errno.h>
#include <mailutils/header.h>
#include <mailutils/locker.h>
#include <mailutils/message.h>
@@ -244,7 +245,9 @@ amd_init_mailbox (mailbox_t mailbox, size_t amd_size, struct _amd_data **pamd)
struct _amd_data *amd;
size_t name_len;
- if (mailbox == NULL || amd_size < sizeof (*amd))
+ if (mailbox == NULL)
+ return MU_ERR_MBX_NULL;
+ if (amd_size < sizeof (*amd))
return EINVAL;
amd = mailbox->data = calloc (1, amd_size);
@@ -338,7 +341,7 @@ static int
amd_close (mailbox_t mailbox)
{
if (!mailbox)
- return EINVAL;
+ return MU_ERR_MBX_NULL;
return 0;
}
@@ -463,7 +466,9 @@ amd_get_message (mailbox_t mailbox, size_t msgno, message_t *pmsg)
struct _amd_message *mhm;
/* Sanity checks. */
- if (pmsg == NULL || amd == NULL)
+ if (pmsg == NULL)
+ return MU_ERR_OUT_PTR_NULL;
+ if (amd == NULL)
return EINVAL;
/* If we did not start a scanning yet do it now. */
@@ -642,7 +647,9 @@ amd_append_message (mailbox_t mailbox, message_t msg)
struct _amd_data *amd = mailbox->data;
struct _amd_message *mhm;
- if (!mailbox || !msg)
+ if (!mailbox)
+ return MU_ERR_MBX_NULL;
+ if (!msg)
return EINVAL;
mhm = calloc (1, amd->msg_size);
diff --git a/mailbox/attachment.c b/mailbox/attachment.c
index 323d55d6d..27d5e3a13 100644
--- a/mailbox/attachment.c
+++ b/mailbox/attachment.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -43,6 +43,7 @@
#include <mailutils/header.h>
#include <mailutils/message.h>
#include <mailutils/stream.h>
+#include <mailutils/errno.h>
#define MAX_HDR_LEN 256
#define BUF_SIZE 2048
@@ -74,7 +75,9 @@ message_create_attachment (const char *content_type, const char *encoding,
char *header, *name = NULL, *fname = NULL;
int ret;
- if (filename == NULL || newmsg == NULL)
+ if (newmsg == NULL)
+ return MU_ERR_OUT_PTR_NULL;
+ if (filename == NULL)
return EINVAL;
if ((ret = message_create (newmsg, NULL)) == 0)
@@ -266,7 +269,7 @@ message_get_attachment_name (message_t msg, char *name, size_t bufsz, size_t *sz
ret = ENOMEM;
}
else
- ret = ENOENT;
+ ret = MU_ERR_NOENT;
}
return ret;
}
@@ -277,8 +280,8 @@ int message_aget_attachment_name(message_t msg, char** name)
size_t sz = 0;
int ret = 0;
- if(name == NULL)
- return EINVAL;
+ if (name == NULL)
+ return MU_ERR_OUT_PTR_NULL;
if((ret = message_get_attachment_name(msg, NULL, 0, &sz)) != 0)
return ret;
@@ -313,7 +316,7 @@ message_get_attachment_name (message_t msg, char *buf, size_t bufsz, size_t *sz)
/* If the header wasn't there, we'll fall back to Content-Type, but
other errors are fatal. */
- if(ret != 0 && ret != ENOENT)
+ if(ret != 0 && ret != MU_ERR_NOENT)
return ret;
if(ret == 0 && value != NULL)
@@ -350,7 +353,7 @@ message_get_attachment_name (message_t msg, char *buf, size_t bufsz, size_t *sz)
strncpy(buf, name, bufsz);
}
else
- ret = ENOENT;
+ ret = MU_ERR_NOENT;
return ret;
}
@@ -456,8 +459,10 @@ message_encapsulate (message_t msg, message_t * newmsg, void **data)
size_t nbytes;
body_t body;
- if (msg == NULL || newmsg == NULL)
+ if (msg == NULL)
return EINVAL;
+ if (newmsg == NULL)
+ return MU_ERR_OUT_PTR_NULL;
if ((ret = _attachment_setup (&info, msg, &ostream, data)) != 0)
return ret;
@@ -514,8 +519,10 @@ message_unencapsulate (message_t msg, message_t * newmsg, void **data)
stream_t istream, ostream;
struct _msg_info *info = NULL;
- if (msg == NULL || newmsg == NULL)
+ if (msg == NULL)
return EINVAL;
+ if (newmsg == NULL)
+ return MU_ERR_OUT_PTR_NULL;
if ((data == NULL || *data == NULL)
&& (ret = message_get_header (msg, &hdr)) == 0)
diff --git a/mailbox/attribute.c b/mailbox/attribute.c
index 19c733b02..fd92871f3 100644
--- a/mailbox/attribute.c
+++ b/mailbox/attribute.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -28,6 +28,7 @@
# include <strings.h>
#endif
+#include <mailutils/errno.h>
#include <attribute0.h>
static int flags_to_string __P ((int, char *, size_t, size_t *));
@@ -37,7 +38,7 @@ attribute_create (attribute_t *pattr, void *owner)
{
attribute_t attr;
if (pattr == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
attr = calloc (1, sizeof(*attr));
if (attr == NULL)
return ENOMEM;
@@ -90,8 +91,10 @@ attribute_set_modified (attribute_t attr)
int
attribute_get_flags (attribute_t attr, int *pflags)
{
- if (attr == NULL || pflags == NULL)
+ if (attr == NULL)
return EINVAL;
+ if (pflags == NULL)
+ return MU_ERR_OUT_PTR_NULL;
if (attr->_get_flags)
return attr->_get_flags (attr, pflags);
*pflags = attr->flags;
diff --git a/mailbox/auth.c b/mailbox/auth.c
index 0a42f4a71..97278f51e 100644
--- a/mailbox/auth.c
+++ b/mailbox/auth.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -48,7 +48,7 @@ authority_create (authority_t *pauthority, ticket_t ticket, void *owner)
{
authority_t authority;
if (pauthority == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
authority = calloc (1, sizeof (*authority));
if (authority == NULL)
return ENOMEM;
@@ -93,8 +93,10 @@ authority_set_ticket (authority_t authority, ticket_t ticket)
int
authority_get_ticket (authority_t authority, ticket_t *pticket)
{
- if (authority == NULL || pticket == NULL)
+ if (authority == NULL)
return EINVAL;
+ if (pticket == NULL)
+ return MU_ERR_OUT_PTR_NULL;
if (authority->ticket == NULL)
{
int status = ticket_create (&(authority->ticket), authority);
diff --git a/mailbox/body.c b/mailbox/body.c
index 2bebc0de0..82d632856 100644
--- a/mailbox/body.c
+++ b/mailbox/body.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -30,6 +30,7 @@
#include <mailutils/stream.h>
#include <mailutils/mutil.h>
+#include <mailutils/errno.h>
#include <body0.h>
#define BODY_MODIFIED 0x10000
@@ -53,7 +54,9 @@ body_create (body_t *pbody, void *owner)
{
body_t body;
- if (pbody == NULL || owner == NULL)
+ if (pbody == NULL)
+ return MU_ERR_OUT_PTR_NULL;
+ if (owner == NULL)
return EINVAL;
body = calloc (1, sizeof (*body));
@@ -140,8 +143,10 @@ body_get_filename (body_t body, char *filename, size_t len, size_t *pn)
int
body_get_stream (body_t body, stream_t *pstream)
{
- if (body == NULL || pstream == NULL)
+ if (body == NULL)
return EINVAL;
+ if (pstream == NULL)
+ return MU_ERR_OUT_PTR_NULL;
if (body->stream == NULL)
{
diff --git a/mailbox/debug.c b/mailbox/debug.c
index 2500da2df..0b7985529 100644
--- a/mailbox/debug.c
+++ b/mailbox/debug.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
+#include <mailutils/errno.h>
#include <debug0.h>
int
@@ -31,7 +32,7 @@ mu_debug_create (mu_debug_t *pdebug, void *owner)
{
mu_debug_t debug;
if (pdebug == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
debug = calloc (sizeof (*debug), 1);
if (debug == NULL)
return ENOMEM;
diff --git a/mailbox/envelope.c b/mailbox/envelope.c
index bf9d51039..3b10dc5a6 100644
--- a/mailbox/envelope.c
+++ b/mailbox/envelope.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@
#endif
#include <errno.h>
#include <stdlib.h>
+#include <mailutils/errno.h>
#include <envelope0.h>
int
@@ -27,7 +28,7 @@ envelope_create (envelope_t *penvelope, void *owner)
{
envelope_t envelope;
if (penvelope == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
envelope = calloc (1, sizeof (*envelope));
if (envelope == NULL)
return ENOMEM;
diff --git a/mailbox/file_stream.c b/mailbox/file_stream.c
index 508398b7b..2c503bae7 100644
--- a/mailbox/file_stream.c
+++ b/mailbox/file_stream.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -486,7 +486,7 @@ file_stream_create (stream_t *stream, const char* filename, int flags)
int ret;
if (stream == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
fs = calloc (1, sizeof (struct _file_stream));
if (fs == NULL)
@@ -528,7 +528,7 @@ stdio_stream_create (stream_t *stream, FILE *file, int flags)
int ret;
if (stream == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
if (file == NULL)
return EINVAL;
@@ -954,7 +954,7 @@ _prog_stream_create (struct _prog_stream **pfs,
int ret;
if (stream == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
if (progname == NULL || (flags & MU_STREAM_NO_CLOSE))
return EINVAL;
diff --git a/mailbox/filter.c b/mailbox/filter.c
index 773ea64fe..e99c2e77a 100644
--- a/mailbox/filter.c
+++ b/mailbox/filter.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -36,6 +36,7 @@ First draft: Alain Magloire.
#include <mailutils/iterator.h>
#include <mailutils/stream.h>
+#include <mailutils/errno.h>
static void
filter_destroy (stream_t stream)
@@ -138,7 +139,7 @@ int
filter_get_list (list_t *plist)
{
if (plist == NULL)
- return EINVAL;
+ return MU_ERR_OUT_PTR_NULL;
monitor_wrlock (&filter_monitor);
if (filter_list == NULL)
{
@@ -171,7 +172,9 @@ filter_create (stream_t *pstream, stream_t stream, const char *name,
int status;
list_t list = NULL;
- if (pstream == NULL || stream == NULL || name == NULL)
+ if (pstream == NULL)
+ return MU_ERR_OUT_PTR_NULL;
+ if (stream == NULL || name == NULL)
return EINVAL;
filter_get_list (&list);
@@ -256,6 +259,6 @@ filter_create (stream_t *pstream, stream_t stream, const char *name,
stream_set_destroy (*pstream, filter_destroy, filter);
}
else
- status = ENOENT;
+ status = MU_ERR_NOENT;
return status;
}
diff --git a/mailbox/filter_trans.c b/mailbox/filter_trans.c
index 3785b9de3..f800c2c45 100644
--- a/mailbox/filter_trans.c
+++ b/mailbox/filter_trans.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -29,6 +29,7 @@ First Draft: Dave Inglis.
#include <string.h>
#include <mailutils/stream.h>
+#include <mailutils/errno.h>
#include <filter0.h>
@@ -76,7 +77,9 @@ trans_read (filter_t filter, char *optr, size_t osize, off_t offset,
int ret = 0, i;
size_t bytes, *nbytes = &bytes;
- if (optr == NULL || osize == 0)
+ if (optr == NULL)
+ return MU_ERR_OUT_NULL;
+ if (osize == 0)
return EINVAL;
if (n_bytes)
diff --git a/mailbox/folder.c b/mailbox/folder.c
index d50298beb..50f008e43 100644
--- a/mailbox/folder.c
+++ b/