Whamcloud - gitweb
tune2fs: allow tune2fs to be built as a static library for Android
[tools/e2fsprogs.git] / lib / ext2fs / tdb.h
index 7ba7ac7..6a4086c 100644 (file)
@@ -1,17 +1,17 @@
 #ifndef __TDB_H__
 #define __TDB_H__
 
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    trivial database library
 
    Copyright (C) Andrew Tridgell 1999-2004
-   
+
      ** NOTE! The following LGPL license applies to the tdb
      ** library. This does NOT imply that all of Samba is released
      ** under the LGPL
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
@@ -51,12 +51,12 @@ extern "C" {
 #define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
 
 /* error codes */
-enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK, 
+enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
                TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
                TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY};
 
 /* debugging uses one of the following levels */
-enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR, 
+enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR,
                      TDB_DEBUG_WARNING, TDB_DEBUG_TRACE};
 
 typedef struct TDB_DATA {
@@ -119,7 +119,17 @@ typedef struct TDB_DATA {
 #define tdb_dump_all ext2fs_tdb_dump_all
 #define tdb_printfreelist ext2fs_tdb_printfreelist
 #define tdb_validate_freelist ext2fs_tdb_validate_freelist
-
+#define tdb_chainlock_mark ext2fs_tdb_chainlock_mark
+#define tdb_chainlock_nonblock ext2fs_tdb_chainlock_nonblock
+#define tdb_chainlock_unmark ext2fs_tdb_chainlock_unmark
+#define tdb_enable_seqnum ext2fs_tdb_enable_seqnum
+#define tdb_increment_seqnum_nonblock ext2fs_tdb_increment_seqnum_nonblock
+#define tdb_lock_nonblock ext2fs_tdb_lock_nonblock
+#define tdb_lockall_mark ext2fs_tdb_lockall_mark
+#define tdb_lockall_nonblock ext2fs_tdb_lockall_nonblock
+#define tdb_lockall_read_nonblock ext2fs_tdb_lockall_read_nonblock
+#define tdb_lockall_unmark ext2fs_tdb_lockall_unmark
+#define tdb_flush ext2fs_tdb_flush
 
 /* this is the context structure that is returned from a db open */
 typedef struct tdb_context TDB_CONTEXT;
@@ -161,9 +171,13 @@ int tdb_traverse(struct tdb_context *tdb, tdb_traverse_func fn, void *);
 int tdb_traverse_read(struct tdb_context *tdb, tdb_traverse_func fn, void *);
 int tdb_exists(struct tdb_context *tdb, TDB_DATA key);
 int tdb_lockall(struct tdb_context *tdb);
+int tdb_lockall_nonblock(struct tdb_context *tdb);
 int tdb_unlockall(struct tdb_context *tdb);
 int tdb_lockall_read(struct tdb_context *tdb);
+int tdb_lockall_read_nonblock(struct tdb_context *tdb);
 int tdb_unlockall_read(struct tdb_context *tdb);
+int tdb_lockall_mark(struct tdb_context *tdb);
+int tdb_lockall_unmark(struct tdb_context *tdb);
 const char *tdb_name(struct tdb_context *tdb);
 int tdb_fd(struct tdb_context *tdb);
 tdb_log_func tdb_log_fn(struct tdb_context *tdb);
@@ -176,20 +190,24 @@ int tdb_get_seqnum(struct tdb_context *tdb);
 int tdb_hash_size(struct tdb_context *tdb);
 size_t tdb_map_size(struct tdb_context *tdb);
 int tdb_get_flags(struct tdb_context *tdb);
+void tdb_enable_seqnum(struct tdb_context *tdb);
+void tdb_increment_seqnum_nonblock(struct tdb_context *tdb);
+int tdb_flush(struct tdb_context *tdb);
 
 /* Low level locking functions: use with care */
 int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key);
 int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key);
 int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key);
 int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key);
 
 /* Debug functions. Not used in production. */
 void tdb_dump_all(struct tdb_context *tdb);
 int tdb_printfreelist(struct tdb_context *tdb);
 int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries);
 
-extern TDB_DATA tdb_null;
-
 #ifdef  __cplusplus
 }
 #endif