aboutsummaryrefslogtreecommitdiff
path: root/gl/base64.h
diff options
context:
space:
mode:
authorGravatar Thomas Guyot-Sionnest <dermoth@aei.ca> 2009-01-15 04:22:57 -0500
committerGravatar Thomas Guyot-Sionnest <dermoth@aei.ca> 2009-01-15 05:19:08 -0500
commit71cdb52799220f8d9052643baf1d3e9836a9c755 (patch)
tree27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/base64.h
parentf7afa46586645e50498d8b2d0c67884f014dc3a4 (diff)
downloadmonitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz
Sync with gnulib
Diffstat (limited to 'gl/base64.h')
-rw-r--r--gl/base64.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/gl/base64.h b/gl/base64.h
index 1f9b203e..63b6abcb 100644
--- a/gl/base64.h
+++ b/gl/base64.h
@@ -29,6 +29,12 @@
integer >= n/k, i.e., the ceiling of n/k. */
# define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)
+struct base64_decode_context
+{
+ unsigned int i;
+ char buf[4];
+};
+
extern bool isbase64 (char ch);
extern void base64_encode (const char *restrict in, size_t inlen,
@@ -36,10 +42,20 @@ extern void base64_encode (const char *restrict in, size_t inlen,
extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out);
-extern bool base64_decode (const char *restrict in, size_t inlen,
- char *restrict out, size_t *outlen);
+extern void base64_decode_ctx_init (struct base64_decode_context *ctx);
+
+extern bool base64_decode_ctx (struct base64_decode_context *ctx,
+ const char *restrict in, size_t inlen,
+ char *restrict out, size_t *outlen);
+
+extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx,
+ const char *in, size_t inlen,
+ char **out, size_t *outlen);
+
+#define base64_decode(in, inlen, out, outlen) \
+ base64_decode_ctx (NULL, in, inlen, out, outlen)
-extern bool base64_decode_alloc (const char *in, size_t inlen,
- char **out, size_t *outlen);
+#define base64_decode_alloc(in, inlen, out, outlen) \
+ base64_decode_alloc_ctx (NULL, in, inlen, out, outlen)
#endif /* BASE64_H */