list.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile: list.h,v $
00003                              -------------------
00004     cvs         : $Id: list.h,v 1.15 2005/09/28 19:10:11 aquamaniac Exp $
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 
00090 GWENHYWFAR_API
00091 void GWEN_List_free(GWEN_LIST *l);
00092 
00095 GWENHYWFAR_API
00096 GWEN_LIST *GWEN_List_dup(const GWEN_LIST *l);
00097 
00098 
00099 GWENHYWFAR_API
00100 void GWEN_List_Unshare(GWEN_LIST *l);
00101 
00102 
00106 GWENHYWFAR_API
00107 void GWEN_List_Dump(const GWEN_LIST *l, FILE *f, unsigned int indent);
00108 
00112 GWENHYWFAR_API
00113 void GWEN_List_PushBack(GWEN_LIST *l, void *p);
00114 
00118 GWENHYWFAR_API
00119 void GWEN_List_PushBackRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp);
00120 
00125 GWENHYWFAR_API
00126 void GWEN_List_PushFront(GWEN_LIST *l, void *p);
00127 
00132 GWENHYWFAR_API
00133 void GWEN_List_PushFrontRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp);
00134 
00139 GWENHYWFAR_API
00140 void *GWEN_List_GetFront(const GWEN_LIST *l);
00141 
00146 GWENHYWFAR_API
00147 GWEN_REFPTR *GWEN_List_GetFrontRefPtr(const GWEN_LIST *l);
00148 
00153 GWENHYWFAR_API
00154 void *GWEN_List_GetBack(const GWEN_LIST *l);
00155 
00160 GWENHYWFAR_API
00161 GWEN_REFPTR *GWEN_List_GetBackRefPtr(const GWEN_LIST *l);
00162 
00167 GWENHYWFAR_API
00168 void GWEN_List_Erase(GWEN_LIST *l, GWEN_LIST_ITERATOR *it);
00169 
00170 
00171 GWENHYWFAR_API
00172 void GWEN_List_Remove(GWEN_LIST *l, const void *p);
00173 
00174 
00180 GWENHYWFAR_API
00181 unsigned int GWEN_List_GetSize(const GWEN_LIST *l);
00182 
00183 GWENHYWFAR_API
00184 GWEN_REFPTR_INFO *GWEN_List_GetRefPtrInfo(const GWEN_LIST *l);
00185 
00186 GWENHYWFAR_API
00187 void GWEN_List_SetRefPtrInfo(GWEN_LIST *l, GWEN_REFPTR_INFO *rpi);
00188 
00193 GWENHYWFAR_API
00194 void GWEN_List_PopBack(GWEN_LIST *l);
00195 
00200 GWENHYWFAR_API
00201 void GWEN_List_PopFront(GWEN_LIST *l);
00202 
00207 GWENHYWFAR_API
00208 void GWEN_List_Clear(GWEN_LIST *l);
00209 
00210 
00223 GWENHYWFAR_API
00224 void *GWEN_List_ForEach(GWEN_LIST *list, GWEN_LIST_FOREACH_CB func,
00225                         void *user_data);
00226 
00228 GWENHYWFAR_API
00229 GWEN_LIST_ITERATOR *GWEN_List_First(const GWEN_LIST *l);
00230 
00232 GWENHYWFAR_API
00233 GWEN_LIST_ITERATOR *GWEN_List_Last(const GWEN_LIST *l);
00234 
00238 GWENHYWFAR_API
00239 GWEN_LIST_ITERATOR *GWEN_ListIterator_new(const GWEN_LIST *l);
00240 
00242 GWENHYWFAR_API
00243 void GWEN_ListIterator_free(GWEN_LIST_ITERATOR *li);
00244 
00249 GWENHYWFAR_API
00250 void *GWEN_ListIterator_Previous(GWEN_LIST_ITERATOR *li);
00251 
00256 GWENHYWFAR_API
00257 GWEN_REFPTR *GWEN_ListIterator_PreviousRefPtr(GWEN_LIST_ITERATOR *li);
00258 
00263 GWENHYWFAR_API
00264 void *GWEN_ListIterator_Next(GWEN_LIST_ITERATOR *li);
00265 
00270 GWENHYWFAR_API
00271 GWEN_REFPTR *GWEN_ListIterator_NextRefPtr(GWEN_LIST_ITERATOR *li);
00272 
00277 GWENHYWFAR_API
00278 void *GWEN_ListIterator_Data(GWEN_LIST_ITERATOR *li);
00279 
00284 GWENHYWFAR_API
00285 GWEN_REFPTR *GWEN_ListIterator_DataRefPtr(GWEN_LIST_ITERATOR *li);
00286 
00287 GWENHYWFAR_API
00288 void GWEN_ListIterator_IncLinkCount(GWEN_LIST_ITERATOR *li);
00289 
00290 GWENHYWFAR_API
00291 unsigned int GWEN_ListIterator_GetLinkCount(const GWEN_LIST_ITERATOR *li);
00292 
00293 
00294 
00295 
00296 GWENHYWFAR_API
00297 GWEN_CONSTLIST *GWEN_ConstList_new();
00298 
00299 GWENHYWFAR_API
00300 void GWEN_ConstList_free(GWEN_CONSTLIST *l);
00301 
00302 GWENHYWFAR_API
00303 void GWEN_ConstList_PushBack(GWEN_CONSTLIST *l, const void *p);
00304 
00305 GWENHYWFAR_API
00306 void GWEN_ConstList_PushFront(GWEN_CONSTLIST *l, const void *p);
00307 
00308 GWENHYWFAR_API
00309 const void *GWEN_ConstList_GetFront(GWEN_CONSTLIST *l);
00310 
00311 GWENHYWFAR_API
00312 const void *GWEN_ConstList_GetBack(GWEN_CONSTLIST *l);
00313 
00314 GWENHYWFAR_API
00315 unsigned int GWEN_ConstList_GetSize(GWEN_CONSTLIST *l);
00316 
00317 GWENHYWFAR_API
00318 void GWEN_ConstList_PopBack(GWEN_CONSTLIST *l);
00319 
00320 GWENHYWFAR_API
00321 void GWEN_ConstList_PopFront(GWEN_CONSTLIST *l);
00322 
00323 GWENHYWFAR_API
00324 void GWEN_ConstList_Clear(GWEN_CONSTLIST *l);
00325 
00326 GWENHYWFAR_API
00327 const void *GWEN_ConstList_ForEach(GWEN_CONSTLIST *l, 
00328                                    GWEN_CONSTLIST_FOREACH_CB fn,
00329                                    void *user_data);
00330 
00331 GWENHYWFAR_API
00332 GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_First(const GWEN_CONSTLIST *l);
00333 
00334 GWENHYWFAR_API
00335 GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_Last(const GWEN_CONSTLIST *l);
00336 
00337 GWENHYWFAR_API
00338 GWEN_CONSTLIST_ITERATOR *GWEN_ConstListIterator_new(const GWEN_CONSTLIST *l);
00339 
00340 GWENHYWFAR_API
00341 void GWEN_ConstListIterator_free(GWEN_CONSTLIST_ITERATOR *li);
00342 
00343 GWENHYWFAR_API
00344 const void *GWEN_ConstListIterator_Previous(GWEN_CONSTLIST_ITERATOR *li);
00345 
00346 GWENHYWFAR_API
00347 const void *GWEN_ConstListIterator_Next(GWEN_CONSTLIST_ITERATOR *li);
00348 
00349 GWENHYWFAR_API
00350 const void *GWEN_ConstListIterator_Data(GWEN_CONSTLIST_ITERATOR *li);
00351 
00352 
00353  /* defgroup */
00355 
00356 
00357 #ifdef __cplusplus
00358 }
00359 #endif
00360 
00361 
00362 #endif
00363 
00364 
00365 

Generated on Wed Jan 11 16:49:07 2006 for gwenhywfar by  doxygen 1.4.6