chiark / gitweb /
Regression tests compile on systems without poll(2). Do not install
[adns.git] / src / adns.h
index 4f25dc7246529a5e6e711ea568767539f4b6faa2..698cfb4c5c8f6dfc7ec7bfc52b38a8263949d0da 100644 (file)
 
 #ifndef ADNS_H_INCLUDED
 #define ADNS_H_INCLUDED
+#ifdef __cplusplus
+extern "C" { /* I really dislike this - iwj. */
+#endif
 
 #include <stdio.h>
 
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
 
 /* All struct in_addr anywhere in adns are in NETWORK byte order. */
 
@@ -297,6 +303,9 @@ void adns_cancel(adns_query query);
  * first adns_submit or _transact call using the same adns_state after
  * it became invalid, so you may compare it for equality with other
  * query handles until you next call _query or _transact.
+ *
+ * _submit and _synchronous return ENOSYS if they don't understand the
+ * query type.
  */
 
 void adns_finish(adns_state ads);
@@ -306,7 +315,7 @@ void adns_finish(adns_state ads);
 
 
 void adns_forallqueries_begin(adns_state ads);
-struct adns_query adns_forallqueries_next(adns_state ads, void **context_r);
+adns_query adns_forallqueries_next(adns_state ads, void **context_r);
 /* Iterator functions, which you can use to loop over the outstanding
  * (submitted but not yet successfuly checked/waited) queries.
  *
@@ -319,7 +328,7 @@ struct adns_query adns_forallqueries_next(adns_state ads, void **context_r);
  * query in the same adns_state).  There is no need to explicitly
  * finish an iteration.
  *
- * context_r may be 0.
+ * context_r may be 0.  *context_r may not be set when _next returns 0.
  */
 
 /*
@@ -564,4 +573,7 @@ const char *adns_errabbrev(adns_status st);
  * not returned by the same adns library.
  */
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
 #endif