X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Frfc822%2Frfc822.h;h=19fccea8f35afbb3d36b0b68c420f7e30ef3572c;hb=f71d6c64922b68fe3a785ec3a9faf093ef9299e1;hp=1170c113e92a236f149e677d45024980574a8cdb;hpb=89f4cfdd19a1ad7fa17bd1149ddd49874f7dd115;p=ccan diff --git a/ccan/rfc822/rfc822.h b/ccan/rfc822/rfc822.h index 1170c113..19fccea8 100644 --- a/ccan/rfc822/rfc822.h +++ b/ccan/rfc822/rfc822.h @@ -168,4 +168,23 @@ struct bytestring rfc822_header_raw_value(struct rfc822_msg *msg, struct bytestring rfc822_header_unfolded_value(struct rfc822_msg *msg, struct rfc822_header *hdr); +/** + * rfc822_header_is - determine if a header is of a given name + * @msg: message + * @hdr: a header handle + * @name: header name + * + * This returns true if the header field @hdr has name @name (case + * insensitive), otherwise false. + */ +bool rfc822_header_is(struct rfc822_msg *msg, struct rfc822_header *hdr, + const char *name); + +struct rfc822_header *rfc822_next_header_of_name(struct rfc822_msg *msg, + struct rfc822_header *hdr, + const char *name); + +#define rfc822_first_header_of_name(_msg, _name) \ + (rfc822_next_header_of_name((_msg), NULL, (_name))) + #endif /* CCAN_RFC822_H_ */