2 Unix SMB/CIFS implementation.
4 Copyright (C) Volker Lendecke 2005-2007
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __MEMCACHE_H__
21 #define __MEMCACHE_H__
27 enum memcache_number {
34 GETPWNAM_CACHE, /* talloc */
38 struct memcache *memcache_init(TALLOC_CTX *mem_ctx, size_t max_size);
40 void memcache_set_global(struct memcache *cache);
42 void memcache_add(struct memcache *cache, enum memcache_number n,
43 DATA_BLOB key, DATA_BLOB value);
45 void memcache_add_talloc(struct memcache *cache, enum memcache_number n,
46 DATA_BLOB key, void *ptr);
48 void memcache_delete(struct memcache *cache, enum memcache_number n,
51 bool memcache_lookup(struct memcache *cache, enum memcache_number n,
52 DATA_BLOB key, DATA_BLOB *value);
54 void *memcache_lookup_talloc(struct memcache *cache, enum memcache_number n,
57 void memcache_flush(struct memcache *cache, enum memcache_number n);