/* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "istream.h"
#include "istream-private.h"
#include "qp-encoder.h"
#include <ctype.h>
struct qp_encoder {
const char *linebreak;
};
struct qp_encoder *
{
if ((flags & QP_ENCODER_FLAG_HEADER_FORMAT) != 0 &&
(flags & QP_ENCODER_FLAG_BINARY_DATA) != 0)
i_panic("qp encoder cannot do header format with binary data");
if ((flags & QP_ENCODER_FLAG_HEADER_FORMAT) != 0) {
} else {
}
return qp;
}
{
}
static inline void
{
if (c == ' ')
c = '_';
else if (c != '\t' &&
(c == '?' || c == '_' || c == '=' || c < 33 || c > 126))
} else if (c != ' ' && c != '\t' &&
(c == '=' || c < 33 || c > 126)) {
}
/* Include terminating = as well */
else
return;
}
/* Include terminating = as well */
}
if (encode) {
} else {
}
}
{
if (src_size == 0)
return;
if (qp->add_header_preamble) {
}
for(unsigned int i = 0; i < src_size; i++) {
unsigned char c = src[i];
/* if input is not binary data and we encounter newline
convert it as crlf, or if the last byte was CR, preserve
CRLF */
if (c == '\n' &&
/* reset line length here */
continue;
}
if (c == '\r') {
} else {
qp_encode_or_break(qp, c);
}
}
}
{
}