message-header-encode.h revision a5f1628ad97ad649bfef86c84c3afc1d9cb0f326
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen#ifndef MESSAGE_HEADER_ENCODE_H
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen#define MESSAGE_HEADER_ENCODE_H
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen/* Encode UTF-8 input into output wherever necessary. */
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenvoid message_header_encode(const char *input, string_t *output);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenvoid message_header_encode_data(const unsigned char *input, unsigned int len,
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen string_t *output);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen/* Encode the whole UTF-8 input using "Q" or "B" encoding into output.
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen The output is split into multiple lines if necessary. The first line length
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen is looked up from the output string. */
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenvoid message_header_encode_q(const unsigned char *input, unsigned int len,
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen string_t *output);
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainenvoid message_header_encode_b(const unsigned char *input, unsigned int len,
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainen string_t *output);
7d6389e4053c2dac1fb37180b5756b00785983dcTimo Sirainen
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen#endif
e82af44fe25ca9b88210f313548dc08538e4a677Timo Sirainen