summaryrefslogtreecommitdiff
path: root/dependencies/uthash/tests/lru_cache/cache.h
blob: 350576d4fb88b5fd90d1aab965f545239c4fb272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * =====================================================================================
 *
 *       Filename:  cache.h
 *
 *    Description:  A simple cache
 *
 *        Version:  1.0
 *        Created:  04/11/2013 02:30:46 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Oliver Lorenz (ol), olli@olorenz.org
 *        Company:  https://olorenz.org
 *        License:  This is licensed under the same terms as uthash itself
 *
 * =====================================================================================
 */

#ifndef _CACHE_
#define _CACHE_

struct foo_cache;

extern int foo_cache_create(struct foo_cache **dst, const size_t capacity,
			    void (*free_cb) (void *element));
extern int foo_cache_delete(struct foo_cache *cache, int keep_data);
extern int foo_cache_lookup(struct foo_cache *cache, char *key, void *result);
extern int foo_cache_insert(struct foo_cache *cache, char *key, void *data);

#endif