From: ian Date: Sat, 7 Jan 2006 17:08:04 +0000 (+0000) Subject: + * New adns_init_logfn etc. for having logging done with a callback X-Git-Tag: before-srv-2006-04-04~10 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=commitdiff_plain;h=c227e3bcc4a3d9e4a076e19976f8b2bb153143e7;hp=-c + * New adns_init_logfn etc. for having logging done with a callback @@ -1,4 +1,4 @@ -adns (1.2); urgency=medium +adns (1.1.999.0.1); urgency=medium * Fix error in prototype in definition of adns__parse_domain. * New LICENCE.WAIVERS file for GPL-incompatility workarounds. @@ -16,6 +16,8 @@ * Add bind(2) and listen(2) to test harness (for epithet's benefit, but harmless in adns). * Add missing ENOTSOCK to hcommon.c.m4 (was already in hcommon.c!) + * New adns_init_logfn etc. for having logging done with a callback + function. -- --- c227e3bcc4a3d9e4a076e19976f8b2bb153143e7 diff --combined changelog index 058436d,1d94160..a4bdd97 --- a/changelog +++ b/changelog @@@ -1,21 -1,24 +1,23 @@@ - - -THIS BRANCH IS NOW CLOSED - - EVERYTHING HAS BEEN MERGED TO THE TRUNK - (at CVS tag mergepoint-logcallbackfn) - - DO NOT EDIT - - - * New adns_init_logfn etc. for having logging done with a callback - function. - - -- - --adns (1.2); urgency=medium ++adns (1.1.999.0.1); urgency=medium * Fix error in prototype in definition of adns__parse_domain. * New LICENCE.WAIVERS file for GPL-incompatility workarounds. * Clarified GPL-vs-LGPL: a bit less hostile and a bit more mercenary. * Allow `;'-comments in resolv.conf (report from Colin Charles). + * Added a TODO list item. + * Add .PHONY: install to Makefile, to help people with demented fs's. + * Darwin listed in INSTALL. + * New adnsheloex client courtesy of Tony Finch (and copyright notices + updated). + * Add documentation comment by definition of adns_r_ptr_raw type enum. + * Add -Wno-pointer-sign if GCC has that option. + * Call Tensurerecordfile in Hgettimeofday (Tensurerecordfile was + Tensureinputfile/Tensureoutputfile). + * Add bind(2) and listen(2) to test harness (for epithet's benefit, but + harmless in adns). + * Add missing ENOTSOCK to hcommon.c.m4 (was already in hcommon.c!) ++ * New adns_init_logfn etc. for having logging done with a callback ++ function. -- diff --combined src/adns.h index bd6b536,9be8b68..f262d47 --- a/src/adns.h +++ b/src/adns.h @@@ -58,6 -58,7 +58,7 @@@ #define ADNS_H_INCLUDED #include + #include #include #include @@@ -117,7 -118,7 +118,7 @@@ typedef enum adns_r_soa_raw= 6, adns_r_soa= adns_r_soa_raw|adns__qtf_mail822, - adns_r_ptr_raw= 12, + adns_r_ptr_raw= 12, /* do not mind PTR with wrong or missing A */ adns_r_ptr= adns_r_ptr_raw|adns__qtf_deref, adns_r_hinfo= 13, @@@ -360,6 -361,19 +361,19 @@@ int adns_init(adns_state *newstate_r, a int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags, FILE *diagfile /*0=>discard*/, const char *configtext); + typedef void adns_logcallbackfn(adns_state ads, void *logfndata, + const char *fmt, va_list al); + /* Will be called perhaps several times for each message; when the + * message is complete, the string implied by fmt and al will end in + * a newline. Log messages start with `adns debug:' or `adns + * warning:' or `adns:' (for errors), or `adns debug [PID]:' + * etc. if adns_if_logpid is set. */ + + int adns_init_logfn(adns_state *newstate_r, adns_initflags flags, + const char *configtext /*0=>use default config files*/, + adns_logcallbackfn *logfn /*0=>logfndata is a FILE* */, + void *logfndata /*0 with logfn==0 => discard*/); + /* Configuration: * adns_init reads /etc/resolv.conf, which is expected to be (broadly * speaking) in the format expected by libresolv, and then @@@ -672,10 -686,10 +686,10 @@@ void adns_beforeselect(adns_state ads, * for adns_firsttimeout. readfds, writefds, exceptfds and maxfd_io may * not be 0. * - * If now is not 0 then this will never actually do any I/O, or change - * the fds that adns is using or the timeouts it wants. In any case - * it won't block, and it will set the timeout to zero if a query - * finishes in _beforeselect. + * If tv_mod is 0 on entry then this will never actually do any I/O, + * or change the fds that adns is using or the timeouts it wants. In + * any case it won't block, and it will set the timeout to zero if a + * query finishes in _beforeselect. */ void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds,