.TH "libwget-base64" 3 "Tue Jan 26 2021" "Version 1.99.1" "wget2" \" -*- nroff -*- .ad l .nh .SH NAME libwget-base64 \- Base64 functions .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "bool \fBwget_base64_is_string\fP (const char *src)" .br .ti -1c .RI "size_t \fBwget_base64_decode\fP (char *dst, const char *src, size_t n)" .br .ti -1c .RI "char * \fBwget_base64_decode_alloc\fP (const char *src, size_t n, size_t *outlen)" .br .ti -1c .RI "size_t \fBwget_base64_encode\fP (char *dst, const char *src, size_t n)" .br .ti -1c .RI "char * \fBwget_base64_encode_alloc\fP (const char *src, size_t n)" .br .ti -1c .RI "char * \fBwget_base64_encode_vprintf_alloc\fP (const char *fmt, va_list args)" .br .ti -1c .RI "char * \fBwget_base64_encode_printf_alloc\fP (const char *fmt,\&.\&.\&.)" .br .in -1c .SH "Detailed Description" .PP This is a collection base64 encoding/decoding functions used in Wget2\&. .SH "Function Documentation" .PP .SS "bool wget_base64_is_string (const char * src)" .PP \fBParameters\fP .RS 4 \fIsrc\fP String to be checked .RE .PP \fBReturns\fP .RS 4 1 if \fCsrc\fP is a base64 string, 0 otherwise .RE .PP Checks whether \fCsrc\fP is a base64 string\&. Returns 0 if \fCsrc\fP is NULL\&. .SS "size_t wget_base64_decode (char * dst, const char * src, size_t n)" .PP \fBParameters\fP .RS 4 \fIdst\fP Output buffer .br \fIsrc\fP Base64 string to be decoded .br \fIn\fP Length of \fCsrc\fP .RE .PP \fBReturns\fP .RS 4 Number of bytes written into \fCdst\fP .RE .PP Decodes \fCn\fP bytes of the base64 string \fCsrc\fP\&. The decoded bytes are written into \fCdst\fP and are 0-terminated\&. .PP The size of \fCdst\fP has to be at minimum ((\fCn\fP + 3) / 4) * 3 + 1 bytes\&. .SS "char* wget_base64_decode_alloc (const char * src, size_t n, size_t * outlen)" .PP \fBParameters\fP .RS 4 \fIsrc\fP Base64 string to be decoded .br \fIn\fP Length of \fCsrc\fP .br \fIoutlen\fP Length of returned string, may be NULL\&. .RE .PP \fBReturns\fP .RS 4 Decoded bytes, zero terminated .RE .PP Decodes \fCn\fP bytes of the base64 string \fCsrc\fP\&. The decoded bytes are returned in an allocated buffer\&. .PP You should free() the returned string when not needed any more\&. .SS "size_t wget_base64_encode (char * dst, const char * src, size_t n)" .PP \fBParameters\fP .RS 4 \fIdst\fP Base64 output string .br \fIsrc\fP Input buffer .br \fIn\fP Number of bytes to be encoded .RE .PP \fBReturns\fP .RS 4 Length of output string \fCdst\fP .RE .PP Encodes \fCn\fP bytes from \fCsrc\fP into a base64 string\&. The encoded string is written into \fCdst\fP (0-terminated)\&. .PP The length of \fCdst\fP has to be at minimum ((\fCn\fP + 2) / 3) * 4 + 1 bytes\&. .SS "char* wget_base64_encode_alloc (const char * src, size_t n)" .PP \fBParameters\fP .RS 4 \fIsrc\fP Input buffer .br \fIn\fP Number of bytes to be encoded .RE .PP \fBReturns\fP .RS 4 Base64 encoded string .RE .PP Encodes \fCn\fP bytes from input buffer \fCsrc\fP\&. The encoded string is returned in an allocated buffer\&. .PP You should free() the returned string when not needed any more\&. .SS "char* wget_base64_encode_vprintf_alloc (const char * fmt, va_list args)" .PP \fBParameters\fP .RS 4 \fIfmt\fP Printf-like format string .br \fIargs\fP Argument list .RE .PP \fBReturns\fP .RS 4 Base64 encoded string .RE .PP Encodes the string constructed by \fCfmt\fP and \fCargs\fP\&. The encoded string is returned in an allocated buffer\&. .PP You should free() the returned string when not needed any more\&. .SS "char* wget_base64_encode_printf_alloc (const char * fmt, \&.\&.\&.)" .PP \fBParameters\fP .RS 4 \fIfmt\fP Printf-like format string .br \fI\&.\&.\&.\fP Argument list .RE .PP \fBReturns\fP .RS 4 Base64 encoded string .RE .PP Encodes the string constructed by \fCfmt\fP and the arguments\&. The encoded string is returned in an allocated buffer\&. .PP You should free() the returned string when not needed any more\&. .SH "Author" .PP Generated automatically by Doxygen for wget2 from the source code\&.