1 /*************************************************************************** 2 begin : Fri Dec 06 2019 3 copyright : (C) 2019 by Martin Preuss 4 email : martin@libchipcard.de 5 6 *************************************************************************** 7 * * 8 * This library is free software; you can redistribute it and/or * 9 * modify it under the terms of the GNU Lesser General Public * 10 * License as published by the Free Software Foundation; either * 11 * version 2.1 of the License, or (at your option) any later version. * 12 * * 13 * This library is distributed in the hope that it will be useful, * 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 16 * Lesser General Public License for more details. * 17 * * 18 * You should have received a copy of the GNU Lesser General Public * 19 * License along with this library; if not, write to the Free Software * 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 21 * MA 02111-1307 USA * 22 * * 23 ***************************************************************************/ 24 25 #ifndef GWENHYWFAR_SIMPLEPTRLIST_P_H 26 #define GWENHYWFAR_SIMPLEPTRLIST_P_H 27 28 #include <gwenhywfar/simpleptrlist.h> 29 #include <gwenhywfar/types.h> 30 #include <gwenhywfar/misc.h> 31 32 33 #define GWEN_SIMPLEPTRLIST_FLAGS_COPYONWRITE 0x80000000L 34 35 36 typedef struct INTERNAL_PTRLIST INTERNAL_PTRLIST; 37 struct INTERNAL_PTRLIST { 38 int refCounter; 39 uint64_t storedEntries; 40 void *entries[0]; 41 }; 42 43 44 45 struct GWEN_SIMPLEPTRLIST { 46 GWEN_INHERIT_ELEMENT(GWEN_SIMPLEPTRLIST) 47 48 uint64_t maxEntries; 49 uint64_t usedEntries; 50 uint64_t steps; 51 uint32_t flags; 52 uint32_t refCount; 53 int userIntData; 54 uint64_t userCounter; 55 INTERNAL_PTRLIST *entryList; 56 57 GWEN_SIMPLEPTRLIST_ATTACHOBJECT_FN attachObjectFn; 58 GWEN_SIMPLEPTRLIST_FREEOBJECT_FN freeObjectFn; 59 }; 60 61 62 63 #endif /* GWENHYWFAR_SIMPLEPTRLIST_P_H */ 64 65