list.h
Go to the documentation of this file.
/***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Sat Nov 15 2003
copyright : (C) 2003 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWENHYWFAR_LIST_H
#define GWENHYWFAR_LIST_H
#ifdef __cplusplus
extern "C" {
#endif
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/inherit.h>
#include <gwenhywfar/refptr.h>
/* This is needed for PalmOS, because it define some functions needed */
#include <string.h>
#include <stdio.h>
typedef struct GWEN_LIST GWEN_LIST;
typedef void *(*GWEN_LIST_FOREACH_CB)(void *element, void *user_data);
typedef struct GWEN_LIST GWEN_CONSTLIST;
typedef const void *(*GWEN_CONSTLIST_FOREACH_CB)(const void *element,
void *user_data);
typedef struct GWEN_LIST_ITERATOR GWEN_LIST_ITERATOR;
typedef struct GWEN_LIST_ITERATOR GWEN_CONSTLIST_ITERATOR;
GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_LIST, GWENHYWFAR_API)
GWENHYWFAR_API
GWEN_LIST *GWEN_List_new(void);
GWENHYWFAR_API
void GWEN_List_free(GWEN_LIST *l);
GWENHYWFAR_API
GWEN_LIST *GWEN_List_dup(const GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_List_Unshare(GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_List_Dump(const GWEN_LIST *l, FILE *f, unsigned int indent);
GWENHYWFAR_API
void GWEN_List_PushBack(GWEN_LIST *l, void *p);
GWENHYWFAR_API
void GWEN_List_PushBackRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp);
GWENHYWFAR_API
void GWEN_List_PushFront(GWEN_LIST *l, void *p);
GWENHYWFAR_API
void GWEN_List_PushFrontRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp);
GWENHYWFAR_API
void *GWEN_List_GetFront(const GWEN_LIST *l);
GWENHYWFAR_API
GWEN_REFPTR *GWEN_List_GetFrontRefPtr(const GWEN_LIST *l);
GWENHYWFAR_API
void *GWEN_List_GetBack(const GWEN_LIST *l);
GWENHYWFAR_API
GWEN_REFPTR *GWEN_List_GetBackRefPtr(const GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_List_Erase(GWEN_LIST *l, GWEN_LIST_ITERATOR *it);
GWENHYWFAR_API
void GWEN_List_Remove(GWEN_LIST *l, const void *element);
GWENHYWFAR_API
unsigned int GWEN_List_GetSize(const GWEN_LIST *l);
GWENHYWFAR_API
int GWEN_List_IsEmpty(const GWEN_LIST *l);
GWENHYWFAR_API
GWEN_REFPTR_INFO *GWEN_List_GetRefPtrInfo(const GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_List_SetRefPtrInfo(GWEN_LIST *l, GWEN_REFPTR_INFO *rpi);
GWENHYWFAR_API
void GWEN_List_PopBack(GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_List_PopFront(GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_List_Clear(GWEN_LIST *l);
GWENHYWFAR_API
GWEN_LIST_ITERATOR *GWEN_List_FindIter(GWEN_LIST *l, const void *element);
GWENHYWFAR_API
const void *GWEN_List_Contains(GWEN_LIST *l, const void *element);
GWENHYWFAR_API
void *GWEN_List_ForEach(GWEN_LIST *list, GWEN_LIST_FOREACH_CB func,
void *user_data);
GWENHYWFAR_API
GWEN_LIST_ITERATOR *GWEN_List_First(const GWEN_LIST *l);
GWENHYWFAR_API
GWEN_LIST_ITERATOR *GWEN_List_Last(const GWEN_LIST *l);
GWENHYWFAR_API
GWEN_LIST_ITERATOR *GWEN_ListIterator_new(const GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_ListIterator_free(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
void *GWEN_ListIterator_Previous(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
GWEN_REFPTR *GWEN_ListIterator_PreviousRefPtr(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
void *GWEN_ListIterator_Next(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
GWEN_REFPTR *GWEN_ListIterator_NextRefPtr(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
void *GWEN_ListIterator_Data(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
GWEN_REFPTR *GWEN_ListIterator_DataRefPtr(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
void GWEN_ListIterator_IncLinkCount(GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
unsigned int GWEN_ListIterator_GetLinkCount(const GWEN_LIST_ITERATOR *li);
GWENHYWFAR_API
GWEN_CONSTLIST *GWEN_ConstList_new(void);
GWENHYWFAR_API
void GWEN_ConstList_free(GWEN_CONSTLIST *l);
GWENHYWFAR_API
void GWEN_ConstList_PushBack(GWEN_CONSTLIST *l, const void *p);
GWENHYWFAR_API
void GWEN_ConstList_PushFront(GWEN_CONSTLIST *l, const void *p);
GWENHYWFAR_API
const void *GWEN_ConstList_GetFront(const GWEN_CONSTLIST *l);
GWENHYWFAR_API
const void *GWEN_ConstList_GetBack(const GWEN_CONSTLIST *l);
GWENHYWFAR_API
unsigned int GWEN_ConstList_GetSize(const GWEN_CONSTLIST *l);
GWENHYWFAR_API
int GWEN_ConstList_IsEmpty(const GWEN_LIST *l);
GWENHYWFAR_API
void GWEN_ConstList_PopBack(GWEN_CONSTLIST *l);
GWENHYWFAR_API
void GWEN_ConstList_PopFront(GWEN_CONSTLIST *l);
GWENHYWFAR_API
void GWEN_ConstList_Clear(GWEN_CONSTLIST *l);
GWENHYWFAR_API
const void *GWEN_ConstList_ForEach(GWEN_CONSTLIST *list,
GWEN_CONSTLIST_FOREACH_CB func,
void *user_data);
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_FindIter(const GWEN_CONSTLIST *l, const void *element);
GWENHYWFAR_API
const void *GWEN_ConstList_Contains(const GWEN_CONSTLIST *l, const void *element);
GWENHYWFAR_API
void GWEN_ConstList_Erase(GWEN_CONSTLIST *l, GWEN_CONSTLIST_ITERATOR *it);
GWENHYWFAR_API
void GWEN_ConstList_Remove(GWEN_CONSTLIST *l, const void *element);
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_First(const GWEN_CONSTLIST *l);
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR *GWEN_ConstList_Last(const GWEN_CONSTLIST *l);
GWENHYWFAR_API
GWEN_CONSTLIST_ITERATOR *GWEN_ConstListIterator_new(const GWEN_CONSTLIST *l);
GWENHYWFAR_API
void GWEN_ConstListIterator_free(GWEN_CONSTLIST_ITERATOR *li);
GWENHYWFAR_API
const void *GWEN_ConstListIterator_Previous(GWEN_CONSTLIST_ITERATOR *li);
GWENHYWFAR_API
const void *GWEN_ConstListIterator_Next(GWEN_CONSTLIST_ITERATOR *li);
GWENHYWFAR_API
const void *GWEN_ConstListIterator_Data(GWEN_CONSTLIST_ITERATOR *li);
/* defgroup */
#ifdef __cplusplus
}
#endif
#endif
gwenhywfarapi.h
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
inherit.h
GWEN_INHERIT_FUNCTION_LIB_DEFS
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition inherit.h:125
GWEN_ConstList_Clear
GWENHYWFAR_API void GWEN_ConstList_Clear(GWEN_CONSTLIST *l)
GWEN_List_FindIter
GWENHYWFAR_API GWEN_LIST_ITERATOR * GWEN_List_FindIter(GWEN_LIST *l, const void *element)
GWEN_List_SetRefPtrInfo
GWENHYWFAR_API void GWEN_List_SetRefPtrInfo(GWEN_LIST *l, GWEN_REFPTR_INFO *rpi)
GWEN_List_Erase
GWENHYWFAR_API void GWEN_List_Erase(GWEN_LIST *l, GWEN_LIST_ITERATOR *it)
GWEN_ListIterator_PreviousRefPtr
GWENHYWFAR_API GWEN_REFPTR * GWEN_ListIterator_PreviousRefPtr(GWEN_LIST_ITERATOR *li)
GWEN_ConstListIterator_Next
GWENHYWFAR_API const void * GWEN_ConstListIterator_Next(GWEN_CONSTLIST_ITERATOR *li)
GWEN_List_Last
GWENHYWFAR_API GWEN_LIST_ITERATOR * GWEN_List_Last(const GWEN_LIST *l)
GWEN_ConstList_new
GWENHYWFAR_API GWEN_CONSTLIST * GWEN_ConstList_new(void)
GWEN_CONSTLIST_FOREACH_CB
const void *(* GWEN_CONSTLIST_FOREACH_CB)(const void *element, void *user_data)
Definition list.h:67
GWEN_CONSTLIST
struct GWEN_LIST GWEN_CONSTLIST
Doubly-linked list with const objects.
Definition list.h:64
GWEN_ConstList_IsEmpty
GWENHYWFAR_API int GWEN_ConstList_IsEmpty(const GWEN_LIST *l)
GWEN_List_PushBackRefPtr
GWENHYWFAR_API void GWEN_List_PushBackRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp)
GWEN_LIST
struct GWEN_LIST GWEN_LIST
Doubly-linked list.
Definition list.h:55
GWEN_ListIterator_new
GWENHYWFAR_API GWEN_LIST_ITERATOR * GWEN_ListIterator_new(const GWEN_LIST *l)
GWEN_ListIterator_Next
GWENHYWFAR_API void * GWEN_ListIterator_Next(GWEN_LIST_ITERATOR *li)
GWEN_List_PushFront
GWENHYWFAR_API void GWEN_List_PushFront(GWEN_LIST *l, void *p)
GWEN_List_free
GWENHYWFAR_API void GWEN_List_free(GWEN_LIST *l)
GWEN_List_Dump
GWENHYWFAR_API void GWEN_List_Dump(const GWEN_LIST *l, FILE *f, unsigned int indent)
GWEN_ListIterator_NextRefPtr
GWENHYWFAR_API GWEN_REFPTR * GWEN_ListIterator_NextRefPtr(GWEN_LIST_ITERATOR *li)
GWEN_LIST_ITERATOR
struct GWEN_LIST_ITERATOR GWEN_LIST_ITERATOR
Definition list.h:72
GWEN_List_PopBack
GWENHYWFAR_API void GWEN_List_PopBack(GWEN_LIST *l)
GWEN_ConstList_GetFront
GWENHYWFAR_API const void * GWEN_ConstList_GetFront(const GWEN_CONSTLIST *l)
GWEN_List_Unshare
GWENHYWFAR_API void GWEN_List_Unshare(GWEN_LIST *l)
GWEN_List_GetBackRefPtr
GWENHYWFAR_API GWEN_REFPTR * GWEN_List_GetBackRefPtr(const GWEN_LIST *l)
GWEN_List_GetFront
GWENHYWFAR_API void * GWEN_List_GetFront(const GWEN_LIST *l)
GWEN_ConstList_GetBack
GWENHYWFAR_API const void * GWEN_ConstList_GetBack(const GWEN_CONSTLIST *l)
GWEN_ConstList_Contains
GWENHYWFAR_API const void * GWEN_ConstList_Contains(const GWEN_CONSTLIST *l, const void *element)
GWEN_ConstList_PushBack
GWENHYWFAR_API void GWEN_ConstList_PushBack(GWEN_CONSTLIST *l, const void *p)
GWEN_List_Clear
GWENHYWFAR_API void GWEN_List_Clear(GWEN_LIST *l)
GWEN_ConstListIterator_free
GWENHYWFAR_API void GWEN_ConstListIterator_free(GWEN_CONSTLIST_ITERATOR *li)
GWEN_ConstList_PopBack
GWENHYWFAR_API void GWEN_ConstList_PopBack(GWEN_CONSTLIST *l)
GWEN_List_Remove
GWENHYWFAR_API void GWEN_List_Remove(GWEN_LIST *l, const void *element)
GWEN_ListIterator_DataRefPtr
GWENHYWFAR_API GWEN_REFPTR * GWEN_ListIterator_DataRefPtr(GWEN_LIST_ITERATOR *li)
GWEN_ConstList_GetSize
GWENHYWFAR_API unsigned int GWEN_ConstList_GetSize(const GWEN_CONSTLIST *l)
GWEN_List_GetRefPtrInfo
GWENHYWFAR_API GWEN_REFPTR_INFO * GWEN_List_GetRefPtrInfo(const GWEN_LIST *l)
GWEN_ConstList_FindIter
GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR * GWEN_ConstList_FindIter(const GWEN_CONSTLIST *l, const void *element)
GWEN_List_new
GWENHYWFAR_API GWEN_LIST * GWEN_List_new(void)
GWEN_ListIterator_free
GWENHYWFAR_API void GWEN_ListIterator_free(GWEN_LIST_ITERATOR *li)
GWEN_ListIterator_Data
GWENHYWFAR_API void * GWEN_ListIterator_Data(GWEN_LIST_ITERATOR *li)
GWEN_CONSTLIST_ITERATOR
struct GWEN_LIST_ITERATOR GWEN_CONSTLIST_ITERATOR
Definition list.h:76
GWEN_List_GetFrontRefPtr
GWENHYWFAR_API GWEN_REFPTR * GWEN_List_GetFrontRefPtr(const GWEN_LIST *l)
GWEN_LIST_FOREACH_CB
void *(* GWEN_LIST_FOREACH_CB)(void *element, void *user_data)
Definition list.h:58
GWEN_ListIterator_GetLinkCount
GWENHYWFAR_API unsigned int GWEN_ListIterator_GetLinkCount(const GWEN_LIST_ITERATOR *li)
GWEN_ListIterator_IncLinkCount
GWENHYWFAR_API void GWEN_ListIterator_IncLinkCount(GWEN_LIST_ITERATOR *li)
GWEN_List_PushBack
GWENHYWFAR_API void GWEN_List_PushBack(GWEN_LIST *l, void *p)
GWEN_List_Contains
GWENHYWFAR_API const void * GWEN_List_Contains(GWEN_LIST *l, const void *element)
GWEN_List_PushFrontRefPtr
GWENHYWFAR_API void GWEN_List_PushFrontRefPtr(GWEN_LIST *l, GWEN_REFPTR *rp)
GWEN_ConstList_Remove
GWENHYWFAR_API void GWEN_ConstList_Remove(GWEN_CONSTLIST *l, const void *element)
GWEN_ConstListIterator_new
GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR * GWEN_ConstListIterator_new(const GWEN_CONSTLIST *l)
GWEN_ConstList_First
GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR * GWEN_ConstList_First(const GWEN_CONSTLIST *l)
GWEN_ConstListIterator_Data
GWENHYWFAR_API const void * GWEN_ConstListIterator_Data(GWEN_CONSTLIST_ITERATOR *li)
GWEN_List_dup
GWENHYWFAR_API GWEN_LIST * GWEN_List_dup(const GWEN_LIST *l)
GWEN_ConstList_ForEach
GWENHYWFAR_API const void * GWEN_ConstList_ForEach(GWEN_CONSTLIST *list, GWEN_CONSTLIST_FOREACH_CB func, void *user_data)
GWEN_ConstList_free
GWENHYWFAR_API void GWEN_ConstList_free(GWEN_CONSTLIST *l)
GWEN_List_IsEmpty
GWENHYWFAR_API int GWEN_List_IsEmpty(const GWEN_LIST *l)
GWEN_ConstList_PopFront
GWENHYWFAR_API void GWEN_ConstList_PopFront(GWEN_CONSTLIST *l)
GWEN_List_GetBack
GWENHYWFAR_API void * GWEN_List_GetBack(const GWEN_LIST *l)
GWEN_List_ForEach
GWENHYWFAR_API void * GWEN_List_ForEach(GWEN_LIST *list, GWEN_LIST_FOREACH_CB func, void *user_data)
GWEN_ListIterator_Previous
GWENHYWFAR_API void * GWEN_ListIterator_Previous(GWEN_LIST_ITERATOR *li)
GWEN_List_First
GWENHYWFAR_API GWEN_LIST_ITERATOR * GWEN_List_First(const GWEN_LIST *l)
GWEN_ConstListIterator_Previous
GWENHYWFAR_API const void * GWEN_ConstListIterator_Previous(GWEN_CONSTLIST_ITERATOR *li)
GWEN_ConstList_Last
GWENHYWFAR_API GWEN_CONSTLIST_ITERATOR * GWEN_ConstList_Last(const GWEN_CONSTLIST *l)
GWEN_List_PopFront
GWENHYWFAR_API void GWEN_List_PopFront(GWEN_LIST *l)
GWEN_ConstList_PushFront
GWENHYWFAR_API void GWEN_ConstList_PushFront(GWEN_CONSTLIST *l, const void *p)
GWEN_List_GetSize
GWENHYWFAR_API unsigned int GWEN_List_GetSize(const GWEN_LIST *l)
GWEN_ConstList_Erase
GWENHYWFAR_API void GWEN_ConstList_Erase(GWEN_CONSTLIST *l, GWEN_CONSTLIST_ITERATOR *it)
refptr.h
GWEN_REFPTR_INFO
struct GWEN_REFPTR_INFO GWEN_REFPTR_INFO
Definition refptr.h:44
GWEN_REFPTR
struct GWEN_REFPTR GWEN_REFPTR
Definition refptr.h:45