Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/ext2fs
File: tdb.h
#ifndef __TDB_H__
[0] Fix | Delete
#define __TDB_H__
[1] Fix | Delete
[2] Fix | Delete
/*
[3] Fix | Delete
Unix SMB/CIFS implementation.
[4] Fix | Delete
[5] Fix | Delete
trivial database library
[6] Fix | Delete
[7] Fix | Delete
Copyright (C) Andrew Tridgell 1999-2004
[8] Fix | Delete
[9] Fix | Delete
** NOTE! The following LGPL license applies to the tdb
[10] Fix | Delete
** library. This does NOT imply that all of Samba is released
[11] Fix | Delete
** under the LGPL
[12] Fix | Delete
[13] Fix | Delete
This library is free software; you can redistribute it and/or
[14] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[15] Fix | Delete
License as published by the Free Software Foundation; either
[16] Fix | Delete
version 2 of the License, or (at your option) any later version.
[17] Fix | Delete
[18] Fix | Delete
This library is distributed in the hope that it will be useful,
[19] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[20] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[21] Fix | Delete
Lesser General Public License for more details.
[22] Fix | Delete
[23] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[24] Fix | Delete
License along with this library; if not, write to the Free Software
[25] Fix | Delete
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
[26] Fix | Delete
*/
[27] Fix | Delete
[28] Fix | Delete
#ifdef __cplusplus
[29] Fix | Delete
extern "C" {
[30] Fix | Delete
#endif
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
/* flags to tdb_store() */
[34] Fix | Delete
#define TDB_REPLACE 1
[35] Fix | Delete
#define TDB_INSERT 2
[36] Fix | Delete
#define TDB_MODIFY 3
[37] Fix | Delete
[38] Fix | Delete
/* flags for tdb_open() */
[39] Fix | Delete
#define TDB_DEFAULT 0 /* just a readability place holder */
[40] Fix | Delete
#define TDB_CLEAR_IF_FIRST 1
[41] Fix | Delete
#define TDB_INTERNAL 2 /* don't store on disk */
[42] Fix | Delete
#define TDB_NOLOCK 4 /* don't do any locking */
[43] Fix | Delete
#define TDB_NOMMAP 8 /* don't use mmap */
[44] Fix | Delete
#define TDB_CONVERT 16 /* convert endian (internal use) */
[45] Fix | Delete
#define TDB_BIGENDIAN 32 /* header is big-endian (internal use) */
[46] Fix | Delete
#define TDB_NOSYNC 64 /* don't use synchronous transactions */
[47] Fix | Delete
#define TDB_SEQNUM 128 /* maintain a sequence number */
[48] Fix | Delete
[49] Fix | Delete
#define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
[50] Fix | Delete
[51] Fix | Delete
/* error codes */
[52] Fix | Delete
enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
[53] Fix | Delete
TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
[54] Fix | Delete
TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY};
[55] Fix | Delete
[56] Fix | Delete
/* debugging uses one of the following levels */
[57] Fix | Delete
enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR,
[58] Fix | Delete
TDB_DEBUG_WARNING, TDB_DEBUG_TRACE};
[59] Fix | Delete
[60] Fix | Delete
typedef struct TDB_DATA {
[61] Fix | Delete
unsigned char *dptr;
[62] Fix | Delete
size_t dsize;
[63] Fix | Delete
} TDB_DATA;
[64] Fix | Delete
[65] Fix | Delete
#ifndef PRINTF_ATTRIBUTE
[66] Fix | Delete
#if (__GNUC__ >= 3)
[67] Fix | Delete
/** Use gcc attribute to check printf fns. a1 is the 1-based index of
[68] Fix | Delete
* the parameter containing the format, and a2 the index of the first
[69] Fix | Delete
* argument. Note that some gcc 2.x versions don't handle this
[70] Fix | Delete
* properly **/
[71] Fix | Delete
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
[72] Fix | Delete
#else
[73] Fix | Delete
#define PRINTF_ATTRIBUTE(a1, a2)
[74] Fix | Delete
#endif
[75] Fix | Delete
#endif
[76] Fix | Delete
[77] Fix | Delete
/* ext2fs tdb renames */
[78] Fix | Delete
#define tdb_open ext2fs_tdb_open
[79] Fix | Delete
#define tdb_open_ex ext2fs_tdb_open_ex
[80] Fix | Delete
#define tdb_set_max_dead ext2fs_tdb_set_max_dead
[81] Fix | Delete
#define tdb_reopen ext2fs_tdb_reopen
[82] Fix | Delete
#define tdb_reopen_all ext2fs_tdb_reopen_all
[83] Fix | Delete
#define tdb_set_logging_function ext2fs_tdb_set_logging_function
[84] Fix | Delete
#define tdb_error ext2fs_tdb_error
[85] Fix | Delete
#define tdb_errorstr ext2fs_tdb_errorstr
[86] Fix | Delete
#define tdb_fetch ext2fs_tdb_fetch
[87] Fix | Delete
#define tdb_parse_record ext2fs_tdb_parse_record
[88] Fix | Delete
#define tdb_delete ext2fs_tdb_delete
[89] Fix | Delete
#define tdb_store ext2fs_tdb_store
[90] Fix | Delete
#define tdb_append ext2fs_tdb_append
[91] Fix | Delete
#define tdb_close ext2fs_tdb_close
[92] Fix | Delete
#define tdb_firstkey ext2fs_tdb_firstkey
[93] Fix | Delete
#define tdb_nextkey ext2fs_tdb_nextkey
[94] Fix | Delete
#define tdb_traverse ext2fs_tdb_traverse
[95] Fix | Delete
#define tdb_traverse_read ext2fs_tdb_traverse_read
[96] Fix | Delete
#define tdb_exists ext2fs_tdb_exists
[97] Fix | Delete
#define tdb_lockall ext2fs_tdb_lockall
[98] Fix | Delete
#define tdb_unlockall ext2fs_tdb_unlockall
[99] Fix | Delete
#define tdb_lockall_read ext2fs_tdb_lockall_read
[100] Fix | Delete
#define tdb_unlockall_read ext2fs_tdb_unlockall_read
[101] Fix | Delete
#define tdb_name ext2fs_tdb_name
[102] Fix | Delete
#define tdb_fd ext2fs_tdb_fd
[103] Fix | Delete
#define tdb_log_fn ext2fs_tdb_log_fn
[104] Fix | Delete
#define tdb_get_logging_private ext2fs_tdb_get_logging_private
[105] Fix | Delete
#define tdb_transaction_start ext2fs_tdb_transaction_start
[106] Fix | Delete
#define tdb_transaction_commit ext2fs_tdb_transaction_commit
[107] Fix | Delete
#define tdb_transaction_cancel ext2fs_tdb_transaction_cancel
[108] Fix | Delete
#define tdb_transaction_recover ext2fs_tdb_transaction_recover
[109] Fix | Delete
#define tdb_get_seqnum ext2fs_tdb_get_seqnum
[110] Fix | Delete
#define tdb_hash_size ext2fs_tdb_hash_size
[111] Fix | Delete
#define tdb_map_size ext2fs_tdb_map_size
[112] Fix | Delete
#define tdb_get_flags ext2fs_tdb_get_flags
[113] Fix | Delete
#define tdb_chainlock ext2fs_tdb_chainlock
[114] Fix | Delete
#define tdb_chainunlock ext2fs_tdb_chainunlock
[115] Fix | Delete
#define tdb_chainlock_read ext2fs_tdb_chainlock_read
[116] Fix | Delete
#define tdb_chainunlock_read ext2fs_tdb_chainunlock_read
[117] Fix | Delete
#define tdb_dump_all ext2fs_tdb_dump_all
[118] Fix | Delete
#define tdb_printfreelist ext2fs_tdb_printfreelist
[119] Fix | Delete
#define tdb_validate_freelist ext2fs_tdb_validate_freelist
[120] Fix | Delete
#define tdb_chainlock_mark ext2fs_tdb_chainlock_mark
[121] Fix | Delete
#define tdb_chainlock_nonblock ext2fs_tdb_chainlock_nonblock
[122] Fix | Delete
#define tdb_chainlock_unmark ext2fs_tdb_chainlock_unmark
[123] Fix | Delete
#define tdb_enable_seqnum ext2fs_tdb_enable_seqnum
[124] Fix | Delete
#define tdb_increment_seqnum_nonblock ext2fs_tdb_increment_seqnum_nonblock
[125] Fix | Delete
#define tdb_lock_nonblock ext2fs_tdb_lock_nonblock
[126] Fix | Delete
#define tdb_lockall_mark ext2fs_tdb_lockall_mark
[127] Fix | Delete
#define tdb_lockall_nonblock ext2fs_tdb_lockall_nonblock
[128] Fix | Delete
#define tdb_lockall_read_nonblock ext2fs_tdb_lockall_read_nonblock
[129] Fix | Delete
#define tdb_lockall_unmark ext2fs_tdb_lockall_unmark
[130] Fix | Delete
#define tdb_flush ext2fs_tdb_flush
[131] Fix | Delete
[132] Fix | Delete
/* this is the context structure that is returned from a db open */
[133] Fix | Delete
typedef struct tdb_context TDB_CONTEXT;
[134] Fix | Delete
[135] Fix | Delete
typedef int (*tdb_traverse_func)(struct tdb_context *, TDB_DATA, TDB_DATA, void *);
[136] Fix | Delete
typedef void (*tdb_log_func)(struct tdb_context *, enum tdb_debug_level, const char *, ...) PRINTF_ATTRIBUTE(3, 4);
[137] Fix | Delete
typedef unsigned int (*tdb_hash_func)(TDB_DATA *key);
[138] Fix | Delete
[139] Fix | Delete
struct tdb_logging_context {
[140] Fix | Delete
tdb_log_func log_fn;
[141] Fix | Delete
void *log_private;
[142] Fix | Delete
};
[143] Fix | Delete
[144] Fix | Delete
struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags,
[145] Fix | Delete
int open_flags, mode_t mode);
[146] Fix | Delete
struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
[147] Fix | Delete
int open_flags, mode_t mode,
[148] Fix | Delete
const struct tdb_logging_context *log_ctx,
[149] Fix | Delete
tdb_hash_func hash_fn);
[150] Fix | Delete
void tdb_set_max_dead(struct tdb_context *tdb, int max_dead);
[151] Fix | Delete
[152] Fix | Delete
int tdb_reopen(struct tdb_context *tdb);
[153] Fix | Delete
int tdb_reopen_all(int parent_longlived);
[154] Fix | Delete
void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log_ctx);
[155] Fix | Delete
enum TDB_ERROR tdb_error(struct tdb_context *tdb);
[156] Fix | Delete
const char *tdb_errorstr(struct tdb_context *tdb);
[157] Fix | Delete
TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key);
[158] Fix | Delete
int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
[159] Fix | Delete
int (*parser)(TDB_DATA key, TDB_DATA data,
[160] Fix | Delete
void *private_data),
[161] Fix | Delete
void *private_data);
[162] Fix | Delete
int tdb_delete(struct tdb_context *tdb, TDB_DATA key);
[163] Fix | Delete
int tdb_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag);
[164] Fix | Delete
int tdb_append(struct tdb_context *tdb, TDB_DATA key, TDB_DATA new_dbuf);
[165] Fix | Delete
int tdb_close(struct tdb_context *tdb);
[166] Fix | Delete
TDB_DATA tdb_firstkey(struct tdb_context *tdb);
[167] Fix | Delete
TDB_DATA tdb_nextkey(struct tdb_context *tdb, TDB_DATA key);
[168] Fix | Delete
int tdb_traverse(struct tdb_context *tdb, tdb_traverse_func fn, void *);
[169] Fix | Delete
int tdb_traverse_read(struct tdb_context *tdb, tdb_traverse_func fn, void *);
[170] Fix | Delete
int tdb_exists(struct tdb_context *tdb, TDB_DATA key);
[171] Fix | Delete
int tdb_lockall(struct tdb_context *tdb);
[172] Fix | Delete
int tdb_lockall_nonblock(struct tdb_context *tdb);
[173] Fix | Delete
int tdb_unlockall(struct tdb_context *tdb);
[174] Fix | Delete
int tdb_lockall_read(struct tdb_context *tdb);
[175] Fix | Delete
int tdb_lockall_read_nonblock(struct tdb_context *tdb);
[176] Fix | Delete
int tdb_unlockall_read(struct tdb_context *tdb);
[177] Fix | Delete
int tdb_lockall_mark(struct tdb_context *tdb);
[178] Fix | Delete
int tdb_lockall_unmark(struct tdb_context *tdb);
[179] Fix | Delete
const char *tdb_name(struct tdb_context *tdb);
[180] Fix | Delete
int tdb_fd(struct tdb_context *tdb);
[181] Fix | Delete
tdb_log_func tdb_log_fn(struct tdb_context *tdb);
[182] Fix | Delete
void *tdb_get_logging_private(struct tdb_context *tdb);
[183] Fix | Delete
int tdb_transaction_start(struct tdb_context *tdb);
[184] Fix | Delete
int tdb_transaction_commit(struct tdb_context *tdb);
[185] Fix | Delete
int tdb_transaction_cancel(struct tdb_context *tdb);
[186] Fix | Delete
int tdb_transaction_recover(struct tdb_context *tdb);
[187] Fix | Delete
int tdb_get_seqnum(struct tdb_context *tdb);
[188] Fix | Delete
int tdb_hash_size(struct tdb_context *tdb);
[189] Fix | Delete
size_t tdb_map_size(struct tdb_context *tdb);
[190] Fix | Delete
int tdb_get_flags(struct tdb_context *tdb);
[191] Fix | Delete
void tdb_enable_seqnum(struct tdb_context *tdb);
[192] Fix | Delete
void tdb_increment_seqnum_nonblock(struct tdb_context *tdb);
[193] Fix | Delete
int tdb_flush(struct tdb_context *tdb);
[194] Fix | Delete
[195] Fix | Delete
/* Low level locking functions: use with care */
[196] Fix | Delete
int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key);
[197] Fix | Delete
int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key);
[198] Fix | Delete
int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key);
[199] Fix | Delete
int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key);
[200] Fix | Delete
int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key);
[201] Fix | Delete
int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key);
[202] Fix | Delete
int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key);
[203] Fix | Delete
[204] Fix | Delete
/* Debug functions. Not used in production. */
[205] Fix | Delete
void tdb_dump_all(struct tdb_context *tdb);
[206] Fix | Delete
int tdb_printfreelist(struct tdb_context *tdb);
[207] Fix | Delete
int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries);
[208] Fix | Delete
[209] Fix | Delete
#ifdef __cplusplus
[210] Fix | Delete
}
[211] Fix | Delete
#endif
[212] Fix | Delete
[213] Fix | Delete
#endif /* tdb.h */
[214] Fix | Delete
[215] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function