summaryrefslogtreecommitdiff
path: root/usr.bin/dig
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-06-25 12:14:19 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-06-25 12:14:19 +0000
commitd3e9e9491952688bac2caa3839b2f5796b68bb0a (patch)
tree7d6974e711ad35212240bbf65a523240759c0826 /usr.bin/dig
parent9ad74e274143579b32fefbbf4ea4c6f38557194e (diff)
remove some unused code and uneeded includes
ok beck@ florian@
Diffstat (limited to 'usr.bin/dig')
-rw-r--r--usr.bin/dig/lib/dns/gen.c1
-rw-r--r--usr.bin/dig/lib/dns/include/dns/rdataset.h16
-rw-r--r--usr.bin/dig/lib/dns/rdata.c3
-rw-r--r--usr.bin/dig/lib/dns/rdatalist.c3
-rw-r--r--usr.bin/dig/lib/dns/rdataset.c13
-rw-r--r--usr.bin/dig/lib/isc/lex.c5
-rw-r--r--usr.bin/dig/lib/isccfg/include/isccfg/cfg.h69
-rw-r--r--usr.bin/dig/lib/isccfg/parser.c43
8 files changed, 5 insertions, 148 deletions
diff --git a/usr.bin/dig/lib/dns/gen.c b/usr.bin/dig/lib/dns/gen.c
index d0720fde0a0..96da6d300c2 100644
--- a/usr.bin/dig/lib/dns/gen.c
+++ b/usr.bin/dig/lib/dns/gen.c
@@ -83,7 +83,6 @@ static const char copyright[] =
#define TYPECLASSLEN 20 /* DNS mnemonic size. Must be less than 100. */
#define TYPECLASSBUF (TYPECLASSLEN + 1)
#define TYPECLASSFMT "%" STR(TYPECLASSLEN) "[-0-9a-z]_%d"
-#define ATTRIBUTESIZE 256
#define DIRNAMESIZE 256
static struct cc {
diff --git a/usr.bin/dig/lib/dns/include/dns/rdataset.h b/usr.bin/dig/lib/dns/include/dns/rdataset.h
index e1da816f9e4..5fbf3e03587 100644
--- a/usr.bin/dig/lib/dns/include/dns/rdataset.h
+++ b/usr.bin/dig/lib/dns/include/dns/rdataset.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.h,v 1.12 2022/06/25 10:20:30 florian Exp $ */
+/* $Id: rdataset.h,v 1.13 2022/06/25 12:14:18 jsg Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
@@ -181,20 +181,6 @@ dns_rdataset_makequestion(dns_rdataset_t *rdataset, dns_rdataclass_t rdclass,
*\li 'rdataset' is a valid, associated, question rdataset.
*/
-void
-dns_rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target);
-/*%<
- * Make 'target' refer to the same rdataset as 'source'.
- *
- * Requires:
- *\li 'source' is a valid, associated rdataset.
- *
- *\li 'target' is a valid, dissociated rdataset.
- *
- * Ensures:
- *\li 'target' references the same rdataset as 'source'.
- */
-
isc_result_t
dns_rdataset_first(dns_rdataset_t *rdataset);
/*%<
diff --git a/usr.bin/dig/lib/dns/rdata.c b/usr.bin/dig/lib/dns/rdata.c
index c27409efc3c..8f513d05354 100644
--- a/usr.bin/dig/lib/dns/rdata.c
+++ b/usr.bin/dig/lib/dns/rdata.c
@@ -14,13 +14,12 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.33 2021/04/02 06:37:40 florian Exp $ */
+/* $Id: rdata.c,v 1.34 2022/06/25 12:14:18 jsg Exp $ */
/*! \file */
#include <arpa/inet.h>
-#include <ctype.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.bin/dig/lib/dns/rdatalist.c b/usr.bin/dig/lib/dns/rdatalist.c
index 2f8a9a27e17..dceedb6a07f 100644
--- a/usr.bin/dig/lib/dns/rdatalist.c
+++ b/usr.bin/dig/lib/dns/rdatalist.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatalist.c,v 1.3 2022/06/25 10:20:29 florian Exp $ */
+/* $Id: rdatalist.c,v 1.4 2022/06/25 12:14:18 jsg Exp $ */
/*! \file */
@@ -22,7 +22,6 @@
#include <isc/util.h>
-#include <dns/name.h>
#include <dns/rdata.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
diff --git a/usr.bin/dig/lib/dns/rdataset.c b/usr.bin/dig/lib/dns/rdataset.c
index 7e9aa5ed8d5..cd9b5f12357 100644
--- a/usr.bin/dig/lib/dns/rdataset.c
+++ b/usr.bin/dig/lib/dns/rdataset.c
@@ -159,19 +159,6 @@ dns_rdataset_makequestion(dns_rdataset_t *rdataset, dns_rdataclass_t rdclass,
rdataset->attributes |= DNS_RDATASETATTR_QUESTION;
}
-void
-dns_rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) {
-
- /*
- * Make 'target' refer to the same rdataset as 'source'.
- */
-
- REQUIRE(source->methods != NULL);
- REQUIRE(target->methods == NULL);
-
- (source->methods->clone)(source, target);
-}
-
isc_result_t
dns_rdataset_first(dns_rdataset_t *rdataset) {
diff --git a/usr.bin/dig/lib/isc/lex.c b/usr.bin/dig/lib/isc/lex.c
index 984c264c1b1..05fcd495393 100644
--- a/usr.bin/dig/lib/isc/lex.c
+++ b/usr.bin/dig/lib/isc/lex.c
@@ -14,11 +14,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lex.c,v 1.14 2022/01/17 18:19:51 naddy Exp $ */
+/* $Id: lex.c,v 1.15 2022/06/25 12:14:18 jsg Exp $ */
/*! \file */
-#include <ctype.h>
#include <stdlib.h>
#include <isc/buffer.h>
@@ -239,8 +238,6 @@ typedef enum {
lexstate_qstring
} lexstate;
-#define IWSEOL (ISC_LEXOPT_INITIALWS | ISC_LEXOPT_EOL)
-
static void
pushback(inputsource *source, int c) {
REQUIRE(source->pushback->current > 0);
diff --git a/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h b/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h
index 1ed3c620ea6..3a95ee3fa48 100644
--- a/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h
+++ b/usr.bin/dig/lib/isccfg/include/isccfg/cfg.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cfg.h,v 1.6 2020/09/14 08:40:44 florian Exp $ */
+/* $Id: cfg.h,v 1.7 2022/06/25 12:14:18 jsg Exp $ */
#ifndef ISCCFG_CFG_H
#define ISCCFG_CFG_H 1
@@ -157,75 +157,8 @@ cfg_obj_asstring(const cfg_obj_t *obj);
* \li A pointer to a null terminated string.
*/
-int
-cfg_obj_islist(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of list type.
- */
-
-const cfg_listelt_t *
-cfg_list_first(const cfg_obj_t *obj);
-/*%<
- * Returns the first list element in a configuration object of a list type.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of a list type or NULL.
- *
- * Returns:
- * \li A pointer to a cfg_listelt_t representing the first list element,
- * or NULL if the list is empty or nonexistent.
- */
-
-const cfg_listelt_t *
-cfg_list_next(const cfg_listelt_t *elt);
-/*%<
- * Returns the next element of a list of configuration objects.
- *
- * Requires:
- * \li 'elt' points to cfg_listelt_t obtained from cfg_list_first() or
- * a previous call to cfg_list_next().
- *
- * Returns:
- * \li A pointer to a cfg_listelt_t representing the next element,
- * or NULL if there are no more elements.
- */
-
-unsigned int
-cfg_list_length(const cfg_obj_t *obj, int recurse);
-/*%<
- * Returns the length of a list of configure objects. If obj is
- * not a list, returns 0. If recurse is true, add in the length of
- * all contained lists.
- */
-
-void
-cfg_print(const cfg_obj_t *obj,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-void
-cfg_printx(const cfg_obj_t *obj, unsigned int flags,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-
#define CFG_PRINTER_XKEY 0x1 /* '?' out shared keys. */
-/*%<
- * Print the configuration object 'obj' by repeatedly calling the
- * function 'f', passing 'closure' and a region of text starting
- * at 'text' and comprising 'textlen' characters.
- *
- * If CFG_PRINTER_XKEY the contents of shared keys will be obscured
- * by replacing them with question marks ('?')
- */
-
-void
-cfg_print_grammar(const cfg_type_t *type,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-/*%<
- * Print a summary of the grammar of the configuration type 'type'.
- */
-
void
cfg_obj_destroy(cfg_parser_t *pctx, cfg_obj_t **obj);
/*%<
diff --git a/usr.bin/dig/lib/isccfg/parser.c b/usr.bin/dig/lib/isccfg/parser.c
index 6da5e1ae12e..4b9c0b8ef9f 100644
--- a/usr.bin/dig/lib/isccfg/parser.c
+++ b/usr.bin/dig/lib/isccfg/parser.c
@@ -590,49 +590,6 @@ cfg_parse_listelt(cfg_parser_t *pctx, const cfg_type_t *elttype,
return (result);
}
-int
-cfg_obj_islist(const cfg_obj_t *obj) {
- REQUIRE(obj != NULL);
- return (obj->type->rep == &cfg_rep_list);
-}
-
-const cfg_listelt_t *
-cfg_list_first(const cfg_obj_t *obj) {
- REQUIRE(obj == NULL || obj->type->rep == &cfg_rep_list);
- if (obj == NULL)
- return (NULL);
- return (ISC_LIST_HEAD(obj->value.list));
-}
-
-const cfg_listelt_t *
-cfg_list_next(const cfg_listelt_t *elt) {
- REQUIRE(elt != NULL);
- return (ISC_LIST_NEXT(elt, link));
-}
-
-/*
- * Return the length of a list object. If obj is NULL or is not
- * a list, return 0.
- */
-unsigned int
-cfg_list_length(const cfg_obj_t *obj, int recurse) {
- const cfg_listelt_t *elt;
- unsigned int count = 0;
-
- if (obj == NULL || !cfg_obj_islist(obj))
- return (0U);
- for (elt = cfg_list_first(obj);
- elt != NULL;
- elt = cfg_list_next(elt)) {
- if (recurse && cfg_obj_islist(elt->obj)) {
- count += cfg_list_length(elt->obj, recurse);
- } else {
- count++;
- }
- }
- return (count);
-}
-
/*
* Maps.
*/