chiark / gitweb /
Import changes from chiark: cvs rdiff -u -r tochiark-1998-11-08 -r fromchiark-1998...
[adns] / src / adns.h
index 63e753752644789aacecd0cd5025607d50d45783..2bb67809b971e28bd03a50aa711071f34fb635e5 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C)1998 Ian Jackson.
  * This version provided for review and comment only.
  *
- * $Id: adns.h,v 1.23 1998/11/08 16:16:09 ian Exp $
+ * $Id: adns.h,v 1.24 1998/11/10 01:03:54 ian Exp $
  */
 /*
  *  This file is part of adns, which is Copyright (C) 1997, 1998 Ian Jackson
@@ -163,7 +163,7 @@ typedef struct {
 typedef struct {
   adns_status status;
   char *cname; /* always NULL if query was for CNAME records */
-  adns_rrtype type;
+  adns_rrtype type; /* guaranteed to be same as in query */
   int nrrs, rrsz;
   union {
     void *untyped;
@@ -288,6 +288,34 @@ void adns_interest(adns_state, int *maxfd_io, fd_set *readfds_io,
  *  }
  */
 
+adns_status adns_rr_info(adns_rrtype type,
+                        const char **rrtname_r, const char **fmtname_r,
+                        int *len_r,
+                        const void *datap, char **data_r);
+/* Gets information in human-readable (but non-i18n) form
+ * for eg debugging purposes.  type must be specified,
+ * and the official name of the corresponding RR type will
+ * be returned in *rrtname_r, and information about the processing
+ * style in *fmtname_r.  The length of the table entry in an answer
+ * for that type will be returned in in *len_r.
+ * Any or all of rrtname_r, fmtname_r and len_r may be 0.
+ * If fmtname_r is non-null then *fmtname_r may be
+ * null on return, indicating that no special processing is
+ * involved.
+ *
+ * data_r be must be non-null iff datap is.  In this case
+ * *data_r will be set to point to a human-readable text
+ * string representing the RR data.  The text will have
+ * been obtained from malloc() and must be freed by the caller.
+ *
+ * Usually this routine will succeed.  Possible errors include:
+ *  adns_s_nomemory
+ *  adns_s_notimplemented (RR type not known)
+ *  adns_s_invaliddata (*datap contained garbage)
+ * If an error occurs then no memory has been allocated,
+ * and *rrtname_r, *fmtname_r, *len_r and *data_r are undefined.
+ */
+
 const char *adns_strerror(adns_status st);
 
 #endif