[PATCH] Make tdb use ldb's log functions

Stefan (metze) Metzmacher metze at samba.org
Mon Jul 3 07:51:07 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bartlett schrieb:
> I've now added a proper debug level system to tdb, so we can map this to
> ldb's debug levels.  I would really apprciate some comments on this, in
> particular on any etiquette on extending the tdb API.

Hi Andrew,

>  /* register a loging function */
> -void tdb_logging_function(struct tdb_context *tdb, void (*fn)(struct tdb_context *, int , const char *, ...))
> +void tdb_logging_function(struct tdb_context *tdb, tdb_log_func log_fn, void *log_private)
>  {
> -	tdb->log_fn = fn?fn:null_log_fn;
> +	tdb->log_fn = log_fn?log_fn:null_log_fn;
> +	tdb->log_fn = log_fn?log_private:NULL;

here's a typo...:-)

>  }
>  
> +void *tdb_logging_private(struct tdb_context *tdb)
> +{
> +	return tdb->log_private;
> +}
>  

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)
...

the rest looks good
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFEqMxrm70gjA5TCD8RAmxDAJ4yxkp8K30JTLp+2ESrBN1wfOVfwACcCW67
LxLhHyFiIDtcb3MAUl0Km4I=
=Klbi
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list