chiark / gitweb /
src/internal.h: Hoist the qcontext definition to before typeinfo.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 31 May 2014 15:37:48 +0000 (16:37 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 13 Jun 2014 08:57:41 +0000 (09:57 +0100)
So that typeinfo functions can have argument types which involve the
qcontext structure.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
src/internal.h

index f459a24766a61c3138062f28fa04d3f5a4b7c04a..fed84663626f2eeae1c1709a04b425451a995789 100644 (file)
@@ -124,6 +124,20 @@ typedef struct {
   struct timeval now;
 } parseinfo;
 
   struct timeval now;
 } parseinfo;
 
+typedef struct {
+  void *ext;
+  void (*callback)(adns_query parent, adns_query child);
+
+  union {
+    adns_rr_addr ptr_addr;
+  } tinfo; /* type-specific state for the query itself: zero-init if you
+           * don't know better. */
+
+  union {
+    adns_rr_hostaddr *hostaddr;
+  } pinfo; /* state for use by parent's callback function */
+} qcontext;
+
 typedef struct typeinfo {
   adns_rrtype typekey;
   const char *rrtname;
 typedef struct typeinfo {
   adns_rrtype typekey;
   const char *rrtname;
@@ -199,20 +213,6 @@ union maxalign {
   union maxalign *up;
 } data;
 
   union maxalign *up;
 } data;
 
-typedef struct {
-  void *ext;
-  void (*callback)(adns_query parent, adns_query child);
-
-  union {
-    adns_rr_addr ptr_addr;
-  } tinfo; /* type-specific state for the query itself: zero-init if you
-           * don't know better. */
-
-  union {
-    adns_rr_hostaddr *hostaddr;
-  } pinfo; /* state for use by parent's callback function */
-} qcontext;
-
 struct adns__query {
   adns_state ads;
   enum { query_tosend, query_tcpw, query_childw, query_done } state;
 struct adns__query {
   adns_state ads;
   enum { query_tosend, query_tcpw, query_childw, query_done } state;