pub unsafe fn mailimf_message_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_message,
) -> libc::c_int {
    let mut fields: *mut mailimf_fields = 0 as *mut mailimf_fields;
    let mut body: *mut mailimf_body = 0 as *mut mailimf_body;
    let mut msg: *mut mailimf_message = 0 as *mut mailimf_message;
    let mut cur_token: size_t = 0;
    let mut r: libc::c_int = 0;
    let mut res: libc::c_int = 0;
    cur_token = *indx;
    r = mailimf_fields_parse(message, length, &mut cur_token, &mut fields);
    if r != MAILIMF_NO_ERROR as libc::c_int {
        res = r
    } else {
        r = mailimf_crlf_parse(message, length, &mut cur_token);
        if r != MAILIMF_NO_ERROR as libc::c_int && r != MAILIMF_ERROR_PARSE as libc::c_int {
            res = r
        } else {
            r = mailimf_body_parse(message, length, &mut cur_token, &mut body);
            if r != MAILIMF_NO_ERROR as libc::c_int {
                res = r
            } else {
                msg = mailimf_message_new(fields, body);
                if msg.is_null() {
                    res = MAILIMF_ERROR_MEMORY as libc::c_int;
                    mailimf_body_free(body);
                } else {
                    *indx = cur_token;
                    *result = msg;
                    return MAILIMF_NO_ERROR as libc::c_int;
                }
            }
            mailimf_fields_free(fields);
        }
    }
    return res;
}
/*
  mailimf_message_parse will parse the given message

  @param message this is a string containing the message content
  @param length this is the size of the given string
  @param indx this is a pointer to the start of the message 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_message_parse will parse the given message
mailimf_message_parse will parse the given message
pub unsafe fn mailimf_message_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_message,
) -> libc::c_int {
    let mut fields: *mut mailimf_fields = 0 as *mut mailimf_fields;
    let mut body: *mut mailimf_body = 0 as *mut mailimf_body;
    let mut msg: *mut mailimf_message = 0 as *mut mailimf_message;
    let mut cur_token: size_t = 0;
    let mut r: libc::c_int = 0;
    let mut res: libc::c_int = 0;
    cur_token = *indx;
    r = mailimf_fields_parse(message, length, &mut cur_token, &mut fields);
    if r != MAILIMF_NO_ERROR as libc::c_int {
        res = r
    } else {
        r = mailimf_crlf_parse(message, length, &mut cur_token);
        if r != MAILIMF_NO_ERROR as libc::c_int && r != MAILIMF_ERROR_PARSE as libc::c_int {
            res = r
        } else {
            r = mailimf_body_parse(message, length, &mut cur_token, &mut body);
            if r != MAILIMF_NO_ERROR as libc::c_int {
                res = r
            } else {
                msg = mailimf_message_new(fields, body);
                if msg.is_null() {
                    res = MAILIMF_ERROR_MEMORY as libc::c_int;
                    mailimf_body_free(body);
                } else {
                    *indx = cur_token;
                    *result = msg;
                    return MAILIMF_NO_ERROR as libc::c_int;
                }
            }
            mailimf_fields_free(fields);
        }
    }
    return res;
}
pub unsafe fn mailimf_message_parse ( mut message : * const libc :: c_char , mut length : size_t , mut indx : * mut size_t , mut result : * mut * mut mailimf_message , ) -> libc :: c_int { let mut fields : * mut mailimf_fields = 0 as * mut mailimf_fields ; let mut body : * mut mailimf_body = 0 as * mut mailimf_body ; let mut msg : * mut mailimf_message = 0 as * mut mailimf_message ; let mut cur_token : size_t = 0 ; let mut r : libc :: c_int = 0 ; let mut res : libc :: c_int = 0 ; cur_token = * indx ; r = mailimf_fields_parse ( message , length , & mut cur_token , & mut fields ) ; if r != MAILIMF_NO_ERROR as libc :: c_int { res = r } else { r = mailimf_crlf_parse ( message , length , & mut cur_token ) ; if r != MAILIMF_NO_ERROR as libc :: c_int && r != MAILIMF_ERROR_PARSE as libc :: c_int { res = r } else { r = mailimf_body_parse ( message , length , & mut cur_token , & mut body ) ; if r != MAILIMF_NO_ERROR as libc :: c_int { res = r } else { msg = mailimf_message_new ( fields , body ) ; if msg . is_null ( ) { res = MAILIMF_ERROR_MEMORY as libc :: c_int ; mailimf_body_free ( body ) ; } else { * indx = cur_token ; * result = msg ; return MAILIMF_NO_ERROR as libc :: c_int ; } } mailimf_fields_free ( fields ) ; } } return res ; }
mailimf_message_parse will parse the given message
mailimf_message_parse will parse the given message
message
*const libc::c_char
length
size_t
indx
*mut size_t
result
*mut *mut mailimf_message
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 message content
this is a string containing the message content
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 message 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 message in the given string ( * indx ) is modified to point at the end of the parsed data
result
*mut *mut mailimf_message
the result of the parse operation is stored in
(* result)
the result of the parse operation is stored in ( * result )