pub unsafe fn mailimf_quoted_string_write_driver(
    mut do_write: Option<
        unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
    >,
    mut data: *mut libc::c_void,
    mut col: *mut libc::c_int,
    mut string: *const libc::c_char,
    mut len: size_t,
) -> libc::c_int {
    let mut r: libc::c_int = 0;
    let mut i: size_t = 0;
    r = do_write.expect("non-null function pointer")(
        data,
        b"\"\x00" as *const u8 as *const libc::c_char,
        1i32 as size_t,
    );
    if r == 0i32 {
        return MAILIMF_ERROR_FILE as libc::c_int;
    }
    i = 0i32 as size_t;
    while i < len {
        match *string.offset(i as isize) as libc::c_int {
            92 | 34 => {
                r = do_write.expect("non-null function pointer")(
                    data,
                    b"\\\x00" as *const u8 as *const libc::c_char,
                    1i32 as size_t,
                );
                if r == 0i32 {
                    return MAILIMF_ERROR_FILE as libc::c_int;
                }
                r = do_write.expect("non-null function pointer")(
                    data,
                    &*string.offset(i as isize),
                    1i32 as size_t,
                );
                if r == 0i32 {
                    return MAILIMF_ERROR_FILE as libc::c_int;
                }
                *col += 2i32
            }
            _ => {
                r = do_write.expect("non-null function pointer")(
                    data,
                    &*string.offset(i as isize),
                    1i32 as size_t,
                );
                if r == 0i32 {
                    return MAILIMF_ERROR_FILE as libc::c_int;
                }
                *col += 1
            }
        }
        i = i.wrapping_add(1)
    }
    r = do_write.expect("non-null function pointer")(
        data,
        b"\"\x00" as *const u8 as *const libc::c_char,
        1i32 as size_t,
    );
    if r == 0i32 {
        return MAILIMF_ERROR_FILE as libc::c_int;
    }
    return MAILIMF_NO_ERROR as libc::c_int;
}
/*
  mailimf_quoted_string_write writes a string that is quoted
  to a given stream

  @param f is the stream
  @param col (* col) is the column number where we will start to
    write the text, the ending column will be stored in (* col)
  @param string is the string to quote and write
*/
mailimf_quoted_string_write writes a string that is quoted
to a given stream
mailimf_quoted_string_write writes a string that is quoted to a given stream
pub unsafe fn mailimf_quoted_string_write_driver(
    mut do_write: Option<
        unsafe fn(_: *mut libc::c_void, _: *const libc::c_char, _: size_t) -> libc::c_int,
    >,
    mut data: *mut libc::c_void,
    mut col: *mut libc::c_int,
    mut string: *const libc::c_char,
    mut len: size_t,
) -> libc::c_int {
    let mut r: libc::c_int = 0;
    let mut i: size_t = 0;
    r = do_write.expect("non-null function pointer")(
        data,
        b"\"\x00" as *const u8 as *const libc::c_char,
        1i32 as size_t,
    );
    if r == 0i32 {
        return MAILIMF_ERROR_FILE as libc::c_int;
    }
    i = 0i32 as size_t;
    while i < len {
        match *string.offset(i as isize) as libc::c_int {
            92 | 34 => {
                r = do_write.expect("non-null function pointer")(
                    data,
                    b"\\\x00" as *const u8 as *const libc::c_char,
                    1i32 as size_t,
                );
                if r == 0i32 {
                    return MAILIMF_ERROR_FILE as libc::c_int;
                }
                r = do_write.expect("non-null function pointer")(
                    data,
                    &*string.offset(i as isize),
                    1i32 as size_t,
                );
                if r == 0i32 {
                    return MAILIMF_ERROR_FILE as libc::c_int;
                }
                *col += 2i32
            }
            _ => {
                r = do_write.expect("non-null function pointer")(
                    data,
                    &*string.offset(i as isize),
                    1i32 as size_t,
                );
                if r == 0i32 {
                    return MAILIMF_ERROR_FILE as libc::c_int;
                }
                *col += 1
            }
        }
        i = i.wrapping_add(1)
    }
    r = do_write.expect("non-null function pointer")(
        data,
        b"\"\x00" as *const u8 as *const libc::c_char,
        1i32 as size_t,
    );
    if r == 0i32 {
        return MAILIMF_ERROR_FILE as libc::c_int;
    }
    return MAILIMF_NO_ERROR as libc::c_int;
}
pub unsafe fn mailimf_quoted_string_write_driver ( mut do_write : Option < unsafe fn ( _ : * mut libc :: c_void , _ : * const libc :: c_char , _ : size_t ) -> libc :: c_int , > , mut data : * mut libc :: c_void , mut col : * mut libc :: c_int , mut string : * const libc :: c_char , mut len : size_t , ) -> libc :: c_int { let mut r : libc :: c_int = 0 ; let mut i : size_t = 0 ; r = do_write . expect ( " " ) ( data , b" \" \x00 " as * const u8 as * const libc :: c_char , 1i32 as size_t , ) ; if r == 0i32 { return MAILIMF_ERROR_FILE as libc :: c_int ; } i = 0i32 as size_t ; while i < len { match * string . offset ( i as isize ) as libc :: c_int { 92 | 34 => { r = do_write . expect ( " " ) ( data , b" \\ \x00 " as * const u8 as * const libc :: c_char , 1i32 as size_t , ) ; if r == 0i32 { return MAILIMF_ERROR_FILE as libc :: c_int ; } r = do_write . expect ( " " ) ( data , & * string . offset ( i as isize ) , 1i32 as size_t , ) ; if r == 0i32 { return MAILIMF_ERROR_FILE as libc :: c_int ; } * col += 2i32 } _ => { r = do_write . expect ( " " ) ( data , & * string . offset ( i as isize ) , 1i32 as size_t , ) ; if r == 0i32 { return MAILIMF_ERROR_FILE as libc :: c_int ; } * col += 1 } } i = i . wrapping_add ( 1 ) } r = do_write . expect ( " " ) ( data , b" \" \x00 " as * const u8 as * const libc :: c_char , 1i32 as size_t , ) ; if r == 0i32 { return MAILIMF_ERROR_FILE as libc :: c_int ; } return MAILIMF_NO_ERROR as libc :: c_int ; }
mailimf_quoted_string_write writes a string that is quoted
to a given stream
mailimf_quoted_string_write writes a string that is quoted to a given stream
do_write
size_t
data
*mut libc::c_void
col
*mut libc::c_int
string
*const libc::c_char
len
size_t
do_write
size_t
data
*mut libc::c_void
col
*mut libc::c_int
(* col) is the column number where we will start to
write the text, the ending column will be stored in (* col)
( * col ) is the column number where we will start to write the text the ending column will be stored in ( * col )
string
*const libc::c_char
None
len
size_t
f
None