Changeset 5300

Show
Ignore:
Timestamp:
02/22/08 08:52:33 (11 months ago)
Author:
morris
Message:

Add wi_hash_contains_key()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/collections/wi-hash.c

    r5288 r5300  
    756756 
    757757 
     758wi_boolean_t wi_hash_contains_key(wi_hash_t *hash, void *key) { 
     759        _wi_hash_bucket_t       *bucket; 
     760        wi_uinteger_t           index; 
     761 
     762        index = _WI_HASH_KEY_HASH(hash, key) % hash->buckets_count; 
     763        bucket = _wi_hash_bucket_for_key(hash, key, index); 
     764         
     765        return (bucket != NULL); 
     766} 
     767 
     768 
     769 
    758770void wi_hash_set_hash(wi_hash_t *hash, wi_hash_t *otherhash) { 
    759771        wi_hash_remove_all_data(hash); 
  • libwired/trunk/libwired/collections/wi-hash.h

    r5229 r5300  
    7979WI_EXPORT void                                                          wi_hash_add_entries_from_hash(wi_hash_t *, wi_hash_t *); 
    8080WI_EXPORT void *                                                        wi_hash_data_for_key(wi_hash_t *, void *); 
     81WI_EXPORT wi_boolean_t                                          wi_hash_contains_key(wi_hash_t *, void *); 
    8182WI_EXPORT void                                                          wi_hash_set_hash(wi_hash_t *, wi_hash_t *); 
    8283