2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

328. [func] Added isc_base64_decodestring().

(This is basically bin/named/server.c:base64_cstring_tobuffer(), which I
will remove in another revision that will not need to be pulled up.  I also
would like to change isc_base64_totext() and isc_base64_tobuffer() to be
isc_base64_encoderegion() and isc_base64_decodelexer(), unless there are
exceptions.  I find their existing names to be quite confusing with regard to
what translation function each performs.)
This commit is contained in:
David Lawrence
2000-07-11 21:51:13 +00:00
parent f4d9f465cd
commit 9bf765ab3a
3 changed files with 62 additions and 6 deletions

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: base64.h,v 1.9 2000/06/06 17:50:38 gson Exp $ */
/* $Id: base64.h,v 1.10 2000/07/11 21:51:13 tale Exp $ */
#ifndef ISC_BASE64_H
#define ISC_BASE64_H 1
@@ -53,10 +53,31 @@ isc_base64_totext(isc_region_t *source, int wordlength,
* necessary.
*/
isc_result_t
isc_base64_decodestring(isc_mem_t *mctx, char *cstr, isc_buffer_t *target);
/*
* Decode a null-terminated base64 string.
*
* Requires:
* 'mctx' is non-null.
* 'cstr' is non-null.
* 'target' is a valid buffer.
*
* Returns:
* ISC_R_SUCCESS -- the entire decoded representation of 'cstring'
* fit in 'target'.
* ISC_R_BADBASE64 -- 'cstr' is not a valid base64 encoding.
*
* Other error returns are any possible error code from:
* isc_lex_create(),
* isc_lex_openbuffer(),
* isc_base64_tobuffer().
*/
isc_result_t
isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
/*
* Convert base64 encoded text into data.
* Convert base64 encoded text from a lexer context into data.
*
* Requires:
* 'lex' is a valid lexer context
@@ -71,6 +92,7 @@ isc_base64_tobuffer(isc_lex_t *lexer, isc_buffer_t *target, int length);
*/
ISC_LANG_ENDDECLS
#endif /* ISC_BASE64_H */