6 ** Copyright 1998 - 2009 Double Precision, Inc. See COPYING for
7 ** distribution information.
19 ** Raw RFC 2047 parser.
21 ** rfc2047_decoder() repeatedly invokes the callback function, passing it
22 ** the decoded RFC 2047 string that's given as an argument.
25 int rfc2047_decoder(const char *text
,
26 void (*callback
)(const char *chset
,
34 ** rfc2047_print_unicodeaddr is like rfc822_print, except that it converts
35 ** RFC 2047 MIME encoding to 8 bit text.
40 int rfc2047_print_unicodeaddr(const struct rfc822a
*a
,
42 void (*print_func
)(char, void *),
43 void (*print_separator
)(const char *, void *),
48 ** And now, let's encode something with RFC 2047. Encode the following
49 ** string in the indicated character set, into a malloced buffer. Returns 0
53 char *rfc2047_encode_str(const char *str
, const char *charset
,
54 int (*qp_allow
)(char c
) /* See below */);
57 /* Potential arguments for qp_allow */
59 int rfc2047_qp_allow_any(char); /* Any character */
60 int rfc2047_qp_allow_comment(char); /* Any character except () */
61 int rfc2047_qp_allow_word(char); /* See RFC2047, bottom of page 7 */
66 ** rfc2047_encode_header allocates a buffer, and MIME-encodes a header.
68 ** The name of the header, passed as the first parameter, should be
69 ** "From", "To", "Subject", etc... It is not included in the encoded contents.
71 char *rfc2047_encode_header_tobuf(const char *name
, /* Header name */
72 const char *header
, /* Header's contents */
76 ** rfc2047_encode_header_addr allocates a buffer, and MIME-encodes an
77 ** RFC822 address header.
80 char *rfc2047_encode_header_addr(const struct rfc822a
*a
,