X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/1389dc72fe158c45875e5a372b389d500ba89462..69e9793fa2073d101b56faabc352f2c36d900704:/src/adns.h diff --git a/src/adns.h b/src/adns.h index 59fb91e..876fddc 100644 --- a/src/adns.h +++ b/src/adns.h @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: adns.h,v 1.58 1999/09/25 15:46:39 ian Exp $ + * $Id: adns.h,v 1.61 1999/09/26 18:59:34 ian Exp $ */ #ifndef ADNS_H_INCLUDED @@ -336,6 +336,12 @@ int adns_wait(adns_state ads, adns_answer **answer_r, void **context_r); +/* same as adns_wait but uses poll(2) internally */ +int adns_wait_poll(adns_state ads, + adns_query *query_io, + adns_answer **answer_r, + void **context_r); + void adns_cancel(adns_query query); /* The adns_query you get back from _submit is valid (ie, can be @@ -381,9 +387,11 @@ adns_query adns_forallqueries_next(adns_state ads, void **context_r); * context_r may be 0. *context_r may not be set when _next returns 0. */ -void adns_checkconsistency(adns_state ads); +void adns_checkconsistency(adns_state ads, adns_query qu); /* Checks the consistency of adns's internal data structures. * If any error is found, the program will abort(). + * You may pass 0 for qu; if you pass non-null then additional checks + * are done to make sure that qu is a valid query. */ /* @@ -551,7 +559,7 @@ int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, int *timeo * in *nfds_io, and always return either 0 (if it is not interested in * any fds) or ERANGE (if it is). * - * NOTE that (unless timeout_io is 0) adns may acquire additional fds + * NOTE that (unless now is 0) adns may acquire additional fds * from one call to the next, so you must put adns_beforepoll in a * loop, rather than assuming that the second call (with the buffer * size requested by the first) will not return ERANGE. @@ -572,9 +580,11 @@ int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, int *timeo * adns_beforepoll will return 0 on success, and will not fail for any * reason other than the fds buffer being too small (ERANGE). * - * This call will never actually do any I/O, or change the fds that - * adns is using or the timeouts it wants; and in any case it won't - * block. + * This call will never actually do any I/O. If you supply the + * current time it will not change the fds that adns is using or the + * timeouts it wants. + * + * In any case this call won't block. */ #define ADNS_POLLFDS_RECOMMENDED 2