Commit 8e632048 8e632048790803010c55b60e254e0c9c5a51d42c by Sergey Poznyakoff

Use mu_off_t instead of off_t

1 parent 0f3bca17
2005-11-15 Sergey Poznyakoff <gray@gnu.org.ua>
* configure.ac: Determine the size of off_t and define an
equivalent mu_off_t type. We cannot use off_t in the library since
its size depends on whether large file support is used or not,
which will lead to arbitrary crashes if a user application and the
library use off_t of different sizes.
(MU_COMMON_INCLUDES): New substitute variable
* gnulib.modules (mailutils): Add glob
* include/mailutils/types.h: Removed
* include/mailutils/types.hin: New file
* include/mailutils/Makefile.am: Build types.h
* auth/Makefile.am (UNCLUDES): Rewritten using MU_COMMON_INCLUDES
* comsat/Makefile.am: Likewise
* config/Makefile.am: Likewise
* dotlock/Makefile.am: Likewise
* examples/Makefile.am: Likewise
* frm/Makefile.am: Likewise
* guimb/Makefile.am: Likewise
* imap4d/Makefile.am: Likewise
* lib/Makefile.am: Likewise
* libmu_cpp/Makefile.am: Likewise
* libmu_scm/Makefile.am: Likewise
* libsieve/Makefile.am: Likewise
* libsieve/extensions/Makefile.am: Likewise
* mail/Makefile.am: Likewise
* mail.local/Makefile.am: Likewise
* mail.remote/Makefile.am: Likewise
* mailbox/Makefile.am: Likewise
* mailbox/imap/Makefile.am: Likewise
* mailbox/maildir/Makefile.am: Likewise
* mailbox/mbox/Makefile.am: Likewise
* mailbox/mh/Makefile.am: Likewise
* mailbox/nntp/Makefile.am: Likewise
* mailbox/pop/Makefile.am: Likewise
* mapi/Makefile.am: Likewise
* messages/Makefile.am: Likewise
* mh/Makefile.am: Likewise
* mimeview/Makefile.am: Likewise
* movemail/Makefile.am: Likewise
* pop3d/Makefile.am: Likewise
* readmsg/Makefile.am: Likewise
* sieve/Makefile.am: Likewise
* sql/Makefile.am: Likewise
* auth/tls.c: Use mu_off_t instead of off_t
* examples/argcv.c: Likewise
* examples/base64.c: Likewise
* examples/mimetest.c: Likewise
* examples/murun.c: Likewise
* examples/nntpclient.c: Likewise
* examples/pop3client.c: Likewise
* include/mailutils/header.h: Likewise
* include/mailutils/mailbox.h: Likewise
* include/mailutils/stream.h: Likewise
* include/mailutils/types.h: Likewise
* libmu_scm/mu_port.c: Likewise
* mail.local/main.c: Likewise
* mailbox/amd.c: Likewise
* mailbox/body.c: Likewise
* mailbox/file_stream.c: Likewise
* mailbox/filter.c: Likewise
* mailbox/filter_iconv.c: Likewise
* mailbox/filter_rfc822.c: Likewise
* mailbox/filter_trans.c: Likewise
* mailbox/header.c: Likewise
* mailbox/mailbox.c: Likewise
* mailbox/mapfile_stream.c
* mailbox/memory_stream.c
* mailbox/message.c: Likewise
* mailbox/mime.c: Likewise
* mailbox/stream.c: Likewise
* mailbox/tcp.c: Likewise
* mailbox/imap/folder.c: Likewise
* mailbox/imap/mbox.c: Likewise
* mailbox/include/amd.h: Likewise
* mailbox/include/filter0.h: Likewise
* mailbox/include/header0.h: Likewise
* mailbox/include/imap0.h: Likewise
* mailbox/include/mailbox0.h: Likewise
* mailbox/include/stream0.h: Likewise
* mailbox/mbox/mbox.c: Likewise
* mailbox/mbox/mboxscan.c: Likewise
* mailbox/nntp/mbox.c: Likewise
* mailbox/nntp/nntp_stream.c: Likewise
* mailbox/pop/mbox.c: Likewise
* mailbox/pop/pop3_stream.c: Likewise
* mh/mh_stream.c: Likewise
* pop3d/pop3d.c: Likewise
* m4/gnulib.m4: Update
* m4/mu_libobj.m4: Update
Update by gnulib-sync:
* lib/allocsa.c: Updated
* lib/allocsa.h: Updated
* lib/allocsa.valgrind: Updated
* lib/asprintf.c: Updated
* lib/error.c: Updated
* lib/error.h: Updated
* lib/exit.h: Updated
* lib/exitfail.c: Updated
* lib/exitfail.h: Updated
* lib/getpass.c: Updated
* lib/getpass.h: Updated
* lib/intprops.h: Updated
* lib/mbswidth.c: Updated
* lib/mbswidth.h: Updated
* lib/obstack.c: Updated
* lib/obstack.h: Updated
* lib/realloc.c: Updated
* lib/setenv.c: Updated
* lib/setenv.h: Updated
* lib/snprintf.c: Updated
* lib/snprintf.h: Updated
* lib/unsetenv.c: Updated
* lib/vasprintf.c: Updated
* lib/vasprintf.h: Updated
* lib/xalloc-die.c: Updated
* lib/xalloc.h: Updated
* lib/xmalloc.c: Updated
* lib/xsize.h: Updated
* lib/xstrtol.c: Updated
* lib/xstrtol.h: Updated
* lib/xstrtoul.c: Updated
* m4/alloca.m4: Updated
* m4/allocsa.m4: Updated
* m4/argp.m4: Updated
* m4/d-type.m4: Added to the repository
* m4/eealloc.m4: Updated
* m4/eoverflow.m4: Updated
* m4/error.m4: Updated
* m4/exitfail.m4: Updated
* m4/extensions.m4: Updated
* m4/fnmatch.m4: Updated
* m4/getdelim.m4: Updated
* m4/getline.m4: Updated
* m4/getlogin_r.m4: Added to the repository
* m4/getopt.m4: Updated
* m4/getpass.m4: Updated
* m4/glob.m4: Added to the repository
* m4/intmax_t.m4: Updated
* m4/inttypes.m4: Updated
* m4/inttypes_h_gl.m4: Updated
* m4/longdouble.m4: Updated
* m4/longlong_gl.m4: Updated
* m4/mbchar.m4: Updated
* m4/mbiter.m4: Added to the repository
* m4/mbrtowc.m4: Updated
* m4/mbstate_t.m4: Updated
* m4/mbswidth.m4: Updated
* m4/md5.m4: Updated
* m4/memchr.m4: Updated
* m4/mempcpy.m4: Updated
* m4/minmax.m4: Updated
* m4/obstack.m4: Updated
* m4/onceonly.m4: Updated
* m4/regex.m4: Updated
* m4/restrict.m4: Updated
* m4/setenv.m4: Updated
* m4/signed.m4: Updated
* m4/size_max.m4: Updated
* m4/snprintf.m4: Updated
* m4/stat-macros.m4: Added to the repository
* m4/stdbool.m4: Updated
* m4/stdint.m4: Added to the repository
* m4/stdint_h_gl.m4: Updated
* m4/strcase.m4: Updated
* m4/strchrnul.m4: Updated
* m4/strdup.m4: Added to the repository
* m4/strerror_r.m4: Updated
* m4/strndup.m4: Updated
* m4/strnlen.m4: Updated
* m4/strtok_r.m4: Updated
* m4/sysexits.m4: Updated
* m4/uintmax_t_gl.m4: Updated
* m4/ulonglong_gl.m4: Updated
* m4/vasnprintf.m4: Updated
* m4/vasprintf.m4: Updated
* m4/vsnprintf.m4: Updated
* m4/wchar_t.m4: Updated
* m4/wint_t.m4: Updated
* m4/xalloc.m4: Updated
* m4/xsize.m4: Updated
* m4/xstrtol.m4: Updated
* mailbox/alloca.c: Updated
* mailbox/alloca_.h: Updated
* mailbox/argp-ba.c: Updated
* mailbox/argp-eexst.c: Updated
* mailbox/argp-fmtstream.c: Updated
* mailbox/argp-fmtstream.h: Updated
* mailbox/argp-fs-xinl.c: Updated
* mailbox/argp-help.c: Updated
* mailbox/argp-namefrob.h: Updated
* mailbox/argp-parse.c: Updated
* mailbox/argp-pv.c: Updated
* mailbox/argp-pvh.c: Updated
* mailbox/argp-xinl.c: Updated
* mailbox/argp.h: Updated
* mailbox/asnprintf.c: Updated
* mailbox/fnmatch.c: Added to the repository
* mailbox/fnmatch_.h: Added to the repository
* mailbox/fnmatch_loop.c: Added to the repository
* mailbox/getdelim.c: Updated
* mailbox/getdelim.h: Updated
* mailbox/getline.c: Updated
* mailbox/getline.h: Updated
* mailbox/getlogin_r.c: Added to the repository
* mailbox/getlogin_r.h: Added to the repository
* mailbox/getopt.c: Updated
* mailbox/getopt1.c: Updated
* mailbox/getopt_.h: Updated
* mailbox/getopt_int.h: Updated
* mailbox/gettext.h: Updated
* mailbox/glob-libc.h: Added to the repository
* mailbox/glob.c: Added to the repository
* mailbox/glob_.h: Added to the repository
* mailbox/malloc.c: Added to the repository
* mailbox/mbchar.c: Updated
* mailbox/mbchar.h: Updated
* mailbox/mbuiter.h: Added to the repository
* mailbox/md5.c: Updated
* mailbox/md5.h: Updated
* mailbox/memchr.c: Updated
* mailbox/mempcpy.c: Updated
* mailbox/mempcpy.h: Updated
* mailbox/minmax.h: Updated
* mailbox/printf-args.c: Updated
* mailbox/printf-args.h: Updated
* mailbox/printf-parse.c: Updated
* mailbox/printf-parse.h: Updated
* mailbox/regcomp.c: Updated
* mailbox/regex.c: Updated
* mailbox/regex.h: Updated
* mailbox/regex_internal.c: Updated
* mailbox/regex_internal.h: Updated
* mailbox/regexec.c: Updated
* mailbox/size_max.h: Updated
* mailbox/stat-macros.h: Added to the repository
* mailbox/stdbool_.h: Updated
* mailbox/stdint_.h: Added to the repository
* mailbox/strcase.h: Updated
* mailbox/strcasecmp.c: Updated
* mailbox/strchrnul.c: Updated
* mailbox/strchrnul.h: Updated
* mailbox/strdup.c: Added to the repository
* mailbox/strdup.h: Added to the repository
* mailbox/strncasecmp.c: Updated
* mailbox/strndup.c: Updated
* mailbox/strndup.h: Updated
* mailbox/strnlen.c: Updated
* mailbox/strnlen.h: Updated
* mailbox/strnlen1.c: Updated
* mailbox/strnlen1.h: Updated
* mailbox/strtok_r.c: Updated
* mailbox/strtok_r.h: Updated
* mailbox/sysexit_.h: Updated
* mailbox/vasnprintf.c: Updated
* mailbox/vasnprintf.h: Updated
* mailbox/vsnprintf.c: Updated
* mailbox/vsnprintf.h: Updated
* mailbox/xsize.h: Updated
* examples/argcv.c: Add missing includes
* examples/mailcap.c: Likewise
* examples/url-parse.c: Likewise
......
......@@ -271,7 +271,7 @@ _tls_destroy (mu_stream_t stream)
static int
_tls_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc;
......@@ -290,7 +290,7 @@ _tls_read (mu_stream_t stream, char *optr, size_t osize,
static int
_tls_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc;
......@@ -329,7 +329,7 @@ _tls_readline (mu_stream_t stream, char *optr, size_t osize,
static int
_tls_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _tls_stream *s = mu_stream_get_owner (stream);
int rc;
......
......@@ -16,9 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -16,9 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
......
......@@ -16,10 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
......
......@@ -16,9 +16,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
......
......@@ -20,9 +20,8 @@
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
# include <config.h> /* For ARG_UNUSED only */
#endif
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
......
......@@ -20,9 +20,8 @@
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
# include <config.h> /* For ARG_UNUSED only */
#endif
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
......
......@@ -130,7 +130,7 @@ extern int mu_header_set_lines (mu_header_t,
int (*_lines) (mu_header_t, size_t *), void *);
extern int mu_header_set_fill (mu_header_t,
int (*_fill) (mu_header_t, char *, size_t, off_t, size_t *), void *owner);
int (*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *), void *owner);
#ifdef __cplusplus
......
......@@ -56,7 +56,7 @@ 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 (mu_mailbox_t, off_t *size);
extern int mu_mailbox_get_size (mu_mailbox_t, mu_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);
......
......@@ -70,12 +70,12 @@ extern int mu_stream_get_transport2 (mu_stream_t stream, mu_transport_t *pt,
mu_transport_t *pt2);
extern int mu_stream_get_transport (mu_stream_t stream, mu_transport_t *pt);
extern int mu_stream_read (mu_stream_t, char *, size_t, off_t, size_t *);
extern int mu_stream_readline (mu_stream_t, char *, size_t, off_t, size_t *);
extern int mu_stream_size (mu_stream_t, off_t *);
extern int mu_stream_truncate (mu_stream_t, off_t);
extern int mu_stream_write (mu_stream_t, const char *, size_t, off_t,
size_t *);
extern int mu_stream_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
extern int mu_stream_readline (mu_stream_t, char *, size_t, mu_off_t, size_t *);
extern int mu_stream_size (mu_stream_t, mu_off_t *);
extern int mu_stream_truncate (mu_stream_t, mu_off_t);
extern int mu_stream_write (mu_stream_t, const char *, size_t, mu_off_t,
size_t *);
extern int mu_stream_setbufsiz (mu_stream_t stream, size_t size);
extern int mu_stream_flush (mu_stream_t);
......@@ -118,21 +118,21 @@ extern int mu_stream_set_get_transport2 (mu_stream_t,
void *owner);
extern int mu_stream_set_read (mu_stream_t,
int (*_read) (mu_stream_t, char *, size_t, off_t, size_t *),
void *owner);
int (*_read) (mu_stream_t, char *, size_t, mu_off_t, size_t *),
void *owner);
extern int mu_stream_set_readline (mu_stream_t,
int (*_readline) (mu_stream_t, char *, size_t, off_t, size_t *),
int (*_readline) (mu_stream_t, char *, size_t, mu_off_t, size_t *),
void *owner);
extern int mu_stream_set_size (mu_stream_t,
int (*_size) (mu_stream_t, off_t *), void *owner);
int (*_size) (mu_stream_t, mu_off_t *), void *owner);
extern int mu_stream_set_truncate (mu_stream_t,
int (*_truncate) (mu_stream_t, off_t), void *owner);
int (*_truncate) (mu_stream_t, mu_off_t), void *owner);
extern int mu_stream_set_write (mu_stream_t,
int (*_write) (mu_stream_t, const char *, size_t, off_t, size_t *),
int (*_write) (mu_stream_t, const char *, size_t, mu_off_t, size_t *),
void *owner);
extern int mu_stream_set_flush (mu_stream_t,
......@@ -152,7 +152,7 @@ extern int mu_stream_sequential_readline (mu_stream_t stream,
extern int mu_stream_sequential_write (mu_stream_t stream,
const char *buf, size_t size);
extern int mu_stream_seek (mu_stream_t stream, off_t off, int whence);
extern int mu_stream_seek (mu_stream_t stream, mu_off_t off, int whence);
extern int mu_stream_strerror (mu_stream_t stream, const char **p);
......
......@@ -213,12 +213,12 @@ mu_port_end_input (SCM port, int offset)
pt->rw_active = SCM_PORT_NEITHER;
}
static off_t
mu_port_seek (SCM port, off_t offset, int whence)
static mu_off_t
mu_port_seek (SCM port, mu_off_t offset, int whence)
{
struct mu_port *mp = MU_PORT (port);
scm_port *pt = SCM_PTAB_ENTRY (port);
off_t size = 0;
mu_off_t size = 0;
if (whence == SEEK_CUR && offset == 0)
return mp->offset;
......@@ -251,7 +251,7 @@ mu_port_seek (SCM port, off_t offset, int whence)
}
static void
mu_port_truncate (SCM port, off_t length)
mu_port_truncate (SCM port, mu_off_t length)
{
struct mu_port *mp = MU_PORT (port);
if (mu_stream_truncate (mp->stream, length))
......@@ -262,7 +262,7 @@ static int
mu_port_print (SCM exp, SCM port, scm_print_state *pstate)
{
struct mu_port *mp = MU_PORT (exp);
off_t size = 0;
mu_off_t size = 0;
scm_puts ("#<", port);
scm_print_port_mode (exp, port);
......
......@@ -520,7 +520,7 @@ switch_user_id (struct mu_auth_data *auth, int user)
}
static int
tmp_write (mu_stream_t stream, off_t *poffset, char *buf, size_t len)
tmp_write (mu_stream_t stream, mu_off_t *poffset, char *buf, size_t len)
{
size_t n = 0;
int status = mu_stream_write (stream, buf, len, *poffset, &n);
......@@ -536,7 +536,7 @@ make_tmp (const char *from, mu_mailbox_t *mbox)
mu_stream_t stream;
char *buf = NULL;
size_t n = 0;
off_t offset = 0;
mu_off_t offset = 0;
size_t line;
int status;
static char *newline = "\n";
......@@ -655,7 +655,7 @@ deliver (mu_mailbox_t imbx, char *name)
struct mu_auth_data *auth;
int status;
mu_stream_t istream, ostream;
off_t size;
mu_off_t size;
int failed = 0;
auth = mu_get_auth_by_name (name);
......@@ -738,7 +738,7 @@ deliver (mu_mailbox_t imbx, char *name)
#if defined(USE_MAILBOX_QUOTAS)
{
size_t n;
off_t isize;
mu_off_t isize;
switch (check_quota (name, size, &n))
{
......@@ -773,11 +773,11 @@ deliver (mu_mailbox_t imbx, char *name)
if (!failed && switch_user_id (auth, 1) == 0)
{
off_t ioff = 0;
off_t off = size;
mu_off_t ioff = 0;
mu_off_t off = size;
size_t nwr, nrd;
char *buf = NULL;
off_t bufsize = 1024;
mu_off_t bufsize = 1024;
mu_stream_size (istream, &bufsize);
for (; (buf = malloc (bufsize)) == NULL && bufsize > 1; bufsize /= 2)
......
......@@ -84,17 +84,17 @@ static int amd_uidnext (mu_mailbox_t mailbox, size_t *puidnext);
static int amd_uidvalidity (mu_mailbox_t, unsigned long *);
static int amd_scan (mu_mailbox_t, size_t, size_t *);
static int amd_is_updated (mu_mailbox_t);
static int amd_get_size (mu_mailbox_t, off_t *);
static int amd_get_size (mu_mailbox_t, mu_off_t *);
static int amd_body_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int amd_body_readline (mu_stream_t, char *, size_t, off_t, size_t *);
static int amd_stream_size (mu_stream_t stream, off_t *psize);
static int amd_body_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int amd_body_readline (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int amd_stream_size (mu_stream_t stream, mu_off_t *psize);
static int amd_body_size (mu_body_t body, size_t *psize);
static int amd_body_lines (mu_body_t body, size_t *plines);
static int amd_header_fill (mu_header_t header, char *buffer, size_t len,
off_t off, size_t *pnread);
mu_off_t off, size_t *pnread);
static int amd_header_size (mu_header_t header, size_t *psize);
static int amd_header_lines (mu_header_t header, size_t *plines);
......@@ -125,11 +125,11 @@ static int amd_envelope_sender (mu_envelope_t envelope, char *buf, size_t len,
Indexes are zero-based. */
static int
amd_msg_bsearch (struct _amd_data *amd, off_t first, off_t last,
amd_msg_bsearch (struct _amd_data *amd, mu_off_t first, mu_off_t last,
struct _amd_message *msg,
off_t *pret)
mu_off_t *pret)
{
off_t mid;
mu_off_t mid;
int rc;
if (last < first)
......@@ -163,7 +163,7 @@ amd_msg_lookup (struct _amd_data *amd, struct _amd_message *msg,
size_t *pret)
{
int rc;
off_t i;
mu_off_t i;
if (!amd->msg_array)
{
......@@ -997,7 +997,7 @@ amd_scan_message (struct _amd_message *mhm)
{
mu_stream_t stream = mhm->stream;
char buf[1024];
off_t off = 0;
mu_off_t off = 0;
size_t n;
int status;
int in_header = 1;
......@@ -1096,7 +1096,7 @@ amd_is_updated (mu_mailbox_t mailbox)
}
static int
amd_get_size (mu_mailbox_t mailbox ARG_UNUSED, off_t *psize ARG_UNUSED)
amd_get_size (mu_mailbox_t mailbox ARG_UNUSED, mu_off_t *psize ARG_UNUSED)
{
/*FIXME*/
return ENOSYS;
......@@ -1227,12 +1227,12 @@ amd_check_message (struct _amd_message *mhm)
static int
amd_readstream (struct _amd_message *mhm, char *buffer, size_t buflen,
off_t off, size_t *pnread, int isreadline,
off_t start, off_t end)
mu_off_t off, size_t *pnread, int isreadline,
mu_off_t start, mu_off_t end)
{
size_t nread = 0;
int status = 0;
off_t ln;
mu_off_t ln;
if (buffer == NULL || buflen == 0)
{
......@@ -1272,7 +1272,7 @@ amd_readstream (struct _amd_message *mhm, char *buffer, size_t buflen,
}
static int
amd_body_read (mu_stream_t is, char *buffer, size_t buflen, off_t off,
amd_body_read (mu_stream_t is, char *buffer, size_t buflen, mu_off_t off,
size_t *pnread)
{
mu_body_t body = mu_stream_get_owner (is);
......@@ -1285,7 +1285,7 @@ amd_body_read (mu_stream_t is, char *buffer, size_t buflen, off_t off,
static int
amd_body_readline (mu_stream_t is, char *buffer, size_t buflen,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
mu_body_t body = mu_stream_get_owner (is);
mu_message_t msg = mu_body_get_owner (body);
......@@ -1298,7 +1298,7 @@ amd_body_readline (mu_stream_t is, char *buffer, size_t buflen,
/* Return corresponding sizes */
static int
amd_stream_size (mu_stream_t stream, off_t *psize)
amd_stream_size (mu_stream_t stream, mu_off_t *psize)
{
mu_body_t body = mu_stream_get_owner (stream);
return amd_body_size (body, (size_t*) psize);
......@@ -1333,7 +1333,7 @@ amd_body_lines (mu_body_t body, size_t *plines)
/* Headers */
static int
amd_header_fill (mu_header_t header, char *buffer, size_t len,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
mu_message_t msg = mu_header_get_owner (header);
struct _amd_message *mhm = mu_message_get_owner (msg);
......
......@@ -38,11 +38,11 @@
static int _body_flush (mu_stream_t);
static int _body_get_transport2 (mu_stream_t, mu_transport_t *, mu_transport_t *);
static int _body_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int _body_readline (mu_stream_t, char *, size_t, off_t, size_t *);
static int _body_truncate (mu_stream_t, off_t);
static int _body_size (mu_stream_t, off_t *);
static int _body_write (mu_stream_t, const char *, size_t, off_t, size_t *);
static int _body_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int _body_readline (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int _body_truncate (mu_stream_t, mu_off_t);
static int _body_size (mu_stream_t, mu_off_t *);
static int _body_write (mu_stream_t, const char *, size_t, mu_off_t, size_t *);
/* Our own defaults for the body. */
static int _body_get_size (mu_body_t, size_t *);
......@@ -254,35 +254,35 @@ _body_get_transport2 (mu_stream_t stream, mu_transport_t *pin, mu_transport_t *p
}
static int
_body_read (mu_stream_t stream, char *buffer, size_t n, off_t off, size_t *pn)
_body_read (mu_stream_t stream, char *buffer, size_t n, mu_off_t off, size_t *pn)
{
mu_body_t body = mu_stream_get_owner (stream);
return mu_stream_read (body->fstream, buffer, n, off, pn);
}
static int
_body_readline (mu_stream_t stream, char *buffer, size_t n, off_t off, size_t *pn)
_body_readline (mu_stream_t stream, char *buffer, size_t n, mu_off_t off, size_t *pn)
{
mu_body_t body = mu_stream_get_owner (stream);
return mu_stream_readline (body->fstream, buffer, n, off, pn);
}
static int
_body_write (mu_stream_t stream, const char *buf, size_t n, off_t off, size_t *pn)
_body_write (mu_stream_t stream, const char *buf, size_t n, mu_off_t off, size_t *pn)
{
mu_body_t body = mu_stream_get_owner (stream);
return mu_stream_write (body->fstream, buf, n, off, pn);
}
static int
_body_truncate (mu_stream_t stream, off_t n)
_body_truncate (mu_stream_t stream, mu_off_t n)
{
mu_body_t body = mu_stream_get_owner (stream);
return mu_stream_truncate (body->fstream, n);
}
static int
_body_size (mu_stream_t stream, off_t *size)
_body_size (mu_stream_t stream, mu_off_t *size)
{
mu_body_t body = mu_stream_get_owner (stream);
return mu_stream_size (body->fstream, size);
......@@ -311,7 +311,7 @@ _body_get_size (mu_body_t body, size_t *psize)
static int
_body_get_size0 (mu_stream_t stream, size_t *psize)
{
off_t off = 0;
mu_off_t off = 0;
int status = mu_stream_size (stream, &off);
if (psize)
*psize = off;
......@@ -327,9 +327,9 @@ _body_get_lines0 (mu_stream_t stream, size_t *plines)
{
char buf[128];
size_t n = 0;
off_t off = 0;
mu_off_t off = 0;
while ((status = mu_stream_readline (stream, buf, sizeof buf,
off, &n)) == 0 && n > 0)
off, &n)) == 0 && n > 0)
{
if (buf[n - 1] == '\n')
lines++;
......
......@@ -46,7 +46,7 @@
struct _file_stream
{
FILE *file;
off_t offset;
mu_off_t offset;
char *filename;
mu_stream_t cache;
......@@ -67,7 +67,7 @@ _file_destroy (mu_stream_t stream)
static int
_file_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _file_stream *fs = mu_stream_get_owner (stream);
size_t n;
......@@ -110,7 +110,7 @@ _file_read (mu_stream_t stream, char *optr, size_t osize,
static int
_file_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _file_stream *fs = mu_stream_get_owner (stream);
size_t n = 0;
......@@ -163,7 +163,7 @@ _file_readline (mu_stream_t stream, char *optr, size_t osize,
static int
_file_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _file_stream *fs = mu_stream_get_owner (stream);
size_t n;
......@@ -201,7 +201,7 @@ _file_write (mu_stream_t stream, const char *iptr, size_t isize,
static int
_stdin_file_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *pnbytes)
mu_off_t offset, size_t *pnbytes)
{
int status = 0;
size_t nbytes;
......@@ -262,7 +262,7 @@ _stdin_file_read (mu_stream_t stream, char *optr, size_t osize,
static int
_stdin_file_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *pnbytes)
mu_off_t offset, size_t *pnbytes)
{
int status;
size_t nbytes;
......@@ -293,14 +293,14 @@ _stdin_file_readline (mu_stream_t stream, char *optr, size_t osize,
static int
_stdout_file_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _file_stream *fs = mu_stream_get_owner (stream);
return _file_write (stream, iptr, isize, fs->offset, nbytes);
}
static int
_file_truncate (mu_stream_t stream, off_t len)
_file_truncate (mu_stream_t stream, mu_off_t len)
{
struct _file_stream *fs = mu_stream_get_owner (stream);
if (fs->file && ftruncate (fileno(fs->file), len) != 0)
......@@ -309,7 +309,7 @@ _file_truncate (mu_stream_t stream, off_t len)
}
static int
_file_size (mu_stream_t stream, off_t *psize)
_file_size (mu_stream_t stream, mu_off_t *psize)
{
struct _file_stream *fs = mu_stream_get_owner (stream);
struct stat stbuf;
......@@ -933,7 +933,7 @@ _prog_open (mu_stream_t stream)
static int
_prog_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *pnbytes)
mu_off_t offset, size_t *pnbytes)
{
struct _prog_stream *fs = mu_stream_get_owner (stream);
return mu_stream_read (fs->in, optr, osize, offset, pnbytes);
......@@ -941,7 +941,7 @@ _prog_read (mu_stream_t stream, char *optr, size_t osize,
static int
_prog_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *pnbytes)
mu_off_t offset, size_t *pnbytes)
{
struct _prog_stream *fs = mu_stream_get_owner (stream);
return mu_stream_readline (fs->in, optr, osize, offset, pnbytes);
......@@ -949,7 +949,7 @@ _prog_readline (mu_stream_t stream, char *optr, size_t osize,
static int
_prog_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *pnbytes)
mu_off_t offset, size_t *pnbytes)
{
struct _prog_stream *fs = mu_stream_get_owner (stream);
return mu_stream_write (fs->out, iptr, isize, offset, pnbytes);
......
......@@ -51,7 +51,7 @@ filter_destroy (mu_stream_t stream)
}
static int
filter_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset,
filter_read (mu_stream_t stream, char *buffer, size_t buflen, mu_off_t offset,
size_t *nbytes)
{
mu_filter_t filter = mu_stream_get_owner (stream);
......@@ -63,7 +63,7 @@ filter_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset,
static int
filter_readline (mu_stream_t stream, char *buffer, size_t buflen,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
mu_filter_t filter = mu_stream_get_owner (stream);
if (filter->_readline && (filter->direction & MU_STREAM_READ
......@@ -74,7 +74,7 @@ filter_readline (mu_stream_t stream, char *buffer, size_t buflen,
static int
filter_write (mu_stream_t stream, const char *buffer, size_t buflen,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
mu_filter_t filter = mu_stream_get_owner (stream);
if (filter->_write && (filter->direction & MU_STREAM_WRITE
......@@ -92,14 +92,14 @@ filter_open (mu_stream_t stream)
}
static int
filter_truncate (mu_stream_t stream, off_t len)
filter_truncate (mu_stream_t stream, mu_off_t len)
{
mu_filter_t filter = mu_stream_get_owner (stream);
return mu_stream_truncate (filter->stream, len);
}
static int
filter_size (mu_stream_t stream, off_t *psize)
filter_size (mu_stream_t stream, mu_off_t *psize)
{
mu_filter_t filter = mu_stream_get_owner (stream);
return mu_stream_size (filter->stream, psize);
......
......@@ -117,7 +117,7 @@ _icvt_destroy (mu_stream_t stream)
}
static int _icvt_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *pnbytes);
mu_off_t offset, size_t *pnbytes);
static int
internal_icvt_read (mu_stream_t stream, char *optr, size_t osize, size_t *pnbytes)
......@@ -332,7 +332,7 @@ copy_pass (struct icvt_stream *s, char *optr, size_t osize, size_t *pnbytes)
static int
_icvt_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset ARG_UNUSED, size_t *pnbytes)
mu_off_t offset ARG_UNUSED, size_t *pnbytes)
{
struct icvt_stream *s = mu_stream_get_owner (stream);
......
......@@ -32,14 +32,14 @@
static int rfc822_init (mu_filter_t);
static void rfc822_destroy (mu_filter_t);
static int rfc822_read (mu_filter_t, char *, size_t, off_t, size_t *);
static int rfc822_readline (mu_filter_t, char *, size_t, off_t, size_t *);
static int rfc822_read0 (mu_filter_t, char *, size_t, off_t, size_t *, int);
static int rfc822_read (mu_filter_t, char *, size_t, mu_off_t, size_t *);
static int rfc822_readline (mu_filter_t, char *, size_t, mu_off_t, size_t *);
static int rfc822_read0 (mu_filter_t, char *, size_t, mu_off_t, size_t *, int);
struct rfc822
{
off_t r_offset; /* rfc822 offset. */
off_t s_offset; /* stream offset. */
mu_off_t r_offset; /* rfc822 offset. */
mu_off_t s_offset; /* stream offset. */
size_t lines;
int residue;
};
......@@ -89,14 +89,14 @@ rfc822_destroy (mu_filter_t filter)
static int
rfc822_read (mu_filter_t filter, char *buffer, size_t buflen,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
return rfc822_read0 (filter, buffer, buflen, off, pnread, 0);
}
static int
rfc822_readline (mu_filter_t filter, char *buffer, size_t buflen,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
return rfc822_read0 (filter, buffer, buflen, off, pnread, 1);
}
......@@ -108,7 +108,7 @@ rfc822_readline (mu_filter_t filter, char *buffer, size_t buflen,
static int
rfc822_read0 (mu_filter_t filter, char *buffer, size_t buflen,
off_t off, size_t *pnread, int isreadline)
mu_off_t off, size_t *pnread, int isreadline)
{
size_t total = 0;
int status = 0;
......
......@@ -70,7 +70,7 @@ trans_destroy (mu_filter_t filter)
}
static int
trans_read (mu_filter_t filter, char *optr, size_t osize, off_t offset,
trans_read (mu_filter_t filter, char *optr, size_t osize, mu_off_t offset,
size_t *n_bytes)
{
struct _trans_stream *ts = filter->data;
......
/* Declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
......@@ -34,9 +34,7 @@
#if defined __GETOPT_PREFIX && !defined __need_getopt
# include <stdlib.h>
# include <stdio.h>
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
# include <unistd.h>
# undef __need_getopt
# undef getopt
# undef getopt_long
......
......@@ -39,9 +39,9 @@
#define HEADER_MODIFIED 1
static int header_parse (mu_header_t, const char *, int);
static int header_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int header_readline (mu_stream_t, char *, size_t, off_t, size_t *);
static int header_write (mu_stream_t, const char *, size_t, off_t, size_t *);
static int header_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int header_readline (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int header_write (mu_stream_t, const char *, size_t, mu_off_t, size_t *);
static int fill_blurb (mu_header_t);
static void header_free_cache (mu_header_t);
......@@ -944,7 +944,7 @@ mu_header_set_stream (mu_header_t header, mu_stream_t stream, void *owner)
int
mu_header_set_fill (mu_header_t header, int
(*_fill) (mu_header_t, char *, size_t, off_t, size_t *),
(*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *),
void *owner)
{
if (header == NULL)
......@@ -1031,7 +1031,7 @@ fill_blurb (mu_header_t header)
static int
header_write (mu_stream_t os, const char *buf, size_t buflen,
off_t off, size_t *pnwrite)
mu_off_t off, size_t *pnwrite)
{
mu_header_t header = mu_stream_get_owner (os);
int status;
......@@ -1116,7 +1116,7 @@ header_write (mu_stream_t os, const char *buf, size_t buflen,
}
static int
header_read (mu_stream_t is, char *buf, size_t buflen, off_t off, size_t *pnread)
header_read (mu_stream_t is, char *buf, size_t buflen, mu_off_t off, size_t *pnread)
{
int len;
mu_header_t header = mu_stream_get_owner (is);
......@@ -1154,7 +1154,7 @@ header_read (mu_stream_t is, char *buf, size_t buflen, off_t off, size_t *pnread
}
static int
header_readline (mu_stream_t is, char *buf, size_t buflen, off_t off, size_t *pn)
header_readline (mu_stream_t is, char *buf, size_t buflen, mu_off_t off, size_t *pn)
{
int len;
mu_header_t header = mu_stream_get_owner (is);
......
......@@ -1388,7 +1388,7 @@ imap_list (f_imap_t f_imap)
}
else if ((status = imap_string (f_imap, &tok)) == 0)
{
off_t sz = 0;
mu_off_t sz = 0;
mu_stream_size (f_imap->string.stream, &sz);
lr->name = calloc (sz + 1, 1);
......@@ -1747,7 +1747,7 @@ imap_body (f_imap_t f_imap, char **ptr)
if (f_imap->state == IMAP_SCAN_ACK)
{
char *buffer;
off_t total = 0;
mu_off_t total = 0;
if (f_imap->string.msg_imap && f_imap->string.msg_imap->fheader)
mu_header_destroy (&f_imap->string.msg_imap->fheader, NULL);
mu_stream_size (f_imap->string.stream, &total);
......
......@@ -80,7 +80,7 @@ static int imap_message_size (mu_message_t, size_t *);
static int imap_message_lines (mu_message_t, size_t *);
static int imap_message_get_transport2 (mu_stream_t, mu_transport_t *pin,
mu_transport_t *pout);
static int imap_message_read (mu_stream_t , char *, size_t, off_t, size_t *);
static int imap_message_read (mu_stream_t , char *, size_t, mu_off_t, size_t *);
static int imap_message_uid (mu_message_t, size_t *);
/* mu_mime_t API. */
......@@ -98,12 +98,12 @@ static int imap_attr_set_flags (mu_attribute_t, int);
static int imap_attr_unset_flags (mu_attribute_t, int);
/* mu_header_t API. */
static int imap_header_read (mu_header_t, char*, size_t, off_t, size_t *);
static int imap_header_read (mu_header_t, char*, size_t, mu_off_t, size_t *);
static int imap_header_get_value (mu_header_t, const char*, char *, size_t, size_t *);
static int imap_header_get_fvalue (mu_header_t, const char*, char *, size_t, size_t *);
/* mu_body_t API. */
static int imap_body_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int imap_body_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int imap_body_size (mu_body_t, size_t *);
static int imap_body_lines (mu_body_t, size_t *);
static int imap_body_get_transport2 (mu_stream_t, mu_transport_t *pin, mu_transport_t *pout);
......@@ -1068,7 +1068,7 @@ imap_append_message0 (mu_mailbox_t mailbox, mu_message_t msg)
case IMAP_APPEND_SEND:
{
mu_stream_t stream = NULL;
off_t off = 0;
mu_off_t off = 0;
size_t n = 0;
char buffer[255];
mu_message_get_stream (msg, &stream);
......@@ -1165,7 +1165,7 @@ imap_copy_message (mu_mailbox_t mailbox, mu_message_t msg)
/* Message read overload */
static int
imap_message_read (mu_stream_t stream, char *buffer, size_t buflen,
off_t offset, size_t *plen)
mu_off_t offset, size_t *plen)
{
mu_message_t msg = mu_stream_get_owner (stream);
msg_imap_t msg_imap = mu_message_get_owner (msg);
......@@ -1844,7 +1844,7 @@ imap_header_get_fvalue (mu_header_t header, const char *field, char * buffer,
}
static int
imap_header_read (mu_header_t header, char *buffer, size_t buflen, off_t offset,
imap_header_read (mu_header_t header, char *buffer, size_t buflen, mu_off_t offset,
size_t *plen)
{
mu_message_t msg = mu_header_get_owner (header);
......@@ -1949,8 +1949,8 @@ imap_body_lines (mu_body_t body, size_t *plines)
/* FIXME: Send EISPIPE if trying to seek back. */
static int
imap_body_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset,
size_t *plen)
imap_body_read (mu_stream_t stream, char *buffer, size_t buflen,
mu_off_t offset, size_t *plen)
{
mu_body_t body = mu_stream_get_owner (stream);
mu_message_t msg = mu_body_get_owner (body);
......
......@@ -41,8 +41,8 @@ struct _amd_data;
struct _amd_message
{
mu_stream_t stream; /* Associated file stream */
off_t body_start; /* Offset of body start in the message file */
off_t body_end; /* Offset of body end (size of file, effectively)*/
mu_off_t body_start; /* Offset of body start in the message file */
mu_off_t body_end; /* Offset of body end (size of file, effectively)*/
int attr_flags; /* Attribute flags */
int deleted; /* Was the message originally deleted */
......
......@@ -40,9 +40,9 @@ struct _mu_filter
int direction;
int type;
void *data;
int (*_read) (mu_filter_t, char *, size_t, off_t, size_t *);
int (*_readline) (mu_filter_t, char *, size_t, off_t, size_t *);
int (*_write) (mu_filter_t, const char *, size_t, off_t, size_t *);
int (*_read) (mu_filter_t, char *, size_t, mu_off_t, size_t *);
int (*_readline) (mu_filter_t, char *, size_t, mu_off_t, size_t *);
int (*_write) (mu_filter_t, const char *, size_t, mu_off_t, size_t *);
void (*_destroy) (mu_filter_t);
};
......
......@@ -65,7 +65,7 @@ struct _mu_header
int (*_set_value) (mu_header_t, const char *, const char *, int);
int (*_lines) (mu_header_t, size_t *);
int (*_size) (mu_header_t, size_t *);
int (*_fill) (mu_header_t, char *, size_t, off_t, size_t *);
int (*_fill) (mu_header_t, char *, size_t, mu_off_t, size_t *);
};
#ifdef __cplusplus
......
......@@ -152,7 +152,7 @@ struct _f_imap
struct
{
mu_stream_t stream;
off_t offset;
mu_off_t offset;
size_t nleft; /* nleft to read in the literal. */
msg_imap_t msg_imap;
enum imap_state type;
......@@ -168,7 +168,7 @@ struct _f_imap
char *buffer;
char *ptr;
char *nl;
off_t offset; /* Dummy, this is used because of the stream buffering.
mu_off_t offset; /* Dummy, this is used because of the stream buffering.
The mu_stream_t maintains and offset and the offset we use must
be in sync. */
......
......@@ -71,7 +71,7 @@ struct _mu_mailbox
int (*_scan) (mu_mailbox_t, size_t, size_t *);
int (*_is_updated) (mu_mailbox_t);
int (*_get_size) (mu_mailbox_t, off_t *);
int (*_get_size) (mu_mailbox_t, mu_off_t *);
};
......
......@@ -35,7 +35,7 @@ struct rbuffer
char *ptr;
size_t count;
size_t bufsiz;
off_t offset;
mu_off_t offset;
};
struct _mu_stream
......@@ -50,17 +50,17 @@ struct _mu_stream
struct rbuffer rbuffer;
/* Stream pointer for sequential offset. */
off_t offset;
mu_off_t offset;
void (*_destroy) (mu_stream_t);
int (*_open) (mu_stream_t);
int (*_close) (mu_stream_t);
int (*_get_transport2) (mu_stream_t, mu_transport_t *, mu_transport_t *);
int (*_read) (mu_stream_t, char *, size_t, off_t, size_t *);
int (*_readline) (mu_stream_t, char *, size_t, off_t, size_t *);
int (*_write) (mu_stream_t, const char *, size_t, off_t, size_t *);
int (*_truncate) (mu_stream_t, off_t);
int (*_size) (mu_stream_t, off_t *);
int (*_read) (mu_stream_t, char *, size_t, mu_off_t, size_t *);
int (*_readline) (mu_stream_t, char *, size_t, mu_off_t, size_t *);
int (*_write) (mu_stream_t, const char *, size_t, mu_off_t, size_t *);
int (*_truncate) (mu_stream_t, mu_off_t);
int (*_size) (mu_stream_t, mu_off_t *);
int (*_flush) (mu_stream_t);
int (*_setbufsiz)(mu_stream_t, size_t);
int (*_strerror) (mu_stream_t, const char **);
......
......@@ -309,7 +309,7 @@ mu_mailbox_scan (mu_mailbox_t mbox, size_t msgno, size_t *pcount)
}
int
mu_mailbox_get_size (mu_mailbox_t mbox, off_t *psize)
mu_mailbox_get_size (mu_mailbox_t mbox, mu_off_t *psize)
{
if (mbox == NULL || mbox->_get_size == NULL)
return MU_ERR_EMPTY_VFN;
......
......@@ -66,7 +66,7 @@ _mapfile_destroy (mu_stream_t stream)
static int
_mapfile_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _mapfile_stream *mfs = mu_stream_get_owner (stream);
size_t n = 0;
......@@ -74,7 +74,7 @@ _mapfile_read (mu_stream_t stream, char *optr, size_t osize,
if (mfs->ptr == MAP_FAILED)
return EINVAL;
if (offset < (off_t)mfs->size)
if (offset < (mu_off_t)mfs->size)
{
n = ((offset + osize) > mfs->size) ? mfs->size - offset : osize;
memcpy (optr, mfs->ptr + offset, n);
......@@ -87,7 +87,7 @@ _mapfile_read (mu_stream_t stream, char *optr, size_t osize,
static int
_mapfile_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _mapfile_stream *mfs = mu_stream_get_owner (stream);
char *nl;
......@@ -96,7 +96,7 @@ _mapfile_readline (mu_stream_t stream, char *optr, size_t osize,
if (mfs->ptr == MAP_FAILED)
return EINVAL;
if (offset < (off_t)mfs->size)
if (offset < (mu_off_t)mfs->size)
{
/* Save space for the null byte. */
osize--;
......@@ -113,7 +113,7 @@ _mapfile_readline (mu_stream_t stream, char *optr, size_t osize,
static int
_mapfile_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _mapfile_stream *mfs = mu_stream_get_owner (stream);
......@@ -154,7 +154,7 @@ _mapfile_write (mu_stream_t stream, const char *iptr, size_t isize,
}
static int
_mapfile_truncate (mu_stream_t stream, off_t len)
_mapfile_truncate (mu_stream_t stream, mu_off_t len)
{
struct _mapfile_stream *mfs = mu_stream_get_owner (stream);
if (mfs->ptr == MAP_FAILED)
......@@ -181,7 +181,7 @@ _mapfile_truncate (mu_stream_t stream, off_t len)
}
static int
_mapfile_size (mu_stream_t stream, off_t *psize)
_mapfile_size (mu_stream_t stream, mu_off_t *psize)
{
struct _mapfile_stream *mfs = mu_stream_get_owner (stream);
struct stat stbuf;
......
......@@ -71,22 +71,22 @@ static int mbox_uidvalidity (mu_mailbox_t, unsigned long *);
static int mbox_uidnext (mu_mailbox_t, size_t *);
static int mbox_scan (mu_mailbox_t, size_t, size_t *);
static int mbox_is_updated (mu_mailbox_t);
static int mbox_get_size (mu_mailbox_t, off_t *);
static int mbox_get_size (mu_mailbox_t, mu_off_t *);
/* private stuff */
static int mbox_append_message0 (mu_mailbox_t, mu_message_t, off_t *, int, int);
static int mbox_append_message0 (mu_mailbox_t, mu_message_t, mu_off_t *, int, int);
static int mbox_message_uid (mu_message_t, size_t *);
static int mbox_header_fill (mu_header_t, char *, size_t, off_t, size_t *);
static int mbox_header_fill (mu_header_t, char *, size_t, mu_off_t, size_t *);
static int mbox_get_body_transport (mu_stream_t, mu_transport_t *, mu_transport_t *);
static int mbox_get_transport2 (mbox_message_t, mu_transport_t *, mu_transport_t *);
static int mbox_get_attr_flags (mu_attribute_t, int *);
static int mbox_set_attr_flags (mu_attribute_t, int);
static int mbox_unset_attr_flags (mu_attribute_t, int);
static int mbox_body_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int mbox_body_readline (mu_stream_t, char *, size_t, off_t, size_t *);
static int mbox_body_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int mbox_body_readline (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int mbox_readstream (mbox_message_t, char *, size_t,
off_t, size_t *, int, off_t, off_t);
static int mbox_stream_size (mu_stream_t stream, off_t *psize);
mu_off_t, size_t *, int, mu_off_t, mu_off_t);
static int mbox_stream_size (mu_stream_t stream, mu_off_t *psize);
static int mbox_header_size (mu_header_t, size_t *);
static int mbox_header_lines (mu_header_t, size_t *);
......@@ -359,7 +359,7 @@ mbox_scan (mu_mailbox_t mailbox, size_t msgno, size_t *pcount)
static int
mbox_is_updated (mu_mailbox_t mailbox)
{
off_t size = 0;
mu_off_t size = 0;
mbox_data_t mud = mailbox->data;
if (mu_stream_size (mailbox->stream, &size) != 0)
return 0;
......@@ -443,8 +443,8 @@ mbox_expunge0 (mu_mailbox_t mailbox, int remove_deleted)
sigset_t signalset;
int tempfile;
size_t i, j, dirty; /* dirty will indicate the first modified message. */
off_t marker = 0; /* marker will be the position to truncate. */
off_t total = 0;
mu_off_t marker = 0; /* marker will be the position to truncate. */
mu_off_t total = 0;
char *tmpmboxname = NULL;
mu_mailbox_t tmpmailbox = NULL;
size_t save_imapbase = 0; /* uidvalidity is save in the first message. */
......@@ -619,7 +619,7 @@ mbox_expunge0 (mu_mailbox_t mailbox, int remove_deleted)
/* Nothing changed copy the message straight. */
char buffer [1024];
size_t n;
off_t offset = mum->header_from;
mu_off_t offset = mum->header_from;
size_t len = mum->body_end - mum->header_from;
while (len > 0)
{
......@@ -654,11 +654,11 @@ mbox_expunge0 (mu_mailbox_t mailbox, int remove_deleted)
- or the lock was held for too long.
- The mailbox may not have been properly updated before expunging. */
{
off_t size = 0;
mu_off_t size = 0;
if (mu_stream_size (mailbox->stream, &size) == 0)
{
off_t len = size - mud->size;
off_t offset = mud->size;
mu_off_t len = size - mud->size;
mu_off_t offset = mud->size;
char buffer [1024];
size_t n = 0;
if (len > 0 )
......@@ -694,8 +694,8 @@ mbox_expunge0 (mu_mailbox_t mailbox, int remove_deleted)
{
char buffer [1024];
size_t n = 0;
off_t off = 0;
off_t offset = marker;
mu_off_t off = 0;
mu_off_t offset = marker;
while ((status = mu_stream_read (tmpmailbox->stream, buffer,
sizeof (buffer), off, &n)) == 0
&& n > 0)
......@@ -889,7 +889,7 @@ mbox_unset_attr_flags (mu_attribute_t attr, int flags)
static int
mbox_body_readline (mu_stream_t is, char *buffer, size_t buflen,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
mu_body_t body = mu_stream_get_owner (is);
mu_message_t msg = mu_body_get_owner (body);
......@@ -901,7 +901,7 @@ mbox_body_readline (mu_stream_t is, char *buffer, size_t buflen,
static int
mbox_body_read (mu_stream_t is, char *buffer, size_t buflen,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
mu_body_t body = mu_stream_get_owner (is);
mu_message_t msg = mu_body_get_owner (body);
......@@ -912,8 +912,8 @@ mbox_body_read (mu_stream_t is, char *buffer, size_t buflen,
static int
mbox_readstream (mbox_message_t mum, char *buffer, size_t buflen,
off_t off, size_t *pnread, int isreadline,
off_t start, off_t end)
mu_off_t off, size_t *pnread, int isreadline,
mu_off_t start, mu_off_t end)
{
size_t nread = 0;
int status = 0;
......@@ -932,7 +932,7 @@ mbox_readstream (mbox_message_t mum, char *buffer, size_t buflen,
pthread_cleanup_push (mbox_cleanup, (void *)mum->mud->mailbox);
#endif
{
off_t ln = end - (start + off);
mu_off_t ln = end - (start + off);
if (ln > 0)
{
/* Position the file pointer and the buffer. */
......@@ -957,7 +957,7 @@ mbox_readstream (mbox_message_t mum, char *buffer, size_t buflen,
static int
mbox_header_fill (mu_header_t header, char *buffer, size_t len,
off_t off, size_t *pnread)
mu_off_t off, size_t *pnread)
{
mu_message_t msg = mu_header_get_owner (header);
mbox_message_t mum = mu_message_get_owner (msg);
......@@ -1049,7 +1049,7 @@ mbox_body_size (mu_body_t body, size_t *psize)
}
static int
mbox_stream_size (mu_stream_t stream, off_t *psize)
mbox_stream_size (mu_stream_t stream, mu_off_t *psize)
{
mu_body_t body = mu_stream_get_owner (stream);
return mbox_body_size (body, (size_t*) psize);
......@@ -1308,7 +1308,7 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg)
default:
{
off_t size;
mu_off_t size;
/* Move to the end of the file, not necesary if _APPEND mode. */
if ((status = mu_stream_size (mailbox->stream, &size)) != 0
|| (status = mbox_append_message0 (mailbox, msg, &size, 0, 0)) != 0)
......@@ -1401,7 +1401,7 @@ restore_date (mu_message_t msg, mbox_data_t mud)
perfomance big time when expunging. But should not this be the
responsability of the client ? */
static int
mbox_append_message0 (mu_mailbox_t mailbox, mu_message_t msg, off_t *psize,
mbox_append_message0 (mu_mailbox_t mailbox, mu_message_t msg, mu_off_t *psize,
int is_expunging, int first)
{
mbox_data_t mud = mailbox->data;
......@@ -1741,9 +1741,9 @@ mbox_append_message0 (mu_mailbox_t mailbox, mu_message_t msg, off_t *psize,
}
static int
mbox_get_size (mu_mailbox_t mailbox, off_t *psize)
mbox_get_size (mu_mailbox_t mailbox, mu_off_t *psize)
{
off_t size;
mu_off_t size;
int status;
/* Maybe was not open yet ?? */
......
......@@ -560,7 +560,7 @@ mbox_scan0 (mu_mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
char buf[MSGLINELEN];
int inheader;
int inbody;
off_t total = 0;
mu_off_t total = 0;
mbox_data_t mud = mailbox->data;
mbox_message_t mum = NULL;
int status = 0;
......
......@@ -58,7 +58,7 @@ _memory_destroy (mu_stream_t stream)
static int
_memory_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _memory_stream *mfs = mu_stream_get_owner (stream);
size_t n = 0;
......@@ -74,7 +74,7 @@ _memory_read (mu_stream_t stream, char *optr, size_t osize,
static int
_memory_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _memory_stream *mfs = mu_stream_get_owner (stream);
char *nl;
......@@ -96,7 +96,7 @@ _memory_readline (mu_stream_t stream, char *optr, size_t osize,
static int
_memory_write (mu_stream_t stream, const char *iptr, size_t isize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _memory_stream *mfs = mu_stream_get_owner (stream);
......@@ -121,7 +121,7 @@ _memory_write (mu_stream_t stream, const char *iptr, size_t isize,
}
static int
_memory_truncate (mu_stream_t stream, off_t len)
_memory_truncate (mu_stream_t stream, mu_off_t len)
{
struct _memory_stream *mfs = mu_stream_get_owner (stream);
......@@ -131,7 +131,7 @@ _memory_truncate (mu_stream_t stream, off_t len)
free (mfs->ptr);
mfs->ptr = NULL;
}
else if (len != (off_t)mfs->size)
else if (len != (mu_off_t)mfs->size)
{
char *tmp = realloc (mfs->ptr, len);
if (tmp == NULL)
......@@ -144,7 +144,7 @@ _memory_truncate (mu_stream_t stream, off_t len)
}
static int
_memory_size (mu_stream_t stream, off_t *psize)
_memory_size (mu_stream_t stream, mu_off_t *psize)
{
struct _memory_stream *mfs = mu_stream_get_owner (stream);
if (psize)
......
......@@ -55,21 +55,21 @@
#define MESSAGE_MODIFIED 0x10000;
static int message_read (mu_stream_t is, char *buf, size_t buflen,
off_t off, size_t *pnread );
mu_off_t off, size_t *pnread );
static int message_write (mu_stream_t os, const char *buf, size_t buflen,
off_t off, size_t *pnwrite);
mu_off_t off, size_t *pnwrite);
static int message_get_transport2 (mu_stream_t stream, mu_transport_t *pin,
mu_transport_t *pout);
static int message_sender (mu_envelope_t envelope, char *buf, size_t len,
size_t *pnwrite);
static int message_date (mu_envelope_t envelope, char *buf, size_t len,
size_t *pnwrite);
static int message_stream_size (mu_stream_t stream, off_t *psize);
static int message_stream_size (mu_stream_t stream, mu_off_t *psize);
static int message_header_fill (mu_header_t header, char *buffer,
size_t buflen, off_t off,
size_t buflen, mu_off_t off,
size_t * pnread);
static int message_body_read (mu_stream_t stream, char *buffer,
size_t n, off_t off, size_t *pn);
size_t n, mu_off_t off, size_t *pn);
/* Allocate ressources for the mu_message_t. */
int
......@@ -172,7 +172,7 @@ mu_message_create_copy (mu_message_t *to, mu_message_t from)
int status = 0;
mu_stream_t fromstr = NULL;
mu_stream_t tostr = NULL;
off_t off = 0;
mu_off_t off = 0;
size_t n = 0;
char buf[512];
......@@ -618,7 +618,7 @@ mu_message_get_uidl (mu_message_t msg, char *buffer, size_t buflen, size_t *pwri
struct md5_ctx md5context;
mu_stream_t stream = NULL;
char buf[1024];
off_t offset = 0;
mu_off_t offset = 0;
unsigned char md5digest[16];
char *tmp;
n = 0;
......@@ -784,7 +784,7 @@ mu_message_get_observable (mu_message_t msg, mu_observable_t *pobservable)
/* Implements the mu_stream_read () on the message stream. */
static int
message_read (mu_stream_t is, char *buf, size_t buflen,
off_t off, size_t *pnread )
mu_off_t off, size_t *pnread )
{
mu_message_t msg = mu_stream_get_owner (is);
mu_stream_t his, bis;
......@@ -822,7 +822,7 @@ message_read (mu_stream_t is, char *buf, size_t buflen,
/* Implements the mu_stream_write () on the message stream. */
static int
message_write (mu_stream_t os, const char *buf, size_t buflen,
off_t off, size_t *pnwrite)
mu_off_t off, size_t *pnwrite)
{
mu_message_t msg = mu_stream_get_owner (os);
int status = 0;
......@@ -887,7 +887,7 @@ message_write (mu_stream_t os, const char *buf, size_t buflen,
msg->hdr_buflen = msg->hdr_done = 0;
return status;
}
if (off < (off_t)msg->hdr_buflen)
if (off < (mu_off_t)msg->hdr_buflen)
off = 0;
else
off -= msg->hdr_buflen;
......@@ -928,7 +928,7 @@ message_get_transport2 (mu_stream_t stream, mu_transport_t *pin, mu_transport_t
/* Implements the stream_stream_size () on the message stream. */
static int
message_stream_size (mu_stream_t stream, off_t *psize)
message_stream_size (mu_stream_t stream, mu_off_t *psize)
{
mu_message_t msg = mu_stream_get_owner (stream);
return mu_message_size (msg, (size_t*) psize);
......@@ -1019,7 +1019,7 @@ message_sender (mu_envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
static int
message_header_fill (mu_header_t header, char *buffer, size_t buflen,
off_t off, size_t * pnread)
mu_off_t off, size_t * pnread)
{
int status = 0;
mu_message_t msg = mu_header_get_owner (header);
......@@ -1057,7 +1057,7 @@ message_header_fill (mu_header_t header, char *buffer, size_t buflen,
}
static int
message_body_read (mu_stream_t stream, char *buffer, size_t n, off_t off,
message_body_read (mu_stream_t stream, char *buffer, size_t n, mu_off_t off,
size_t *pn)
{
mu_body_t body = mu_stream_get_owner (stream);
......
......@@ -406,7 +406,7 @@ _mime_parse_mpart_message (mu_mime_t mime)
/*------ Mime message functions for READING a multipart message -----*/
static int
_mimepart_body_read (mu_stream_t stream, char *buf, size_t buflen, off_t off,
_mimepart_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off,
size_t * nbytes)
{
mu_body_t body = mu_stream_get_owner (stream);
......@@ -561,7 +561,7 @@ _mime_set_content_type (mu_mime_t mime)
} while (0)
static int
_mime_body_read (mu_stream_t stream, char *buf, size_t buflen, off_t off,
_mime_body_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t off,
size_t * nbytes)
{
mu_body_t body = mu_stream_get_owner (stream);
......
......@@ -65,10 +65,10 @@ static int nntp_mailbox_get_message (mu_mailbox_t, size_t, mu_message_t *);
static int nntp_mailbox_messages_count (mu_mailbox_t, size_t *);
static int nntp_mailbox_scan (mu_mailbox_t, size_t, size_t *);
/* FIXME
static int nntp_mailbox_get_size (mu_mailbox_t, off_t *); */
static int nntp_mailbox_get_size (mu_mailbox_t, mu_off_t *); */
static int nntp_message_get_transport2 (mu_stream_t, mu_transport_t *, mu_transport_t *);
static int nntp_message_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int nntp_message_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int nntp_message_size (mu_message_t, size_t *);
/* FIXME
static int nntp_message_line (mu_message_t, size_t *); */
......@@ -77,11 +77,11 @@ static int nntp_message_uid (mu_message_t, size_t *);
/* FIXME
static int nntp_header_get_transport2 (mu_header_t, char *,
size_t, off_t, size_t *); */
static int nntp_header_fill (mu_header_t, char *, size_t, off_t, size_t *);
size_t, mu_off_t, size_t *); */
static int nntp_header_fill (mu_header_t, char *, size_t, mu_off_t, size_t *);
static int nntp_body_get_transport2 (mu_stream_t, mu_transport_t *, mu_transport_t *);
static int nntp_body_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int nntp_body_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int nntp_body_size (mu_body_t, size_t *);
static int nntp_body_lines (mu_body_t, size_t *);
......@@ -573,7 +573,7 @@ nntp_message_uidl (mu_message_t msg, char *buffer, size_t buflen,
/* Message read overload */
static int
nntp_message_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset, size_t *plen)
nntp_message_read (mu_stream_t stream, char *buffer, size_t buflen, mu_off_t offset, size_t *plen)
{
mu_message_t msg = mu_stream_get_owner (stream);
msg_nntp_t msg_nntp = mu_message_get_owner (msg);
......@@ -611,7 +611,7 @@ nntp_message_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset
/* Message read overload */
static int
nntp_body_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset, size_t *plen)
nntp_body_read (mu_stream_t stream, char *buffer, size_t buflen, mu_off_t offset, size_t *plen)
{
mu_body_t body = mu_stream_get_owner (stream);
mu_message_t msg = mu_body_get_owner (body);
......@@ -650,7 +650,7 @@ nntp_body_read (mu_stream_t stream, char *buffer, size_t buflen, off_t offset, s
/* Header read overload */
static int
nntp_header_fill (mu_header_t header, char *buffer, size_t buflen, off_t offset, size_t *plen)
nntp_header_fill (mu_header_t header, char *buffer, size_t buflen, mu_off_t offset, size_t *plen)
{
mu_message_t msg = mu_header_get_owner (header);
msg_nntp_t msg_nntp = mu_message_get_owner (msg);
......
......@@ -43,7 +43,7 @@ mu_nntp_stream_destroy (mu_stream_t stream)
}
static int
mu_nntp_stream_read (mu_stream_t stream, char *buf, size_t buflen, off_t offset, size_t *pn)
mu_nntp_stream_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t offset, size_t *pn)
{
struct mu_nntp_stream *nntp_stream = mu_stream_get_owner (stream);
size_t n = 0;
......@@ -94,7 +94,7 @@ mu_nntp_stream_read (mu_stream_t stream, char *buf, size_t buflen, off_t offset,
}
static int
mu_nntp_stream_readline (mu_stream_t stream, char *buf, size_t buflen, off_t offset, size_t *pn)
mu_nntp_stream_readline (mu_stream_t stream, char *buf, size_t buflen, mu_off_t offset, size_t *pn)
{
struct mu_nntp_stream *nntp_stream = mu_stream_get_owner (stream);
size_t n = 0;
......
......@@ -128,18 +128,18 @@ static int pop_is_updated (mu_mailbox_t);
/* The implementation of mu_message_t */
int _pop_user (mu_authority_t);
int _pop_apop (mu_authority_t);
static int pop_get_size (mu_mailbox_t, off_t *);
static int pop_get_size (mu_mailbox_t, mu_off_t *);
/* We use pop_top for retreiving headers. */
/* static int pop_header_read (mu_header_t, char *, size_t, off_t, size_t *); */
/* static int pop_header_read (mu_header_t, char *, size_t, mu_off_t, size_t *); */
static int pop_body_transport (mu_stream_t, mu_transport_t *, mu_transport_t *);
static int pop_body_size (mu_body_t, size_t *);
static int pop_body_lines (mu_body_t, size_t *);
static int pop_body_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int pop_message_read (mu_stream_t, char *, size_t, off_t, size_t *);
static int pop_body_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int pop_message_read (mu_stream_t, char *, size_t, mu_off_t, size_t *);
static int pop_message_size (mu_message_t, size_t *);
static int pop_message_transport (mu_stream_t, mu_transport_t *, mu_transport_t *);
static int pop_top (mu_header_t, char *, size_t, off_t, size_t *);
static int pop_retr (pop_message_t, char *, size_t, off_t, size_t *);
static int pop_top (mu_header_t, char *, size_t, mu_off_t, size_t *);
static int pop_retr (pop_message_t, char *, size_t, mu_off_t, size_t *);
static int pop_get_transport2 (pop_message_t, mu_transport_t *, mu_transport_t *);
static int pop_get_attribute (mu_attribute_t, int *);
static int pop_set_attribute (mu_attribute_t, int);
......@@ -200,7 +200,7 @@ struct _pop_data
size_t buflen; /* Len of buffer. */
char *ptr; /* Points to the end of the buffer i.e the non consume chars. */
char *nl; /* Points to the '\n' char in te string. */
off_t offset; /* Dummy, this is use because of the stream buffering.
mu_off_t offset; /* Dummy, this is use because of the stream buffering.
The mu_stream_t maintains and offset and the offset we use must
be in sync. */
......@@ -1222,7 +1222,7 @@ pop_expunge (mu_mailbox_t mbox)
/* Mailbox size ? It is part of the STAT command */
static int
pop_get_size (mu_mailbox_t mbox, off_t *psize)
pop_get_size (mu_mailbox_t mbox, mu_off_t *psize)
{
pop_data_t mpd = mbox->data;
int status = 0;
......@@ -1559,7 +1559,7 @@ pop_uidl (mu_message_t msg, char *buffer, size_t buflen, size_t *pnwriten)
read ahead, for example for the headers. */
static int
pop_top (mu_header_t header, char *buffer, size_t buflen,
off_t offset, size_t *pnread)
mu_off_t offset, size_t *pnread)
{
mu_message_t msg = mu_header_get_owner (header);
pop_message_t mpm = mu_message_get_owner (msg);
......@@ -1662,7 +1662,7 @@ pop_top (mu_header_t header, char *buffer, size_t buflen,
#if 0
/* Stub to call pop_retr (). Call form the stream object of the header. */
static int
pop_header_read (mu_header_t header, char *buffer, size_t buflen, off_t offset,
pop_header_read (mu_header_t header, char *buffer, size_t buflen, mu_off_t offset,
size_t *pnread)
{
mu_message_t msg = mu_header_get_owner (header);
......@@ -1694,7 +1694,7 @@ pop_header_read (mu_header_t header, char *buffer, size_t buflen, off_t offset,
/* Stub to call pop_retr (). Call from the stream object of the body. */
static int
pop_body_read (mu_stream_t is, char *buffer, size_t buflen, off_t offset,
pop_body_read (mu_stream_t is, char *buffer, size_t buflen, mu_off_t offset,
size_t *pnread)
{
mu_body_t body = mu_stream_get_owner (is);
......@@ -1726,7 +1726,7 @@ pop_body_read (mu_stream_t is, char *buffer, size_t buflen, off_t offset,
/* Stub to call pop_retr (), calling from the stream object of a message. */
static int
pop_message_read (mu_stream_t is, char *buffer, size_t buflen, off_t offset,
pop_message_read (mu_stream_t is, char *buffer, size_t buflen, mu_off_t offset,
size_t *pnread)
{
mu_message_t msg = mu_stream_get_owner (is);
......@@ -1790,7 +1790,7 @@ fill_buffer (pop_data_t mpd, char *buffer, size_t buflen)
/* The heart of most funtions. Send the RETR and skip different parts. */
static int
pop_retr (pop_message_t mpm, char *buffer, size_t buflen,
off_t offset ARG_UNUSED, size_t *pnread)
mu_off_t offset ARG_UNUSED, size_t *pnread)
{
pop_data_t mpd;
size_t nread = 0;
......
......@@ -43,7 +43,7 @@ mu_pop3_stream_destroy (mu_stream_t stream)
}
static int
mu_pop3_stream_read (mu_stream_t stream, char *buf, size_t buflen, off_t offset, size_t *pn)
mu_pop3_stream_read (mu_stream_t stream, char *buf, size_t buflen, mu_off_t offset, size_t *pn)
{
struct mu_pop3_stream *pop3_stream = mu_stream_get_owner (stream);
size_t n = 0;
......@@ -94,7 +94,7 @@ mu_pop3_stream_read (mu_stream_t stream, char *buf, size_t buflen, off_t offset,
}
static int
mu_pop3_stream_readline (mu_stream_t stream, char *buf, size_t buflen, off_t offset, size_t *pn)
mu_pop3_stream_readline (mu_stream_t stream, char *buf, size_t buflen, mu_off_t offset, size_t *pn)
{
struct mu_pop3_stream *pop3_stream = mu_stream_get_owner (stream);
size_t n = 0;
......
......@@ -40,7 +40,7 @@
#include <mailutils/errno.h>
#include <stream0.h>
static int refill (mu_stream_t, off_t);
static int refill (mu_stream_t, mu_off_t);
/* A stream provides a way for an object to do I/O. It overloads
stream read/write functions. Only a minimal buffering is done
......@@ -156,7 +156,7 @@ mu_stream_setbufsiz (mu_stream_t stream, size_t size)
int
mu_stream_read (mu_stream_t is, char *buf, size_t count,
off_t offset, size_t *pnread)
mu_off_t offset, size_t *pnread)
{
int status = 0;
if (is == NULL || is->_read == NULL)
......@@ -265,7 +265,7 @@ mu_stream_read (mu_stream_t is, char *buf, size_t count,
*/
int
mu_stream_readline (mu_stream_t is, char *buf, size_t count,
off_t offset, size_t *pnread)
mu_off_t offset, size_t *pnread)
{
int status = 0;
......@@ -398,7 +398,7 @@ mu_stream_readline (mu_stream_t is, char *buf, size_t count,
int
mu_stream_write (mu_stream_t os, const char *buf, size_t count,
off_t offset, size_t *pnwrite)
mu_off_t offset, size_t *pnwrite)
{
int nleft;
int err = 0;
......@@ -481,7 +481,7 @@ mu_stream_get_property (mu_stream_t stream, mu_property_t *pp)
}
int
mu_stream_size (mu_stream_t stream, off_t *psize)
mu_stream_size (mu_stream_t stream, mu_off_t *psize)
{
if (stream == NULL || stream->_size == NULL)
return EINVAL;
......@@ -489,7 +489,7 @@ mu_stream_size (mu_stream_t stream, off_t *psize)
}
int
mu_stream_truncate (mu_stream_t stream, off_t len)
mu_stream_truncate (mu_stream_t stream, mu_off_t len)
{
if (stream == NULL || stream->_truncate == NULL )
return EINVAL;
......@@ -575,7 +575,7 @@ mu_stream_set_get_transport2 (mu_stream_t stream,
int
mu_stream_set_read (mu_stream_t stream, int (*_read)
(mu_stream_t, char *, size_t, off_t, size_t *),
(mu_stream_t, char *, size_t, mu_off_t, size_t *),
void *owner)
{
if (stream == NULL)
......@@ -590,7 +590,7 @@ mu_stream_set_read (mu_stream_t stream, int (*_read)
int
mu_stream_set_readline (mu_stream_t stream, int (*_readline)
(mu_stream_t, char *, size_t, off_t, size_t *),
(mu_stream_t, char *, size_t, mu_off_t, size_t *),
void *owner)
{
if (stream == NULL)
......@@ -605,7 +605,7 @@ mu_stream_set_readline (mu_stream_t stream, int (*_readline)
int
mu_stream_set_write (mu_stream_t stream, int (*_write)
(mu_stream_t, const char *, size_t, off_t, size_t *),
(mu_stream_t, const char *, size_t, mu_off_t, size_t *),
void *owner)
{
if (stream == NULL)
......@@ -620,7 +620,7 @@ mu_stream_set_write (mu_stream_t stream, int (*_write)
int
mu_stream_set_size (mu_stream_t stream, int (*_size)(mu_stream_t, off_t *), void *owner)
mu_stream_set_size (mu_stream_t stream, int (*_size)(mu_stream_t, mu_off_t *), void *owner)
{
if (stream == NULL)
return EINVAL;
......@@ -631,7 +631,7 @@ mu_stream_set_size (mu_stream_t stream, int (*_size)(mu_stream_t, off_t *), void
}
int
mu_stream_set_truncate (mu_stream_t stream, int (*_truncate) (mu_stream_t, off_t),
mu_stream_set_truncate (mu_stream_t stream, int (*_truncate) (mu_stream_t, mu_off_t),
void *owner)
{
if (stream == NULL)
......@@ -736,9 +736,9 @@ mu_stream_sequential_write (mu_stream_t stream, const char *buf, size_t size)
}
int
mu_stream_seek (mu_stream_t stream, off_t off, int whence)
mu_stream_seek (mu_stream_t stream, mu_off_t off, int whence)
{
off_t size = 0;
mu_off_t size = 0;
size_t pos;
int rc;
......@@ -803,7 +803,7 @@ mu_stream_strerror (mu_stream_t stream, const char **p)
}
static int
refill (mu_stream_t stream, off_t offset)
refill (mu_stream_t stream, mu_off_t offset)
{
if (stream->_read)
{
......
......@@ -173,7 +173,7 @@ _tcp_get_transport2 (mu_stream_t stream, mu_transport_t *tr, mu_transport_t *tr2
}
static int
_tcp_read (mu_stream_t stream, char *buf, size_t buf_size, off_t offset, size_t * br)
_tcp_read (mu_stream_t stream, char *buf, size_t buf_size, mu_off_t offset, size_t * br)
{
struct _tcp_instance *tcp = mu_stream_get_owner (stream);
int bytes;
......@@ -192,7 +192,7 @@ _tcp_read (mu_stream_t stream, char *buf, size_t buf_size, off_t offset, size_t
}
static int
_tcp_write (mu_stream_t stream, const char *buf, size_t buf_size, off_t offset,
_tcp_write (mu_stream_t stream, const char *buf, size_t buf_size, mu_off_t offset,
size_t * bw)
{
struct _tcp_instance *tcp = mu_stream_get_owner (stream);
......
......@@ -46,7 +46,7 @@ struct _mhdraft_stream {
static int
_mhdraft_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _mhdraft_stream *s = mu_stream_get_owner (stream);
......@@ -62,7 +62,7 @@ _mhdraft_read (mu_stream_t stream, char *optr, size_t osize,
static int
_mhdraft_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
struct _mhdraft_stream *s = mu_stream_get_owner (stream);
......@@ -90,7 +90,7 @@ _mhdraft_readline (mu_stream_t stream, char *optr, size_t osize,
}
static int
_mhdraft_size (mu_stream_t stream, off_t *psize)
_mhdraft_size (mu_stream_t stream, mu_off_t *psize)
{
struct _mhdraft_stream *s = mu_stream_get_owner (stream);
int rc = mu_stream_size (s->stream, psize);
......@@ -195,8 +195,8 @@ struct _mhdraft_message
{
char *from;
char *date;
off_t body_start;
off_t body_end;
mu_off_t body_start;
mu_off_t body_end;
};
static int
......@@ -209,7 +209,7 @@ restore_envelope (mu_stream_t str, struct _mhdraft_message **pmenv)
int rc;
char buffer[128];
size_t len;
off_t body_start, body_end;
mu_off_t body_start, body_end;
while ((rc = mu_stream_readline (str, buffer, sizeof buffer, offset, &len)) == 0
&& len > 0)
......@@ -318,7 +318,7 @@ _body_size (mu_body_t body, size_t *size)
static int
_body_read (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
mu_body_t body = mu_stream_get_owner (stream);
mu_message_t msg = mu_body_get_owner (body);
......@@ -331,7 +331,7 @@ _body_read (mu_stream_t stream, char *optr, size_t osize,
static int
_body_readline (mu_stream_t stream, char *optr, size_t osize,
off_t offset, size_t *nbytes)
mu_off_t offset, size_t *nbytes)
{
mu_body_t body = mu_stream_get_owner (stream);
mu_message_t msg = mu_body_get_owner (body);
......@@ -343,7 +343,7 @@ _body_readline (mu_stream_t stream, char *optr, size_t osize,
}
static int
_body_stream_size (mu_stream_t stream, off_t *psize)
_body_stream_size (mu_stream_t stream, mu_off_t *psize)
{
mu_body_t body = mu_stream_get_owner (stream);
mu_message_t msg = mu_body_get_owner (body);
......
......@@ -386,8 +386,8 @@ pop3d_mainloop (int fd, FILE *infile, FILE *outfile)
of sync. */
if (state == TRANSACTION && !mu_mailbox_is_updated (mbox))
{
static off_t mailbox_size;
off_t newsize = 0;
static mu_off_t mailbox_size;
mu_off_t newsize = 0;
mu_mailbox_get_size (mbox, &newsize);
/* Did we shrink? First time save the size. */
if (!mailbox_size)
......
......@@ -311,7 +311,7 @@ muaux_modules=`echo $MODLIST | sort -u`
mailutils_modules=`echo $mailutils_modules | sort -u`
copy_files lib muaux
copy_files mailbox mailutils 's/AC_LIBSOURCES/MU_LIBSOURCES/;s/AC_REPLACE_FUNCS/MU_REPLACE_FUNCS/;s/AC_LIBOBJ/MU_LIBOBJ/'
copy_files mailbox mailutils 's/AC_LIBSOURCES/MU_LIBSOURCES/;s/AC_LIBSOURCE/MU_LIBSOURCE/;s/AC_REPLACE_FUNCS/MU_REPLACE_FUNCS/;s/AC_LIBOBJ/MU_LIBOBJ/'
if [ -n "$DRY_RUN" ]; then
echo "-----BEGIN gnulib.m4 FILE-----"
......