X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilclist.h;h=81ea3638bd8a468c9a4501c9eb55c1e353c9932c;hb=52e57c880aba9c5e89f59d962eb9af75670b76e0;hp=e7d9c53bf1d1f0da084f2adee395b6aebb51bc3a;hpb=8fd8212bcd16f2b53fbedff2a9b9a4e8c15b9695;p=silc.git diff --git a/lib/silcutil/silclist.h b/lib/silcutil/silclist.h index e7d9c53b..81ea3638 100644 --- a/lib/silcutil/silclist.h +++ b/lib/silcutil/silclist.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -22,7 +22,7 @@ * 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. @@ -44,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 */ @@ -104,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) @@ -143,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)