     /* Prefix header_ is reserved */
     #include <mailutils/header.h>

So far we plan support for RFC822 and plan for RFC1522. with RFC1522 non ASCII characters will be encoded.

 -- Function: int header_create (header_t *HDR, const char *BLURB, size_t LEN, void *OWNER)
     Initialize a HDR to a supported type.  If BLURB is not NULL, it is parsed.

 -- Function: void header_destroy (header_t *HDR, void *OWNER)
     The resources allocated for HDR are freed.

 -- Function: int header_set_value (header_t HDR, const char *FN, const char *FV, size_t n, int REPLACE)
     Set the field-name FN to field-value FV of size N in HDR.  If REPLACE is non-zero the initial value is replaced, if zero it is appended.

     Some basic macros are already provided for rfc822.

     MU_HDR_RETURN_PATH
          Return-Path

     MU_HDR_RECEIVED
          Received

     MU_HDR_DATE
          Date

     MU_HDR_FROM
          From

     MU_HDR_RESENT_FROM
          Resent-From

     MU_HDR_SUBJECT
          Subject

     MU_HDR_SENDER
          Sender

     MU_HDR_RESENT_SENDER
          Resent-SENDER

     MU_HDR_TO
          To

     MU_HDR_RESENT_TO
          Resent-To

     MU_HDR_CC
          Cc

     MU_HDR_RESENT_CC
          Resent-Cc

     MU_HDR_BCC
          Bcc

     MU_HDR_RESENT_BCC
          Resent-Bcc

     MU_HDR_REPLY_TO
          Reply-To

     MU_HDR_RESENT_REPLY_TO
          Resent-Reply-To

     MU_HDR_MESSAGE_ID
          Message-ID

     MU_HDR_RESENT_MESSAGE_ID
          Resent-Message-ID

     MU_HDR_IN_REPLY_TO
          In-Reply-To

     MU_HDR_ENCRYPTED
          Encrypted

     MU_HDR_PRECEDENCE
          Precedence

     MU_HDR_STATUS
          Status

     MU_HDR_CONTENT_LENGTH
          Content-Length

     MU_HDR_CONTENT_TYPE
          Content-Type

     MU_HDR_MIME_VERSION
          MIME-Version

 -- Function: int header_get_value (header_t HDR, const char *FN, char *FV, size_t LEN, size_t *N)
     Value of field-name FN is returned in buffer FV of size LEN. The number of bytes written is put in N.

 -- Function: int header_aget_value (header_t HDR, const char *FN, char **FV)
     The value is allocated.

 -- Function: int header_get_stream (header_t HDR, stream_t *PSTREAM)

 -- Function: int header_set_size (header_t HDR, size_t *SIZE)

 -- Function: int header_set_lines (header_t HDR, size_t *LPINES)