mirror of
https://github.com/chatmail/core.git
synced 2026-05-13 11:56:30 +03:00
refactor(mmime): remove some duplication
This commit is contained in:
@@ -43,15 +43,14 @@ pub struct mailimf_date_time {
|
|||||||
pub dt_zone: libc::c_int,
|
pub dt_zone: libc::c_int,
|
||||||
}
|
}
|
||||||
/* this is the type of address */
|
/* this is the type of address */
|
||||||
pub type unnamed = libc::c_uint;
|
|
||||||
/* if this is a group
|
/* if this is a group
|
||||||
(group_name: address1@domain1,
|
(group_name: address1@domain1,
|
||||||
address2@domain2; ) */
|
address2@domain2; ) */
|
||||||
pub const MAILIMF_ADDRESS_GROUP: unnamed = 2;
|
pub const MAILIMF_ADDRESS_GROUP: libc::c_uint = 2;
|
||||||
/* if this is a mailbox (mailbox@domain) */
|
/* if this is a mailbox (mailbox@domain) */
|
||||||
pub const MAILIMF_ADDRESS_MAILBOX: unnamed = 1;
|
pub const MAILIMF_ADDRESS_MAILBOX: libc::c_uint = 1;
|
||||||
/* on parse error */
|
/* on parse error */
|
||||||
pub const MAILIMF_ADDRESS_ERROR: unnamed = 0;
|
pub const MAILIMF_ADDRESS_ERROR: libc::c_uint = 0;
|
||||||
/*
|
/*
|
||||||
mailimf_address is an address
|
mailimf_address is an address
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use crate::mailmime::types::*;
|
|||||||
use crate::mmapstring::*;
|
use crate::mmapstring::*;
|
||||||
use crate::other::*;
|
use crate::other::*;
|
||||||
|
|
||||||
pub const MAIL_CHARCONV_ERROR_CONV: libc::c_uint = 3;
|
|
||||||
pub const MAIL_CHARCONV_ERROR_UNKNOWN_CHARSET: libc::c_uint = 1;
|
|
||||||
pub const MAIL_CHARCONV_ERROR_MEMORY: libc::c_uint = 2;
|
|
||||||
pub const TYPE_WORD: libc::c_uint = 1;
|
pub const TYPE_WORD: libc::c_uint = 1;
|
||||||
pub const TYPE_ENCODED_WORD: libc::c_uint = 2;
|
pub const TYPE_ENCODED_WORD: libc::c_uint = 2;
|
||||||
pub const MAILMIME_ENCODING_Q: libc::c_uint = 1;
|
pub const MAILMIME_ENCODING_Q: libc::c_uint = 1;
|
||||||
@@ -850,7 +847,7 @@ unsafe fn mailmime_etoken_parse(
|
|||||||
return mailimf_custom_string_parse(message, length, indx, result, Some(is_etoken_char));
|
return mailimf_custom_string_parse(message, length, indx, result, Some(is_etoken_char));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub unsafe fn is_etoken_char(mut ch: libc::c_char) -> libc::c_int {
|
unsafe fn is_etoken_char(mut ch: libc::c_char) -> libc::c_int {
|
||||||
let mut uch: libc::c_uchar = ch as libc::c_uchar;
|
let mut uch: libc::c_uchar = ch as libc::c_uchar;
|
||||||
if (uch as libc::c_int) < 31i32 {
|
if (uch as libc::c_int) < 31i32 {
|
||||||
return 0i32;
|
return 0i32;
|
||||||
|
|||||||
Reference in New Issue
Block a user