diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2013-06-05 19:20:52 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-06-05 19:20:52 -0400 |
commit | c36cba5bc1c783f87b0ada8a8b42303bfadeaf0a (patch) | |
tree | a8027ec35d6c7bbc5f6a168ab3bfae569f66ed1c /src/libudev/hashmap.c | |
parent | 58daf39a6c4002a9dd89690d88ce2ec41b2a7ea3 (diff) |
Remove unused functions from src/libudev/{conf-files,exit-status,hashmap,log,path-util,set,strv}.c
A lot of upstream commits cross many boundaries between systemd code
and udev code. The point of intersection is upstreams src/shared
folder. The best way we find to track them is to apply their commits
to udev and libudev and then just pick remove functions from the
shared folder. Its timely but it gives us the best control over what
gets in and what doesnt.
In this commit we removed the following functions:
conf_files_list_nulstr
exit_status_to_string
is_clean_exit_lsb
uint64_hash_func
uint64_compare_func
hashmap_free_free_free
hashmap_update
hashmap_get2
hashmap_remove_and_replace
hashmap_remove_value
hashmap_steal_first_key
hashmap_next
log_forget_fds
log_set_facility
log_meta_object
log_struct_internal
log_set_target_from_string
log_set_max_level_from_string
log_get_target
log_get_max_level
log_show_color_from_string
log_show_location_from_string
log_on_console
is_path
path_split_and_make_absolute
set_ensure_allocated
set_replace
set_remove_and_put
set_size
set_isempty
set_iterate_skip
set_steal_first
set_first
set_last
set_merge
set_move_one
set_copy
set_clear_free
set_get_strv
strv_find_prefix
strv_merge_concat
strv_split_newlines
strv_join
strv_remove_prefix
strv_parse_nulstr
strv_overlap
strv_sort
strv_print
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev/hashmap.c')
-rw-r--r-- | src/libudev/hashmap.c | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/src/libudev/hashmap.c b/src/libudev/hashmap.c index 9f7db34397..863312cc6c 100644 --- a/src/libudev/hashmap.c +++ b/src/libudev/hashmap.c @@ -157,15 +157,6 @@ unsigned uint64_hash_func(const void *p) { return (unsigned) ((u >> 32) ^ u); } -int uint64_compare_func(const void *_a, const void *_b) { - uint64_t a, b; - - a = *(const uint64_t*) _a; - b = *(const uint64_t*) _b; - - return a < b ? -1 : (a > b ? 1 : 0); -} - Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) { bool b; Hashmap *h; @@ -309,17 +300,6 @@ void hashmap_free_free(Hashmap *h) { hashmap_free(h); } -void hashmap_free_free_free(Hashmap *h) { - - /* Free the hashmap and all data and key objects in it */ - - if (!h) - return; - - hashmap_clear_free_free(h); - hashmap_free(h); -} - void hashmap_clear(Hashmap *h) { if (!h) return; @@ -416,21 +396,6 @@ int hashmap_replace(Hashmap *h, const void *key, void *value) { return hashmap_put(h, key, value); } -int hashmap_update(Hashmap *h, const void *key, void *value) { - struct hashmap_entry *e; - unsigned hash; - - assert(h); - - hash = h->hash_func(key) % NBUCKETS; - e = hash_scan(h, hash, key); - if (!e) - return -ENOENT; - - e->value = value; - return 0; -} - void* hashmap_get(Hashmap *h, const void *key) { unsigned hash; struct hashmap_entry *e; @@ -446,24 +411,6 @@ void* hashmap_get(Hashmap *h, const void *key) { return e->value; } -void* hashmap_get2(Hashmap *h, const void *key, void **key2) { - unsigned hash; - struct hashmap_entry *e; - - if (!h) - return NULL; - - hash = h->hash_func(key) % NBUCKETS; - e = hash_scan(h, hash, key); - if (!e) - return NULL; - - if (key2) - *key2 = (void*) e->key; - - return e->value; -} - bool hashmap_contains(Hashmap *h, const void *key) { unsigned hash; @@ -522,53 +469,6 @@ int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new_key, return 0; } -int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value) { - struct hashmap_entry *e, *k; - unsigned old_hash, new_hash; - - if (!h) - return -ENOENT; - - old_hash = h->hash_func(old_key) % NBUCKETS; - if (!(e = hash_scan(h, old_hash, old_key))) - return -ENOENT; - - new_hash = h->hash_func(new_key) % NBUCKETS; - - if ((k = hash_scan(h, new_hash, new_key))) - if (e != k) - remove_entry(h, k); - - unlink_entry(h, e, old_hash); - - e->key = new_key; - e->value = value; - - link_entry(h, e, new_hash); - - return 0; -} - -void* hashmap_remove_value(Hashmap *h, const void *key, void *value) { - struct hashmap_entry *e; - unsigned hash; - - if (!h) - return NULL; - - hash = h->hash_func(key) % NBUCKETS; - - if (!(e = hash_scan(h, hash, key))) - return NULL; - - if (e->value != value) - return NULL; - - remove_entry(h, e); - - return value; -} - void *hashmap_iterate(Hashmap *h, Iterator *i, const void **key) { struct hashmap_entry *e; @@ -704,21 +604,6 @@ void* hashmap_steal_first(Hashmap *h) { return data; } -void* hashmap_steal_first_key(Hashmap *h) { - void *key; - - if (!h) - return NULL; - - if (!h->iterate_list_head) - return NULL; - - key = (void*) h->iterate_list_head->key; - remove_entry(h, h->iterate_list_head); - - return key; -} - unsigned hashmap_size(Hashmap *h) { if (!h) @@ -838,25 +723,3 @@ char **hashmap_get_strv(Hashmap *h) { return sv; } - -void *hashmap_next(Hashmap *h, const void *key) { - unsigned hash; - struct hashmap_entry *e; - - assert(h); - assert(key); - - if (!h) - return NULL; - - hash = h->hash_func(key) % NBUCKETS; - e = hash_scan(h, hash, key); - if (!e) - return NULL; - - e = e->iterate_next; - if (!e) - return NULL; - - return e->value; -} |