diff options
author | Simo Sorce <idra@samba.org> | 2005-01-12 16:00:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:47 -0500 |
commit | a2f77f979d7271a9708ed06f43b00ffb10ec7f4c (patch) | |
tree | f9de8a02597f95ba9c7af1c2086a69cafacb3a87 /source4/lib/ldb/common/ldb_ldif.c | |
parent | 7588b41e153ebd84c974f7289847bcd05f32ba4b (diff) | |
download | samba-a2f77f979d7271a9708ed06f43b00ffb10ec7f4c.tar.gz samba-a2f77f979d7271a9708ed06f43b00ffb10ec7f4c.tar.bz2 samba-a2f77f979d7271a9708ed06f43b00ffb10ec7f4c.zip |
r4714: move the ldb code to the new talloc interface (eg remove _p suffix)
this helps standalone building of ldb
renew the schema module
split code into functions to improve readability and code reuse
add and modify works correctly but we need a proper testsuite
Simo
(This used to be commit a681ae365ff1b5a2771b42ebd90336651ce1e513)
Diffstat (limited to 'source4/lib/ldb/common/ldb_ldif.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_ldif.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/lib/ldb/common/ldb_ldif.c b/source4/lib/ldb/common/ldb_ldif.c index d20a2a3553..546cf461f8 100644 --- a/source4/lib/ldb/common/ldb_ldif.c +++ b/source4/lib/ldb/common/ldb_ldif.c @@ -97,7 +97,7 @@ char *ldb_base64_encode(struct ldb_context *ldb, const char *buf, int len) int bytes = (len*8 + 5)/6; char *out; - out = talloc_array_p(ldb, char, bytes+2); + out = talloc_array(ldb, char, bytes+2); if (!out) return NULL; for (i=0;i<bytes;i++) { @@ -305,7 +305,7 @@ static char *next_chunk(struct ldb_context *ldb, if (chunk_size+1 >= alloc_size) { char *c2; alloc_size += 1024; - c2 = talloc_realloc_p(ldb, chunk, char, alloc_size); + c2 = talloc_realloc(ldb, chunk, char, alloc_size); if (!c2) { talloc_free(chunk); errno = ENOMEM; @@ -427,7 +427,7 @@ static int msg_add_empty(struct ldb_context *ldb, { struct ldb_message_element *el2, *el; - el2 = talloc_realloc_p(msg, msg->elements, + el2 = talloc_realloc(msg, msg->elements, struct ldb_message_element, msg->num_elements+1); if (!el2) { errno = ENOMEM; @@ -468,10 +468,10 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb, value.data = NULL; - ldif = talloc_p(ldb, struct ldb_ldif); + ldif = talloc(ldb, struct ldb_ldif); if (!ldif) return NULL; - ldif->msg = talloc_p(ldif, struct ldb_message); + ldif->msg = talloc(ldif, struct ldb_message); if (ldif->msg == NULL) { talloc_free(ldif); return NULL; @@ -556,7 +556,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb, flags == el->flags) { /* its a continuation */ el->values = - talloc_realloc_p(msg->elements, el->values, + talloc_realloc(msg->elements, el->values, struct ldb_val, el->num_values+1); if (!el->values) { goto failed; @@ -565,7 +565,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb, el->num_values++; } else { /* its a new attribute */ - msg->elements = talloc_realloc_p(ldif, msg->elements, + msg->elements = talloc_realloc(ldif, msg->elements, struct ldb_message_element, msg->num_elements+1); if (!msg->elements) { @@ -574,7 +574,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb, el = &msg->elements[msg->num_elements]; el->flags = flags; el->name = talloc_strdup(msg->elements, attr); - el->values = talloc_p(msg->elements, struct ldb_val); + el->values = talloc(msg->elements, struct ldb_val); if (!el->values || !el->name) { goto failed; } |