Merged silc_1_1_branch to trunk.
[silc.git] / lib / silcutil / silclist.h
index 1cd197700eea7cf9076fcab1855d0bbdfda55c25..81ea3638bd8a468c9a4501c9eb55c1e353c9932c 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2002 - 2005 Pekka Riikonen
+  Copyright (C) 2002 - 2007 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
  * DESCRIPTION
  *
  * Implementation of the SilcList interface.  This interface provides
- * simple linked list.
+ * simple linked list.  This interface does not allocate any memory.
+ *
+ * SILC List is not thread-safe.  If the same list context must be used
+ * in multithreaded environment concurrency control must be employed.
  *
  ***/
 
@@ -41,7 +44,7 @@
  *    function silc_list_init.
  *
  ***/
-typedef struct {
+typedef struct SilcListStruct {
   void *head;                       /* Start of the list */
   void *tail;                       /* End of the list */
   void *current;                    /* Current pointer in list */
@@ -101,6 +104,7 @@ do {                                                        \
   (list).next_offset = silc_offsetof(type, nextfield); \
   (list).prev_set = 0;                                 \
   (list).prev_offset = 0;                              \
+  (list).end_set = 0;                                  \
   (list).head = (list).tail = (list).current = NULL;   \
 } while(0)
 
@@ -140,6 +144,7 @@ do {                                                                \
   (list).next_offset = silc_offsetof(type, nextfield);         \
   (list).prev_offset = silc_offsetof(type, prevfield);         \
   (list).prev_set = 1;                                         \
+  (list).end_set = 0;                                          \
   (list).head = (list).tail = (list).current = NULL;           \
 } while(0)