X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcapputil%2Fsilcidcache.c;fp=lib%2Fsilcapputil%2Fsilcidcache.c;h=5e6629477dbfee50a98096f6b759d33d97678a1a;hb=510fa1da68f18f2c0e2518a690d254339a02a3bb;hp=93364caf6ca97e04647a35ac4a813910c99bf370;hpb=167f333f9382922ef617147de238339c98792844;p=silc.git diff --git a/lib/silcapputil/silcidcache.c b/lib/silcapputil/silcidcache.c index 93364caf..5e662947 100644 --- a/lib/silcapputil/silcidcache.c +++ b/lib/silcapputil/silcidcache.c @@ -256,6 +256,22 @@ SilcBool silc_idcache_update(SilcIDCache cache, SilcIDCacheEntry entry, return TRUE; } +/* Update entry by context */ + +SilcBool silc_idcache_update_by_context(SilcIDCache cache, void *context, + void *old_id, void *new_id, + char *old_name, char *new_name, + SilcBool free_old_name) +{ + SilcIDCacheEntry c; + + if (!silc_hash_table_find(cache->context_table, context, NULL, (void **)&c)) + return FALSE; + + return silc_idcache_update(cache, c, old_id, new_id, old_name, new_name, + free_old_name); +} + /* Returns all cache entrys from the ID cache to the `ret' ID Cache List. */ SilcBool silc_idcache_get_all(SilcIDCache cache, SilcList *ret_list)