Properly fix bug with cancelling children.
[adns] / src / adns.h
index 7c75db9..7a38276 100644 (file)
@@ -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.56 1999/08/14 18:54:38 ian Exp $
+ *  $Id: adns.h,v 1.60 1999/09/26 15:17:29 ian Exp $
  */
 
 #ifndef ADNS_H_INCLUDED
@@ -49,6 +49,8 @@ typedef enum {
   adns_if_noautosys=    0x0010, /* do not make syscalls at every opportunity */
   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_initflags;
 
 typedef enum {
@@ -379,6 +381,13 @@ 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, 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.
+ */
+
 /*
  * Example expected/legal calling sequence for submit/check/wait:
  *  adns_init
@@ -544,7 +553,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.
@@ -565,9 +574,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
@@ -626,19 +637,24 @@ adns_status adns_rr_info(adns_rrtype type,
  * syntax is INET followed by the dotted quad (from inet_ntoa).
  * Currently only IPv4 is supported.
  *
+ * Text strings (as in adns_rr_txt) appear inside double quotes, and
+ * use \" and \\ to represent " and \, and \xHH to represent
+ * characters not in the range 32-126.
+ *
  * Hostname with addresses (adns_rr_hostaddr): this consists of the
- * hostname, as usual, followed by the adns_status value (as an
- * abbreviation) for the address lookup, followed by zero or more
+ * hostname, as usual, followed by the adns_status value, as an
+ * abbreviation, and then a descriptive string (encoded as if it were
+ * a piece of text), for the address lookup, followed by zero or more
  * addresses enclosed in ( and ).  If the result was a permanent
  * failure, then a single ?  appears instead of the ( ).  If the
  * result was a temporary failure then an empty pair of parentheses
  * appears (which a space in between).  For example, one of the NS
- * records for greenend.org.uk comes out like 
- *  ns.chiark.greenend.org.uk ok ( INET 195.224.76.132 )
+ * records for greenend.org.uk comes out like
+ *  ns.chiark.greenend.org.uk ok "OK" ( INET 195.224.76.132 )
  * an MX referring to a nonexistent host might come out like:
- *  50 sun2.nsfnet-relay.ac.uk nxdomain ( )
+ *  50 sun2.nsfnet-relay.ac.uk nxdomain "No such domain" ( )
  * and if nameserver information is not available you might get:
- *  dns2.spong.dyn.ml.org timeout ?
+ *  dns2.spong.dyn.ml.org timeout "DNS query timed out" ?
  */
 
 const char *adns_strerror(adns_status st);