adns_if_eintr= 0x0020, /* allow _wait and _synchronous to return EINTR */
adns_if_nosigpipe= 0x0040, /* applic has SIGPIPE set to SIG_IGN, do not protect */
adns_if_checkc_entex= 0x0100, /* do consistency checks on entry/exit to adns funcs */
- adns_if_checkc_freq= 0x0300, /* do consistency checks very frequently (slow!) */
+ adns_if_checkc_freq= 0x0300 /* do consistency checks very frequently (slow!) */
} adns_initflags;
typedef enum {
/* permanent errors */
adns_s_nxdomain,
- adns_s_nodata,
+ adns_s_nodata
} adns_status;
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
* 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.
*/
/*
* from, or send outgoing data via, fd. Very like _processany. If it
* returns zero then fd will no longer be readable or writeable
* (unless of course more data has arrived since). adns will _only_
- * that fd and only in the manner specified, regardless of whether
+ * use that fd and only in the manner specified, regardless of whether
* adns_if_noautosys was specified.
*
* adns_processexceptional should be called when select(2) reports an
* 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.
* 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