1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r382: More C++ friendliness fixes.

This commit is contained in:
Tim Potter 2004-04-28 07:32:37 +00:00 committed by Gerald (Jerry) Carter
parent 8acecc7f27
commit e96f3a2005
5 changed files with 13 additions and 13 deletions

View File

@ -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) free(msg->elements);
if (msg->private) free(msg->private);
if (msg->private_data) free(msg->private_data);
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
*/
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_message *msg;
@ -463,14 +463,14 @@ struct ldb_ldif *ldif_read(int (*fgetc_fn)(void *), void *private)
msg->dn = NULL;
msg->elements = NULL;
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) {
goto failed;
}
msg->private = chunk;
msg->private_data = chunk;
s = chunk;
if (next_attr(&s, &attr, &value) != 0) {

View File

@ -86,7 +86,7 @@ struct ldb_message {
char *dn;
unsigned int num_elements;
struct ldb_message_element *elements;
void *private; /* private to the backend */
void *private_data; /* private to the backend */
};
enum ldb_changetype {
@ -210,10 +210,10 @@ const char *ldb_errstring(struct ldb_context *ldb);
ldif manipulation functions
*/
int ldif_write(int (*fprintf_fn)(void *, const char *, ...),
void *private,
void *private_data,
const struct ldb_ldif *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_string(const char *s);
int ldif_write_file(FILE *f, const struct ldb_ldif *msg);

View File

@ -264,7 +264,7 @@ static int lldb_search(struct ldb_context *ldb, const char *base,
(*res)[msg_count]->num_elements = 0;
(*res)[msg_count]->elements = NULL;
(*res)[msg_count]->private = NULL;
(*res)[msg_count]->private_data = NULL;
/* loop over all attributes */
for (attr=ldap_first_attribute(lldb->ldap, msg, &berptr);

View File

@ -576,7 +576,7 @@ static int ltdb_index_add1(struct ldb_context *ldb, const char *dn,
}
msg.num_elements = 0;
msg.elements = NULL;
msg.private = NULL;
msg.private_data = NULL;
}
free(dn_key);

View File

@ -166,7 +166,7 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_context *ldb,
ret->num_elements = 0;
ret->elements = NULL;
ret->private = NULL;
ret->private_data = NULL;
if (!attrs) {
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;
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++) {
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);
return -1;
}
msg->private = tdb_data.dptr;
msg->private_data = tdb_data.dptr;
msg->num_elements = 0;
msg->elements = NULL;