list.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  $RCSfile$
00003                              -------------------
00004     cvs         : $Id: list.h 1080 2006-07-16 08:48:11Z martin $
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 
00168 GWENHYWFAR_API
00169 void GWEN_List_Erase(GWEN_LIST *l, GWEN_LIST_ITERATOR *it);
00170 
00171 
00172 GWENHYWFAR_API
00173 void GWEN_List_Remove(GWEN_LIST *l, const void *p);
00174 
00175 
00181 GWENHYWFAR_API
00182 unsigned int GWEN_List_GetSize(const GWEN_LIST *l);
00183 
00184 GWENHYWFAR_API
00185 GWEN_REFPTR_INFO *GWEN_List_GetRefPtrInfo(const GWEN_LIST *l);
00186 
00187 GWENHYWFAR_API
00188 void GWEN_List_SetRefPtrInfo(GWEN_LIST *l, GWEN_REFPTR_INFO *rpi);
00189 
00194 GWENHYWFAR_API
00195 void GWEN_List_PopBack(GWEN_LIST *l);
00196 
00201 GWENHYWFAR_API
00202 void GWEN_List_PopFront(GWEN_LIST *l);
00203 
00208 GWENHYWFAR_API
00209 void GWEN_List_Clear(GWEN_LIST *l);
00210 
00211 
00224 GWENHYWFAR_API
00225 void *GWEN_List_ForEach(GWEN_LIST *list, GWEN_LIST_FOREACH_CB func,
00226                         void *user_data);
00227 
00229 GWENHYWFAR_API
00230 GWEN_LIST_ITERATOR *GWEN_List_First(const GWEN_LIST *l);
00231 
00233 GWENHYWFAR_API
00234 GWEN_LIST_ITERATOR *GWEN_List_Last(const GWEN_LIST *l);
00235 
00239 GWENHYWFAR_API
00240 GWEN_LIST_ITERATOR *GWEN_ListIterator_new(const GWEN_LIST *l);
00241 
00243 GWENHYWFAR_API
00244 void GWEN_ListIterator_free(GWEN_LIST_ITERATOR *li);
00245 
00250 GWENHYWFAR_API
00251 void *GWEN_ListIterator_Previous(GWEN_LIST_ITERATOR *li);
00252 
00257 GWENHYWFAR_API
00258 GWEN_REFPTR *GWEN_ListIterator_PreviousRefPtr(GWEN_LIST_ITERATOR *li);
00259 
00264 GWENHYWFAR_API
00265 void *GWEN_ListIterator_Next(GWEN_LIST_ITERATOR *li);
00266 
00271 GWENHYWFAR_API
00272 GWEN_REFPTR *GWEN_ListIterator_NextRefPtr(GWEN_LIST_ITERATOR *li);
00273 
00278 GWENHYWFAR_API
00279 void *GWEN_ListIterator_Data(GWEN_LIST_ITERATOR *li);
00280 
00285 GWENHYWFAR_API
00286 GWEN_REFPTR *GWEN_ListIterator_DataRefPtr(GWEN_LIST_ITERATOR *li);
00287 
00288 GWENHYWFAR_API
00289 void GWEN_ListIterator_IncLinkCount(GWEN_LIST_ITERATOR *li);
00290 
00291 GWENHYWFAR_API
00292 unsigned int GWEN_ListIterator_GetLinkCount(const GWEN_LIST_ITERATOR *li);
00293 
00294 
00295 
00296 
00298 GWENHYWFAR_API
00299 GWEN_CONSTLIST *GWEN_ConstList_new();
00300 
00304 GWENHYWFAR_API
00305 void GWEN_ConstList_free(GWEN_CONSTLIST *l);
00306 
00310 GWENHYWFAR_API
00311 void GWEN_ConstList_PushBack(GWEN_CONSTLIST *l, const void *p);
00312 
00317 GWENHYWFAR_API
00318 void GWEN_ConstList_PushFront(GWEN_CONSTLIST *l, const void *p);
00319 
00324 GWENHYWFAR_API
00325 const void *GWEN_ConstList_GetFront(GWEN_CONSTLIST *l);
00326 
00331 GWENHYWFAR_API
00332 const void *GWEN_ConstList_GetBack(GWEN_CONSTLIST *l);
00333 
00339 GWENHYWFAR_API
00340 unsigned int GWEN_ConstList_GetSize(GWEN_CONSTLIST *l);
00341 
00346 GWENHYWFAR_API
00347 void GWEN_ConstList_PopBack(GWEN_CONSTLIST *l);
00348 
00353 GWENHYWFAR_API
00354 void GWEN_ConstList_PopFront(GWEN_CONSTLIST *l);
00355 
00360 GWENHYWFAR_API
00361 void GWEN_ConstList_Clear(GWEN_CONSTLIST *l);
00362 
00375 GWENHYWFAR_API
00376 const void *GWEN_ConstList_ForEach(GWEN_CONSTLIST *list, 
00377                                    GWEN_CONSTLIST_FOREACH_CB func,
00378                                    void *user_data);
00379 
00381 GWENHYWFAR_API
00382 GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_First(const GWEN_CONSTLIST *l);
00383 
00385 GWENHYWFAR_API
00386 GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_Last(const GWEN_CONSTLIST *l);
00387 
00391 GWENHYWFAR_API
00392 GWEN_CONSTLIST_ITERATOR *GWEN_ConstListIterator_new(const GWEN_CONSTLIST *l);
00393 
00395 GWENHYWFAR_API
00396 void GWEN_ConstListIterator_free(GWEN_CONSTLIST_ITERATOR *li);
00397 
00402 GWENHYWFAR_API
00403 const void *GWEN_ConstListIterator_Previous(GWEN_CONSTLIST_ITERATOR *li);
00404 
00409 GWENHYWFAR_API
00410 const void *GWEN_ConstListIterator_Next(GWEN_CONSTLIST_ITERATOR *li);
00411 
00416 GWENHYWFAR_API
00417 const void *GWEN_ConstListIterator_Data(GWEN_CONSTLIST_ITERATOR *li);
00418 
00419 
00420  /* defgroup */
00422 
00423 
00424 #ifdef __cplusplus
00425 }
00426 #endif
00427 
00428 
00429 #endif
00430 
00431 
00432 

Generated on Sat Sep 16 11:19:15 2006 for gwenhywfar by  doxygen 1.4.7