pub unsafe fn chash_delete(
    mut hash: *mut chash,
    mut key: *mut chashdatum,
    mut oldvalue: *mut chashdatum,
) -> libc::c_int {
    /*  chashdatum result = { NULL, TRUE }; */
    let mut func: libc::c_uint = 0;
    let mut indx: libc::c_uint = 0;
    let mut iter: *mut chashiter = 0 as *mut chashiter;
    let mut old: *mut chashiter = 0 as *mut chashiter;
    func = chash_func((*key).data as *const libc::c_char, (*key).len);
    indx = func.wrapping_rem((*hash).size);
    old = 0 as *mut chashiter;
    iter = *(*hash).cells.offset(indx as isize);
    while !iter.is_null() {
        if (*iter).key.len == (*key).len
            && (*iter).func == func
            && 0 == memcmp((*iter).key.data, (*key).data, (*key).len as libc::size_t)
        {
            if !old.is_null() {
                (*old).next = (*iter).next
            } else {
                let ref mut fresh4 = *(*hash).cells.offset(indx as isize);
                *fresh4 = (*iter).next
            }
            if 0 != (*hash).copykey {
                free((*iter).key.data);
            }
            if 0 != (*hash).copyvalue {
                free((*iter).value.data);
            } else if !oldvalue.is_null() {
                (*oldvalue).data = (*iter).value.data;
                (*oldvalue).len = (*iter).value.len
            }
            free(iter as *mut libc::c_void);
            (*hash).count = (*hash).count.wrapping_sub(1);
            return 0i32;
        }
        old = iter;
        iter = (*iter).next
    }
    return -1i32;
}
/* Removes the entry associated to this key if it is found in the hash table,
and returns its contents if not dupped (otherwise, pointer will be NULL
and len TRUE). If entry is not found both pointer and len will be NULL. */
Removes the entry associated to this key if it is found in the hash table,
and returns its contents if not dupped (otherwise, pointer will be NULL
and len TRUE). If entry is not found both pointer and len will be NULL.
Removes the entry associated to this key if it is found in the hash table and returns its contents if not dupped ( otherwise pointer will be NULL and len TRUE ) . If entry is not found both pointer and len will be NULL .
pub unsafe fn chash_delete(
    mut hash: *mut chash,
    mut key: *mut chashdatum,
    mut oldvalue: *mut chashdatum,
) -> libc::c_int {
    /*  chashdatum result = { NULL, TRUE }; */
    let mut func: libc::c_uint = 0;
    let mut indx: libc::c_uint = 0;
    let mut iter: *mut chashiter = 0 as *mut chashiter;
    let mut old: *mut chashiter = 0 as *mut chashiter;
    func = chash_func((*key).data as *const libc::c_char, (*key).len);
    indx = func.wrapping_rem((*hash).size);
    old = 0 as *mut chashiter;
    iter = *(*hash).cells.offset(indx as isize);
    while !iter.is_null() {
        if (*iter).key.len == (*key).len
            && (*iter).func == func
            && 0 == memcmp((*iter).key.data, (*key).data, (*key).len as libc::size_t)
        {
            if !old.is_null() {
                (*old).next = (*iter).next
            } else {
                let ref mut fresh4 = *(*hash).cells.offset(indx as isize);
                *fresh4 = (*iter).next
            }
            if 0 != (*hash).copykey {
                free((*iter).key.data);
            }
            if 0 != (*hash).copyvalue {
                free((*iter).value.data);
            } else if !oldvalue.is_null() {
                (*oldvalue).data = (*iter).value.data;
                (*oldvalue).len = (*iter).value.len
            }
            free(iter as *mut libc::c_void);
            (*hash).count = (*hash).count.wrapping_sub(1);
            return 0i32;
        }
        old = iter;
        iter = (*iter).next
    }
    return -1i32;
}
pub unsafe fn chash_delete ( mut hash : * mut chash , mut key : * mut chashdatum , mut oldvalue : * mut chashdatum , ) -> libc :: c_int { /*  chashdatum result = { NULL, TRUE }; */ let mut func : libc :: c_uint = 0 ; let mut indx : libc :: c_uint = 0 ; let mut iter : * mut chashiter = 0 as * mut chashiter ; let mut old : * mut chashiter = 0 as * mut chashiter ; func = chash_func ( ( * key ) . data as * const libc :: c_char , ( * key ) . len ) ; indx = func . wrapping_rem ( ( * hash ) . size ) ; old = 0 as * mut chashiter ; iter = * ( * hash ) . cells . offset ( indx as isize ) ; while ! iter . is_null ( ) { if ( * iter ) . key . len == ( * key ) . len && ( * iter ) . func == func && 0 == memcmp ( ( * iter ) . key . data , ( * key ) . data , ( * key ) . len as libc :: size_t ) { if ! old . is_null ( ) { ( * old ) . next = ( * iter ) . next } else { let ref mut fresh4 = * ( * hash ) . cells . offset ( indx as isize ) ; * fresh4 = ( * iter ) . next } if 0 != ( * hash ) . copykey { free ( ( * iter ) . key . data ) ; } if 0 != ( * hash ) . copyvalue { free ( ( * iter ) . value . data ) ; } else if ! oldvalue . is_null ( ) { ( * oldvalue ) . data = ( * iter ) . value . data ; ( * oldvalue ) . len = ( * iter ) . value . len } free ( iter as * mut libc :: c_void ) ; ( * hash ) . count = ( * hash ) . count . wrapping_sub ( 1 ) ; return 0i32 ; } old = iter ; iter = ( * iter ) . next } return - 1i32 ; }
Removes the entry associated to this key if it is found in the hash table,
and returns its contents if not dupped (otherwise, pointer will be NULL
and len TRUE).
Removes the entry associated to this key if it is found in the hash table and returns its contents if not dupped ( otherwise pointer will be NULL and len TRUE ) .
hash
*mut chash
key
*mut chashdatum
oldvalue
*mut chashdatum
hash
*mut chash
key
*mut chashdatum
oldvalue
*mut chashdatum