c9141125278100269eb3a907c911afe78c46717cTimo Sirainen#ifndef MAIL_HTML2TEXT_H
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen#define MAIL_HTML2TEXT_H
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen
c9141125278100269eb3a907c911afe78c46717cTimo Sirainenenum mail_html2text_flags {
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen MAIL_HTML2TEXT_FLAG_SKIP_QUOTED = 0x01
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen};
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen
c9141125278100269eb3a907c911afe78c46717cTimo Sirainenstruct mail_html2text *
c9141125278100269eb3a907c911afe78c46717cTimo Sirainenmail_html2text_init(enum mail_html2text_flags flags);
c9141125278100269eb3a907c911afe78c46717cTimo Sirainenvoid mail_html2text_more(struct mail_html2text *ht,
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen const unsigned char *data, size_t size,
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen buffer_t *output);
c9141125278100269eb3a907c911afe78c46717cTimo Sirainenvoid mail_html2text_deinit(struct mail_html2text **ht);
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainenstatic inline bool
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainenmail_html2text_content_type_match(const char *content_type)
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainen{
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainen return strcasecmp(content_type, "text/html") == 0 ||
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainen strcasecmp(content_type, "application/xhtml+xml") == 0;
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainen}
00a50d6dc74e15b5b83afcb8c12c2109a2ca376dTimo Sirainen
c9141125278100269eb3a907c911afe78c46717cTimo Sirainen#endif