chiark / gitweb /
src/: Carve out a `representation' subfield of adns_rrtype.
[adns.git] / src / adns.h
index befa0b3858f6ab5badb02c4d6d4a9ff8adf11a98..578545c80024f5bb0442227b69481874d95c9fd3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * adns.h
- * - adns user-visible API (single-threaded, without any locking)
+ * - adns user-visible API
  */
 /*
  *
@@ -106,6 +106,7 @@ typedef enum { /* In general, or together the desired flags: */
 
 typedef enum {
  adns_rrt_typemask=  0x0ffff,
+ adns_rrt_reprmask= 0xffffff,
  adns__qtf_deref=    0x10000,/* dereference domains; perhaps get extra data */
  adns__qtf_mail822=  0x20000,/* return mailboxes in RFC822 rcpt field fmt   */
 
@@ -401,6 +402,18 @@ typedef struct {
  *  requested.
  */
 
+/* Threads:
+ *  adns does not use any static modifiable state, so it
+ *   is safe to call adns_init several times and then use the
+ *   resulting adns_states concurrently.
+ *  However, it is NOT safe to make simultaneous calls into
+ *   adns using the same adns_state; a single adns_state must be used
+ *   only by one thread at a time.  You can solve this problem by
+ *   having one adns_state per thread, or if that isn't feasible, you
+ *   could maintain a pool of adns_states.  Unfortunately neither of
+ *   these approaches has optimal performance.
+ */
+
 int adns_init(adns_state *newstate_r, adns_initflags flags,
              FILE *diagfile /*0=>stderr*/);