source: vendor/current/source3/lib/gencache.h

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 1.9 KB
Line 
1/*
2 * Unix SMB/CIFS implementation.
3 *
4 * Generic, persistent and shared between processes cache mechanism for use
5 * by various parts of the Samba code
6 *
7 * Copyright (C) Rafal Szczesniak 2002
8 * Copyright (C) Volker Lendecke 2009
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#ifndef __LIB_GENCACHE_H__
25#define __LIB_GENCACHE_H__
26
27#include "replace.h"
28#include "system/time.h"
29#include "lib/util/data_blob.h"
30
31bool gencache_set(const char *keystr, const char *value, time_t timeout);
32bool gencache_del(const char *keystr);
33bool gencache_get(const char *keystr, TALLOC_CTX *mem_ctx, char **value,
34 time_t *ptimeout);
35bool gencache_parse(const char *keystr,
36 void (*parser)(time_t timeout, DATA_BLOB blob,
37 void *private_data),
38 void *private_data);
39bool gencache_get_data_blob(const char *keystr, TALLOC_CTX *mem_ctx,
40 DATA_BLOB *blob,
41 time_t *timeout, bool *was_expired);
42bool gencache_stabilize(void);
43bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob,
44 time_t timeout);
45void gencache_iterate_blobs(void (*fn)(const char *key, DATA_BLOB value,
46 time_t timeout, void *private_data),
47 void *private_data, const char *pattern);
48void gencache_iterate(void (*fn)(const char* key, const char *value,
49 time_t timeout, void* dptr),
50 void* data, const char* keystr_pattern);
51
52#endif
Note: See TracBrowser for help on using the repository browser.