summaryrefslogtreecommitdiff
path: root/lib/curl_base64.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-08-24 08:07:36 +0200
committerYang Tse <yangsita@gmail.com>2011-08-24 08:10:30 +0200
commitfd00b382b2d33ef90c6f5c840a32b66c8ceb1662 (patch)
treee95c73f96e5b4e67059326823e68ce78fc6f300b /lib/curl_base64.h
parentcce6508242ab73cca896788ad9f968b89e5f9f3a (diff)
downloadcurl-fd00b382b2d33ef90c6f5c840a32b66c8ceb1662.tar.gz
base64: fix Curl_base64_encode and Curl_base64_decode interfaces
Previous interfaces for these libcurl internal functions did not allow to tell apart a legitimate zero size result from an error condition. These functions now return a CURLcode indicating function success or otherwise specific error. Output size is returned using a pointer argument. All usage of these two functions, and others closely related, has been adapted to the new interfaces. Relative error and OOM handling adapted or added where missing. Unit test 1302 also adapted.
Diffstat (limited to 'lib/curl_base64.h')
-rw-r--r--lib/curl_base64.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/curl_base64.h b/lib/curl_base64.h
index 2498a0a22..6e200d2ec 100644
--- a/lib/curl_base64.h
+++ b/lib/curl_base64.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -22,10 +22,11 @@
*
***************************************************************************/
-size_t Curl_base64_encode(struct SessionHandle *data,
- const char *inputbuff, size_t insize,
- char **outptr);
+CURLcode Curl_base64_encode(struct SessionHandle *data,
+ const char *inputbuff, size_t insize,
+ char **outptr, size_t *outlen);
-size_t Curl_base64_decode(const char *src, unsigned char **outptr);
+CURLcode Curl_base64_decode(const char *src,
+ unsigned char **outptr, size_t *outlen);
#endif /* HEADER_CURL_BASE64_H */