2 Unix SMB/CIFS implementation.
4 Copyright (C) Andrew Tridgell 1999
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/>.
25 #include <talloc.h> /* for tdb_wrap_open() */
26 #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */
27 #include "../../lib/util/util_tdb.h"
30 * The tdb_unpack() and tdb_pack[_append]() helpers are deprecated. Consider
31 * using idl/ndr for marshalling of complex data types instead.
33 int tdb_unpack(const uint8_t *buf
, int bufsize
, const char *fmt
, ...);
34 size_t tdb_pack(uint8_t *buf
, int bufsize
, const char *fmt
, ...);
36 struct tdb_context
*tdb_open_log(const char *name
, int hash_size
,
37 int tdb_flags
, int open_flags
, mode_t mode
);
39 NTSTATUS
map_nt_error_from_tdb(enum TDB_ERROR err
);
41 int tdb_data_cmp(TDB_DATA t1
, TDB_DATA t2
);
43 char *tdb_data_string(TALLOC_CTX
*mem_ctx
, TDB_DATA d
);
44 char *tdb_data_dbg(TDB_DATA d
);
46 /****************************************************************************
47 Lock a chain, with timeout.
48 ****************************************************************************/
49 int tdb_chainlock_with_timeout( struct tdb_context
*tdb
, TDB_DATA key
,
50 unsigned int timeout
);
52 /****************************************************************************
53 Lock a chain by string, with timeout Return non-zero if lock failed.
54 ****************************************************************************/
55 int tdb_lock_bystring_with_timeout(struct tdb_context
*tdb
, const char *keyval
,
58 /****************************************************************************
59 Readlock a chain by string, with timeout Return non-zero if lock failed.
60 ****************************************************************************/
61 int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT
*tdb
, const char *keyval
,
62 unsigned int timeout
);
65 #endif /* __TDBUTIL_H__ */