pub unsafe fn mailimf_address_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_address,
) -> libc::c_int {
    let mut type_0: libc::c_int = 0;
    let mut cur_token: size_t = 0;
    let mut mailbox: *mut mailimf_mailbox = 0 as *mut mailimf_mailbox;
    let mut group: *mut mailimf_group = 0 as *mut mailimf_group;
    let mut address: *mut mailimf_address = 0 as *mut mailimf_address;
    let mut r: libc::c_int = 0;
    let mut res: libc::c_int = 0;
    cur_token = *indx;
    mailbox = 0 as *mut mailimf_mailbox;
    group = 0 as *mut mailimf_group;
    type_0 = MAILIMF_ADDRESS_ERROR as libc::c_int;
    r = mailimf_group_parse(message, length, &mut cur_token, &mut group);
    if r == MAILIMF_NO_ERROR as libc::c_int {
        type_0 = MAILIMF_ADDRESS_GROUP as libc::c_int
    }
    if r == MAILIMF_ERROR_PARSE as libc::c_int {
        r = mailimf_mailbox_parse(message, length, &mut cur_token, &mut mailbox);
        if r == MAILIMF_NO_ERROR as libc::c_int {
            type_0 = MAILIMF_ADDRESS_MAILBOX as libc::c_int
        }
    }
    if r != MAILIMF_NO_ERROR as libc::c_int {
        res = r
    } else {
        address = mailimf_address_new(type_0, mailbox, group);
        if address.is_null() {
            res = MAILIMF_ERROR_MEMORY as libc::c_int;
            if !mailbox.is_null() {
                mailimf_mailbox_free(mailbox);
            }
            if !group.is_null() {
                mailimf_group_free(group);
            }
        } else {
            *result = address;
            *indx = cur_token;
            return MAILIMF_NO_ERROR as libc::c_int;
        }
    }
    return res;
}
/*
  mailimf_address_parse will parse the given address

  @param message this is a string containing the address
  @param length this is the size of the given string
  @param indx this is a pointer to the start of the address in
    the given string, (* indx) is modified to point at the end
    of the parsed data
  @param result the result of the parse operation is stored in
    (* result)

  @return MAILIMF_NO_ERROR on success, MAILIMF_ERROR_XXX on error
*/
mailimf_address_parse will parse the given address
mailimf_address_parse will parse the given address
pub unsafe fn mailimf_address_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_address,
) -> libc::c_int {
    let mut type_0: libc::c_int = 0;
    let mut cur_token: size_t = 0;
    let mut mailbox: *mut mailimf_mailbox = 0 as *mut mailimf_mailbox;
    let mut group: *mut mailimf_group = 0 as *mut mailimf_group;
    let mut address: *mut mailimf_address = 0 as *mut mailimf_address;
    let mut r: libc::c_int = 0;
    let mut res: libc::c_int = 0;
    cur_token = *indx;
    mailbox = 0 as *mut mailimf_mailbox;
    group = 0 as *mut mailimf_group;
    type_0 = MAILIMF_ADDRESS_ERROR as libc::c_int;
    r = mailimf_group_parse(message, length, &mut cur_token, &mut group);
    if r == MAILIMF_NO_ERROR as libc::c_int {
        type_0 = MAILIMF_ADDRESS_GROUP as libc::c_int
    }
    if r == MAILIMF_ERROR_PARSE as libc::c_int {
        r = mailimf_mailbox_parse(message, length, &mut cur_token, &mut mailbox);
        if r == MAILIMF_NO_ERROR as libc::c_int {
            type_0 = MAILIMF_ADDRESS_MAILBOX as libc::c_int
        }
    }
    if r != MAILIMF_NO_ERROR as libc::c_int {
        res = r
    } else {
        address = mailimf_address_new(type_0, mailbox, group);
        if address.is_null() {
            res = MAILIMF_ERROR_MEMORY as libc::c_int;
            if !mailbox.is_null() {
                mailimf_mailbox_free(mailbox);
            }
            if !group.is_null() {
                mailimf_group_free(group);
            }
        } else {
            *result = address;
            *indx = cur_token;
            return MAILIMF_NO_ERROR as libc::c_int;
        }
    }
    return res;
}
pub unsafe fn mailimf_address_parse ( mut message : * const libc :: c_char , mut length : size_t , mut indx : * mut size_t , mut result : * mut * mut mailimf_address , ) -> libc :: c_int { let mut type_0 : libc :: c_int = 0 ; let mut cur_token : size_t = 0 ; let mut mailbox : * mut mailimf_mailbox = 0 as * mut mailimf_mailbox ; let mut group : * mut mailimf_group = 0 as * mut mailimf_group ; let mut address : * mut mailimf_address = 0 as * mut mailimf_address ; let mut r : libc :: c_int = 0 ; let mut res : libc :: c_int = 0 ; cur_token = * indx ; mailbox = 0 as * mut mailimf_mailbox ; group = 0 as * mut mailimf_group ; type_0 = MAILIMF_ADDRESS_ERROR as libc :: c_int ; r = mailimf_group_parse ( message , length , & mut cur_token , & mut group ) ; if r == MAILIMF_NO_ERROR as libc :: c_int { type_0 = MAILIMF_ADDRESS_GROUP as libc :: c_int } if r == MAILIMF_ERROR_PARSE as libc :: c_int { r = mailimf_mailbox_parse ( message , length , & mut cur_token , & mut mailbox ) ; if r == MAILIMF_NO_ERROR as libc :: c_int { type_0 = MAILIMF_ADDRESS_MAILBOX as libc :: c_int } } if r != MAILIMF_NO_ERROR as libc :: c_int { res = r } else { address = mailimf_address_new ( type_0 , mailbox , group ) ; if address . is_null ( ) { res = MAILIMF_ERROR_MEMORY as libc :: c_int ; if ! mailbox . is_null ( ) { mailimf_mailbox_free ( mailbox ) ; } if ! group . is_null ( ) { mailimf_group_free ( group ) ; } } else { * result = address ; * indx = cur_token ; return MAILIMF_NO_ERROR as libc :: c_int ; } } return res ; }
mailimf_address_parse will parse the given address
mailimf_address_parse will parse the given address
message
*const libc::c_char
length
size_t
indx
*mut size_t
result
*mut *mut mailimf_address
MAILIMF_NO_ERROR on success, MAILIMF_ERROR_XXX on error
MAILIMF_NO_ERROR on success MAILIMF_ERROR_XXX on error
message
*const libc::c_char
this is a string containing the address
this is a string containing the address
length
size_t
this is the size of the given string
this is the size of the given string
indx
*mut size_t
this is a pointer to the start of the address in
the given string, (* indx) is modified to point at the end
of the parsed data
this is a pointer to the start of the address in the given string ( * indx ) is modified to point at the end of the parsed data
result
*mut *mut mailimf_address
the result of the parse operation is stored in
(* result)
the result of the parse operation is stored in ( * result )