changeset 3418:37bbed99b90b HEAD

Use macros when using W and S extras too.
author Timo Sirainen <tss@iki.fi>
date Thu, 09 Jun 2005 17:43:07 +0300
parents b0bdf32564b7
children b97914e7c941
files src/lib-storage/index/maildir/maildir-mail.c src/lib-storage/index/maildir/maildir-storage.h
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-mail.c	Thu Jun 09 17:31:43 2005 +0300
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Thu Jun 09 17:43:07 2005 +0300
@@ -129,7 +129,7 @@
 		return (uoff_t)-1;
 
 	/* size can be included in filename */
-	p = strstr(fname, MAILDIR_EXTRA_SEP_S"W=");
+	p = strstr(fname, MAILDIR_EXTRA_SEP_S MAILDIR_EXTRA_VIRTUAL_SIZE "=");
 	if (p != NULL) {
 		p += 3;
 		virtual_size = 0;
@@ -188,7 +188,7 @@
 		return (uoff_t)-1;
 
 	/* size can be included in filename */
-	p = strstr(fname, MAILDIR_EXTRA_SEP_S"S=");
+	p = strstr(fname, MAILDIR_EXTRA_SEP_S MAILDIR_EXTRA_FILE_SIZE "=");
 	if (p != NULL) {
 		p += 3;
 		size = 0;
--- a/src/lib-storage/index/maildir/maildir-storage.h	Thu Jun 09 17:31:43 2005 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.h	Thu Jun 09 17:43:07 2005 +0300
@@ -21,6 +21,12 @@
 /* ":2," is the standard flags separator */
 #define MAILDIR_FLAGS_FULL_SEP MAILDIR_INFO_SEP_S "2" MAILDIR_FLAGS_SEP_S
 
+/* Maildir++ extension: include file size in the filename to avoid stat() */
+#define MAILDIR_EXTRA_FILE_SIZE "S"
+/* Something (can't remember what anymore) could use 'W' in filename to avoid
+   calculating file's virtual size (added missing CRs). */
+#define MAILDIR_EXTRA_VIRTUAL_SIZE "W"
+
 #include "index-storage.h"
 
 #define STORAGE(maildir_storage) \