[PATCH] Make tdb use ldb's log functions
Stefan (metze) Metzmacher
metze at samba.org
Mon Jul 10 10:28:40 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Bartlett schrieb:
> On Mon, 2006-07-03 at 09:51 +0200, Stefan (metze) Metzmacher wrote:
>
>> I think we should use tdb_set_logging_function() and
>> tdb_get_logging_private() as better names.
>>
>> and maybe pass just one argument to the set function
>> as well to tdb_open_ex().
>>
>> struct tdb_logging_context {
>> tdb_log_func log_fn;
>> void *log_private;
>> };
>> void tdb_set_logging_function(struct tdb_context *tdb,
>> struct tdb_logging_context *log)
>> ...
>
> This sounds reasonable, particularly as tdb_open_ex has too many
> arguments already. Do you think that this *log should be a pointer tdb
> keeps (ie, caller to malloc), or just one it copies the contents of?
>
> If tdb keeps it, who should free() it?
struct tdb_context {
....
struct tdb_logging_context log;
....
};
and then
void tdb_set_logging_function(struct tdb_context *tdb,
const struct tdb_logging_context *log)
{
...
tdb->log = *log;
...
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFEsivYm70gjA5TCD8RAtOIAKDDgmMULfn9666aC/afvWmeQNuGZQCgqR/Q
M+27G3B6Fng5KqXgwt2l97M=
=zn8k
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list