mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
s3:dbwrap: move definitions of db_record and db_contect structs to dbwrap_private.h
The API and callers now only need the forward declarations.
This commit is contained in:
parent
6fb5c47f21
commit
8750e3f22c
@ -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 */
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user