#include <stdarg.h>
#include <assert.h>
#include <unistd.h>
+#include <signal.h>
#include <sys/time.h>
int nservers, nsortlist, tcpserver;
enum adns__tcpstate { server_disconnected, server_connecting, server_ok } tcpstate;
struct timeval tcptimeout;
+ struct sigaction stdsigpipe;
+ sigset_t stdsigmask;
struct server {
struct in_addr addr;
} servers[MAXSERVERS];
* sz bytes long. needswap should return !0 if a>b (strictly, ie
* wrong order) 0 if a<=b (ie, order is fine).
*/
-
+
+void adns__sigpipe_protect(adns_state);
+void adns__sigpipe_unprotect(adns_state);
+/* If SIGPIPE protection is not disabled, will block all signals except
+ * SIGPIPE, and set SIGPIPE's disposition to SIG_IGN. (And then restore.)
+ * Each call to _protect must be followed by a call to _unprotect before
+ * any significant amount of code gets to run.
+ */
+
/* From transmit.c: */
adns_status adns__mkquery(adns_state ads, vbuf *vb, int *id_r,
* serv may be -1 and qu may be 0 - they are used for error reporting only.
*/
+adns_status adns__parse_domain_more(findlabel_state *fls, adns_state ads,
+ adns_query qu, vbuf *vb, parsedomain_flags flags,
+ const byte *dgram);
+/* Like adns__parse_domain, but you pass it a pre-initialised findlabel_state,
+ * for continuing an existing domain or some such of some kind. Also, unlike
+ * _parse_domain, the domain data will be appended to vb, rather than replacing
+ * the existing contents.
+ */
+
adns_status adns__findrr(adns_query qu, int serv,
const byte *dgram, int dglen, int *cbyte_io,
int *type_r, int *class_r, unsigned long *ttl_r,