5 Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
7 Copyright (C) 1997 - 2000 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
25 SilcIDCache structure.
29 The data that is usually used to find the data from the cache.
30 For example for Client ID's this is nickname.
42 Time when this cache entry expires. This is normal time() value
43 plus the validity. Cache entry has expired if current time is
44 more than value in this field, or if this field has been set to
49 Any caller specified context.
60 #define SILC_ID_CACHE_EXPIRE 3600
63 void silc_idcache_sort_by_data(SilcIDCache *cache, unsigned int count);
64 int silc_idcache_find_by_data(SilcIDCache *cache, unsigned int cache_count,
65 char *data, SilcIDCache **ret);
66 int silc_idcache_find_by_id(SilcIDCache *cache, unsigned int cache_count,
67 void *id, SilcIdType type, SilcIDCache **ret);
68 int silc_idcache_add(SilcIDCache **cache, unsigned int cache_count,
69 char *data, SilcIdType id_type, void *id,
71 int silc_idcache_del(SilcIDCache *cache, SilcIDCache *old);
72 int silc_idcache_del_by_data(SilcIDCache *cache, unsigned int cache_count,
74 int silc_idcache_del_by_id(SilcIDCache *cache, unsigned int cache_count,
75 SilcIdType type, void *id);
76 int silc_idcache_del_all(SilcIDCache **cache, unsigned int cache_count);
77 int silc_idcache_purge(SilcIDCache *cache, unsigned int cache_count);