simpleptrlist.h
Go to the documentation of this file.
/***************************************************************************
begin : Fri Dec 06 2019
copyright : (C) 2019 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_SIMPLEPTRLIST_H
#define GWENHYWFAR_SIMPLEPTRLIST_H
#include <gwenhywfar/types.h>
#include <gwenhywfar/inherit.h>
#define GWEN_SIMPLEPTRLIST_FLAGS_ATTACHTOOBJECTS 0x40000000L
#define GWEN_SIMPLEPTRLIST_FLAGS_DETACHFROMOBJECTS 0x20000000L
typedef struct GWEN_SIMPLEPTRLIST GWEN_SIMPLEPTRLIST;
GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_SIMPLEPTRLIST, GWENHYWFAR_API)
typedef GWENHYWFAR_CB void (*GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN)(GWEN_SIMPLEPTRLIST *pl, void *p);
typedef GWENHYWFAR_CB void (*GWEN_SIMPLEPTRLIST_FREEOBJECT_FN)(GWEN_SIMPLEPTRLIST *pl, void *p);
GWENHYWFAR_API GWEN_SIMPLEPTRLIST *GWEN_SimplePtrList_new(uint64_t startEntries, uint64_t steps);
GWENHYWFAR_API void GWEN_SimplePtrList_Attach(GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API void GWEN_SimplePtrList_free(GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API void GWEN_SimplePtrList_Clear(GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API GWEN_SIMPLEPTRLIST *GWEN_SimplePtrList_LazyCopy(GWEN_SIMPLEPTRLIST *oldList);
GWENHYWFAR_API void *GWEN_SimplePtrList_GetPtrAt(const GWEN_SIMPLEPTRLIST *pl, uint64_t idx);
GWENHYWFAR_API int GWEN_SimplePtrList_SetPtrAt(GWEN_SIMPLEPTRLIST *pl, uint64_t idx, void *p);
GWENHYWFAR_API int64_t GWEN_SimplePtrList_AddPtr(GWEN_SIMPLEPTRLIST *pl, void *p);
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetSteps(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API void GWEN_SimplePtrList_SetSteps(GWEN_SIMPLEPTRLIST *pl, uint64_t steps);
GWENHYWFAR_API uint32_t GWEN_SimplePtrList_GetFlags(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API void GWEN_SimplePtrList_SetFlags(GWEN_SIMPLEPTRLIST *pl, uint32_t f);
GWENHYWFAR_API void GWEN_SimplePtrList_AddFlags(GWEN_SIMPLEPTRLIST *pl, uint32_t f);
GWENHYWFAR_API void GWEN_SimplePtrList_SubFlags(GWEN_SIMPLEPTRLIST *pl, uint32_t f);
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetMaxEntries(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetUsedEntries(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API void *GWEN_SimplePtrList_GetEntries(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API int GWEN_SimplePtrList_EnsureWritability(GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API
GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN GWEN_SimplePtrList_SetAttachObjectFn(GWEN_SIMPLEPTRLIST *pl,
GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN fn);
GWENHYWFAR_API
GWEN_SIMPLEPTRLIST_FREEOBJECT_FN GWEN_SimplePtrList_SetFreeObjectFn(GWEN_SIMPLEPTRLIST *pl,
GWEN_SIMPLEPTRLIST_FREEOBJECT_FN fn);
GWENHYWFAR_API
int GWEN_SimplePtrList_GetUserIntData(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API
void GWEN_SimplePtrList_SetUserIntData(GWEN_SIMPLEPTRLIST *pl, int i);
GWENHYWFAR_API void GWEN_SimplePtrList_SetUserCounter(GWEN_SIMPLEPTRLIST *pl, uint64_t i);
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetUserCounter(const GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API void GWEN_SimplePtrList_IncUserCounter(GWEN_SIMPLEPTRLIST *pl);
GWENHYWFAR_API int GWEN_SimplePtrList_DecUserCounter(GWEN_SIMPLEPTRLIST *pl);
#endif /* GWENHYWFAR_SIMPLEPTRLIST_P_H */
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWENHYWFAR_CB
#define GWENHYWFAR_CB
Definition gwenhywfarapi.h:89
inherit.h
GWEN_INHERIT_FUNCTION_LIB_DEFS
#define GWEN_INHERIT_FUNCTION_LIB_DEFS(t, decl)
Definition inherit.h:125
GWEN_SimplePtrList_SetSteps
GWENHYWFAR_API void GWEN_SimplePtrList_SetSteps(GWEN_SIMPLEPTRLIST *pl, uint64_t steps)
GWEN_SimplePtrList_DecUserCounter
GWENHYWFAR_API int GWEN_SimplePtrList_DecUserCounter(GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_AddFlags
GWENHYWFAR_API void GWEN_SimplePtrList_AddFlags(GWEN_SIMPLEPTRLIST *pl, uint32_t f)
GWEN_SimplePtrList_free
GWENHYWFAR_API void GWEN_SimplePtrList_free(GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_IncUserCounter
GWENHYWFAR_API void GWEN_SimplePtrList_IncUserCounter(GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_SetAttachObjectFn
GWENHYWFAR_API GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN GWEN_SimplePtrList_SetAttachObjectFn(GWEN_SIMPLEPTRLIST *pl, GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN fn)
GWEN_SimplePtrList_SetUserIntData
GWENHYWFAR_API void GWEN_SimplePtrList_SetUserIntData(GWEN_SIMPLEPTRLIST *pl, int i)
GWEN_SimplePtrList_AddPtr
GWENHYWFAR_API int64_t GWEN_SimplePtrList_AddPtr(GWEN_SIMPLEPTRLIST *pl, void *p)
GWEN_SimplePtrList_new
GWENHYWFAR_API GWEN_SIMPLEPTRLIST * GWEN_SimplePtrList_new(uint64_t startEntries, uint64_t steps)
GWEN_SimplePtrList_SetUserCounter
GWENHYWFAR_API void GWEN_SimplePtrList_SetUserCounter(GWEN_SIMPLEPTRLIST *pl, uint64_t i)
GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN
GWENHYWFAR_CB void(* GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN)(GWEN_SIMPLEPTRLIST *pl, void *p)
Definition simpleptrlist.h:43
GWEN_SimplePtrList_GetEntries
GWENHYWFAR_API void * GWEN_SimplePtrList_GetEntries(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_GetPtrAt
GWENHYWFAR_API void * GWEN_SimplePtrList_GetPtrAt(const GWEN_SIMPLEPTRLIST *pl, uint64_t idx)
GWEN_SimplePtrList_SubFlags
GWENHYWFAR_API void GWEN_SimplePtrList_SubFlags(GWEN_SIMPLEPTRLIST *pl, uint32_t f)
GWEN_SimplePtrList_GetSteps
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetSteps(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SIMPLEPTRLIST
struct GWEN_SIMPLEPTRLIST GWEN_SIMPLEPTRLIST
Definition simpleptrlist.h:38
GWEN_SimplePtrList_SetPtrAt
GWENHYWFAR_API int GWEN_SimplePtrList_SetPtrAt(GWEN_SIMPLEPTRLIST *pl, uint64_t idx, void *p)
GWEN_SimplePtrList_SetFreeObjectFn
GWENHYWFAR_API GWEN_SIMPLEPTRLIST_FREEOBJECT_FN GWEN_SimplePtrList_SetFreeObjectFn(GWEN_SIMPLEPTRLIST *pl, GWEN_SIMPLEPTRLIST_FREEOBJECT_FN fn)
GWEN_SimplePtrList_GetUsedEntries
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetUsedEntries(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_Attach
GWENHYWFAR_API void GWEN_SimplePtrList_Attach(GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_Clear
GWENHYWFAR_API void GWEN_SimplePtrList_Clear(GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_GetUserCounter
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetUserCounter(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_GetUserIntData
GWENHYWFAR_API int GWEN_SimplePtrList_GetUserIntData(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_SetFlags
GWENHYWFAR_API void GWEN_SimplePtrList_SetFlags(GWEN_SIMPLEPTRLIST *pl, uint32_t f)
GWEN_SimplePtrList_GetFlags
GWENHYWFAR_API uint32_t GWEN_SimplePtrList_GetFlags(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_GetMaxEntries
GWENHYWFAR_API uint64_t GWEN_SimplePtrList_GetMaxEntries(const GWEN_SIMPLEPTRLIST *pl)
GWEN_SIMPLEPTRLIST_FREEOBJECT_FN
GWENHYWFAR_CB void(* GWEN_SIMPLEPTRLIST_FREEOBJECT_FN)(GWEN_SIMPLEPTRLIST *pl, void *p)
Definition simpleptrlist.h:44
GWEN_SimplePtrList_EnsureWritability
GWENHYWFAR_API int GWEN_SimplePtrList_EnsureWritability(GWEN_SIMPLEPTRLIST *pl)
GWEN_SimplePtrList_LazyCopy
GWENHYWFAR_API GWEN_SIMPLEPTRLIST * GWEN_SimplePtrList_LazyCopy(GWEN_SIMPLEPTRLIST *oldList)
types.h