pub unsafe fn mailimf_date_time_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_date_time,
) -> libc::c_int {
    let mut cur_token: size_t = 0;
    let mut day_of_week: libc::c_int = 0;
    let mut date_time: *mut mailimf_date_time = 0 as *mut mailimf_date_time;
    let mut day: libc::c_int = 0;
    let mut month: libc::c_int = 0;
    let mut year: libc::c_int = 0;
    let mut hour: libc::c_int = 0;
    let mut min: libc::c_int = 0;
    let mut sec: libc::c_int = 0;
    let mut zone: libc::c_int = 0;
    let mut r: libc::c_int = 0;
    cur_token = *indx;
    day_of_week = -1i32;
    r = mailimf_day_of_week_parse(message, length, &mut cur_token, &mut day_of_week);
    if r == MAILIMF_NO_ERROR as libc::c_int {
        r = mailimf_comma_parse(message, length, &mut cur_token);
        if !(r == MAILIMF_ERROR_PARSE as libc::c_int) {
            if r != MAILIMF_NO_ERROR as libc::c_int {
                return r;
            }
        }
    } else if r != MAILIMF_ERROR_PARSE as libc::c_int {
        return r;
    }
    day = 0i32;
    month = 0i32;
    year = 0i32;
    r = mailimf_date_parse(
        message,
        length,
        &mut cur_token,
        &mut day,
        &mut month,
        &mut year,
    );
    if r == MAILIMF_ERROR_PARSE as libc::c_int {
        r = mailimf_broken_date_parse(
            message,
            length,
            &mut cur_token,
            &mut day,
            &mut month,
            &mut year,
        )
    } else if r != MAILIMF_NO_ERROR as libc::c_int {
        return r;
    }
    r = mailimf_fws_parse(message, length, &mut cur_token);
    if r != MAILIMF_NO_ERROR as libc::c_int {
        return r;
    }
    hour = 0i32;
    min = 0i32;
    sec = 0i32;
    zone = 0i32;
    r = mailimf_time_parse(
        message,
        length,
        &mut cur_token,
        &mut hour,
        &mut min,
        &mut sec,
        &mut zone,
    );
    if r != MAILIMF_NO_ERROR as libc::c_int {
        return r;
    }
    date_time = mailimf_date_time_new(day, month, year, hour, min, sec, zone);
    if date_time.is_null() {
        return MAILIMF_ERROR_MEMORY as libc::c_int;
    }
    *indx = cur_token;
    *result = date_time;
    return MAILIMF_NO_ERROR as libc::c_int;
}
/*
  mailimf_date_time_parse will parse the given RFC 2822 date

  @param message this is a string containing the date
  @param length this is the size of the given string
  @param indx this is a pointer to the start of the date 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_date_time_parse will parse the given RFC 2822 date
mailimf_date_time_parse will parse the given RFC 2822 date
pub unsafe fn mailimf_date_time_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_date_time,
) -> libc::c_int {
    let mut cur_token: size_t = 0;
    let mut day_of_week: libc::c_int = 0;
    let mut date_time: *mut mailimf_date_time = 0 as *mut mailimf_date_time;
    let mut day: libc::c_int = 0;
    let mut month: libc::c_int = 0;
    let mut year: libc::c_int = 0;
    let mut hour: libc::c_int = 0;
    let mut min: libc::c_int = 0;
    let mut sec: libc::c_int = 0;
    let mut zone: libc::c_int = 0;
    let mut r: libc::c_int = 0;
    cur_token = *indx;
    day_of_week = -1i32;
    r = mailimf_day_of_week_parse(message, length, &mut cur_token, &mut day_of_week);
    if r == MAILIMF_NO_ERROR as libc::c_int {
        r = mailimf_comma_parse(message, length, &mut cur_token);
        if !(r == MAILIMF_ERROR_PARSE as libc::c_int) {
            if r != MAILIMF_NO_ERROR as libc::c_int {
                return r;
            }
        }
    } else if r != MAILIMF_ERROR_PARSE as libc::c_int {
        return r;
    }
    day = 0i32;
    month = 0i32;
    year = 0i32;
    r = mailimf_date_parse(
        message,
        length,
        &mut cur_token,
        &mut day,
        &mut month,
        &mut year,
    );
    if r == MAILIMF_ERROR_PARSE as libc::c_int {
        r = mailimf_broken_date_parse(
            message,
            length,
            &mut cur_token,
            &mut day,
            &mut month,
            &mut year,
        )
    } else if r != MAILIMF_NO_ERROR as libc::c_int {
        return r;
    }
    r = mailimf_fws_parse(message, length, &mut cur_token);
    if r != MAILIMF_NO_ERROR as libc::c_int {
        return r;
    }
    hour = 0i32;
    min = 0i32;
    sec = 0i32;
    zone = 0i32;
    r = mailimf_time_parse(
        message,
        length,
        &mut cur_token,
        &mut hour,
        &mut min,
        &mut sec,
        &mut zone,
    );
    if r != MAILIMF_NO_ERROR as libc::c_int {
        return r;
    }
    date_time = mailimf_date_time_new(day, month, year, hour, min, sec, zone);
    if date_time.is_null() {
        return MAILIMF_ERROR_MEMORY as libc::c_int;
    }
    *indx = cur_token;
    *result = date_time;
    return MAILIMF_NO_ERROR as libc::c_int;
}
pub unsafe fn mailimf_date_time_parse ( mut message : * const libc :: c_char , mut length : size_t , mut indx : * mut size_t , mut result : * mut * mut mailimf_date_time , ) -> libc :: c_int { let mut cur_token : size_t = 0 ; let mut day_of_week : libc :: c_int = 0 ; let mut date_time : * mut mailimf_date_time = 0 as * mut mailimf_date_time ; let mut day : libc :: c_int = 0 ; let mut month : libc :: c_int = 0 ; let mut year : libc :: c_int = 0 ; let mut hour : libc :: c_int = 0 ; let mut min : libc :: c_int = 0 ; let mut sec : libc :: c_int = 0 ; let mut zone : libc :: c_int = 0 ; let mut r : libc :: c_int = 0 ; cur_token = * indx ; day_of_week = - 1i32 ; r = mailimf_day_of_week_parse ( message , length , & mut cur_token , & mut day_of_week ) ; if r == MAILIMF_NO_ERROR as libc :: c_int { r = mailimf_comma_parse ( message , length , & mut cur_token ) ; if ! ( r == MAILIMF_ERROR_PARSE as libc :: c_int ) { if r != MAILIMF_NO_ERROR as libc :: c_int { return r ; } } } else if r != MAILIMF_ERROR_PARSE as libc :: c_int { return r ; } day = 0i32 ; month = 0i32 ; year = 0i32 ; r = mailimf_date_parse ( message , length , & mut cur_token , & mut day , & mut month , & mut year , ) ; if r == MAILIMF_ERROR_PARSE as libc :: c_int { r = mailimf_broken_date_parse ( message , length , & mut cur_token , & mut day , & mut month , & mut year , ) } else if r != MAILIMF_NO_ERROR as libc :: c_int { return r ; } r = mailimf_fws_parse ( message , length , & mut cur_token ) ; if r != MAILIMF_NO_ERROR as libc :: c_int { return r ; } hour = 0i32 ; min = 0i32 ; sec = 0i32 ; zone = 0i32 ; r = mailimf_time_parse ( message , length , & mut cur_token , & mut hour , & mut min , & mut sec , & mut zone , ) ; if r != MAILIMF_NO_ERROR as libc :: c_int { return r ; } date_time = mailimf_date_time_new ( day , month , year , hour , min , sec , zone ) ; if date_time . is_null ( ) { return MAILIMF_ERROR_MEMORY as libc :: c_int ; } * indx = cur_token ; * result = date_time ; return MAILIMF_NO_ERROR as libc :: c_int ; }
mailimf_date_time_parse will parse the given RFC 2822 date
mailimf_date_time_parse will parse the given RFC 2822 date
message
*const libc::c_char
length
size_t
indx
*mut size_t
result
*mut *mut mailimf_date_time
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 date
this is a string containing the date
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 date 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 date in the given string ( * indx ) is modified to point at the end of the parsed data
result
*mut *mut mailimf_date_time
the result of the parse operation is stored in
(* result)
the result of the parse operation is stored in ( * result )