pub unsafe fn mailimf_mailbox_list_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_mailbox_list,
) -> libc::c_int {
    let mut cur_token: size_t = 0;
    let mut list: *mut clist = 0 as *mut clist;
    let mut mailbox_list: *mut mailimf_mailbox_list = 0 as *mut mailimf_mailbox_list;
    let mut r: libc::c_int = 0;
    let mut res: libc::c_int = 0;
    cur_token = *indx;
    r = mailimf_struct_list_parse(
        message,
        length,
        &mut cur_token,
        &mut list,
        ',' as i32 as libc::c_char,
        ::std::mem::transmute::<
            Option<
                unsafe fn(
                    _: *const libc::c_char,
                    _: size_t,
                    _: *mut size_t,
                    _: *mut *mut mailimf_mailbox,
                ) -> libc::c_int,
            >,
            Option<
                unsafe fn(
                    _: *const libc::c_char,
                    _: size_t,
                    _: *mut size_t,
                    _: *mut libc::c_void,
                ) -> libc::c_int,
            >,
        >(Some(mailimf_mailbox_parse)),
        ::std::mem::transmute::<
            Option<unsafe fn(_: *mut mailimf_mailbox) -> ()>,
            Option<unsafe fn(_: *mut libc::c_void) -> libc::c_int>,
        >(Some(mailimf_mailbox_free)),
    );
    if r != MAILIMF_NO_ERROR as libc::c_int {
        res = r
    } else {
        mailbox_list = mailimf_mailbox_list_new(list);
        if mailbox_list.is_null() {
            res = MAILIMF_ERROR_MEMORY as libc::c_int;
            clist_foreach(
                list,
                ::std::mem::transmute::<Option<unsafe fn(_: *mut mailimf_mailbox) -> ()>, clist_func>(
                    Some(mailimf_mailbox_free),
                ),
                0 as *mut libc::c_void,
            );
            clist_free(list);
        } else {
            *result = mailbox_list;
            *indx = cur_token;
            return MAILIMF_NO_ERROR as libc::c_int;
        }
    }
    return res;
}
/*
  mailimf_mailbox_list_parse will parse the given mailbox list

  @param message this is a string containing the mailbox list
  @param length this is the size of the given string
  @param indx this is a pointer to the start of the mailbox list 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_mailbox_list_parse will parse the given mailbox list
mailimf_mailbox_list_parse will parse the given mailbox list
pub unsafe fn mailimf_mailbox_list_parse(
    mut message: *const libc::c_char,
    mut length: size_t,
    mut indx: *mut size_t,
    mut result: *mut *mut mailimf_mailbox_list,
) -> libc::c_int {
    let mut cur_token: size_t = 0;
    let mut list: *mut clist = 0 as *mut clist;
    let mut mailbox_list: *mut mailimf_mailbox_list = 0 as *mut mailimf_mailbox_list;
    let mut r: libc::c_int = 0;
    let mut res: libc::c_int = 0;
    cur_token = *indx;
    r = mailimf_struct_list_parse(
        message,
        length,
        &mut cur_token,
        &mut list,
        ',' as i32 as libc::c_char,
        ::std::mem::transmute::<
            Option<
                unsafe fn(
                    _: *const libc::c_char,
                    _: size_t,
                    _: *mut size_t,
                    _: *mut *mut mailimf_mailbox,
                ) -> libc::c_int,
            >,
            Option<
                unsafe fn(
                    _: *const libc::c_char,
                    _: size_t,
                    _: *mut size_t,
                    _: *mut libc::c_void,
                ) -> libc::c_int,
            >,
        >(Some(mailimf_mailbox_parse)),
        ::std::mem::transmute::<
            Option<unsafe fn(_: *mut mailimf_mailbox) -> ()>,
            Option<unsafe fn(_: *mut libc::c_void) -> libc::c_int>,
        >(Some(mailimf_mailbox_free)),
    );
    if r != MAILIMF_NO_ERROR as libc::c_int {
        res = r
    } else {
        mailbox_list = mailimf_mailbox_list_new(list);
        if mailbox_list.is_null() {
            res = MAILIMF_ERROR_MEMORY as libc::c_int;
            clist_foreach(
                list,
                ::std::mem::transmute::<Option<unsafe fn(_: *mut mailimf_mailbox) -> ()>, clist_func>(
                    Some(mailimf_mailbox_free),
                ),
                0 as *mut libc::c_void,
            );
            clist_free(list);
        } else {
            *result = mailbox_list;
            *indx = cur_token;
            return MAILIMF_NO_ERROR as libc::c_int;
        }
    }
    return res;
}
pub unsafe fn mailimf_mailbox_list_parse ( mut message : * const libc :: c_char , mut length : size_t , mut indx : * mut size_t , mut result : * mut * mut mailimf_mailbox_list , ) -> libc :: c_int { let mut cur_token : size_t = 0 ; let mut list : * mut clist = 0 as * mut clist ; let mut mailbox_list : * mut mailimf_mailbox_list = 0 as * mut mailimf_mailbox_list ; let mut r : libc :: c_int = 0 ; let mut res : libc :: c_int = 0 ; cur_token = * indx ; r = mailimf_struct_list_parse ( message , length , & mut cur_token , & mut list , ',' as i32 as libc :: c_char , :: std :: mem :: transmute :: < Option < unsafe fn ( _ : * const libc :: c_char , _ : size_t , _ : * mut size_t , _ : * mut * mut mailimf_mailbox , ) -> libc :: c_int , > , Option < unsafe fn ( _ : * const libc :: c_char , _ : size_t , _ : * mut size_t , _ : * mut libc :: c_void , ) -> libc :: c_int , > , > ( Some ( mailimf_mailbox_parse ) ) , :: std :: mem :: transmute :: < Option < unsafe fn ( _ : * mut mailimf_mailbox ) -> ( ) > , Option < unsafe fn ( _ : * mut libc :: c_void ) -> libc :: c_int > , > ( Some ( mailimf_mailbox_free ) ) , ) ; if r != MAILIMF_NO_ERROR as libc :: c_int { res = r } else { mailbox_list = mailimf_mailbox_list_new ( list ) ; if mailbox_list . is_null ( ) { res = MAILIMF_ERROR_MEMORY as libc :: c_int ; clist_foreach ( list , :: std :: mem :: transmute :: < Option < unsafe fn ( _ : * mut mailimf_mailbox ) -> ( ) > , clist_func > ( Some ( mailimf_mailbox_free ) , ) , 0 as * mut libc :: c_void , ) ; clist_free ( list ) ; } else { * result = mailbox_list ; * indx = cur_token ; return MAILIMF_NO_ERROR as libc :: c_int ; } } return res ; }
mailimf_mailbox_list_parse will parse the given mailbox list
mailimf_mailbox_list_parse will parse the given mailbox list
message
*const libc::c_char
length
size_t
indx
*mut size_t
result
*mut *mut mailimf_mailbox_list
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 mailbox list
this is a string containing the mailbox list
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 mailbox list 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 mailbox list in the given string ( * indx ) is modified to point at the end of the parsed data
result
*mut *mut mailimf_mailbox_list
the result of the parse operation is stored in
(* result)
the result of the parse operation is stored in ( * result )