Integer type name change.
[silc.git] / lib / silccore / silcidcache.h
index d2d0d06348e0c6c70d66f68bc4ec2238e9391f10..64c8bf9c6b038cd9f032e4259f706483f70d7b1c 100644 (file)
@@ -1,24 +1,24 @@
-/****h* silccore/silcidcache.h
- *
- * NAME
- *
- * silcidcache.h
- *
- * COPYRIGHT
- *
- * Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
- *
- * Copyright (C) 2000 - 2001 Pekka Riikonen
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+/*
+  silcidcache.h
+  Author: Pekka Riikonen <priikone@silcnet.org>
+  Copyright (C) 2000 - 2001 Pekka Riikonen
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+*/
+
+/****h* silccore/SilcIDCacheAPI
  *
  * DESCRIPTION
  * 
@@ -26,7 +26,7 @@
  * protocol.  Application can save here the ID's it uses and the interface
  * provides fast retrieval of the ID's from the cache.
  *
- */
+ ***/
 
 #ifndef SILCIDCACHE_H
 #define SILCIDCACHE_H
@@ -52,7 +52,7 @@
  *
  *      A name associated with the ID.
  *
- *    uint32 expire
+ *    SilcUInt32 expire
  *
  *      Time when this cache entry expires.  This is normal time() value
  *      plus the validity.  Cache entry has expired if current time is
@@ -68,7 +68,7 @@
 typedef struct {
   void *id;
   char *name;
-  uint32 expire;
+  SilcUInt32 expire;
   void *context;
 } *SilcIDCacheEntry;
 /***/
@@ -133,7 +133,7 @@ typedef void (*SilcIDCacheDestructor)(SilcIDCache cache,
  *
  * SYNOPSIS
  *
- *    SilcIDCache silc_idcache_alloc(uint32 count, SilcIdType id_type,
+ *    SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
  *                                   SilcIDCacheDestructor destructor);
  *
  * DESCRIPTION
@@ -144,7 +144,7 @@ typedef void (*SilcIDCacheDestructor)(SilcIDCache cache,
  *    cache.
  *
  ***/
-SilcIDCache silc_idcache_alloc(uint32 count, SilcIdType id_type,
+SilcIDCache silc_idcache_alloc(SilcUInt32 count, SilcIdType id_type,
                               SilcIDCacheDestructor destructor);
 
 /****f* silccore/SilcIDCacheAPI/silc_idcache_free
@@ -172,12 +172,15 @@ void silc_idcache_free(SilcIDCache cache);
  *    Add new entry to the cache. Returns TRUE if the entry was added and
  *    FALSE if it could not be added. The `name' is the name associated with
  *    the ID, the `id' the actual ID and the `context' a used specific context.
- *    If the `expire' is TRUE the entry expires in default time and if FALSE
- *    the entry never expires from the cache.
+ *    If the `expire' is non-zero the entry expires in that specified time.
+ *    If zero the entry never expires from the cache.
+ *
+ *    If the `ret' is non-NULL the created ID Cache entry is returned to 
+ *    that pointer.
  *
  ***/
 bool silc_idcache_add(SilcIDCache cache, char *name, void *id, 
-                     void *context, int expire);
+                     void *context, int expire, SilcIDCacheEntry *ret);
 
 /****f* silccore/SilcIDCacheAPI/silc_idcache_del
  *