From ac18b471d253f8d5c69d1044a59753f32bcd663f Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 17 Aug 2008 00:25:38 +0000 Subject: libcurl internal base64.h header file renamed to curl_base64.h --- lib/curl_base64.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/curl_base64.h (limited to 'lib/curl_base64.h') diff --git a/lib/curl_base64.h b/lib/curl_base64.h new file mode 100644 index 000000000..c98fd196c --- /dev/null +++ b/lib/curl_base64.h @@ -0,0 +1,28 @@ +#ifndef __CURL_BASE64_H +#define __CURL_BASE64_H +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + ***************************************************************************/ +size_t Curl_base64_encode(struct SessionHandle *data, + const char *input, size_t size, char **str); +size_t Curl_base64_decode(const char *source, unsigned char **outptr); +#endif -- cgit v1.2.1 From 1c2947581b8694b3e8ab447c5c7c2c9dbb43bf8b Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 4 Jun 2009 23:55:56 +0000 Subject: fix shadowing of a global declaration --- lib/curl_base64.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/curl_base64.h') diff --git a/lib/curl_base64.h b/lib/curl_base64.h index c98fd196c..627eb93e3 100644 --- a/lib/curl_base64.h +++ b/lib/curl_base64.h @@ -1,5 +1,5 @@ -#ifndef __CURL_BASE64_H -#define __CURL_BASE64_H +#ifndef HEADER_CURL_BASE64_H +#define HEADER_CURL_BASE64_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, , 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,7 +22,11 @@ * * $Id$ ***************************************************************************/ + size_t Curl_base64_encode(struct SessionHandle *data, - const char *input, size_t size, char **str); -size_t Curl_base64_decode(const char *source, unsigned char **outptr); -#endif + const char *inputbuff, size_t insize, + char **outptr); + +size_t Curl_base64_decode(const char *src, unsigned char **outptr); + +#endif /* HEADER_CURL_BASE64_H */ -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/curl_base64.h | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/curl_base64.h') diff --git a/lib/curl_base64.h b/lib/curl_base64.h index 627eb93e3..2498a0a22 100644 --- a/lib/curl_base64.h +++ b/lib/curl_base64.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ size_t Curl_base64_encode(struct SessionHandle *data, -- cgit v1.2.1 From fd00b382b2d33ef90c6f5c840a32b66c8ceb1662 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 24 Aug 2011 08:07:36 +0200 Subject: 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. --- lib/curl_base64.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/curl_base64.h') 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, , et al. + * Copyright (C) 1998 - 2011, Daniel Stenberg, , 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 */ -- cgit v1.2.1