[PATCH] Make tdb use ldb's log functions

Andrew Bartlett abartlet at samba.org
Mon Jul 10 10:49:45 GMT 2006


On Mon, 2006-07-10 at 12:28 +0200, Stefan (metze) Metzmacher wrote:
> -----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;
> 	...
> }

That's what I hoped, as it's the easiest option :-)

Thanks,

Andrew Bartlett
-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Student Network Administrator, Hawker College  http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060710/989ef98c/attachment.bin


More information about the samba-technical mailing list