+Tue Apr 19 11:57:35 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
+
+ * Added context to the SilcIDCache destructor. Affected
+ files are lib/silccore/silcidcache.[ch],
+ lib/silcclient/client.c and silcd/server.c.
+
Mon Apr 18 09:53:28 EEST 2005 Pekka Riikonen <priikone@silcnet.org>
* Added pkg-config check to configure.
# Do the releases and library versioning according to following rules:
#
# - If any code has changed in library, increment [LIB]_REVISION
-# - If functions were added, set [LIB]_REVISION to 0
+# - If functions were added, removed or changed, set [LIB]_REVISION to 0
# - If functions were added, removed or changed, increment [LIB]_CURRENT
# - If functions were added, increment [LIB]_AGE
# - If functions were removed, set [LIB]_AGE to 0
LIB_BASE_VERSION=1.0
# libsilc versions
-LIBSILC_CURRENT=4 # prev = 3
+LIBSILC_CURRENT=5 # prev = 4
LIBSILC_REVISION=0 # prev = 0
-LIBSILC_AGE=3 # prev = 2
+LIBSILC_AGE=3 # prev = 3
# libsilcclient versions
-LIBSILCCLIENT_CURRENT=4 # prev = 3
+LIBSILCCLIENT_CURRENT=4 # prev = 4
LIBSILCCLIENT_REVISION=0 # prev = 0
-LIBSILCCLIENT_AGE=3 # prev = 2
+LIBSILCCLIENT_AGE=3 # prev = 3
# Substitute the version numbers
AC_SUBST(LIB_BASE_VERSION)
conn->remote_port = port;
conn->context = context;
conn->internal->client_cache =
- silc_idcache_alloc(0, SILC_ID_CLIENT, NULL, FALSE, TRUE);
+ silc_idcache_alloc(0, SILC_ID_CLIENT, NULL, NULL, FALSE, TRUE);
conn->internal->channel_cache = silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL,
- FALSE, TRUE);
+ NULL, FALSE, TRUE);
conn->internal->server_cache = silc_idcache_alloc(0, SILC_ID_SERVER, NULL,
- FALSE, TRUE);
+ NULL, FALSE, TRUE);
conn->internal->pending_commands = silc_dlist_init();
conn->internal->ftp_sessions = silc_dlist_init();
SilcHashTable name_table;
SilcHashTable context_table;
SilcIDCacheDestructor destructor;
+ void *context;
SilcIdType type;
unsigned int delete_id : 1;
unsigned int delete_name : 1;
SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
SilcIDCacheDestructor destructor,
+ void *destructor_context,
bool delete_id, bool delete_name)
{
SilcIDCache cache;
cache->context_table = silc_hash_table_alloc(count, silc_hash_ptr, NULL,
NULL, NULL, NULL, NULL, TRUE);
cache->destructor = destructor;
+ cache->context = destructor_context;
cache->type = id_type;
cache->delete_id = delete_id;
cache->delete_name = delete_name;
if (ret == TRUE) {
/* Call the destructor */
if (cache->destructor)
- cache->destructor(cache, c);
+ cache->destructor(cache, c, cache->context);
/* Free the entry, it has been deleted from the hash tables */
silc_idcache_destructor(NULL, c, NULL);
if (ret == TRUE) {
/* Call the destructor */
if (cache->destructor)
- cache->destructor(cache, c);
+ cache->destructor(cache, c, cache->context);
/* Free the entry, it has been deleted from the hash tables */
silc_idcache_destructor(NULL, c, NULL);
* SYNOPSIS
*
* typedef void (*SilcIDCacheDestructor)(SilcIDCache cache,
- * SilcIDCacheEntry entry);
+ * SilcIDCacheEntry entry,
+ * void *context);
*
* DESCRIPTION
*
*
***/
typedef void (*SilcIDCacheDestructor)(SilcIDCache cache,
- SilcIDCacheEntry entry);
+ SilcIDCacheEntry entry,
+ void *context);
#define SILC_ID_CACHE_EXPIRE 3600
#define SILC_ID_CACHE_EXPIRE_DEF (time(NULL) + SILC_ID_CACHE_EXPIRE)
* SYNOPSIS
*
* SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
- * SilcIDCacheDestructor destructor);
+ * SilcIDCacheDestructor destructor,
+ * void *destructor_context,
+ * bool delete_id, bool delete_name);
*
* DESCRIPTION
*
***/
SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
SilcIDCacheDestructor destructor,
+ void *destructor_context,
bool delete_id, bool delete_name);
/****f* silccore/SilcIDCacheAPI/silc_idcache_free