From: Mark Wooding Date: Sat, 31 May 2014 15:37:48 +0000 (+0100) Subject: src/internal.h: Hoist the qcontext definition to before typeinfo. X-Git-Tag: make-bug.2014-07-26~44 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=adns.git;a=commitdiff_plain;h=e1d3be7eb6f703e8cf9b8104497f010c0298637a;ds=sidebyside src/internal.h: Hoist the qcontext definition to before typeinfo. So that typeinfo functions can have argument types which involve the qcontext structure. Signed-off-by: Mark Wooding --- diff --git a/src/internal.h b/src/internal.h index f459a24..fed8466 100644 --- a/src/internal.h +++ b/src/internal.h @@ -124,6 +124,20 @@ typedef struct { 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; @@ -199,20 +213,6 @@ union maxalign { 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;