camel_key_file_new(const gchar *path, gint flags, const gchar version[8])
{
CamelKeyFile *kf;
- off_t last;
+ goffset last;
gint err;
d(printf("New key file '%s'\n", path));
FILE *fp;
gchar *path;
gint flags;
- off_t last;
+ goffset last;
};
struct _CamelKeyFileClass {
GError **error)
{
guint32 action;
- off_t size;
+ goffset size;
gdouble pc;
GError *local_error = NULL;
gint i = 0;
struct stat st;
gint status;
- off_t last = 0;
+ goffset last = 0;
gint ret = -1;
fd = g_open (mbox, O_RDONLY|O_BINARY, 0);
gchar *buffer;
gsize len;
struct _CamelFolderSummaryPrivate *p = CAMEL_FOLDER_SUMMARY_GET_PRIVATE(s);
- off_t start;
+ goffset start;
CamelIndexName *name = NULL;
/* should this check the parser is in the right state, or assume it is?? */
gint atleast;
- off_t seek; /* current offset to start of buffer */
+ goffset seek; /* current offset to start of buffer */
gint unstep; /* how many states to 'unstep' (repeat the current state) */
guint midline:1; /* are we mid-line interrupted? */
guint scan_pre_from:1; /* do we return pre-from data? */
guint eof:1; /* reached eof? */
- off_t start_of_from; /* where from started */
- off_t start_of_boundary; /* where the last boundary started */
- off_t start_of_headers; /* where headers started from the last scan */
+ goffset start_of_from; /* where from started */
+ goffset start_of_boundary; /* where the last boundary started */
+ goffset start_of_headers; /* where headers started from the last scan */
- off_t header_start; /* start of last header, or -1 */
+ goffset header_start; /* start of last header, or -1 */
/* filters to apply to all content before output */
gint filterid; /* id of next filter */
static struct _header_scan_stack *folder_scan_content(struct _header_scan_state *s, gint *lastone, gchar **data, gsize *length);
static struct _header_scan_stack *folder_scan_header(struct _header_scan_state *s, gint *lastone);
static gint folder_scan_skip_line(struct _header_scan_state *s, GByteArray *save);
-static off_t folder_seek(struct _header_scan_state *s, off_t offset, gint whence);
-static off_t folder_tell(struct _header_scan_state *s);
+static goffset folder_seek(struct _header_scan_state *s, goffset offset, gint whence);
+static goffset folder_tell(struct _header_scan_state *s);
static gint folder_read(struct _header_scan_state *s);
static void folder_push_part(struct _header_scan_state *s, struct _header_scan_stack *h);
*
* Since: 2.22
**/
-off_t
+goffset
camel_mime_parser_tell (CamelMimeParser *parser)
{
struct _header_scan_state *s = _PRIVATE (parser);
*
* Since: 2.22
**/
-off_t
+goffset
camel_mime_parser_tell_start_headers (CamelMimeParser *parser)
{
struct _header_scan_state *s = _PRIVATE (parser);
*
* Since: 2.22
**/
-off_t
+goffset
camel_mime_parser_tell_start_from (CamelMimeParser *parser)
{
struct _header_scan_state *s = _PRIVATE (parser);
*
* Since: 2.22
**/
-off_t
+goffset
camel_mime_parser_tell_start_boundary(CamelMimeParser *parser)
{
struct _header_scan_state *s = _PRIVATE (parser);
*
* Since: 2.22
**/
-off_t
-camel_mime_parser_seek(CamelMimeParser *parser, off_t offset, gint whence)
+goffset
+camel_mime_parser_seek(CamelMimeParser *parser, goffset offset, gint whence)
{
struct _header_scan_state *s = _PRIVATE (parser);
}
/* return the current absolute position of the data pointer */
-static off_t
+static goffset
folder_tell(struct _header_scan_state *s)
{
return s->seek + (s->inptr - s->inbuf);
need some way to prime the parser state, so this actually works for
other than top-level messages
*/
-static off_t
-folder_seek(struct _header_scan_state *s, off_t offset, gint whence)
+static goffset
+folder_seek(struct _header_scan_state *s, goffset offset, gint whence)
{
- off_t newoffset;
+ goffset newoffset;
if (s->stream) {
if (CAMEL_IS_SEEKABLE_STREAM(s->stream)) {
/* these should be used with caution, because the state will not
track the seeked position */
/* FIXME: something to bootstrap the state? */
-off_t camel_mime_parser_tell (CamelMimeParser *parser);
-off_t camel_mime_parser_seek (CamelMimeParser *parser, off_t offset, gint whence);
+goffset camel_mime_parser_tell (CamelMimeParser *parser);
+goffset camel_mime_parser_seek (CamelMimeParser *parser, goffset offset, gint whence);
-off_t camel_mime_parser_tell_start_headers (CamelMimeParser *parser);
-off_t camel_mime_parser_tell_start_from (CamelMimeParser *parser);
-off_t camel_mime_parser_tell_start_boundary(CamelMimeParser *parser);
+goffset camel_mime_parser_tell_start_headers (CamelMimeParser *parser);
+goffset camel_mime_parser_tell_start_from (CamelMimeParser *parser);
+goffset camel_mime_parser_tell_start_boundary(CamelMimeParser *parser);
G_END_DECLS
#endif
#ifdef HAVE_BROKEN_SPOOL
-static gint camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, gsize bytes, CamelMimeFilter *filter);
+static gint camel_movemail_copy_filter(gint fromfd, gint tofd, goffset start, gsize bytes, CamelMimeFilter *filter);
static gint camel_movemail_solaris (gint oldsfd, gint dfd, GError **error);
#else
/* these could probably be exposed as a utility? (but only mbox needs it) */
#endif
#if 0
-static gint camel_movemail_copy(gint fromfd, gint tofd, off_t start, gsize bytes);
+static gint camel_movemail_copy(gint fromfd, gint tofd, goffset start, gsize bytes);
#endif
/**
#if 0
static gint
-camel_movemail_copy(gint fromfd, gint tofd, off_t start, gsize bytes)
+camel_movemail_copy(gint fromfd, gint tofd, goffset start, gsize bytes)
{
gchar buffer[4096];
gint written = 0;
#ifdef HAVE_BROKEN_SPOOL
static gint
-camel_movemail_copy_filter(gint fromfd, gint tofd, off_t start, gsize bytes, CamelMimeFilter *filter)
+camel_movemail_copy_filter(gint fromfd, gint tofd, goffset start, gsize bytes, CamelMimeFilter *filter)
{
gchar buffer[4096+PRE_SIZE];
gint written = 0;
const gchar *cl;
gint length;
gint start, body;
- off_t newpos;
+ goffset newpos;
ret = 0;
gchar *micalg;
/* offset pointers of start of boundary in content object */
- off_t start1, end1;
- off_t start2, end2;
+ goffset start1, end1;
+ goffset start2, end2;
};
typedef struct {
CAMEL_STREAM_SET, error);
}
-static off_t
+static goffset
seekable_stream_tell (CamelSeekableStream *stream)
{
return stream->position;
static gint
seekable_stream_set_bounds (CamelSeekableStream *stream,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error)
{
/* store the bounds */
*
* Returns: new position, %-1 if operation failed.
**/
-off_t
+goffset
camel_seekable_stream_seek (CamelSeekableStream *stream,
- off_t offset,
+ goffset offset,
CamelStreamSeekPolicy policy,
GError **error)
{
CamelSeekableStreamClass *class;
- off_t new_offset;
+ goffset new_offset;
g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (stream), -1);
*
* Returns: the current position of the stream.
**/
-off_t
+goffset
camel_seekable_stream_tell (CamelSeekableStream *stream)
{
CamelSeekableStreamClass *class;
**/
gint
camel_seekable_stream_set_bounds (CamelSeekableStream *stream,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error)
{
CamelSeekableStreamClass *class;
struct _CamelSeekableStream {
CamelStream parent;
- off_t position; /* current postion in the stream */
- off_t bound_start; /* first valid position */
- off_t bound_end; /* first invalid position */
+ goffset position; /* current postion in the stream */
+ goffset bound_start; /* first valid position */
+ goffset bound_end; /* first invalid position */
};
struct _CamelSeekableStreamClass {
CamelStreamClass parent_class;
- off_t (*seek) (CamelSeekableStream *stream,
- off_t offset,
+ goffset (*seek) (CamelSeekableStream *stream,
+ goffset offset,
CamelStreamSeekPolicy policy,
GError **error);
- off_t (*tell) (CamelSeekableStream *stream);
+ goffset (*tell) (CamelSeekableStream *stream);
gint (*set_bounds) (CamelSeekableStream *stream,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error);
};
GType camel_seekable_stream_get_type (void);
-off_t camel_seekable_stream_seek (CamelSeekableStream *stream,
- off_t offset,
+goffset camel_seekable_stream_seek (CamelSeekableStream *stream,
+ goffset offset,
CamelStreamSeekPolicy policy,
GError **error);
-off_t camel_seekable_stream_tell (CamelSeekableStream *stream);
+goffset camel_seekable_stream_tell (CamelSeekableStream *stream);
gint camel_seekable_stream_set_bounds(CamelSeekableStream *stream,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error);
G_END_DECLS
return TRUE;
return camel_seekable_stream_seek (
- parent, (off_t) seekable_stream->position,
+ parent, seekable_stream->position,
CAMEL_STREAM_SET, NULL) == seekable_stream->position;
}
return eos;
}
-static off_t
+static goffset
seekable_substream_seek (CamelSeekableStream *seekable_stream,
- off_t offset,
+ goffset offset,
CamelStreamSeekPolicy policy,
GError **error)
{
CamelStream *stream;
CamelSeekableSubstream *seekable_substream;
- off_t real_offset = 0;
+ goffset real_offset = 0;
stream = CAMEL_STREAM (seekable_stream);
seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (seekable_stream);
* Returns: the substream
**/
CamelStream *
-camel_seekable_substream_new(CamelSeekableStream *parent_stream, off_t start, off_t end)
+camel_seekable_substream_new(CamelSeekableStream *parent_stream, goffset start, goffset end)
{
CamelSeekableSubstream *seekable_substream;
/* public methods */
/* obtain a new seekable substream */
-CamelStream *camel_seekable_substream_new(CamelSeekableStream *parent_stream, off_t start, off_t end);
+CamelStream *camel_seekable_substream_new(CamelSeekableStream *parent_stream, goffset start, goffset end);
G_END_DECLS
return 0;
}
-static off_t
+static goffset
stream_fs_seek (CamelSeekableStream *stream,
- off_t offset,
+ goffset offset,
CamelStreamSeekPolicy policy,
GError **error)
{
CamelStreamFsPrivate *priv;
- off_t real = 0;
+ goffset real = 0;
priv = CAMEL_STREAM_FS_GET_PRIVATE (stream);
{
CamelStreamFsPrivate *priv;
CamelStream *stream;
- off_t offset;
+ goffset offset;
if (fd == -1)
return NULL;
**/
CamelStream *
camel_stream_fs_new_with_fd_and_bounds (gint fd,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error)
{
CamelStream *stream;
camel_stream_fs_new_with_name_and_bounds (const gchar *name,
gint flags,
mode_t mode,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error)
{
CamelStream *stream;
(const gchar *name,
gint flags,
mode_t mode,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error);
CamelStream * camel_stream_fs_new_with_fd (gint fd);
CamelStream * camel_stream_fs_new_with_fd_and_bounds
(gint fd,
- off_t start,
- off_t end,
+ goffset start,
+ goffset end,
GError **error);
gint camel_stream_fs_get_fd (CamelStreamFs *stream);
return priv->buffer->len <= seekable_stream->position;
}
-static off_t
+static goffset
stream_mem_seek (CamelSeekableStream *stream,
- off_t offset,
+ goffset offset,
CamelStreamSeekPolicy policy,
GError **error)
{
CamelStreamMemPrivate *priv;
- off_t position;
+ goffset position;
priv = CAMEL_STREAM_MEM_GET_PRIVATE (stream);
typedef struct {
const gchar *pattern;
const gchar *prefix;
- off_t um_so;
- off_t um_eo;
+ goffset um_so;
+ goffset um_eo;
} urlmatch_t;
typedef gboolean (*CamelUrlScanFunc) (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
CamelMboxMessageInfo *info;
- off_t frompos;
+ goffset frompos;
gchar *filename = NULL;
d(printf("Getting message %s\n", uid));
CamelMimeParser *parser = NULL;
gint fd, retval;
gint retried = FALSE;
- off_t frompos;
+ goffset frompos;
d(printf("Getting message %s\n", uid));
/* like summary_rebuild, but also do changeinfo stuff (if supplied) */
static gint
-summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *changeinfo, GError **error)
+summary_update(CamelLocalSummary *cls, goffset offset, CamelFolderChangeInfo *changeinfo, GError **error)
{
gint i, count;
CamelFolderSummary *s = (CamelFolderSummary *)cls;
gint fd;
gint ok = 0;
struct stat st;
- off_t size = 0;
+ goffset size = 0;
GSList *del = NULL;
d(printf("Calling summary update, from pos %d\n", (gint)offset));
while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) {
CamelMessageInfo *info;
- off_t pc = camel_mime_parser_tell_start_from (mp) + 1;
+ goffset pc = camel_mime_parser_tell_start_from (mp) + 1;
camel_operation_progress (NULL, (gint) (((gfloat) pc / size) * 100));
gchar *xevnew, *xevtmp;
const gchar *xev;
gint len;
- off_t lastpos;
+ goffset lastpos;
GPtrArray *summary = NULL;
d(printf("Performing quick summary sync\n"));
gint fd = -1, fdout = -1;
gchar tmpname[64] = { '\0' };
gchar *buffer, *p;
- off_t spoollen, outlen;
+ goffset spoollen, outlen;
gint size, sizeout;
struct stat st;
guint32 flags = (expunge?1:0);
void
test_stream_seekable_writepart(CamelSeekableStream *s)
{
- off_t end;
+ goffset end;
gint i;
push("seekable stream test, writing ");
void
test_stream_seekable_readpart(CamelSeekableStream *s)
{
- off_t off, new, end;
+ goffset off, new, end;
gint i, j;
push("seekable stream test, re-reading");
#include <unistd.h>
struct {
- off_t lower, upper;
+ goffset lower, upper;
} ranges[] = {
{ 3, 10241 },
{ 0, 1024 },
LIBEGROUPWISE_REVISION=1
LIBEGROUPWISE_AGE=0
-LIBCAMEL_CURRENT=18
+LIBCAMEL_CURRENT=19
LIBCAMEL_REVISION=0
LIBCAMEL_AGE=0