summaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/tdb/patches
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext2fs/tdb/patches')
-rw-r--r--lib/ext2fs/tdb/patches/copyright20
-rw-r--r--lib/ext2fs/tdb/patches/ext2tdb-rename65
-rw-r--r--lib/ext2fs/tdb/patches/replace-includes92
-rw-r--r--lib/ext2fs/tdb/patches/series6
-rw-r--r--lib/ext2fs/tdb/patches/static-functions13
-rw-r--r--lib/ext2fs/tdb/patches/static-prototypes72
-rw-r--r--lib/ext2fs/tdb/patches/tdbtool-includes30
7 files changed, 298 insertions, 0 deletions
diff --git a/lib/ext2fs/tdb/patches/copyright b/lib/ext2fs/tdb/patches/copyright
new file mode 100644
index 0000000..d9d1d84
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/copyright
@@ -0,0 +1,20 @@
+Index: tdbsa/tdb.c
+===================================================================
+--- tdbsa.orig/tdb.c
++++ tdbsa/tdb.c
+@@ -4,11 +4,11 @@ Rev: 23371
+ Last Changed Date: 2007-06-06 20:14:06 -0400 (Wed, 06 Jun 2007)
+ */
+ /*
+- Unix SMB/CIFS implementation.
++ trivial database library - standalone version
+
+- trivial database library - private includes
+-
+- Copyright (C) Andrew Tridgell 2005
++ Copyright (C) Andrew Tridgell 1999-2005
++ Copyright (C) Jeremy Allison 2000-2006
++ Copyright (C) Paul `Rusty' Russell 2000
+
+ ** NOTE! The following LGPL license applies to the tdb
+ ** library. This does NOT imply that all of Samba is released
diff --git a/lib/ext2fs/tdb/patches/ext2tdb-rename b/lib/ext2fs/tdb/patches/ext2tdb-rename
new file mode 100644
index 0000000..15bf085
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/ext2tdb-rename
@@ -0,0 +1,65 @@
+Index: tdb/tdb.h
+===================================================================
+--- tdb.orig/tdb.h
++++ tdb/tdb.h
+@@ -76,6 +76,60 @@ typedef struct TDB_DATA {
+ #endif
+ #endif
+
++/* ext2fs tdb renames */
++#define tdb_open ext2fs_tdb_open
++#define tdb_open_ex ext2fs_tdb_open_ex
++#define tdb_set_max_dead ext2fs_tdb_set_max_dead
++#define tdb_reopen ext2fs_tdb_reopen
++#define tdb_reopen_all ext2fs_tdb_reopen_all
++#define tdb_set_logging_function ext2fs_tdb_set_logging_function
++#define tdb_error ext2fs_tdb_error
++#define tdb_errorstr ext2fs_tdb_errorstr
++#define tdb_fetch ext2fs_tdb_fetch
++#define tdb_parse_record ext2fs_tdb_parse_record
++#define tdb_delete ext2fs_tdb_delete
++#define tdb_store ext2fs_tdb_store
++#define tdb_append ext2fs_tdb_append
++#define tdb_close ext2fs_tdb_close
++#define tdb_firstkey ext2fs_tdb_firstkey
++#define tdb_nextkey ext2fs_tdb_nextkey
++#define tdb_traverse ext2fs_tdb_traverse
++#define tdb_traverse_read ext2fs_tdb_traverse_read
++#define tdb_exists ext2fs_tdb_exists
++#define tdb_lockall ext2fs_tdb_lockall
++#define tdb_unlockall ext2fs_tdb_unlockall
++#define tdb_lockall_read ext2fs_tdb_lockall_read
++#define tdb_unlockall_read ext2fs_tdb_unlockall_read
++#define tdb_name ext2fs_tdb_name
++#define tdb_fd ext2fs_tdb_fd
++#define tdb_log_fn ext2fs_tdb_log_fn
++#define tdb_get_logging_private ext2fs_tdb_get_logging_private
++#define tdb_transaction_start ext2fs_tdb_transaction_start
++#define tdb_transaction_commit ext2fs_tdb_transaction_commit
++#define tdb_transaction_cancel ext2fs_tdb_transaction_cancel
++#define tdb_transaction_recover ext2fs_tdb_transaction_recover
++#define tdb_get_seqnum ext2fs_tdb_get_seqnum
++#define tdb_hash_size ext2fs_tdb_hash_size
++#define tdb_map_size ext2fs_tdb_map_size
++#define tdb_get_flags ext2fs_tdb_get_flags
++#define tdb_chainlock ext2fs_tdb_chainlock
++#define tdb_chainunlock ext2fs_tdb_chainunlock
++#define tdb_chainlock_read ext2fs_tdb_chainlock_read
++#define tdb_chainunlock_read ext2fs_tdb_chainunlock_read
++#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
++
+ /* this is the context structure that is returned from a db open */
+ typedef struct tdb_context TDB_CONTEXT;
+
diff --git a/lib/ext2fs/tdb/patches/replace-includes b/lib/ext2fs/tdb/patches/replace-includes
new file mode 100644
index 0000000..f4181c1
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/replace-includes
@@ -0,0 +1,92 @@
+Index: tdb/tdb.c
+===================================================================
+--- tdb.orig/tdb.c
++++ tdb/tdb.c
+@@ -29,11 +29,82 @@ Last Changed Date: 2007-06-22 13:36:10 -
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#include "replace.h"
+-#include "system/filesys.h"
+-#include "system/time.h"
+-#include "system/shmem.h"
+-#include "system/select.h"
++#ifdef CONFIG_STAND_ALONE
++#define HAVE_MMAP
++#define HAVE_STRDUP
++#define HAVE_SYS_MMAN_H
++#define HAVE_UTIME_H
++#define HAVE_UTIME
++#endif
++#define _XOPEN_SOURCE 500
++
++#include <unistd.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdarg.h>
++#include <stddef.h>
++#include <errno.h>
++#include <string.h>
++#ifdef HAVE_SYS_SELECT_H
++#include <sys/select.h>
++#endif
++#include <sys/time.h>
++#include <sys/types.h>
++#include <time.h>
++#ifdef HAVE_UTIME_H
++#include <utime.h>
++#endif
++#include <sys/stat.h>
++#include <sys/file.h>
++#include <fcntl.h>
++
++#ifdef HAVE_SYS_MMAN_H
++#include <sys/mman.h>
++#endif
++
++#ifndef MAP_FILE
++#define MAP_FILE 0
++#endif
++
++#ifndef MAP_FAILED
++#define MAP_FAILED ((void *)-1)
++#endif
++
++#ifndef HAVE_STRDUP
++#define strdup rep_strdup
++static char *rep_strdup(const char *s)
++{
++ char *ret;
++ int length;
++ if (!s)
++ return NULL;
++
++ if (!length)
++ length = strlen(s);
++
++ ret = malloc(length + 1);
++ if (ret) {
++ strncpy(ret, s, length);
++ ret[length] = '\0';
++ }
++ return ret;
++}
++#endif
++
++#ifndef PRINTF_ATTRIBUTE
++#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
++/** Use gcc attribute to check printf fns. a1 is the 1-based index of
++ * the parameter containing the format, and a2 the index of the first
++ * argument. Note that some gcc 2.x versions don't handle this
++ * properly **/
++#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
++#else
++#define PRINTF_ATTRIBUTE(a1, a2)
++#endif
++#endif
++
++typedef int bool;
++
+ #include "tdb.h"
+
+ #ifndef u32
diff --git a/lib/ext2fs/tdb/patches/series b/lib/ext2fs/tdb/patches/series
new file mode 100644
index 0000000..722b921
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/series
@@ -0,0 +1,6 @@
+copyright
+replace-includes
+static-prototypes
+static-functions
+tdbtool-includes
+ext2tdb-rename
diff --git a/lib/ext2fs/tdb/patches/static-functions b/lib/ext2fs/tdb/patches/static-functions
new file mode 100644
index 0000000..ab0fbef
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/static-functions
@@ -0,0 +1,13 @@
+Index: tdbsa/tdb.c
+===================================================================
+--- tdbsa.orig/tdb.c
++++ tdbsa/tdb.c
+@@ -2254,7 +2254,7 @@ int tdb_transaction_recover(struct tdb_c
+ /* file: freelist.c */
+
+ /* read a freelist record and check for simple errors */
+-int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct list_struct *rec)
++static int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off, struct list_struct *rec)
+ {
+ if (tdb->methods->tdb_read(tdb, off, rec, sizeof(*rec),DOCONV()) == -1)
+ return -1;
diff --git a/lib/ext2fs/tdb/patches/static-prototypes b/lib/ext2fs/tdb/patches/static-prototypes
new file mode 100644
index 0000000..cf8af61
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/static-prototypes
@@ -0,0 +1,72 @@
+Index: tdbsa/tdb.c
+===================================================================
+--- tdbsa.orig/tdb.c
++++ tdbsa/tdb.c
+@@ -251,39 +251,39 @@ struct tdb_context {
+ /*
+ internal prototypes
+ */
+-int tdb_munmap(struct tdb_context *tdb);
+-void tdb_mmap(struct tdb_context *tdb);
+-int tdb_lock(struct tdb_context *tdb, int list, int ltype);
+-int tdb_unlock(struct tdb_context *tdb, int list, int ltype);
+-int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int probe, size_t len);
+-int tdb_transaction_lock(struct tdb_context *tdb, int ltype);
+-int tdb_transaction_unlock(struct tdb_context *tdb);
+-int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len);
+-int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off);
+-int tdb_write_unlock_record(struct tdb_context *tdb, tdb_off_t off);
+-int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
+-int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
+-void *tdb_convert(void *buf, u32 size);
+-int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
+-tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_struct *rec);
+-int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
+-int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
+-int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off);
+-int tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off);
+-int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
+-int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
+-int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct *rec);
+-unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len);
+-int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key,
++static int tdb_munmap(struct tdb_context *tdb);
++static void tdb_mmap(struct tdb_context *tdb);
++static int tdb_lock(struct tdb_context *tdb, int list, int ltype);
++static int tdb_unlock(struct tdb_context *tdb, int list, int ltype);
++static int tdb_brlock(struct tdb_context *tdb, tdb_off_t offset, int rw_type, int lck_type, int probe, size_t len);
++static int tdb_transaction_lock(struct tdb_context *tdb, int ltype);
++static int tdb_transaction_unlock(struct tdb_context *tdb);
++static int tdb_brlock_upgrade(struct tdb_context *tdb, tdb_off_t offset, size_t len);
++static int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off);
++static int tdb_write_unlock_record(struct tdb_context *tdb, tdb_off_t off);
++static int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
++static int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
++static void *tdb_convert(void *buf, u32 size);
++static int tdb_free(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
++static tdb_off_t tdb_allocate(struct tdb_context *tdb, tdb_len_t length, struct list_struct *rec);
++static int tdb_ofs_read(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
++static int tdb_ofs_write(struct tdb_context *tdb, tdb_off_t offset, tdb_off_t *d);
++static int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off);
++static int tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off);
++static int tdb_rec_read(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
++static int tdb_rec_write(struct tdb_context *tdb, tdb_off_t offset, struct list_struct *rec);
++static int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct *rec);
++static unsigned char *tdb_alloc_read(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t len);
++static int tdb_parse_data(struct tdb_context *tdb, TDB_DATA key,
+ tdb_off_t offset, tdb_len_t len,
+ int (*parser)(TDB_DATA key, TDB_DATA data,
+ void *private_data),
+ void *private_data);
+-tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash, int locktype,
++static tdb_off_t tdb_find_lock_hash(struct tdb_context *tdb, TDB_DATA key, u32 hash, int locktype,
+ struct list_struct *rec);
+-void tdb_io_init(struct tdb_context *tdb);
+-int tdb_expand(struct tdb_context *tdb, tdb_off_t size);
+-int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off,
++static void tdb_io_init(struct tdb_context *tdb);
++static int tdb_expand(struct tdb_context *tdb, tdb_off_t size);
++static int tdb_rec_free_read(struct tdb_context *tdb, tdb_off_t off,
+ struct list_struct *rec);
+
+
diff --git a/lib/ext2fs/tdb/patches/tdbtool-includes b/lib/ext2fs/tdb/patches/tdbtool-includes
new file mode 100644
index 0000000..c076c79
--- /dev/null
+++ b/lib/ext2fs/tdb/patches/tdbtool-includes
@@ -0,0 +1,30 @@
+Index: tdbsa/tdbtool.c
+===================================================================
+--- tdbsa.orig/tdbtool.c
++++ tdbsa/tdbtool.c
+@@ -21,10 +21,21 @@
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+-#include "replace.h"
+-#include "system/locale.h"
+-#include "system/time.h"
+-#include "system/filesys.h"
++#include <errno.h>
++#include <stdlib.h>
++#include <stdio.h>
++#include <fcntl.h>
++#include <unistd.h>
++#include <string.h>
++#include <fcntl.h>
++#include <time.h>
++#include <sys/mman.h>
++#include <sys/stat.h>
++#include <sys/time.h>
++#include <ctype.h>
++#include <signal.h>
++#include <stdarg.h>
++
+ #include "tdb.h"
+
+ static int do_command(void);