summaryrefslogtreecommitdiffstats
path: root/usr.bin/dig/lib/isc
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2020-02-23 23:40:21 +0000
committerjsg <jsg@openbsd.org>2020-02-23 23:40:21 +0000
commitafc94c37458f3fb1a93f727a90bf1f56b6e5eee6 (patch)
tree0468682389171f3638ccc7792ebf1dbc775a3212 /usr.bin/dig/lib/isc
parentrmeove more unused functions and code (diff)
downloadwireguard-openbsd-afc94c37458f3fb1a93f727a90bf1f56b6e5eee6.tar.xz
wireguard-openbsd-afc94c37458f3fb1a93f727a90bf1f56b6e5eee6.zip
remove some unused functions
ok jung@
Diffstat (limited to 'usr.bin/dig/lib/isc')
-rw-r--r--usr.bin/dig/lib/isc/base64.c32
-rw-r--r--usr.bin/dig/lib/isc/include/isc/base64.h20
-rw-r--r--usr.bin/dig/lib/isc/include/isc/lex.h21
-rw-r--r--usr.bin/dig/lib/isc/lex.c38
4 files changed, 4 insertions, 107 deletions
diff --git a/usr.bin/dig/lib/isc/base64.c b/usr.bin/dig/lib/isc/base64.c
index c8d1d4c22b2..cb5d8f29fb3 100644
--- a/usr.bin/dig/lib/isc/base64.c
+++ b/usr.bin/dig/lib/isc/base64.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base64.c,v 1.1 2020/02/07 09:58:53 florian Exp $ */
+/* $Id: base64.c,v 1.2 2020/02/23 23:40:22 jsg Exp $ */
/*! \file */
@@ -176,36 +176,6 @@ base64_decode_finish(base64_decode_ctx_t *ctx) {
}
isc_result_t
-isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length) {
- base64_decode_ctx_t ctx;
- isc_textregion_t *tr;
- isc_token_t token;
- isc_boolean_t eol;
-
- base64_decode_init(&ctx, length, target);
-
- while (!ctx.seen_end && (ctx.length != 0)) {
- unsigned int i;
-
- if (length > 0)
- eol = ISC_FALSE;
- else
- eol = ISC_TRUE;
- RETERR(isc_lex_getmastertoken(lexer, &token,
- isc_tokentype_string, eol));
- if (token.type != isc_tokentype_string)
- break;
- tr = &token.value.as_textregion;
- for (i = 0; i < tr->length; i++)
- RETERR(base64_decode_char(&ctx, tr->base[i]));
- }
- if (ctx.length < 0 && !ctx.seen_end)
- isc_lex_ungettoken(lexer, &token);
- RETERR(base64_decode_finish(&ctx));
- return (ISC_R_SUCCESS);
-}
-
-isc_result_t
isc_base64_decodestring(const char *cstr, isc_buffer_t *target) {
base64_decode_ctx_t ctx;
diff --git a/usr.bin/dig/lib/isc/include/isc/base64.h b/usr.bin/dig/lib/isc/include/isc/base64.h
index 956c10b8705..c4413912948 100644
--- a/usr.bin/dig/lib/isc/include/isc/base64.h
+++ b/usr.bin/dig/lib/isc/include/isc/base64.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base64.h,v 1.3 2020/02/13 13:53:01 jsg Exp $ */
+/* $Id: base64.h,v 1.4 2020/02/23 23:40:22 jsg Exp $ */
#ifndef ISC_BASE64_H
#define ISC_BASE64_H 1
@@ -67,24 +67,6 @@ isc_base64_decodestring(const char *cstr, isc_buffer_t *target);
*
* Other error returns are any possible error code from:
*\li isc_lex_create(),
- *\li isc_base64_tobuffer().
- */
-
-isc_result_t
-isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
-/*!<
- * \brief Convert base64 encoded text from a lexer context into data.
- *
- * Requires:
- *\li 'lex' is a valid lexer context
- *\li 'target' is a buffer containing binary data
- *\li 'length' is an integer
- *
- * Ensures:
- *\li target will contain the data represented by the base64 encoded
- * string parsed by the lexer. No more than length bytes will be read,
- * if length is positive. The 'used' pointer in target will be
- * advanced as necessary.
*/
#endif /* ISC_BASE64_H */
diff --git a/usr.bin/dig/lib/isc/include/isc/lex.h b/usr.bin/dig/lib/isc/include/isc/lex.h
index 829e3c19399..6ec56bc0cea 100644
--- a/usr.bin/dig/lib/isc/include/isc/lex.h
+++ b/usr.bin/dig/lib/isc/include/isc/lex.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lex.h,v 1.4 2020/02/22 19:47:07 jung Exp $ */
+/* $Id: lex.h,v 1.5 2020/02/23 23:40:22 jsg Exp $ */
#ifndef ISC_LEX_H
#define ISC_LEX_H 1
@@ -248,25 +248,6 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp);
*\li #ISC_R_NOMORE No more input sources
*/
-isc_result_t
-isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token,
- isc_tokentype_t expect, isc_boolean_t eol);
-/*%<
- * Get the next token from a DNS master file type stream. This is a
- * convenience function that sets appropriate options and handles quoted
- * strings and end of line correctly for master files. It also ungets
- * unexpected tokens.
- *
- * Requires:
- *\li 'lex' is a valid lexer.
- *
- *\li 'token' is a valid pointer
- *
- * Returns:
- *
- * \li any return code from isc_lex_gettoken().
- */
-
void
isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp);
/*%<
diff --git a/usr.bin/dig/lib/isc/lex.c b/usr.bin/dig/lib/isc/lex.c
index 3d4e62bf521..d9d3baa6bc3 100644
--- a/usr.bin/dig/lib/isc/lex.c
+++ b/usr.bin/dig/lib/isc/lex.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lex.c,v 1.6 2020/02/22 19:47:06 jung Exp $ */
+/* $Id: lex.c,v 1.7 2020/02/23 23:40:22 jsg Exp $ */
/*! \file */
@@ -720,42 +720,6 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
return (result);
}
-isc_result_t
-isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token,
- isc_tokentype_t expect, isc_boolean_t eol)
-{
- unsigned int options = ISC_LEXOPT_EOL | ISC_LEXOPT_EOF |
- ISC_LEXOPT_DNSMULTILINE | ISC_LEXOPT_ESCAPE;
- isc_result_t result;
-
- if (expect == isc_tokentype_qstring)
- options |= ISC_LEXOPT_QSTRING;
- else if (expect == isc_tokentype_number)
- options |= ISC_LEXOPT_NUMBER;
- result = isc_lex_gettoken(lex, options, token);
- if (result == ISC_R_RANGE)
- isc_lex_ungettoken(lex, token);
- if (result != ISC_R_SUCCESS)
- return (result);
-
- if (eol && ((token->type == isc_tokentype_eol) ||
- (token->type == isc_tokentype_eof)))
- return (ISC_R_SUCCESS);
- if (token->type == isc_tokentype_string &&
- expect == isc_tokentype_qstring)
- return (ISC_R_SUCCESS);
- if (token->type != expect) {
- isc_lex_ungettoken(lex, token);
- if (token->type == isc_tokentype_eol ||
- token->type == isc_tokentype_eof)
- return (ISC_R_UNEXPECTEDEND);
- if (expect == isc_tokentype_number)
- return (ISC_R_BADNUMBER);
- return (ISC_R_UNEXPECTEDTOKEN);
- }
- return (ISC_R_SUCCESS);
-}
-
void
isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) {
inputsource *source;