mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
compile
This commit is contained in:
@@ -249,33 +249,32 @@ unsafe fn mailimf_field_parse(
|
|||||||
message: *const libc::c_char,
|
message: *const libc::c_char,
|
||||||
length: size_t,
|
length: size_t,
|
||||||
indx: *mut size_t,
|
indx: *mut size_t,
|
||||||
result: &mut mailimf_field,
|
) -> Result<mailimf_field, libc::c_int> {
|
||||||
) -> libc::c_int {
|
|
||||||
let mut cur_token = *indx;
|
let mut cur_token = *indx;
|
||||||
let try_optional = false;
|
let mut try_optional = false;
|
||||||
|
|
||||||
let mut return_path: *mut mailimf_return = 0 as *mut mailimf_return;
|
let mut return_path = 0 as *mut mailimf_return;
|
||||||
let mut resent_date: *mut mailimf_orig_date = 0 as *mut mailimf_orig_date;
|
let mut resent_date = 0 as *mut mailimf_orig_date;
|
||||||
let mut resent_from: *mut mailimf_from = 0 as *mut mailimf_from;
|
let mut resent_from = 0 as *mut mailimf_from;
|
||||||
let mut resent_sender: *mut mailimf_sender = 0 as *mut mailimf_sender;
|
let mut resent_sender = 0 as *mut mailimf_sender;
|
||||||
let mut resent_to: *mut mailimf_to = 0 as *mut mailimf_to;
|
let mut resent_to = 0 as *mut mailimf_to;
|
||||||
let mut resent_cc: *mut mailimf_cc = 0 as *mut mailimf_cc;
|
let mut resent_cc = 0 as *mut mailimf_cc;
|
||||||
let mut resent_bcc: *mut mailimf_bcc = 0 as *mut mailimf_bcc;
|
let mut resent_bcc = 0 as *mut mailimf_bcc;
|
||||||
let mut resent_msg_id: *mut mailimf_message_id = 0 as *mut mailimf_message_id;
|
let mut resent_msg_id = 0 as *mut mailimf_message_id;
|
||||||
let mut orig_date: *mut mailimf_orig_date = 0 as *mut mailimf_orig_date;
|
let mut orig_date = 0 as *mut mailimf_orig_date;
|
||||||
let mut from: *mut mailimf_from = 0 as *mut mailimf_from;
|
let mut from = 0 as *mut mailimf_from;
|
||||||
let mut sender: *mut mailimf_sender = 0 as *mut mailimf_sender;
|
let mut sender = 0 as *mut mailimf_sender;
|
||||||
let mut reply_to: *mut mailimf_reply_to = 0 as *mut mailimf_reply_to;
|
let mut reply_to = 0 as *mut mailimf_reply_to;
|
||||||
let mut to: *mut mailimf_to = 0 as *mut mailimf_to;
|
let mut to = 0 as *mut mailimf_to;
|
||||||
let mut cc: *mut mailimf_cc = 0 as *mut mailimf_cc;
|
let mut cc = 0 as *mut mailimf_cc;
|
||||||
let mut bcc: *mut mailimf_bcc = 0 as *mut mailimf_bcc;
|
let mut bcc = 0 as *mut mailimf_bcc;
|
||||||
let mut message_id: *mut mailimf_message_id = 0 as *mut mailimf_message_id;
|
let mut message_id = 0 as *mut mailimf_message_id;
|
||||||
let mut in_reply_to: *mut mailimf_in_reply_to = 0 as *mut mailimf_in_reply_to;
|
let mut in_reply_to = 0 as *mut mailimf_in_reply_to;
|
||||||
let mut references: *mut mailimf_references = 0 as *mut mailimf_references;
|
let mut references = 0 as *mut mailimf_references;
|
||||||
let mut subject: *mut mailimf_subject = 0 as *mut mailimf_subject;
|
let mut subject = 0 as *mut mailimf_subject;
|
||||||
let mut comments: *mut mailimf_comments = 0 as *mut mailimf_comments;
|
let mut comments = 0 as *mut mailimf_comments;
|
||||||
let mut keywords: *mut mailimf_keywords = 0 as *mut mailimf_keywords;
|
let mut keywords = 0 as *mut mailimf_keywords;
|
||||||
let mut optional_field: *mut mailimf_optional_field = 0 as *mut mailimf_optional_field;
|
let mut optional_field = 0 as *mut mailimf_optional_field;
|
||||||
|
|
||||||
let guessed_type = guess_header_type(message, length, cur_token);
|
let guessed_type = guess_header_type(message, length, cur_token);
|
||||||
|
|
||||||
@@ -286,253 +285,232 @@ unsafe fn mailimf_field_parse(
|
|||||||
9 => {
|
9 => {
|
||||||
r = mailimf_orig_date_parse(message, length, &mut cur_token, &mut orig_date);
|
r = mailimf_orig_date_parse(message, length, &mut cur_token, &mut orig_date);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::OrigDate(orig_date);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::OrigDate(orig_date));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
10 => {
|
10 => {
|
||||||
r = mailimf_from_parse(message, length, &mut cur_token, &mut from);
|
r = mailimf_from_parse(message, length, &mut cur_token, &mut from);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::From(from);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::From(from));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
11 => {
|
11 => {
|
||||||
r = mailimf_sender_parse(message, length, &mut cur_token, &mut sender);
|
r = mailimf_sender_parse(message, length, &mut cur_token, &mut sender);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Sender(sender);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::Sender(sender));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12 => {
|
12 => {
|
||||||
r = mailimf_reply_to_parse(message, length, &mut cur_token, &mut reply_to);
|
r = mailimf_reply_to_parse(message, length, &mut cur_token, &mut reply_to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ReplyTo(reply_to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ReplyTo(reply_to));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
13 => {
|
13 => {
|
||||||
r = mailimf_to_parse(message, length, &mut cur_token, &mut to);
|
r = mailimf_to_parse(message, length, &mut cur_token, &mut to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::To(to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::To(to));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14 => {
|
14 => {
|
||||||
r = mailimf_cc_parse(message, length, &mut cur_token, &mut cc);
|
r = mailimf_cc_parse(message, length, &mut cur_token, &mut cc);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Cc(cc);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::Cc(cc));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
15 => {
|
15 => {
|
||||||
r = mailimf_bcc_parse(message, length, &mut cur_token, &mut bcc);
|
r = mailimf_bcc_parse(message, length, &mut cur_token, &mut bcc);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Bcc(bcc);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::Bcc(bcc));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
16 => {
|
16 => {
|
||||||
r = mailimf_message_id_parse(message, length, &mut cur_token, &mut message_id);
|
r = mailimf_message_id_parse(message, length, &mut cur_token, &mut message_id);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::MessageId(message_id);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::MessageId(message_id));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
17 => {
|
17 => {
|
||||||
r = mailimf_in_reply_to_parse(message, length, &mut cur_token, &mut in_reply_to);
|
r = mailimf_in_reply_to_parse(message, length, &mut cur_token, &mut in_reply_to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::InReplyTo(in_reply_to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::InReplyTo(in_reply_to));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
18 => {
|
18 => {
|
||||||
r = mailimf_references_parse(message, length, &mut cur_token, &mut references);
|
r = mailimf_references_parse(message, length, &mut cur_token, &mut references);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::References(references);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::References(references));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
19 => {
|
19 => {
|
||||||
r = mailimf_subject_parse(message, length, &mut cur_token, &mut subject);
|
r = mailimf_subject_parse(message, length, &mut cur_token, &mut subject);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Subject(subject);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::Subject(subject));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
20 => {
|
20 => {
|
||||||
r = mailimf_comments_parse(message, length, &mut cur_token, &mut comments);
|
r = mailimf_comments_parse(message, length, &mut cur_token, &mut comments);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Comments(comments);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::Comments(comments));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
21 => {
|
21 => {
|
||||||
r = mailimf_keywords_parse(message, length, &mut cur_token, &mut keywords);
|
r = mailimf_keywords_parse(message, length, &mut cur_token, &mut keywords);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Keywords(keywords);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::Keywords(keywords));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
1 => {
|
1 => {
|
||||||
r = mailimf_return_parse(message, length, &mut cur_token, &mut return_path);
|
r = mailimf_return_parse(message, length, &mut cur_token, &mut return_path);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ReturnPath(return_path);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ReturnPath(return_path));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2 => {
|
2 => {
|
||||||
r = mailimf_resent_date_parse(message, length, &mut cur_token, &mut resent_date);
|
r = mailimf_resent_date_parse(message, length, &mut cur_token, &mut resent_date);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentDate(resent_date);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentDate(resent_date));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
3 => {
|
3 => {
|
||||||
r = mailimf_resent_from_parse(message, length, &mut cur_token, &mut resent_from);
|
r = mailimf_resent_from_parse(message, length, &mut cur_token, &mut resent_from);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentFrom(resent_from);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentFrom(resent_from));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
4 => {
|
4 => {
|
||||||
r = mailimf_resent_sender_parse(message, length, &mut cur_token, &mut resent_sender);
|
r = mailimf_resent_sender_parse(message, length, &mut cur_token, &mut resent_sender);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentSender(resent_sender);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentSender(resent_sender));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
5 => {
|
5 => {
|
||||||
r = mailimf_resent_to_parse(message, length, &mut cur_token, &mut resent_to);
|
r = mailimf_resent_to_parse(message, length, &mut cur_token, &mut resent_to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentTo(resent_to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentTo(resent_to));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
6 => {
|
6 => {
|
||||||
r = mailimf_resent_cc_parse(message, length, &mut cur_token, &mut resent_cc);
|
r = mailimf_resent_cc_parse(message, length, &mut cur_token, &mut resent_cc);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentCc(resent_cc);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentCc(resent_cc));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
7 => {
|
7 => {
|
||||||
r = mailimf_resent_bcc_parse(message, length, &mut cur_token, &mut resent_bcc);
|
r = mailimf_resent_bcc_parse(message, length, &mut cur_token, &mut resent_bcc);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentBcc(resent_bcc);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentBcc(resent_bcc));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
8 => {
|
8 => {
|
||||||
r = mailimf_resent_msg_id_parse(message, length, &mut cur_token, &mut resent_msg_id);
|
r = mailimf_resent_msg_id_parse(message, length, &mut cur_token, &mut resent_msg_id);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ResentMsgId(resent_msg_id);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::ResentMsgId(resent_msg_id));
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
try_optional = true;
|
try_optional = true;
|
||||||
} else {
|
} else {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
@@ -543,14 +521,13 @@ unsafe fn mailimf_field_parse(
|
|||||||
if try_optional {
|
if try_optional {
|
||||||
r = mailimf_optional_field_parse(message, length, &mut cur_token, &mut optional_field);
|
r = mailimf_optional_field_parse(message, length, &mut cur_token, &mut optional_field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
*result = mailimf_field::OptionalField(optional_field);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
return Ok(mailimf_field::OptionalField(optional_field));
|
||||||
}
|
}
|
||||||
|
|
||||||
res
|
Err(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn mailimf_optional_field_parse(
|
unsafe fn mailimf_optional_field_parse(
|
||||||
@@ -1131,7 +1108,7 @@ unsafe fn mailimf_resent_msg_id_parse(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn mailimf_msg_id_parse(
|
pub unsafe fn mailimf_msg_id_parse(
|
||||||
@@ -3890,7 +3867,7 @@ pub unsafe fn mailimf_msg_id_list_parse(
|
|||||||
indx,
|
indx,
|
||||||
result,
|
result,
|
||||||
Some(mailimf_unstrict_msg_id_parse),
|
Some(mailimf_unstrict_msg_id_parse),
|
||||||
Some(mailimf_msg_id_free),
|
Some(|f| mailimf_msg_id_free(*f)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3898,33 +3875,32 @@ unsafe fn mailimf_unstrict_msg_id_parse(
|
|||||||
message: *const libc::c_char,
|
message: *const libc::c_char,
|
||||||
length: size_t,
|
length: size_t,
|
||||||
indx: *mut size_t,
|
indx: *mut size_t,
|
||||||
result: &mut *mut libc::c_char,
|
) -> Result<*mut libc::c_char, libc::c_int> {
|
||||||
) -> libc::c_int {
|
|
||||||
let mut msgid: *mut libc::c_char = 0 as *mut libc::c_char;
|
let mut msgid: *mut libc::c_char = 0 as *mut libc::c_char;
|
||||||
let mut cur_token: size_t = 0;
|
let mut cur_token: size_t = 0;
|
||||||
let mut r: libc::c_int = 0;
|
let mut r: libc::c_int = 0;
|
||||||
cur_token = *indx;
|
cur_token = *indx;
|
||||||
r = mailimf_cfws_parse(message, length, &mut cur_token);
|
r = mailimf_cfws_parse(message, length, &mut cur_token);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int && r != MAILIMF_ERROR_PARSE as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int && r != MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
r = mailimf_parse_unwanted_msg_id(message, length, &mut cur_token);
|
r = mailimf_parse_unwanted_msg_id(message, length, &mut cur_token);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
r = mailimf_msg_id_parse(message, length, &mut cur_token, &mut msgid);
|
r = mailimf_msg_id_parse(message, length, &mut cur_token, &mut msgid);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
r = mailimf_parse_unwanted_msg_id(message, length, &mut cur_token);
|
r = mailimf_parse_unwanted_msg_id(message, length, &mut cur_token);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
free(msgid as *mut libc::c_void);
|
free(msgid as *mut libc::c_void);
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
*result = msgid;
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
Ok(msgid)
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn mailimf_parse_unwanted_msg_id(
|
unsafe fn mailimf_parse_unwanted_msg_id(
|
||||||
mut message: *const libc::c_char,
|
mut message: *const libc::c_char,
|
||||||
mut length: size_t,
|
mut length: size_t,
|
||||||
@@ -4171,55 +4147,52 @@ unsafe fn mailimf_struct_multiple_parse<T>(
|
|||||||
mut indx: *mut size_t,
|
mut indx: *mut size_t,
|
||||||
mut result: &mut Vec<T>,
|
mut result: &mut Vec<T>,
|
||||||
mut parser: Option<
|
mut parser: Option<
|
||||||
unsafe fn(_: *const libc::c_char, _: size_t, _: *mut size_t, _: &mut T) -> libc::c_int,
|
unsafe fn(_: *const libc::c_char, _: size_t, _: *mut size_t) -> Result<T, libc::c_int>,
|
||||||
>,
|
>,
|
||||||
mut destructor: Option<unsafe fn(_: T)>,
|
mut destructor: Option<unsafe fn(_: &T)>,
|
||||||
) -> libc::c_int {
|
) -> libc::c_int {
|
||||||
let mut current_block: u64;
|
let mut current_block: u64;
|
||||||
let mut struct_list = Vec::new();
|
let mut struct_list = Vec::new();
|
||||||
let mut cur_token: size_t = 0;
|
let mut cur_token: size_t = 0;
|
||||||
let mut value: T;
|
|
||||||
|
|
||||||
let mut r: libc::c_int = 0;
|
let mut r: libc::c_int = 0;
|
||||||
let mut res: libc::c_int = 0;
|
let mut res: libc::c_int = 0;
|
||||||
cur_token = *indx;
|
cur_token = *indx;
|
||||||
r = parser.expect("non-null function pointer")(message, length, &mut cur_token, &mut value);
|
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
|
||||||
res = r
|
|
||||||
} else {
|
|
||||||
struct_list.push(value);
|
|
||||||
loop {
|
|
||||||
r = parser.expect("non-null function pointer")(
|
|
||||||
message,
|
|
||||||
length,
|
|
||||||
&mut cur_token,
|
|
||||||
&mut value,
|
|
||||||
);
|
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
|
||||||
if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
|
||||||
current_block = 11057878835866523405;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
res = r;
|
|
||||||
current_block = 8222683242185098763;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
struct_list.push(value);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
match current_block {
|
|
||||||
8222683242185098763 => {}
|
|
||||||
_ => {
|
|
||||||
*result = struct_list;
|
|
||||||
*indx = cur_token;
|
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(destructor) = destructor {
|
match parser.expect("non-null function pointer")(message, length, &mut cur_token) {
|
||||||
for el in &struct_list {
|
Err(err) => res = err,
|
||||||
destructor(*el);
|
Ok(value) => {
|
||||||
|
struct_list.push(value);
|
||||||
|
loop {
|
||||||
|
match parser.expect("non-null function pointer")(message, length, &mut cur_token) {
|
||||||
|
Err(r) => {
|
||||||
|
if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
|
current_block = 11057878835866523405;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
res = r;
|
||||||
|
current_block = 8222683242185098763;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Ok(value) => {
|
||||||
|
struct_list.push(value);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
match current_block {
|
||||||
|
8222683242185098763 => {}
|
||||||
|
_ => {
|
||||||
|
*result = struct_list;
|
||||||
|
*indx = cur_token;
|
||||||
|
return MAILIMF_NO_ERROR as libc::c_int;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(destructor) = destructor {
|
||||||
|
for el in &struct_list {
|
||||||
|
destructor(el);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4886,38 +4859,41 @@ pub unsafe fn mailimf_envelope_fields_parse(
|
|||||||
let mut list = Vec::new();
|
let mut list = Vec::new();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let mut elt: mailimf_field;
|
match mailimf_envelope_field_parse(message, length, &mut cur_token) {
|
||||||
r = mailimf_envelope_field_parse(message, length, &mut cur_token, &mut elt);
|
Ok(elt) => {
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
list.push(elt);
|
||||||
list.push(elt);
|
|
||||||
continue;
|
|
||||||
} else if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
|
||||||
r = mailimf_ignore_field_parse(message, length, &mut cur_token);
|
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* do nothing */
|
Err(mut r) => {
|
||||||
if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
current_block = 2719512138335094285;
|
r = mailimf_ignore_field_parse(message, length, &mut cur_token);
|
||||||
break;
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
/* do nothing */
|
||||||
|
if r == MAILIMF_ERROR_PARSE as libc::c_int {
|
||||||
|
current_block = 2719512138335094285;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
res = r;
|
||||||
|
current_block = 894413572976700158;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
res = r;
|
||||||
|
current_block = 894413572976700158;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
match current_block {
|
||||||
|
2719512138335094285 => {
|
||||||
|
*result = mailimf_fields_new(list);
|
||||||
|
*indx = cur_token;
|
||||||
|
return MAILIMF_NO_ERROR as libc::c_int;
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
res = r;
|
|
||||||
current_block = 894413572976700158;
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
res = r;
|
|
||||||
current_block = 894413572976700158;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
match current_block {
|
|
||||||
2719512138335094285 => {
|
|
||||||
*result = mailimf_fields_new(list);
|
|
||||||
*indx = cur_token;
|
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
|
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
@@ -5032,10 +5008,7 @@ unsafe fn mailimf_envelope_field_parse(
|
|||||||
message: *const libc::c_char,
|
message: *const libc::c_char,
|
||||||
length: size_t,
|
length: size_t,
|
||||||
indx: *mut size_t,
|
indx: *mut size_t,
|
||||||
result: &mut mailimf_field,
|
) -> Result<mailimf_field, libc::c_int> {
|
||||||
) -> libc::c_int {
|
|
||||||
let mut cur_token: size_t = 0;
|
|
||||||
let mut type_0: libc::c_int = 0;
|
|
||||||
let mut orig_date: *mut mailimf_orig_date = 0 as *mut mailimf_orig_date;
|
let mut orig_date: *mut mailimf_orig_date = 0 as *mut mailimf_orig_date;
|
||||||
let mut from: *mut mailimf_from = 0 as *mut mailimf_from;
|
let mut from: *mut mailimf_from = 0 as *mut mailimf_from;
|
||||||
let mut sender: *mut mailimf_sender = 0 as *mut mailimf_sender;
|
let mut sender: *mut mailimf_sender = 0 as *mut mailimf_sender;
|
||||||
@@ -5049,97 +5022,94 @@ unsafe fn mailimf_envelope_field_parse(
|
|||||||
let mut subject: *mut mailimf_subject = 0 as *mut mailimf_subject;
|
let mut subject: *mut mailimf_subject = 0 as *mut mailimf_subject;
|
||||||
let mut optional_field: *mut mailimf_optional_field = 0 as *mut mailimf_optional_field;
|
let mut optional_field: *mut mailimf_optional_field = 0 as *mut mailimf_optional_field;
|
||||||
|
|
||||||
let mut r = 0;
|
|
||||||
|
|
||||||
let mut cur_token = *indx;
|
let mut cur_token = *indx;
|
||||||
let guessed_type = guess_header_type(message, length, cur_token);
|
let guessed_type = guess_header_type(message, length, cur_token);
|
||||||
|
let mut r = 0;
|
||||||
let mut try_optional = false;
|
|
||||||
|
|
||||||
match guessed_type {
|
match guessed_type {
|
||||||
9 => {
|
9 => {
|
||||||
r = mailimf_orig_date_parse(message, length, &mut cur_token, &mut orig_date);
|
r = mailimf_orig_date_parse(message, length, &mut cur_token, &mut orig_date);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::OrigDate(orig_date);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::OrigDate(orig_date));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
10 => {
|
10 => {
|
||||||
r = mailimf_from_parse(message, length, &mut cur_token, &mut from);
|
r = mailimf_from_parse(message, length, &mut cur_token, &mut from);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::From(from);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::From(from));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
11 => {
|
11 => {
|
||||||
r = mailimf_sender_parse(message, length, &mut cur_token, &mut sender);
|
r = mailimf_sender_parse(message, length, &mut cur_token, &mut sender);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Sender(sender);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::Sender(sender));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
12 => {
|
12 => {
|
||||||
r = mailimf_reply_to_parse(message, length, &mut cur_token, &mut reply_to);
|
r = mailimf_reply_to_parse(message, length, &mut cur_token, &mut reply_to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::ReplyTo(reply_to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::ReplyTo(reply_to));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
13 => {
|
13 => {
|
||||||
r = mailimf_to_parse(message, length, &mut cur_token, &mut to);
|
r = mailimf_to_parse(message, length, &mut cur_token, &mut to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::To(to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::To(to));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
14 => {
|
14 => {
|
||||||
r = mailimf_cc_parse(message, length, &mut cur_token, &mut cc);
|
r = mailimf_cc_parse(message, length, &mut cur_token, &mut cc);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Cc(cc);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::Cc(cc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
15 => {
|
15 => {
|
||||||
r = mailimf_bcc_parse(message, length, &mut cur_token, &mut bcc);
|
r = mailimf_bcc_parse(message, length, &mut cur_token, &mut bcc);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Bcc(bcc);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::Bcc(bcc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
16 => {
|
16 => {
|
||||||
r = mailimf_message_id_parse(message, length, &mut cur_token, &mut message_id);
|
r = mailimf_message_id_parse(message, length, &mut cur_token, &mut message_id);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::MessageId(message_id);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::MessageId(message_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
17 => {
|
17 => {
|
||||||
r = mailimf_in_reply_to_parse(message, length, &mut cur_token, &mut in_reply_to);
|
r = mailimf_in_reply_to_parse(message, length, &mut cur_token, &mut in_reply_to);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::InReplyTo(in_reply_to);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::InReplyTo(in_reply_to));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
18 => {
|
18 => {
|
||||||
r = mailimf_references_parse(message, length, &mut cur_token, &mut references);
|
r = mailimf_references_parse(message, length, &mut cur_token, &mut references);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::References(references);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::References(references));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
19 => {
|
19 => {
|
||||||
r = mailimf_subject_parse(message, length, &mut cur_token, &mut subject);
|
r = mailimf_subject_parse(message, length, &mut cur_token, &mut subject);
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
*result = mailimf_field::Subject(subject);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
|
return Ok(mailimf_field::Subject(subject));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
r = MAILIMF_ERROR_PARSE as libc::c_int;
|
return Err(MAILIMF_ERROR_PARSE as libc::c_int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r
|
Err(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -5210,25 +5180,22 @@ unsafe fn mailimf_envelope_or_optional_field_parse(
|
|||||||
message: *const libc::c_char,
|
message: *const libc::c_char,
|
||||||
length: size_t,
|
length: size_t,
|
||||||
indx: *mut size_t,
|
indx: *mut size_t,
|
||||||
result: &mut mailimf_field,
|
) -> Result<mailimf_field, libc::c_int> {
|
||||||
) -> libc::c_int {
|
match mailimf_envelope_field_parse(message, length, indx) {
|
||||||
let mut r: libc::c_int = 0;
|
Ok(value) => Ok(value),
|
||||||
let mut cur_token: size_t = 0;
|
Err(_) => {
|
||||||
let mut optional_field: *mut mailimf_optional_field = 0 as *mut mailimf_optional_field;
|
let mut optional_field: *mut mailimf_optional_field = 0 as *mut mailimf_optional_field;
|
||||||
let mut field: *mut mailimf_field = 0 as *mut mailimf_field;
|
let mut cur_token = *indx;
|
||||||
r = mailimf_envelope_field_parse(message, length, indx, result);
|
let r =
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
mailimf_optional_field_parse(message, length, &mut cur_token, &mut optional_field);
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
}
|
return Err(r);
|
||||||
cur_token = *indx;
|
}
|
||||||
r = mailimf_optional_field_parse(message, length, &mut cur_token, &mut optional_field);
|
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
*result = mailimf_field::OptionalField(optional_field);
|
*indx = cur_token;
|
||||||
*indx = cur_token;
|
Ok(mailimf_field::OptionalField(optional_field))
|
||||||
MAILIMF_NO_ERROR as libc::c_int
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -5296,20 +5263,17 @@ unsafe fn mailimf_only_optional_field_parse(
|
|||||||
message: *const libc::c_char,
|
message: *const libc::c_char,
|
||||||
length: size_t,
|
length: size_t,
|
||||||
indx: *mut size_t,
|
indx: *mut size_t,
|
||||||
result: &mut mailimf_field,
|
) -> Result<mailimf_field, libc::c_int> {
|
||||||
) -> libc::c_int {
|
|
||||||
let mut r: libc::c_int = 0;
|
|
||||||
let mut cur_token: size_t = 0;
|
|
||||||
let mut optional_field = std::ptr::null_mut();
|
let mut optional_field = std::ptr::null_mut();
|
||||||
cur_token = *indx;
|
let mut cur_token = *indx;
|
||||||
r = mailimf_optional_field_parse(message, length, &mut cur_token, &mut optional_field);
|
|
||||||
|
let r = mailimf_optional_field_parse(message, length, &mut cur_token, &mut optional_field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
return r;
|
return Err(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
*result = mailimf_field::OptionalField(optional_field);
|
|
||||||
*indx = cur_token;
|
*indx = cur_token;
|
||||||
MAILIMF_NO_ERROR as libc::c_int
|
Ok(mailimf_field::OptionalField(optional_field))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn mailimf_custom_string_parse(
|
pub unsafe fn mailimf_custom_string_parse(
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ impl Drop for mailimf_field {
|
|||||||
unsafe {
|
unsafe {
|
||||||
match self {
|
match self {
|
||||||
ReturnPath(p) => mailimf_return_free(*p),
|
ReturnPath(p) => mailimf_return_free(*p),
|
||||||
OrigDate(d) => mailimf_orig_date_free(*d),
|
ResentDate(d) => mailimf_orig_date_free(*d),
|
||||||
ResentFrom(r) => mailimf_from_free(*r),
|
ResentFrom(r) => mailimf_from_free(*r),
|
||||||
ResentSender(r) => mailimf_sender_free(*r),
|
ResentSender(r) => mailimf_sender_free(*r),
|
||||||
ResentTo(r) => mailimf_to_free(*r),
|
ResentTo(r) => mailimf_to_free(*r),
|
||||||
@@ -929,8 +929,9 @@ pub unsafe fn mailimf_optional_field_new(
|
|||||||
}
|
}
|
||||||
(*opt_field).fld_name = fld_name;
|
(*opt_field).fld_name = fld_name;
|
||||||
(*opt_field).fld_value = fld_value;
|
(*opt_field).fld_value = fld_value;
|
||||||
return opt_field;
|
opt_field
|
||||||
}
|
}
|
||||||
|
|
||||||
/* internal use */
|
/* internal use */
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe fn mailimf_atom_free(mut atom: *mut libc::c_char) {
|
pub unsafe fn mailimf_atom_free(mut atom: *mut libc::c_char) {
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
use crate::clist::*;
|
|
||||||
use crate::mailimf::types::*;
|
use crate::mailimf::types::*;
|
||||||
use crate::other::*;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
this function creates a new mailimf_fields structure with no fields
|
this function creates a new mailimf_fields structure with no fields
|
||||||
@@ -15,20 +13,8 @@ pub unsafe fn mailimf_fields_new_empty() -> *mut mailimf_fields {
|
|||||||
@return MAILIMF_NO_ERROR will be returned on success,
|
@return MAILIMF_NO_ERROR will be returned on success,
|
||||||
other code will be returned otherwise
|
other code will be returned otherwise
|
||||||
*/
|
*/
|
||||||
pub unsafe fn mailimf_fields_add(
|
pub unsafe fn mailimf_fields_add(fields: *mut mailimf_fields, field: mailimf_field) {
|
||||||
mut fields: *mut mailimf_fields,
|
(*fields).0.push(field)
|
||||||
mut field: *mut mailimf_field,
|
|
||||||
) -> libc::c_int {
|
|
||||||
let mut r: libc::c_int = 0;
|
|
||||||
r = clist_insert_after(
|
|
||||||
(*fields).fld_list,
|
|
||||||
(*(*fields).fld_list).last,
|
|
||||||
field as *mut libc::c_void,
|
|
||||||
);
|
|
||||||
if r < 0i32 {
|
|
||||||
return MAILIMF_ERROR_MEMORY as libc::c_int;
|
|
||||||
}
|
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -38,19 +24,11 @@ pub unsafe fn mailimf_fields_add(
|
|||||||
@param value should be allocated with malloc()
|
@param value should be allocated with malloc()
|
||||||
*/
|
*/
|
||||||
pub unsafe fn mailimf_field_new_custom(
|
pub unsafe fn mailimf_field_new_custom(
|
||||||
mut name: *mut libc::c_char,
|
name: *mut libc::c_char,
|
||||||
mut value: *mut libc::c_char,
|
value: *mut libc::c_char,
|
||||||
) -> *mut mailimf_field {
|
) -> mailimf_field {
|
||||||
let mut opt_field: *mut mailimf_optional_field = 0 as *mut mailimf_optional_field;
|
let opt_field = mailimf_optional_field_new(name, value);
|
||||||
let mut field: *mut mailimf_field = 0 as *mut mailimf_field;
|
assert!(!opt_field.is_null(), "failed memory allocation");
|
||||||
opt_field = mailimf_optional_field_new(name, value);
|
|
||||||
if !opt_field.is_null() {
|
mailimf_field::OptionalField(opt_field)
|
||||||
field = mailimf_field::OptionalField(opt_field);
|
|
||||||
if field.is_null() {
|
|
||||||
mailimf_optional_field_free(opt_field);
|
|
||||||
} else {
|
|
||||||
return field;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0 as *mut mailimf_field;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,35 +166,19 @@ pub unsafe fn mailimf_fields_write_driver(
|
|||||||
mut do_write: Option<
|
mut do_write: Option<
|
||||||
unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
|
unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
|
||||||
>,
|
>,
|
||||||
mut data: *mut libc::c_void,
|
data: *mut libc::c_void,
|
||||||
mut col: *mut libc::c_int,
|
col: *mut libc::c_int,
|
||||||
mut fields: *mut mailimf_fields,
|
fields: *mut mailimf_fields,
|
||||||
) -> libc::c_int {
|
) -> libc::c_int {
|
||||||
let mut cur: *mut clistiter = 0 as *mut clistiter;
|
for cur in &(*fields).0 {
|
||||||
cur = (*(*fields).fld_list).first;
|
let r = mailimf_field_write_driver(do_write, data, col, cur);
|
||||||
while !cur.is_null() {
|
|
||||||
let mut r: libc::c_int = 0;
|
|
||||||
r = mailimf_field_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(if !cur.is_null() {
|
|
||||||
(*cur).data
|
|
||||||
} else {
|
|
||||||
0 as *mut libc::c_void
|
|
||||||
}) as *mut mailimf_field,
|
|
||||||
);
|
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
if r != MAILIMF_NO_ERROR as libc::c_int {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
cur = if !cur.is_null() {
|
|
||||||
(*cur).next
|
|
||||||
} else {
|
|
||||||
0 as *mut clistcell
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
MAILIMF_NO_ERROR as libc::c_int
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
mailimf_field_write writes a field to a given stream
|
mailimf_field_write writes a field to a given stream
|
||||||
|
|
||||||
@@ -207,118 +191,38 @@ pub unsafe fn mailimf_field_write_driver(
|
|||||||
mut do_write: Option<
|
mut do_write: Option<
|
||||||
unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
|
unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
|
||||||
>,
|
>,
|
||||||
mut data: *mut libc::c_void,
|
data: *mut libc::c_void,
|
||||||
mut col: *mut libc::c_int,
|
col: *mut libc::c_int,
|
||||||
mut field: *mut mailimf_field,
|
field: &mailimf_field,
|
||||||
) -> libc::c_int {
|
) -> libc::c_int {
|
||||||
let mut r: libc::c_int = 0;
|
use mailimf_field::*;
|
||||||
match (*field).fld_type {
|
|
||||||
1 => {
|
match field {
|
||||||
r = mailimf_return_write_driver(do_write, data, col, (*field).fld_data.fld_return_path)
|
ReturnPath(path) => mailimf_return_write_driver(do_write, data, col, *path),
|
||||||
}
|
ResentDate(date) => mailimf_resent_date_write_driver(do_write, data, col, *date),
|
||||||
2 => {
|
ResentFrom(from) => mailimf_resent_from_write_driver(do_write, data, col, *from),
|
||||||
r = mailimf_resent_date_write_driver(
|
ResentSender(sender) => mailimf_resent_sender_write_driver(do_write, data, col, *sender),
|
||||||
do_write,
|
ResentTo(to) => mailimf_resent_to_write_driver(do_write, data, col, *to),
|
||||||
data,
|
ResentCc(cc) => mailimf_resent_cc_write_driver(do_write, data, col, *cc),
|
||||||
col,
|
ResentBcc(bcc) => mailimf_resent_bcc_write_driver(do_write, data, col, *bcc),
|
||||||
(*field).fld_data.fld_resent_date,
|
ResentMsgId(id) => mailimf_resent_msg_id_write_driver(do_write, data, col, *id),
|
||||||
)
|
OrigDate(date) => mailimf_orig_date_write_driver(do_write, data, col, *date),
|
||||||
}
|
From(from) => mailimf_from_write_driver(do_write, data, col, *from),
|
||||||
3 => {
|
Sender(sender) => mailimf_sender_write_driver(do_write, data, col, *sender),
|
||||||
r = mailimf_resent_from_write_driver(
|
ReplyTo(to) => mailimf_reply_to_write_driver(do_write, data, col, *to),
|
||||||
do_write,
|
To(to) => mailimf_to_write_driver(do_write, data, col, *to),
|
||||||
data,
|
Cc(cc) => mailimf_cc_write_driver(do_write, data, col, *cc),
|
||||||
col,
|
Bcc(bcc) => mailimf_bcc_write_driver(do_write, data, col, *bcc),
|
||||||
(*field).fld_data.fld_resent_from,
|
MessageId(id) => mailimf_message_id_write_driver(do_write, data, col, *id),
|
||||||
)
|
InReplyTo(to) => mailimf_in_reply_to_write_driver(do_write, data, col, *to),
|
||||||
}
|
References(refs) => mailimf_references_write_driver(do_write, data, col, *refs),
|
||||||
4 => {
|
Subject(s) => mailimf_subject_write_driver(do_write, data, col, *s),
|
||||||
r = mailimf_resent_sender_write_driver(
|
Comments(c) => mailimf_comments_write_driver(do_write, data, col, *c),
|
||||||
do_write,
|
Keywords(k) => mailimf_keywords_write_driver(do_write, data, col, *k),
|
||||||
data,
|
OptionalField(f) => mailimf_optional_field_write_driver(do_write, data, col, *f),
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_resent_sender,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
5 => {
|
|
||||||
r = mailimf_resent_to_write_driver(do_write, data, col, (*field).fld_data.fld_resent_to)
|
|
||||||
}
|
|
||||||
6 => {
|
|
||||||
r = mailimf_resent_cc_write_driver(do_write, data, col, (*field).fld_data.fld_resent_cc)
|
|
||||||
}
|
|
||||||
7 => {
|
|
||||||
r = mailimf_resent_bcc_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_resent_bcc,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
8 => {
|
|
||||||
r = mailimf_resent_msg_id_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_resent_msg_id,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
9 => {
|
|
||||||
r = mailimf_orig_date_write_driver(do_write, data, col, (*field).fld_data.fld_orig_date)
|
|
||||||
}
|
|
||||||
10 => r = mailimf_from_write_driver(do_write, data, col, (*field).fld_data.fld_from),
|
|
||||||
11 => r = mailimf_sender_write_driver(do_write, data, col, (*field).fld_data.fld_sender),
|
|
||||||
12 => {
|
|
||||||
r = mailimf_reply_to_write_driver(do_write, data, col, (*field).fld_data.fld_reply_to)
|
|
||||||
}
|
|
||||||
13 => r = mailimf_to_write_driver(do_write, data, col, (*field).fld_data.fld_to),
|
|
||||||
14 => r = mailimf_cc_write_driver(do_write, data, col, (*field).fld_data.fld_cc),
|
|
||||||
15 => r = mailimf_bcc_write_driver(do_write, data, col, (*field).fld_data.fld_bcc),
|
|
||||||
16 => {
|
|
||||||
r = mailimf_message_id_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_message_id,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
17 => {
|
|
||||||
r = mailimf_in_reply_to_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_in_reply_to,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
18 => {
|
|
||||||
r = mailimf_references_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_references,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
19 => r = mailimf_subject_write_driver(do_write, data, col, (*field).fld_data.fld_subject),
|
|
||||||
20 => {
|
|
||||||
r = mailimf_comments_write_driver(do_write, data, col, (*field).fld_data.fld_comments)
|
|
||||||
}
|
|
||||||
21 => {
|
|
||||||
r = mailimf_keywords_write_driver(do_write, data, col, (*field).fld_data.fld_keywords)
|
|
||||||
}
|
|
||||||
22 => {
|
|
||||||
r = mailimf_optional_field_write_driver(
|
|
||||||
do_write,
|
|
||||||
data,
|
|
||||||
col,
|
|
||||||
(*field).fld_data.fld_optional_field,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
_ => r = MAILIMF_ERROR_INVAL as libc::c_int,
|
|
||||||
}
|
}
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn mailimf_optional_field_write_driver(
|
unsafe fn mailimf_optional_field_write_driver(
|
||||||
mut do_write: Option<
|
mut do_write: Option<
|
||||||
unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
|
unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
|
||||||
|
|||||||
@@ -1251,13 +1251,13 @@ unsafe fn remove_unparsed_mime_headers(fields: *mut mailimf_fields) {
|
|||||||
mailimf_field::OptionalField(data) => {
|
mailimf_field::OptionalField(data) => {
|
||||||
delete = false;
|
delete = false;
|
||||||
if strncasecmp(
|
if strncasecmp(
|
||||||
data.fld_name,
|
(**data).fld_name,
|
||||||
b"Content-\x00" as *const u8 as *const libc::c_char,
|
b"Content-\x00" as *const u8 as *const libc::c_char,
|
||||||
8i32 as libc::size_t,
|
8i32 as libc::size_t,
|
||||||
) == 0i32
|
) == 0i32
|
||||||
{
|
{
|
||||||
let mut name: *mut libc::c_char = 0 as *mut libc::c_char;
|
let mut name: *mut libc::c_char = 0 as *mut libc::c_char;
|
||||||
name = data.fld_name.offset(8isize);
|
name = (**data).fld_name.offset(8isize);
|
||||||
if strcasecmp(name, b"Type\x00" as *const u8 as *const libc::c_char) == 0i32
|
if strcasecmp(name, b"Type\x00" as *const u8 as *const libc::c_char) == 0i32
|
||||||
|| strcasecmp(
|
|| strcasecmp(
|
||||||
name,
|
name,
|
||||||
@@ -1274,7 +1274,7 @@ unsafe fn remove_unparsed_mime_headers(fields: *mut mailimf_fields) {
|
|||||||
delete = true;
|
delete = true;
|
||||||
}
|
}
|
||||||
} else if strcasecmp(
|
} else if strcasecmp(
|
||||||
data.fld_name,
|
(**data).fld_name,
|
||||||
b"MIME-Version\x00" as *const u8 as *const libc::c_char,
|
b"MIME-Version\x00" as *const u8 as *const libc::c_char,
|
||||||
) == 0i32
|
) == 0i32
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1068,8 +1068,6 @@ pub unsafe fn mailmime_fields_parse(
|
|||||||
mut fields: *mut mailimf_fields,
|
mut fields: *mut mailimf_fields,
|
||||||
mut result: *mut *mut mailmime_fields,
|
mut result: *mut *mut mailmime_fields,
|
||||||
) -> libc::c_int {
|
) -> libc::c_int {
|
||||||
let mut current_block: u64;
|
|
||||||
let mut cur: *mut clistiter = 0 as *mut clistiter;
|
|
||||||
let mut mime_fields: *mut mailmime_fields = 0 as *mut mailmime_fields;
|
let mut mime_fields: *mut mailmime_fields = 0 as *mut mailmime_fields;
|
||||||
let mut list: *mut clist = 0 as *mut clist;
|
let mut list: *mut clist = 0 as *mut clist;
|
||||||
let mut r: libc::c_int = 0;
|
let mut r: libc::c_int = 0;
|
||||||
@@ -1078,58 +1076,27 @@ pub unsafe fn mailmime_fields_parse(
|
|||||||
if list.is_null() {
|
if list.is_null() {
|
||||||
res = MAILIMF_ERROR_MEMORY as libc::c_int
|
res = MAILIMF_ERROR_MEMORY as libc::c_int
|
||||||
} else {
|
} else {
|
||||||
cur = (*(*fields).fld_list).first;
|
for field in &(*fields).0 {
|
||||||
loop {
|
let mut mime_field = 0 as *mut mailmime_field;
|
||||||
if cur.is_null() {
|
|
||||||
current_block = 1109700713171191020;
|
if let mailimf_field::OptionalField(opt_field) = field {
|
||||||
break;
|
r = mailmime_field_parse(*opt_field, &mut mime_field);
|
||||||
}
|
|
||||||
let mut field: *mut mailimf_field = 0 as *mut mailimf_field;
|
|
||||||
let mut mime_field: *mut mailmime_field = 0 as *mut mailmime_field;
|
|
||||||
field = (if !cur.is_null() {
|
|
||||||
(*cur).data
|
|
||||||
} else {
|
|
||||||
0 as *mut libc::c_void
|
|
||||||
}) as *mut mailimf_field;
|
|
||||||
if (*field).fld_type == MAILIMF_FIELD_OPTIONAL_FIELD as libc::c_int {
|
|
||||||
r = mailmime_field_parse((*field).fld_data.fld_optional_field, &mut mime_field);
|
|
||||||
if r == MAILIMF_NO_ERROR as libc::c_int {
|
if r == MAILIMF_NO_ERROR as libc::c_int {
|
||||||
r = clist_insert_after(list, (*list).last, mime_field as *mut libc::c_void);
|
r = clist_insert_after(list, (*list).last, mime_field as *mut libc::c_void);
|
||||||
if r < 0i32 {
|
if r < 0i32 {
|
||||||
mailmime_field_free(mime_field);
|
mailmime_field_free(mime_field);
|
||||||
res = MAILIMF_ERROR_MEMORY as libc::c_int;
|
res = MAILIMF_ERROR_MEMORY as libc::c_int;
|
||||||
current_block = 17592539310030730040;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if !(r == MAILIMF_ERROR_PARSE as libc::c_int) {
|
} else if !(r == MAILIMF_ERROR_PARSE as libc::c_int) {
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
res = r;
|
res = r;
|
||||||
current_block = 17592539310030730040;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cur = if !cur.is_null() {
|
|
||||||
(*cur).next
|
|
||||||
} else {
|
|
||||||
0 as *mut clistcell
|
|
||||||
}
|
|
||||||
}
|
|
||||||
match current_block {
|
|
||||||
1109700713171191020 => {
|
|
||||||
if (*list).first.is_null() {
|
|
||||||
res = MAILIMF_ERROR_PARSE as libc::c_int
|
|
||||||
} else {
|
|
||||||
mime_fields = mailmime_fields_new(list);
|
|
||||||
if mime_fields.is_null() {
|
|
||||||
res = MAILIMF_ERROR_MEMORY as libc::c_int
|
|
||||||
} else {
|
|
||||||
*result = mime_fields;
|
|
||||||
return MAILIMF_NO_ERROR as libc::c_int;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clist_foreach(
|
clist_foreach(
|
||||||
list,
|
list,
|
||||||
::std::mem::transmute::<Option<unsafe fn(_: *mut mailmime_field) -> ()>, clist_func>(
|
::std::mem::transmute::<Option<unsafe fn(_: *mut mailmime_field) -> ()>, clist_func>(
|
||||||
|
|||||||
@@ -450,12 +450,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 16539016819803454162;
|
current_block = 16539016819803454162;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::OrigDate(imf_date);
|
let field = mailimf_field::OrigDate(imf_date);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
current_block = 2719512138335094285;
|
||||||
current_block = 13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 2719512138335094285;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 2719512138335094285;
|
current_block = 2719512138335094285;
|
||||||
@@ -468,12 +464,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 13813460800808168376;
|
current_block = 13813460800808168376;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::From(imf_from);
|
let field = mailimf_field::From(imf_from);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
current_block = 3275366147856559585;
|
||||||
current_block = 13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 3275366147856559585;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 3275366147856559585;
|
current_block = 3275366147856559585;
|
||||||
@@ -488,12 +480,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 16539016819803454162;
|
current_block = 16539016819803454162;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::Sender(imf_sender);
|
let field = mailimf_field::Sender(imf_sender);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
current_block = 15090052786889560393;
|
||||||
current_block = 13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 15090052786889560393;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 15090052786889560393;
|
current_block = 15090052786889560393;
|
||||||
@@ -508,12 +496,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 16539016819803454162;
|
current_block = 16539016819803454162;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::ReplyTo(imf_reply_to);
|
let field = mailimf_field::ReplyTo(imf_reply_to);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
current_block = 10150597327160359210;
|
||||||
current_block = 13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 10150597327160359210;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 10150597327160359210;
|
current_block = 10150597327160359210;
|
||||||
@@ -528,12 +512,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 16539016819803454162;
|
current_block = 16539016819803454162;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::To(imf_to);
|
let field = mailimf_field::To(imf_to);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
current_block = 17233182392562552756;
|
||||||
current_block = 13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 17233182392562552756;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 17233182392562552756;
|
current_block = 17233182392562552756;
|
||||||
@@ -548,12 +528,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 16539016819803454162;
|
current_block = 16539016819803454162;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::Cc(imf_cc);
|
let field = mailimf_field::Cc(imf_cc);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int {
|
current_block = 12930649117290160518;
|
||||||
current_block = 13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 12930649117290160518;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 12930649117290160518;
|
current_block = 12930649117290160518;
|
||||||
@@ -568,14 +544,8 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
current_block = 16539016819803454162;
|
current_block = 16539016819803454162;
|
||||||
} else {
|
} else {
|
||||||
let field = mailimf_field::Bcc(imf_bcc);
|
let field = mailimf_field::Bcc(imf_bcc);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int
|
current_block = 7858101417678297991;
|
||||||
{
|
|
||||||
current_block =
|
|
||||||
13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block = 7858101417678297991;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block = 7858101417678297991;
|
current_block = 7858101417678297991;
|
||||||
@@ -595,18 +565,11 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
mailimf_field::MessageId(
|
mailimf_field::MessageId(
|
||||||
imf_msg_id,
|
imf_msg_id,
|
||||||
);
|
);
|
||||||
r = mailimf_fields_add(
|
mailimf_fields_add(
|
||||||
fields, field,
|
fields, field,
|
||||||
);
|
);
|
||||||
if r != MAILIMF_NO_ERROR
|
current_block =
|
||||||
as libc::c_int
|
15514718523126015390;
|
||||||
{
|
|
||||||
current_block =
|
|
||||||
13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block =
|
|
||||||
15514718523126015390;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block =
|
current_block =
|
||||||
@@ -632,20 +595,12 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
mailimf_field::InReplyTo(
|
mailimf_field::InReplyTo(
|
||||||
imf_in_reply_to,
|
imf_in_reply_to,
|
||||||
);
|
);
|
||||||
r = mailimf_fields_add(
|
mailimf_fields_add(
|
||||||
fields, field,
|
fields, field,
|
||||||
);
|
);
|
||||||
if r != MAILIMF_NO_ERROR
|
current_block
|
||||||
as libc::c_int
|
|
||||||
{
|
|
||||||
current_block
|
|
||||||
=
|
|
||||||
13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block
|
|
||||||
=
|
=
|
||||||
15587532755333643506;
|
15587532755333643506;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block =
|
current_block =
|
||||||
@@ -671,25 +626,10 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
=
|
=
|
||||||
mailimf_field::References(
|
mailimf_field::References(
|
||||||
imf_references);
|
imf_references);
|
||||||
r
|
mailimf_fields_add(fields, field);
|
||||||
=
|
current_block
|
||||||
mailimf_fields_add(fields,
|
=
|
||||||
field);
|
7301440000599063274;
|
||||||
if r
|
|
||||||
!=
|
|
||||||
MAILIMF_NO_ERROR
|
|
||||||
as
|
|
||||||
libc::c_int
|
|
||||||
{
|
|
||||||
current_block
|
|
||||||
=
|
|
||||||
13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block
|
|
||||||
=
|
|
||||||
7301440000599063274;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block
|
current_block
|
||||||
@@ -722,17 +662,10 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
} else {
|
} else {
|
||||||
let field =
|
let field =
|
||||||
mailimf_field::Subject(imf_subject);
|
mailimf_field::Subject(imf_subject);
|
||||||
r = mailimf_fields_add(fields, field);
|
mailimf_fields_add(fields, field);
|
||||||
if r != MAILIMF_NO_ERROR as libc::c_int
|
current_block
|
||||||
{
|
=
|
||||||
current_block
|
10153752038087260855;
|
||||||
=
|
|
||||||
13813460800808168376;
|
|
||||||
} else {
|
|
||||||
current_block
|
|
||||||
=
|
|
||||||
10153752038087260855;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
current_block
|
current_block
|
||||||
@@ -791,7 +724,7 @@ pub unsafe fn mailimf_fields_add_data(
|
|||||||
imf_references,
|
imf_references,
|
||||||
imf_subject,
|
imf_subject,
|
||||||
);
|
);
|
||||||
MAILIMF_ERROR_MEMORY
|
MAILIMF_ERROR_MEMORY as libc::c_int
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn detach_free_fields(
|
unsafe fn detach_free_fields(
|
||||||
|
|||||||
Reference in New Issue
Block a user