changeset 105:31034993473c HEAD

there was no need for MessagePart->pos.virtual_pos, so removed it.
author Timo Sirainen <tss@iki.fi>
date Sun, 01 Sep 2002 02:57:37 +0300
parents a6d7ed739926
children 5fe3e04ca8d9
files src/lib-imap/imap-bodystructure.c src/lib-mail/message-parser.c src/lib-mail/message-parser.h src/lib-storage/index/index-fetch-section.c
diffstat 4 files changed, 8 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-imap/imap-bodystructure.c	Sat Aug 31 23:12:59 2002 +0300
+++ b/src/lib-imap/imap-bodystructure.c	Sun Sep 01 02:57:37 2002 +0300
@@ -175,8 +175,8 @@
 	while (part != NULL) {
 		/* note that we want to parse the header of all
 		   the message parts, multiparts too. */
-		i_assert(part->pos.physical_pos >= inbuf->offset);
-		io_buffer_skip(inbuf, part->pos.physical_pos - inbuf->offset);
+		i_assert(part->physical_pos >= inbuf->offset);
+		io_buffer_skip(inbuf, part->physical_pos - inbuf->offset);
 
 		message_parse_header(part, inbuf, NULL, parse_header, pool);
 
--- a/src/lib-mail/message-parser.c	Sat Aug 31 23:12:59 2002 +0300
+++ b/src/lib-mail/message-parser.c	Sun Sep 01 02:57:37 2002 +0300
@@ -158,11 +158,10 @@
 		part = message_part_append(parse_ctx->pool, parent_part);
 
 		/* set child position */
-		memcpy(&part->pos, &parent_part->pos, sizeof(MessagePosition));
-		part->pos.physical_pos += parent_part->body_size.physical_size +
+		part->physical_pos =
+			parent_part->physical_pos +
+			parent_part->body_size.physical_size +
 			parent_part->header_size.physical_size;
-		part->pos.virtual_pos += parent_part->body_size.virtual_size +
-			parent_part->header_size.virtual_size;
 
                 parse_ctx->part = part;
 		next_part = message_parse_part(inbuf, parse_ctx);
--- a/src/lib-mail/message-parser.h	Sat Aug 31 23:12:59 2002 +0300
+++ b/src/lib-mail/message-parser.h	Sun Sep 01 02:57:37 2002 +0300
@@ -5,11 +5,6 @@
 typedef struct _MessagePosition MessagePosition;
 typedef struct _MessageSize MessageSize;
 
-struct _MessagePosition {
-	uoff_t physical_pos;
-	uoff_t virtual_pos;
-};
-
 struct _MessageSize {
 	uoff_t physical_size;
 	uoff_t virtual_size;
@@ -21,7 +16,7 @@
 	MessagePart *next;
 	MessagePart *children;
 
-        MessagePosition pos; /* absolute position from beginning of message */
+	uoff_t physical_pos; /* absolute position from beginning of message */
 	MessageSize header_size;
 	MessageSize body_size;
 
--- a/src/lib-storage/index/index-fetch-section.c	Sat Aug 31 23:12:59 2002 +0300
+++ b/src/lib-storage/index/index-fetch-section.c	Sun Sep 01 02:57:37 2002 +0300
@@ -318,7 +318,7 @@
 		return FALSE;
 
 	/* jump to beginning of wanted data */
-	skip_pos = part->pos.physical_pos + part->header_size.physical_size;
+	skip_pos = part->physical_pos + part->header_size.physical_size;
 	io_buffer_skip(inbuf, skip_pos);
 
 	str = t_strdup_printf("{%lu}\r\n",
@@ -342,7 +342,7 @@
 	if (!imap_msgcache_get_data(ctx->cache, uid, &inbuf))
 		return FALSE;
 
-	io_buffer_skip(inbuf, part->pos.physical_pos);
+	io_buffer_skip(inbuf, part->physical_pos);
 	fetch_header_from(inbuf, &part->header_size, section, sect, ctx);
 	return TRUE;
 }