chiark / gitweb /
Compiles and links.
[adns.git] / src / types.c
index 38330cf11a45e9dd04c27901beb8ab66e2e0a126..5219ff5c887d6a72e3e28f8b21334ad22bbae1e2 100644 (file)
@@ -1,8 +1,28 @@
-/**/
+/*
+ * types.c
+ * - RR-type-specific code, and the machinery to call it
+ */
+/*
+ *  This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
 
 #include "internal.h"
 
-static adns_status rp_inaddr(adns_state ads, adns_query qu, int serv,
+static adns_status rp_inaddr(adns_query qu, int serv,
                             const byte *dgram, int dglen, int cbyte, int max,
                             void *store_r) {
   struct in_addr *dr= store_r;
@@ -12,10 +32,10 @@ static adns_status rp_inaddr(adns_state ads, adns_query qu, int serv,
   return adns_s_ok;
 }
 
-static adns_status rmf_null(adns_state ads, adns_query qu, void *data) { }
+static void rmf_null(adns_query qu, void *data) { }
 
-#define TYPE_SF(size,func,free)    size, rp_#func, rmf_#free
-#define TYPE_SN(size,func)         size, rp_#func, rmf_null
+#define TYPE_SF(size,func,free)    size, rp_##func, rmf_##free
+#define TYPE_SN(size,func)         size, rp_##func, rmf_null
 #define TYPESZ_M(member)           (sizeof(((adns_answer*)0)->rrs.member))
 #define TYPE_MF(member,parse)      TYPE_SF(TYPESZ_M(member),parse,member)
 #define TYPE_MN(member,parse)      TYPE_SN(TYPESZ_M(member),parse)
@@ -52,8 +72,8 @@ static const typeinfo typeinfos[] = {
 #endif
 };
 
-const typeinfo adns__findtype(adns_rrtype type) {
-  const typeinfo *begin, *end;
+const typeinfo *adns__findtype(adns_rrtype type) {
+  const typeinfo *begin, *end, *mid;
 
   begin= typeinfos;  end= typeinfos+(sizeof(typeinfos)/sizeof(typeinfo));