diff --git a/src/const-info.c b/src/const-info.c index c9b6c0ff..4c472dab 100644 --- a/src/const-info.c +++ b/src/const-info.c @@ -6,7 +6,7 @@ #include "const-info.h" static struct const_info consts_info[] = { - { -1, "/* */", "/* */" }, + { -1, NULL, "/* */" }, { 0, "GETDNS_RETURN_GOOD", GETDNS_RETURN_GOOD_TEXT }, { 1, "GETDNS_RETURN_GENERIC_ERROR", GETDNS_RETURN_GENERIC_ERROR_TEXT }, { 300, "GETDNS_RETURN_BAD_DOMAIN_NAME", GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT }, diff --git a/src/dict.c b/src/dict.c index 5a26d1d7..326bdd83 100644 --- a/src/dict.c +++ b/src/dict.c @@ -41,6 +41,7 @@ #include "util-internal.h" #include "dict.h" #include "rr-dict.h" +#include "const-info.h" /*---------------------------------------- getdns_dict_find */ /** @@ -689,13 +690,23 @@ getdns_pp_dict(ldns_buffer * buf, size_t indent, switch (item->dtype) { case t_int: if ((strcmp(item->node.key, "type") == 0 || - strcmp(item->node.key, "type_covered") == 0) && + strcmp(item->node.key, "type_covered") == 0 || + strcmp(item->node.key, "qtype") == 0) && (strval = priv_getdns_rr_type_name(item->data.n))) { if (ldns_buffer_printf( buf, " GETDNS_RRTYPE_%s", strval) < 0) return -1; break; } + if ((strcmp(item->node.key, "answer_type") == 0 || + strcmp(item->node.key, "dnssec_status") == 0 || + strcmp(item->node.key, "status") == 0) && + (strval = + priv_getdns_get_const_info(item->data.n)->name)) { + if (ldns_buffer_printf(buf, " %s", strval) < 0) + return -1; + break; + } if (ldns_buffer_printf(buf, " %d", item->data.n) < 0) return -1; break; diff --git a/src/mk-const-info.c.sh b/src/mk-const-info.c.sh index 17462423..dc341e78 100755 --- a/src/mk-const-info.c.sh +++ b/src/mk-const-info.c.sh @@ -9,7 +9,7 @@ cat > const-info.c << END_OF_HEAD #include "const-info.h" static struct const_info consts_info[] = { - { -1, "/* */", "/* */" }, + { -1, NULL, "/* */" }, END_OF_HEAD awk '/^[ ]+GETDNS_[A-Z_]+[ ]+=[ ]+[0-9]+/{ print "\t{ "$3", \""$1"\", "$1"_TEXT }," }/^#define GETDNS_[A-Z_]+[ ]+[0-9]+/ && !/^#define GETDNS_RRTYPE/ && !/_TEXT/{ print "\t{ "$3", \""$2"\", "$2"_TEXT },"}' getdns/getdns.h | sed 's/,,/,/g' >> const-info.c cat >> const-info.c << END_OF_TAIL