summaryrefslogtreecommitdiff
path: root/src/rexmpp_base64.h
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2023-09-29 20:24:16 +0300
committerdefanor <defanor@uberspace.net>2023-09-29 20:24:16 +0300
commitccdb748c81abc9bb30b8989e27d22bbbb219f9a0 (patch)
tree295be2ea605c8acbe56116ea3ce119b99e3e0440 /src/rexmpp_base64.h
parent04e6fd5194481798bc30abc7a690664d5af36aeb (diff)
Add more checks, tests, and documentation
Diffstat (limited to 'src/rexmpp_base64.h')
-rw-r--r--src/rexmpp_base64.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/rexmpp_base64.h b/src/rexmpp_base64.h
index e681ed9..d11cd91 100644
--- a/src/rexmpp_base64.h
+++ b/src/rexmpp_base64.h
@@ -10,5 +10,26 @@
#include <stddef.h>
-int rexmpp_base64_to (const char *in, size_t in_len, char **out, size_t *out_len);
-int rexmpp_base64_from (const char *in, size_t in_len, char **out, size_t *out_len);
+/**
+ @brief Encodes data in Base64
+ @param[in] in Data to encode
+ @param[in] in_len Length of the input data
+ @param[out] out A pointer to the output buffer; its memory will be
+ allocated by the function, the caller receives ownership over it
+ @param[out] out_len Length of the produced Base64-encoded string
+ @returns 0 on success, a non-zero value otherwise
+*/
+int rexmpp_base64_to (const char *in, size_t in_len,
+ char **out, size_t *out_len);
+
+/**
+ @brief Decodes data from Base64
+ @param[in] in Data to decode
+ @param[in] in_len Length of the input data
+ @param[out] out A pointer to the output buffer; its memory will be
+ allocated by the function, the caller receives ownership over it
+ @param[out] out_len Length of the decoded string
+ @returns 0 on success, a non-zero value otherwise
+*/
+int rexmpp_base64_from (const char *in, size_t in_len,
+ char **out, size_t *out_len);