2 Unix SMB/CIFS implementation.
6 Copyright (C) Rusty Russell 2012
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef _____LIB_UTIL_UTIL_NTDB_H__
23 #define _____LIB_UTIL_UTIL_NTDB_H__
27 struct loadparm_context;
31 /* You only need this on databases with NTDB_CLEAR_IF_FIRST */
32 int ntdb_reopen(struct ntdb_context *ntdb);
34 /* You only need to do this if you have NTDB_CLEAR_IF_FIRST databases, and
35 * the parent will go away before this child. */
36 int ntdb_reopen_all(void);
39 * This is like TDB_CLEAR_IF_FIRST, for use with ntdb_new.
41 * It's a bad idea for new code.
43 #define NTDB_CLEAR_IF_FIRST 1048576
45 /***************************************************************
46 Open an NTDB using talloc: it will be allocated off the context, and
47 all NTDB_DATA.dptr are allocated as children of the ntdb context.
48 Sets up a logging function for you, and uses lp_ctx to decide whether
51 Any extra ntdb attributes can be handed through attr; usually it's
52 NULL, ntdb_new provides logging and allocator attributes.
54 The destructor for the struct ntdb_context will do ntdb_close()
56 ****************************************************************/
57 struct ntdb_context *ntdb_new(TALLOC_CTX *ctx,
58 const char *name, int ntdb_flags,
59 int open_flags, mode_t mode,
60 union ntdb_attribute *attr,
61 struct loadparm_context *lp_ctx);
62 #endif /* _____LIB_UTIL_UTIL_NTDB_H__ */