2 Unix SMB/CIFS implementation.
4 Compatibility layer for TDB1 vs TDB2.
6 Copyright (C) Rusty Russell 2011
8 ** NOTE! The following LGPL license applies to the tdb_compat
9 ** library. This does NOT imply that all of Samba is released
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Lesser General Public
14 License as published by the Free Software Foundation; either
15 version 3 of the License, or (at your option) any later version.
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public
23 License along with this library; if not, see <http://www.gnu.org/licenses/>.
29 #include <ccan/typesafe_cb/typesafe_cb.h>
32 /* FIXME: Inlining this is a bit lazy, but eases S3 build. */
33 static inline struct tdb_context
*
34 tdb_open_compat(const char *name
, int hash_size
,
35 int tdb_flags
, int open_flags
, mode_t mode
,
36 tdb_log_func log_fn
, void *log_private
)
38 struct tdb_logging_context lctx
;
40 lctx
.log_private
= log_private
;
43 return tdb_open_ex(name
, hash_size
, tdb_flags
, open_flags
,
46 return tdb_open(name
, hash_size
, tdb_flags
, open_flags
, mode
);
49 #define tdb_firstkey_compat tdb_firstkey
50 /* Note: this frees the old key.dptr. */
51 static inline TDB_DATA
tdb_nextkey_compat(struct tdb_context
*tdb
, TDB_DATA k
)
53 TDB_DATA next
= tdb_nextkey(tdb
, k
);
57 #define tdb_errorstr_compat(tdb) tdb_errorstr(tdb)
58 #define tdb_fetch_compat tdb_fetch
60 #endif /* TDB_COMPAT_H */