diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-11-16 09:00:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:52 -0500 |
commit | 8a18778286a16423d7d6e483fdb308a91e294efe (patch) | |
tree | b1cf6a44c1cb4deccb04897ab426a724204b3f52 /source4/lib/ldb/ldb_tdb/ldb_pack.c | |
parent | e81157c7379116d83b9906e27c9fd418c779d129 (diff) | |
download | samba-8a18778286a16423d7d6e483fdb308a91e294efe.tar.gz samba-8a18778286a16423d7d6e483fdb308a91e294efe.tar.bz2 samba-8a18778286a16423d7d6e483fdb308a91e294efe.zip |
r3783: - don't use make proto for ldb anymore
- split ldh.h out of samba's includes.h
- make ldb_context and ldb_module private to the subsystem
- use ltdb_ prefix for all ldb_tdb functions
metze
(This used to be commit f5ee40d6ce8224e280070975efc9911558fe675c)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_pack.c')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_pack.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_pack.c b/source4/lib/ldb/ldb_tdb/ldb_pack.c index ad856d2faf..9515beeaa7 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_pack.c +++ b/source4/lib/ldb/ldb_tdb/ldb_pack.c @@ -33,6 +33,8 @@ */ #include "includes.h" +#include "ldb/include/ldb.h" +#include "ldb/include/ldb_private.h" #include "ldb/ldb_tdb/ldb_tdb.h" /* change this if the data format ever changes */ @@ -65,10 +67,11 @@ static unsigned int pull_uint32(uint8_t *p, int ofs) caller frees the data buffer after use */ -int ltdb_pack_data(struct ldb_context *ldb, +int ltdb_pack_data(struct ldb_module *module, const struct ldb_message *message, struct TDB_DATA *data) { + struct ldb_context *ldb = module->ldb; unsigned int i, j, real_elements=0; size_t size; char *p; @@ -138,9 +141,10 @@ int ltdb_pack_data(struct ldb_context *ldb, /* free the memory allocated from a ltdb_unpack_data() */ -void ltdb_unpack_data_free(struct ldb_context *ldb, +void ltdb_unpack_data_free(struct ldb_module *module, struct ldb_message *message) { + struct ldb_context *ldb = module->ldb; unsigned int i; for (i=0;i<message->num_elements;i++) { @@ -160,10 +164,11 @@ void ltdb_unpack_data_free(struct ldb_context *ldb, TDB_DATA data. This means the caller only has to free the elements and values arrays. This can be done with ltdb_unpack_data_free() */ -int ltdb_unpack_data(struct ldb_context *ldb, +int ltdb_unpack_data(struct ldb_module *module, const struct TDB_DATA *data, struct ldb_message *message) { + struct ldb_context *ldb = module->ldb; char *p; unsigned int remaining; unsigned int i, j; @@ -274,7 +279,7 @@ int ltdb_unpack_data(struct ldb_context *ldb, return 0; failed: - ltdb_unpack_data_free(ldb, message); + ltdb_unpack_data_free(module, message); return -1; } |