mirror of
https://github.com/samba-team/samba.git
synced 2025-09-17 05:44:20 +03:00
r382: More C++ friendliness fixes.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
8acecc7f27
commit
e96f3a2005
@@ -410,7 +410,7 @@ void ldif_read_free(struct ldb_ldif *ldif)
|
|||||||
if (msg->elements[i].values) free(msg->elements[i].values);
|
if (msg->elements[i].values) free(msg->elements[i].values);
|
||||||
}
|
}
|
||||||
if (msg->elements) free(msg->elements);
|
if (msg->elements) free(msg->elements);
|
||||||
if (msg->private) free(msg->private);
|
if (msg->private_data) free(msg->private_data);
|
||||||
free(ldif);
|
free(ldif);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ static int msg_add_empty(struct ldb_message *msg, const char *name, unsigned fla
|
|||||||
/*
|
/*
|
||||||
read from a LDIF source, creating a ldb_message
|
read from a LDIF source, creating a ldb_message
|
||||||
*/
|
*/
|
||||||
struct ldb_ldif *ldif_read(int (*fgetc_fn)(void *), void *private)
|
struct ldb_ldif *ldif_read(int (*fgetc_fn)(void *), void *private_data)
|
||||||
{
|
{
|
||||||
struct ldb_ldif *ldif;
|
struct ldb_ldif *ldif;
|
||||||
struct ldb_message *msg;
|
struct ldb_message *msg;
|
||||||
@@ -463,14 +463,14 @@ struct ldb_ldif *ldif_read(int (*fgetc_fn)(void *), void *private)
|
|||||||
msg->dn = NULL;
|
msg->dn = NULL;
|
||||||
msg->elements = NULL;
|
msg->elements = NULL;
|
||||||
msg->num_elements = 0;
|
msg->num_elements = 0;
|
||||||
msg->private = NULL;
|
msg->private_data = NULL;
|
||||||
|
|
||||||
chunk = next_chunk(fgetc_fn, private);
|
chunk = next_chunk(fgetc_fn, private_data);
|
||||||
if (!chunk) {
|
if (!chunk) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg->private = chunk;
|
msg->private_data = chunk;
|
||||||
s = chunk;
|
s = chunk;
|
||||||
|
|
||||||
if (next_attr(&s, &attr, &value) != 0) {
|
if (next_attr(&s, &attr, &value) != 0) {
|
||||||
|
@@ -86,7 +86,7 @@ struct ldb_message {
|
|||||||
char *dn;
|
char *dn;
|
||||||
unsigned int num_elements;
|
unsigned int num_elements;
|
||||||
struct ldb_message_element *elements;
|
struct ldb_message_element *elements;
|
||||||
void *private; /* private to the backend */
|
void *private_data; /* private to the backend */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ldb_changetype {
|
enum ldb_changetype {
|
||||||
@@ -210,10 +210,10 @@ const char *ldb_errstring(struct ldb_context *ldb);
|
|||||||
ldif manipulation functions
|
ldif manipulation functions
|
||||||
*/
|
*/
|
||||||
int ldif_write(int (*fprintf_fn)(void *, const char *, ...),
|
int ldif_write(int (*fprintf_fn)(void *, const char *, ...),
|
||||||
void *private,
|
void *private_data,
|
||||||
const struct ldb_ldif *ldif);
|
const struct ldb_ldif *ldif);
|
||||||
void ldif_read_free(struct ldb_ldif *);
|
void ldif_read_free(struct ldb_ldif *);
|
||||||
struct ldb_ldif *ldif_read(int (*fgetc_fn)(void *), void *private);
|
struct ldb_ldif *ldif_read(int (*fgetc_fn)(void *), void *private_data);
|
||||||
struct ldb_ldif *ldif_read_file(FILE *f);
|
struct ldb_ldif *ldif_read_file(FILE *f);
|
||||||
struct ldb_ldif *ldif_read_string(const char *s);
|
struct ldb_ldif *ldif_read_string(const char *s);
|
||||||
int ldif_write_file(FILE *f, const struct ldb_ldif *msg);
|
int ldif_write_file(FILE *f, const struct ldb_ldif *msg);
|
||||||
|
@@ -264,7 +264,7 @@ static int lldb_search(struct ldb_context *ldb, const char *base,
|
|||||||
|
|
||||||
(*res)[msg_count]->num_elements = 0;
|
(*res)[msg_count]->num_elements = 0;
|
||||||
(*res)[msg_count]->elements = NULL;
|
(*res)[msg_count]->elements = NULL;
|
||||||
(*res)[msg_count]->private = NULL;
|
(*res)[msg_count]->private_data = NULL;
|
||||||
|
|
||||||
/* loop over all attributes */
|
/* loop over all attributes */
|
||||||
for (attr=ldap_first_attribute(lldb->ldap, msg, &berptr);
|
for (attr=ldap_first_attribute(lldb->ldap, msg, &berptr);
|
||||||
|
@@ -576,7 +576,7 @@ static int ltdb_index_add1(struct ldb_context *ldb, const char *dn,
|
|||||||
}
|
}
|
||||||
msg.num_elements = 0;
|
msg.num_elements = 0;
|
||||||
msg.elements = NULL;
|
msg.elements = NULL;
|
||||||
msg.private = NULL;
|
msg.private_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(dn_key);
|
free(dn_key);
|
||||||
|
@@ -166,7 +166,7 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_context *ldb,
|
|||||||
|
|
||||||
ret->num_elements = 0;
|
ret->num_elements = 0;
|
||||||
ret->elements = NULL;
|
ret->elements = NULL;
|
||||||
ret->private = NULL;
|
ret->private_data = NULL;
|
||||||
|
|
||||||
if (!attrs) {
|
if (!attrs) {
|
||||||
if (msg_add_all_elements(ret, msg) != 0) {
|
if (msg_add_all_elements(ret, msg) != 0) {
|
||||||
@@ -221,7 +221,7 @@ void ltdb_search_dn1_free(struct ldb_context *ldb, struct ldb_message *msg)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (msg->dn) free(msg->dn);
|
if (msg->dn) free(msg->dn);
|
||||||
if (msg->private) free(msg->private);
|
if (msg->private_data) free(msg->private_data);
|
||||||
for (i=0;i<msg->num_elements;i++) {
|
for (i=0;i<msg->num_elements;i++) {
|
||||||
if (msg->elements[i].values) free(msg->elements[i].values);
|
if (msg->elements[i].values) free(msg->elements[i].values);
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,7 @@ int ltdb_search_dn1(struct ldb_context *ldb, const char *dn, struct ldb_message
|
|||||||
free(tdb_data.dptr);
|
free(tdb_data.dptr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
msg->private = tdb_data.dptr;
|
msg->private_data = tdb_data.dptr;
|
||||||
msg->num_elements = 0;
|
msg->num_elements = 0;
|
||||||
msg->elements = NULL;
|
msg->elements = NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user