memcache.h
Go to the documentation of this file.
/***************************************************************************
begin : Mon Jul 14 2008
copyright : (C) 2008 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_MEMCACHE_H
#define GWENHYWFAR_MEMCACHE_H
#include <gwenhywfar/gwenhywfarapi.h>
#include <time.h>
#include <inttypes.h>
typedef struct GWEN_MEMCACHE_ENTRY GWEN_MEMCACHE_ENTRY;
typedef struct GWEN_MEMCACHE GWEN_MEMCACHE;
GWENHYWFAR_API
void GWEN_MemCacheEntry_free(GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
uint32_t GWEN_MemCacheEntry_GetId(GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
void *GWEN_MemCacheEntry_GetDataPtr(GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
size_t GWEN_MemCacheEntry_GetDataLen(GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
int GWEN_MemCacheEntry_GetIsValid(const GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
void GWEN_MemCacheEntry_BeginUse(GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
void GWEN_MemCacheEntry_EndUse(GWEN_MEMCACHE_ENTRY *me);
GWENHYWFAR_API
GWEN_MEMCACHE *GWEN_MemCache_new(size_t maxCacheMemory,
uint32_t maxCacheEntries);
GWENHYWFAR_API
void GWEN_MemCache_free(GWEN_MEMCACHE *mc);
GWENHYWFAR_API
GWEN_MEMCACHE_ENTRY *GWEN_MemCache_FindEntry(GWEN_MEMCACHE *mc,
uint32_t id);
GWENHYWFAR_API
GWEN_MEMCACHE_ENTRY *GWEN_MemCache_CreateEntry(GWEN_MEMCACHE *mc,
uint32_t id,
void *dataPtr,
size_t dataLen);
GWENHYWFAR_API
void GWEN_MemCache_PurgeEntry(GWEN_MEMCACHE *mc,
uint32_t id);
GWENHYWFAR_API
void GWEN_MemCache_PurgeEntries(GWEN_MEMCACHE *mc,
uint32_t id, uint32_t mask);
GWENHYWFAR_API
void GWEN_MemCache_Purge(GWEN_MEMCACHE *mc);
#endif
gwenhywfarapi.h
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_MemCache_PurgeEntry
GWENHYWFAR_API void GWEN_MemCache_PurgeEntry(GWEN_MEMCACHE *mc, uint32_t id)
GWEN_MemCache_CreateEntry
GWENHYWFAR_API GWEN_MEMCACHE_ENTRY * GWEN_MemCache_CreateEntry(GWEN_MEMCACHE *mc, uint32_t id, void *dataPtr, size_t dataLen)
GWEN_MEMCACHE_ENTRY
struct GWEN_MEMCACHE_ENTRY GWEN_MEMCACHE_ENTRY
Definition memcache.h:36
GWEN_MemCacheEntry_free
GWENHYWFAR_API void GWEN_MemCacheEntry_free(GWEN_MEMCACHE_ENTRY *me)
GWEN_MemCacheEntry_GetDataLen
GWENHYWFAR_API size_t GWEN_MemCacheEntry_GetDataLen(GWEN_MEMCACHE_ENTRY *me)
GWEN_MemCache_new
GWENHYWFAR_API GWEN_MEMCACHE * GWEN_MemCache_new(size_t maxCacheMemory, uint32_t maxCacheEntries)
GWEN_MemCache_free
GWENHYWFAR_API void GWEN_MemCache_free(GWEN_MEMCACHE *mc)
GWEN_MemCacheEntry_GetIsValid
GWENHYWFAR_API int GWEN_MemCacheEntry_GetIsValid(const GWEN_MEMCACHE_ENTRY *me)
GWEN_MemCacheEntry_EndUse
GWENHYWFAR_API void GWEN_MemCacheEntry_EndUse(GWEN_MEMCACHE_ENTRY *me)
GWEN_MemCache_PurgeEntries
GWENHYWFAR_API void GWEN_MemCache_PurgeEntries(GWEN_MEMCACHE *mc, uint32_t id, uint32_t mask)
GWEN_MemCacheEntry_GetId
GWENHYWFAR_API uint32_t GWEN_MemCacheEntry_GetId(GWEN_MEMCACHE_ENTRY *me)
GWEN_MemCacheEntry_GetDataPtr
GWENHYWFAR_API void * GWEN_MemCacheEntry_GetDataPtr(GWEN_MEMCACHE_ENTRY *me)
GWEN_MemCache_FindEntry
GWENHYWFAR_API GWEN_MEMCACHE_ENTRY * GWEN_MemCache_FindEntry(GWEN_MEMCACHE *mc, uint32_t id)
GWEN_MemCache_Purge
GWENHYWFAR_API void GWEN_MemCache_Purge(GWEN_MEMCACHE *mc)
GWEN_MemCacheEntry_BeginUse
GWENHYWFAR_API void GWEN_MemCacheEntry_BeginUse(GWEN_MEMCACHE_ENTRY *me)
GWEN_MEMCACHE
struct GWEN_MEMCACHE GWEN_MEMCACHE
Definition memcache.h:38