pub unsafe fn chash_clear(mut hash: *mut chash) {
    let mut indx: libc::c_uint = 0;
    let mut iter: *mut chashiter = 0 as *mut chashiter;
    let mut next: *mut chashiter = 0 as *mut chashiter;
    indx = 0i32 as libc::c_uint;
    while indx < (*hash).size {
        iter = *(*hash).cells.offset(indx as isize);
        while !iter.is_null() {
            next = (*iter).next;
            if 0 != (*hash).copykey {
                free((*iter).key.data);
            }
            if 0 != (*hash).copyvalue {
                free((*iter).value.data);
            }
            free(iter as *mut libc::c_void);
            iter = next
        }
        indx = indx.wrapping_add(1)
    }
    memset(
        (*hash).cells as *mut libc::c_void,
        0i32,
        ((*hash).size as libc::size_t)
            .wrapping_mul(::std::mem::size_of::<*mut chashcell>() as libc::size_t),
    );
    (*hash).count = 0i32 as libc::c_uint;
}
/* Removes all elements from a hash */
Removes all elements from a hash
Removes all elements from a hash
pub unsafe fn chash_clear(mut hash: *mut chash) {
    let mut indx: libc::c_uint = 0;
    let mut iter: *mut chashiter = 0 as *mut chashiter;
    let mut next: *mut chashiter = 0 as *mut chashiter;
    indx = 0i32 as libc::c_uint;
    while indx < (*hash).size {
        iter = *(*hash).cells.offset(indx as isize);
        while !iter.is_null() {
            next = (*iter).next;
            if 0 != (*hash).copykey {
                free((*iter).key.data);
            }
            if 0 != (*hash).copyvalue {
                free((*iter).value.data);
            }
            free(iter as *mut libc::c_void);
            iter = next
        }
        indx = indx.wrapping_add(1)
    }
    memset(
        (*hash).cells as *mut libc::c_void,
        0i32,
        ((*hash).size as libc::size_t)
            .wrapping_mul(::std::mem::size_of::<*mut chashcell>() as libc::size_t),
    );
    (*hash).count = 0i32 as libc::c_uint;
}
pub unsafe fn chash_clear ( mut hash : * mut chash ) { let mut indx : libc :: c_uint = 0 ; let mut iter : * mut chashiter = 0 as * mut chashiter ; let mut next : * mut chashiter = 0 as * mut chashiter ; indx = 0i32 as libc :: c_uint ; while indx < ( * hash ) . size { iter = * ( * hash ) . cells . offset ( indx as isize ) ; while ! iter . is_null ( ) { next = ( * iter ) . next ; if 0 != ( * hash ) . copykey { free ( ( * iter ) . key . data ) ; } if 0 != ( * hash ) . copyvalue { free ( ( * iter ) . value . data ) ; } free ( iter as * mut libc :: c_void ) ; iter = next } indx = indx . wrapping_add ( 1 ) } memset ( ( * hash ) . cells as * mut libc :: c_void , 0i32 , ( ( * hash ) . size as libc :: size_t ) . wrapping_mul ( :: std :: mem :: size_of :: < * mut chashcell > ( ) as libc :: size_t ) , ) ; ( * hash ) . count = 0i32 as libc :: c_uint ; }
Removes all elements from a hash
Removes all elements from a hash
hash
*mut chash
hash
*mut chash