mirror of
https://github.com/samba-team/samba.git
synced 2025-11-23 20:23:50 +03:00
r381: make the code more C++ friendly
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
b5cb5a1e62
commit
8acecc7f27
@@ -119,7 +119,7 @@ int ldb_modify(struct ldb_context *ldb,
|
||||
*/
|
||||
int ldb_delete(struct ldb_context *ldb, const char *dn)
|
||||
{
|
||||
return ldb->ops->delete(ldb, dn);
|
||||
return ldb->ops->delete_record(ldb, dn);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -128,7 +128,7 @@ struct ldb_backend_ops {
|
||||
int (*search_free)(struct ldb_context *, struct ldb_message **);
|
||||
int (*add)(struct ldb_context *, const struct ldb_message *);
|
||||
int (*modify)(struct ldb_context *, const struct ldb_message *);
|
||||
int (*delete)(struct ldb_context *, const char *);
|
||||
int (*delete_record)(struct ldb_context *, const char *);
|
||||
const char * (*errstring)(struct ldb_context *);
|
||||
};
|
||||
|
||||
@@ -137,7 +137,7 @@ struct ldb_backend_ops {
|
||||
*/
|
||||
struct ldb_context {
|
||||
/* a private pointer for the backend to use */
|
||||
void *private;
|
||||
void *private_data;
|
||||
|
||||
/* the operations provided by the backend */
|
||||
const struct ldb_backend_ops *ops;
|
||||
|
||||
@@ -71,7 +71,7 @@ static const char *lldb_option_find(const struct lldb_private *lldb, const char
|
||||
static int lldb_close(struct ldb_context *ldb)
|
||||
{
|
||||
int i, ret = 0;
|
||||
struct lldb_private *lldb = ldb->private;
|
||||
struct lldb_private *lldb = ldb->private_data;
|
||||
|
||||
if (ldap_unbind(lldb->ldap) != LDAP_SUCCESS) {
|
||||
ret = -1;
|
||||
@@ -94,7 +94,7 @@ static int lldb_close(struct ldb_context *ldb)
|
||||
*/
|
||||
static int lldb_delete(struct ldb_context *ldb, const char *dn)
|
||||
{
|
||||
struct lldb_private *lldb = ldb->private;
|
||||
struct lldb_private *lldb = ldb->private_data;
|
||||
int ret = 0;
|
||||
|
||||
lldb->last_rc = ldap_delete_s(lldb->ldap, dn);
|
||||
@@ -204,7 +204,7 @@ static int lldb_search(struct ldb_context *ldb, const char *base,
|
||||
enum ldb_scope scope, const char *expression,
|
||||
const char **attrs, struct ldb_message ***res)
|
||||
{
|
||||
struct lldb_private *lldb = ldb->private;
|
||||
struct lldb_private *lldb = ldb->private_data;
|
||||
int count, msg_count;
|
||||
LDAPMessage *ldapres, *msg;
|
||||
|
||||
@@ -388,7 +388,7 @@ failed:
|
||||
*/
|
||||
static int lldb_add(struct ldb_context *ldb, const struct ldb_message *msg)
|
||||
{
|
||||
struct lldb_private *lldb = ldb->private;
|
||||
struct lldb_private *lldb = ldb->private_data;
|
||||
LDAPMod **mods;
|
||||
int ret = 0;
|
||||
|
||||
@@ -410,7 +410,7 @@ static int lldb_add(struct ldb_context *ldb, const struct ldb_message *msg)
|
||||
*/
|
||||
static int lldb_modify(struct ldb_context *ldb, const struct ldb_message *msg)
|
||||
{
|
||||
struct lldb_private *lldb = ldb->private;
|
||||
struct lldb_private *lldb = ldb->private_data;
|
||||
LDAPMod **mods;
|
||||
int ret = 0;
|
||||
|
||||
@@ -432,7 +432,7 @@ static int lldb_modify(struct ldb_context *ldb, const struct ldb_message *msg)
|
||||
*/
|
||||
static const char *lldb_errstring(struct ldb_context *ldb)
|
||||
{
|
||||
struct lldb_private *lldb = ldb->private;
|
||||
struct lldb_private *lldb = ldb->private_data;
|
||||
return ldap_err2string(lldb->last_rc);
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ struct ldb_context *lldb_connect(const char *url,
|
||||
}
|
||||
|
||||
ldb->ops = &lldb_ops;
|
||||
ldb->private = lldb;
|
||||
ldb->private_data = lldb;
|
||||
|
||||
if (options) {
|
||||
/* take a copy of the options array, so we don't have to rely
|
||||
|
||||
@@ -770,7 +770,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
|
||||
*/
|
||||
int ltdb_reindex(struct ldb_context *ldb)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
int ret;
|
||||
|
||||
/* first traverse the database deleting any @INDEX records */
|
||||
|
||||
@@ -237,7 +237,7 @@ void ltdb_search_dn1_free(struct ldb_context *ldb, struct ldb_message *msg)
|
||||
*/
|
||||
int ltdb_search_dn1(struct ldb_context *ldb, const char *dn, struct ldb_message *msg)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
int ret;
|
||||
TDB_DATA tdb_key, tdb_data;
|
||||
|
||||
@@ -427,7 +427,7 @@ static int ltdb_search_full(struct ldb_context *ldb,
|
||||
struct ldb_parse_tree *tree,
|
||||
const char *attrs[], struct ldb_message ***res)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
int ret;
|
||||
struct ltdb_search_info sinfo;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ struct TDB_DATA ltdb_key(const char *dn)
|
||||
*/
|
||||
static int ltdb_lock(struct ldb_context *ldb)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
TDB_DATA key;
|
||||
int ret;
|
||||
|
||||
@@ -84,7 +84,7 @@ static int ltdb_lock(struct ldb_context *ldb)
|
||||
*/
|
||||
static void ltdb_unlock(struct ldb_context *ldb)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
TDB_DATA key;
|
||||
|
||||
key = ltdb_key("LDBLOCK");
|
||||
@@ -102,7 +102,7 @@ static void ltdb_unlock(struct ldb_context *ldb)
|
||||
*/
|
||||
int ltdb_store(struct ldb_context *ldb, const struct ldb_message *msg, int flgs)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
TDB_DATA tdb_key, tdb_data;
|
||||
int ret;
|
||||
|
||||
@@ -164,7 +164,7 @@ static int ltdb_add(struct ldb_context *ldb, const struct ldb_message *msg)
|
||||
*/
|
||||
int ltdb_delete_noindex(struct ldb_context *ldb, const char *dn)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
TDB_DATA tdb_key;
|
||||
int ret;
|
||||
|
||||
@@ -357,7 +357,7 @@ static int msg_delete_element(struct ldb_message *msg,
|
||||
*/
|
||||
static int ltdb_modify(struct ldb_context *ldb, const struct ldb_message *msg)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
TDB_DATA tdb_key, tdb_data;
|
||||
struct ldb_message msg2;
|
||||
int ret, i, j;
|
||||
@@ -465,7 +465,7 @@ unlock_fail:
|
||||
*/
|
||||
static int ltdb_close(struct ldb_context *ldb)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
int ret;
|
||||
ret = tdb_close(ltdb->tdb);
|
||||
free(ltdb);
|
||||
@@ -479,7 +479,7 @@ static int ltdb_close(struct ldb_context *ldb)
|
||||
*/
|
||||
static const char *ltdb_errstring(struct ldb_context *ldb)
|
||||
{
|
||||
struct ltdb_private *ltdb = ldb->private;
|
||||
struct ltdb_private *ltdb = ldb->private_data;
|
||||
return tdb_errorstr(ltdb->tdb);
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ struct ldb_context *ltdb_connect(const char *url,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ldb->private = ltdb;
|
||||
ldb->private_data = ltdb;
|
||||
ldb->ops = <db_ops;
|
||||
|
||||
return ldb;
|
||||
|
||||
Reference in New Issue
Block a user