aboutsummaryrefslogtreecommitdiff
path: root/blaze822.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-14 15:40:48 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-14 15:40:48 +0200
commit54f695dddf65bc8270825fdf08ed0ddc34a58ec3 (patch)
tree39e1f5b88af5d26ede8f3d98c9b2759d96a33d4c /blaze822.c
parentff7771d4fb524148e21045b911a869041b9271af (diff)
downloadmblaze-54f695dddf65bc8270825fdf08ed0ddc34a58ec3.tar.gz
blaze822: iterate over headers
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/blaze822.c b/blaze822.c
index 53fc2e4..6f6542a 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -559,3 +559,20 @@ blaze822_bodylen(struct message *mesg)
return 0;
return mesg->bodyend - mesg->body;
}
+
+char *
+blaze822_next_header(struct message *mesg, char *prev)
+{
+ if (!prev) {
+ prev = mesg->msg;
+ } else {
+ if (prev >= mesg->end)
+ return 0;
+ prev = prev + strlen(prev);
+ }
+ while (prev < mesg->end && *prev == 0)
+ prev++;
+ if (prev >= mesg->end)
+ return 0;
+ return prev;
+}