[dovecot-cvs] dovecot/src/lib-storage mail-storage-private.h, 1.15, 1.16 mail-storage.h, 1.92, 1.93 mail.c, 1.1, 1.2

cras at dovecot.org cras at dovecot.org
Tue Mar 29 19:48:45 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-storage
In directory talvi:/tmp/cvs-serv27861/lib-storage

Modified Files:
	mail-storage-private.h mail-storage.h mail.c 
Log Message:
Renamed mail_get_header() to mail_get_first_header() and mail_gets_headers()
to mail_get_header_stream(). Added new mail_get_headers() which returns
NULL-terminated string list of all found headers.



Index: mail-storage-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage-private.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mail-storage-private.h	29 Mar 2005 13:33:07 -0000	1.15
+++ mail-storage-private.h	29 Mar 2005 16:48:42 -0000	1.16
@@ -165,10 +165,11 @@
 	uoff_t (*get_virtual_size)(struct mail *mail);
 	uoff_t (*get_physical_size)(struct mail *mail);
 
-	const char *(*get_header)(struct mail *mail, const char *field);
+	const char *(*get_first_header)(struct mail *mail, const char *field);
+	const char *const *(*get_headers)(struct mail *mail, const char *field);
 	struct istream *
-		(*get_headers)(struct mail *mail,
-			       struct mailbox_header_lookup_ctx *headers);
+		(*get_header_stream)(struct mail *mail,
+				     struct mailbox_header_lookup_ctx *headers);
 	struct istream *(*get_stream)(struct mail *mail,
 				      struct message_size *hdr_size,
 				      struct message_size *body_size);

Index: mail-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- mail-storage.h	29 Mar 2005 13:33:07 -0000	1.92
+++ mail-storage.h	29 Mar 2005 16:48:42 -0000	1.93
@@ -415,10 +415,13 @@
 uoff_t mail_get_physical_size(struct mail *mail);
 
 /* Get value for single header field */
-const char *mail_get_header(struct mail *mail, const char *field);
+const char *mail_get_first_header(struct mail *mail, const char *field);
+/* Return a NULL-terminated list of values for each found field. */
+const char *const *mail_get_headers(struct mail *mail, const char *field);
 /* Returns stream containing specified headers. */
-struct istream *mail_get_headers(struct mail *mail,
-				 struct mailbox_header_lookup_ctx *headers);
+struct istream *
+mail_get_header_stream(struct mail *mail,
+		       struct mailbox_header_lookup_ctx *headers);
 /* Returns input stream pointing to beginning of message header.
    hdr_size and body_size are updated unless they're NULL. */
 struct istream *mail_get_stream(struct mail *mail,

Index: mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mail.c	15 Mar 2005 19:01:51 -0000	1.1
+++ mail.c	29 Mar 2005 16:48:42 -0000	1.2
@@ -74,23 +74,27 @@
 	return p->v.get_physical_size(mail);
 }
 
-const char *mail_get_header(struct mail *mail, const char *field)
-{
+const char *mail_get_first_header(struct mail *mail, const char *field)
 {
 	struct mail_private *p = (struct mail_private *)mail;
 
-	return p->v.get_header(mail, field);
-}
+	return p->v.get_first_header(mail, field);
 }
 
-struct istream *mail_get_headers(struct mail *mail,
-				 struct mailbox_header_lookup_ctx *headers)
-{
+const char *const *mail_get_headers(struct mail *mail, const char *field)
 {
 	struct mail_private *p = (struct mail_private *)mail;
 
-	return p->v.get_headers(mail, headers);
+	return p->v.get_headers(mail, field);
 }
+
+struct istream *
+mail_get_header_stream(struct mail *mail,
+		       struct mailbox_header_lookup_ctx *headers)
+{
+	struct mail_private *p = (struct mail_private *)mail;
+
+	return p->v.get_header_stream(mail, headers);
 }
 
 struct istream *mail_get_stream(struct mail *mail,



More information about the dovecot-cvs mailing list