list.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: list.h 987 2006-02-14 02:10:29Z aquamaniac $
00005     begin       : Sat Nov 15 2003
00006     copyright   : (C) 2003 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009  ***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 
00029 #ifndef GWENHYWFAR_LIST_H
00030 #define GWENHYWFAR_LIST_H
00031 
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 #include <gwenhywfar/gwenhywfarapi.h>
00038 #include <gwenhywfar/inherit.h>
00039 #include <gwenhywfar/refptr.h>
00040 /* This is needed for PalmOS, because it define some functions needed */
00041 #include <string.h>
00042 #include <stdio.h>
00043 
00044 
00050 
00055 typedef struct GWEN_LIST GWEN_LIST;
00056 
00058 typedef void *(*GWEN_LIST_FOREACH_CB)(void *element, void *user_data);
00059 
00064 typedef struct GWEN_LIST GWEN_CONSTLIST;
00065 
00067 typedef const void *(*GWEN_CONSTLIST_FOREACH_CB)(const void *element,
00068                                                  void *user_data);
00069 
00072 typedef struct GWEN_LIST_ITERATOR GWEN_LIST_ITERATOR;
00073 
00076 typedef struct GWEN_LIST_ITERATOR GWEN_CONSTLIST_ITERATOR;
00077 
00078 
00080 GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_LIST, GWENHYWFAR_API)
00081 
00082 
00083 
00084 GWENHYWFAR_API
00085 GWEN_LIST *GWEN_List_new();
00086 
00089 GWENHYWFAR_API
00090 void GWEN_List_free(GWEN_LIST *l);
00091 
00094 GWENHYWFAR_API
00095 GWEN_LIST *GWEN_List_dup(const GWEN_LIST *l);
00096 
00097 
00098 GWENHYWFAR_API
00099 void GWEN_List_Unshare(GWEN_LIST *l);
00100 
00101 
00105 GWENHYWFAR_API
00106 void GWEN_List_Dump(const GWEN_LIST *l, FILE *f, unsigned int indent);
00107 
00111 GWENHYWFAR_API
00112 void GWEN_List_PushBack(GWEN_LIST *l, void *p);
00113 
00117 GWENHYWFAR_API
00118 void GWEN_List_PushBackRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp);
00119 
00124 GWENHYWFAR_API
00125 void GWEN_List_PushFront(GWEN_LIST *l, void *p);
00126 
00131 GWENHYWFAR_API
00132 void GWEN_List_PushFrontRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp);
00133 
00138 GWENHYWFAR_API
00139 void *GWEN_List_GetFront(const GWEN_LIST *l);
00140 
00145 GWENHYWFAR_API
00146 GWEN_REFPTR *GWEN_List_GetFrontRefPtr(const GWEN_LIST *l);
00147 
00152 GWENHYWFAR_API
00153 void *GWEN_List_GetBack(const GWEN_LIST *l);
00154 
00159 GWENHYWFAR_API
00160 GWEN_REFPTR *GWEN_List_GetBackRefPtr(const GWEN_LIST *l);
00161 
00166 GWENHYWFAR_API
00167 void GWEN_List_Erase(GWEN_LIST *l, GWEN_LIST_ITERATOR *it);
00168 
00169 
00170 GWENHYWFAR_API
00171 void GWEN_List_Remove(GWEN_LIST *l, const void *p);
00172 
00173 
00179 GWENHYWFAR_API
00180 unsigned int GWEN_List_GetSize(const GWEN_LIST *l);
00181 
00182 GWENHYWFAR_API
00183 GWEN_REFPTR_INFO *GWEN_List_GetRefPtrInfo(const GWEN_LIST *l);
00184 
00185 GWENHYWFAR_API
00186 void GWEN_List_SetRefPtrInfo(GWEN_LIST *l, GWEN_REFPTR_INFO *rpi);
00187 
00192 GWENHYWFAR_API
00193 void GWEN_List_PopBack(GWEN_LIST *l);
00194 
00199 GWENHYWFAR_API
00200 void GWEN_List_PopFront(GWEN_LIST *l);
00201 
00206 GWENHYWFAR_API
00207 void GWEN_List_Clear(GWEN_LIST *l);
00208 
00209 
00222 GWENHYWFAR_API
00223 void *GWEN_List_ForEach(GWEN_LIST *list, GWEN_LIST_FOREACH_CB func,
00224                         void *user_data);
00225 
00227 GWENHYWFAR_API
00228 GWEN_LIST_ITERATOR *GWEN_List_First(const GWEN_LIST *l);
00229 
00231 GWENHYWFAR_API
00232 GWEN_LIST_ITERATOR *GWEN_List_Last(const GWEN_LIST *l);
00233 
00237 GWENHYWFAR_API
00238 GWEN_LIST_ITERATOR *GWEN_ListIterator_new(const GWEN_LIST *l);
00239 
00241 GWENHYWFAR_API
00242 void GWEN_ListIterator_free(GWEN_LIST_ITERATOR *li);
00243 
00248 GWENHYWFAR_API
00249 void *GWEN_ListIterator_Previous(GWEN_LIST_ITERATOR *li);
00250 
00255 GWENHYWFAR_API
00256 GWEN_REFPTR *GWEN_ListIterator_PreviousRefPtr(GWEN_LIST_ITERATOR *li);
00257 
00262 GWENHYWFAR_API
00263 void *GWEN_ListIterator_Next(GWEN_LIST_ITERATOR *li);
00264 
00269 GWENHYWFAR_API
00270 GWEN_REFPTR *GWEN_ListIterator_NextRefPtr(GWEN_LIST_ITERATOR *li);
00271 
00276 GWENHYWFAR_API
00277 void *GWEN_ListIterator_Data(GWEN_LIST_ITERATOR *li);
00278 
00283 GWENHYWFAR_API
00284 GWEN_REFPTR *GWEN_ListIterator_DataRefPtr(GWEN_LIST_ITERATOR *li);
00285 
00286 GWENHYWFAR_API
00287 void GWEN_ListIterator_IncLinkCount(GWEN_LIST_ITERATOR *li);
00288 
00289 GWENHYWFAR_API
00290 unsigned int GWEN_ListIterator_GetLinkCount(const GWEN_LIST_ITERATOR *li);
00291 
00292 
00293 
00294 
00296 GWENHYWFAR_API
00297 GWEN_CONSTLIST *GWEN_ConstList_new();
00298 
00302 GWENHYWFAR_API
00303 void GWEN_ConstList_free(GWEN_CONSTLIST *l);
00304 
00308 GWENHYWFAR_API
00309 void GWEN_ConstList_PushBack(GWEN_CONSTLIST *l, const void *p);
00310 
00315 GWENHYWFAR_API
00316 void GWEN_ConstList_PushFront(GWEN_CONSTLIST *l, const void *p);
00317 
00322 GWENHYWFAR_API
00323 const void *GWEN_ConstList_GetFront(GWEN_CONSTLIST *l);
00324 
00329 GWENHYWFAR_API
00330 const void *GWEN_ConstList_GetBack(GWEN_CONSTLIST *l);
00331 
00337 GWENHYWFAR_API
00338 unsigned int GWEN_ConstList_GetSize(GWEN_CONSTLIST *l);
00339 
00344 GWENHYWFAR_API
00345 void GWEN_ConstList_PopBack(GWEN_CONSTLIST *l);
00346 
00351 GWENHYWFAR_API
00352 void GWEN_ConstList_PopFront(GWEN_CONSTLIST *l);
00353 
00358 GWENHYWFAR_API
00359 void GWEN_ConstList_Clear(GWEN_CONSTLIST *l);
00360 
00373 GWENHYWFAR_API
00374 const void *GWEN_ConstList_ForEach(GWEN_CONSTLIST *list, 
00375                                    GWEN_CONSTLIST_FOREACH_CB func,
00376                                    void *user_data);
00377 
00379 GWENHYWFAR_API
00380 GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_First(const GWEN_CONSTLIST *l);
00381 
00383 GWENHYWFAR_API
00384 GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_Last(const GWEN_CONSTLIST *l);
00385 
00389 GWENHYWFAR_API
00390 GWEN_CONSTLIST_ITERATOR *GWEN_ConstListIterator_new(const GWEN_CONSTLIST *l);
00391 
00393 GWENHYWFAR_API
00394 void GWEN_ConstListIterator_free(GWEN_CONSTLIST_ITERATOR *li);
00395 
00400 GWENHYWFAR_API
00401 const void *GWEN_ConstListIterator_Previous(GWEN_CONSTLIST_ITERATOR *li);
00402 
00407 GWENHYWFAR_API
00408 const void *GWEN_ConstListIterator_Next(GWEN_CONSTLIST_ITERATOR *li);
00409 
00414 GWENHYWFAR_API
00415 const void *GWEN_ConstListIterator_Data(GWEN_CONSTLIST_ITERATOR *li);
00416 
00417 
00418  /* defgroup */
00420 
00421 
00422 #ifdef __cplusplus
00423 }
00424 #endif
00425 
00426 
00427 #endif
00428 
00429 
00430 

Generated on Wed Jun 21 00:59:52 2006 for gwenhywfar by  doxygen 1.4.6