mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 7575e07b9f10fc115b62022a9cc96098f072afac
parent f9226dde7b37064c235123d523a5c5a1a9b09f5d
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Sat,  6 Aug 2016 19:27:02 +0200

blaze822: keep a pointer to the original header, if we have it anyway

Diffstat:
blaze822.c | 10+++++++++-
blaze822.h | 2++
blaze822_priv.h | 1+
3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/blaze822.c b/blaze822.c @@ -349,7 +349,7 @@ blaze822(char *file) mesg->msg = buf; mesg->end = end; - mesg->body = mesg->bodyend = mesg->bodychunk = 0; + mesg->body = mesg->bodyend = mesg->bodychunk = mesg->orig_header = 0; return mesg; } @@ -391,6 +391,7 @@ blaze822_mem(char *src, size_t len) mesg->msg = buf; mesg->end = end; mesg->bodychunk = 0; // src is not ours + mesg->orig_header = src; return mesg; } @@ -558,6 +559,7 @@ blaze822_mmap(char *file) mesg->msg = mesg->bodychunk = buf; mesg->end = end; mesg->bodyend = buf + len; + mesg->orig_header = 0; return mesg; @@ -578,6 +580,12 @@ blaze822_body(struct message *mesg) return mesg->body; } +char * +blaze822_orig_header(struct message *mesg) +{ + return mesg->orig_header; +} + size_t blaze822_bodylen(struct message *mesg) { diff --git a/blaze822.h b/blaze822.h @@ -24,6 +24,8 @@ char *blaze822_body(struct message *mesg); size_t blaze822_bodylen(struct message *mesg); size_t blaze822_headerlen(struct message *mesg); +char *blaze822_orig_header(struct message *mesg); + // rfc2047.c int blaze822_decode_rfc2047(char *, char *, size_t, char *); diff --git a/blaze822_priv.h b/blaze822_priv.h @@ -4,6 +4,7 @@ struct message { char *body; char *bodyend; char *bodychunk; + char *orig_header; }; // WSP = SP / HTAB