summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/dbwrap/dbwrap.h37
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c1
-rw-r--r--source3/lib/dbwrap/dbwrap_private.h35
-rw-r--r--source3/lib/dbwrap/dbwrap_rbt.c1
-rw-r--r--source3/lib/dbwrap/dbwrap_tdb.c1
5 files changed, 40 insertions, 35 deletions
diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h
index b5fc018158..13565f8b33 100644
--- a/source3/lib/dbwrap/dbwrap.h
+++ b/source3/lib/dbwrap/dbwrap.h
@@ -22,41 +22,8 @@
#include "tdb_compat.h"
-struct db_record {
- TDB_DATA key, value;
- NTSTATUS (*store)(struct db_record *rec, TDB_DATA data, int flag);
- NTSTATUS (*delete_rec)(struct db_record *rec);
- void *private_data;
-};
-
-struct db_context {
- struct db_record *(*fetch_locked)(struct db_context *db,
- TALLOC_CTX *mem_ctx,
- TDB_DATA key);
- int (*fetch)(struct db_context *db, TALLOC_CTX *mem_ctx,
- TDB_DATA key, TDB_DATA *data);
- int (*traverse)(struct db_context *db,
- int (*f)(struct db_record *rec,
- void *private_data),
- void *private_data);
- int (*traverse_read)(struct db_context *db,
- int (*f)(struct db_record *rec,
- void *private_data),
- void *private_data);
- int (*get_seqnum)(struct db_context *db);
- int (*get_flags)(struct db_context *db);
- int (*transaction_start)(struct db_context *db);
- int (*transaction_commit)(struct db_context *db);
- int (*transaction_cancel)(struct db_context *db);
- int (*parse_record)(struct db_context *db, TDB_DATA key,
- int (*parser)(TDB_DATA key, TDB_DATA data,
- void *private_data),
- void *private_data);
- int (*exists)(struct db_context *db,TDB_DATA key);
- int (*wipe)(struct db_context *db);
- void *private_data;
- bool persistent;
-};
+struct db_record;
+struct db_context;
/* The following definitions come from lib/dbwrap.c */
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 2263d73dec..5823ab4695 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -46,6 +46,7 @@
#include "ctdb_private.h"
#include "ctdbd_conn.h"
#include "dbwrap/dbwrap.h"
+#include "dbwrap/dbwrap_private.h"
#include "dbwrap/dbwrap_ctdb.h"
#include "g_lock.h"
#include "messages.h"
diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h
index 1e221878f5..0a8581a91b 100644
--- a/source3/lib/dbwrap/dbwrap_private.h
+++ b/source3/lib/dbwrap/dbwrap_private.h
@@ -23,6 +23,41 @@
#ifndef __DBWRAP_PRIVATE_H__
#define __DBWRAP_PRIVATE_H__
+struct db_record {
+ TDB_DATA key, value;
+ NTSTATUS (*store)(struct db_record *rec, TDB_DATA data, int flag);
+ NTSTATUS (*delete_rec)(struct db_record *rec);
+ void *private_data;
+};
+
+struct db_context {
+ struct db_record *(*fetch_locked)(struct db_context *db,
+ TALLOC_CTX *mem_ctx,
+ TDB_DATA key);
+ int (*fetch)(struct db_context *db, TALLOC_CTX *mem_ctx,
+ TDB_DATA key, TDB_DATA *data);
+ int (*traverse)(struct db_context *db,
+ int (*f)(struct db_record *rec,
+ void *private_data),
+ void *private_data);
+ int (*traverse_read)(struct db_context *db,
+ int (*f)(struct db_record *rec,
+ void *private_data),
+ void *private_data);
+ int (*get_seqnum)(struct db_context *db);
+ int (*get_flags)(struct db_context *db);
+ int (*transaction_start)(struct db_context *db);
+ int (*transaction_commit)(struct db_context *db);
+ int (*transaction_cancel)(struct db_context *db);
+ int (*parse_record)(struct db_context *db, TDB_DATA key,
+ int (*parser)(TDB_DATA key, TDB_DATA data,
+ void *private_data),
+ void *private_data);
+ int (*exists)(struct db_context *db,TDB_DATA key);
+ int (*wipe)(struct db_context *db);
+ void *private_data;
+ bool persistent;
+};
int dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
TDB_DATA key, TDB_DATA *data);
diff --git a/source3/lib/dbwrap/dbwrap_rbt.c b/source3/lib/dbwrap/dbwrap_rbt.c
index cc4e0dd129..98541eaf07 100644
--- a/source3/lib/dbwrap/dbwrap_rbt.c
+++ b/source3/lib/dbwrap/dbwrap_rbt.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "dbwrap/dbwrap.h"
+#include "dbwrap/dbwrap_private.h"
#include "dbwrap/dbwrap_rbt.h"
#include "../lib/util/rbtree.h"
diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c
index b838539307..4330c961ec 100644
--- a/source3/lib/dbwrap/dbwrap_tdb.c
+++ b/source3/lib/dbwrap/dbwrap_tdb.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "dbwrap/dbwrap.h"
+#include "dbwrap/dbwrap_private.h"
#include "dbwrap/dbwrap_tdb.h"
#include "lib/util/tdb_wrap.h"