Skip to content

Commit

Permalink
lib: remove support for CURL_DOES_CONVERSIONS
Browse files Browse the repository at this point in the history
TPF was the only user and support for that was dropped.

Closes curl#8378
  • Loading branch information
bagder committed Feb 4, 2022
1 parent da15443 commit 2610142
Show file tree
Hide file tree
Showing 95 changed files with 198 additions and 1,907 deletions.
3 changes: 1 addition & 2 deletions docs/examples/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2022, 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
Expand Down Expand Up @@ -135,7 +135,6 @@ COMPLICATED_EXAMPLES = \
multi-uv.c \
multithread.c \
opensslthreadlock.c \
sampleconv.c \
sessioninfo.c \
smooth-gtk-thread.c \
synctime.c \
Expand Down
112 changes: 0 additions & 112 deletions docs/examples/sampleconv.c

This file was deleted.

7 changes: 5 additions & 2 deletions docs/libcurl/opts/CURLOPT_CONV_FROM_NETWORK_FUNCTION.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * Copyright (C) 1998 - 2022, 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
Expand Down Expand Up @@ -94,7 +94,10 @@ curl_easy_setopt(curl, CURLOPT_CONV_FROM_NETWORK_FUNCTION,
my_conv_from_ascii_to_ebcdic);
.fi
.SH AVAILABILITY
Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
Not available since 7.82.0

Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
built.
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
.SH "SEE ALSO"
Expand Down
7 changes: 5 additions & 2 deletions docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * Copyright (C) 1998 - 2022, 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
Expand Down Expand Up @@ -92,7 +92,10 @@ curl_easy_setopt(curl, CURLOPT_CONV_FROM_UTF8_FUNCTION,
my_conv_from_utf8_to_ebcdic);
.fi
.SH AVAILABILITY
Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
Not available since 7.82.0

Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
built.
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
.SH "SEE ALSO"
Expand Down
7 changes: 5 additions & 2 deletions docs/libcurl/opts/CURLOPT_CONV_TO_NETWORK_FUNCTION.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * Copyright (C) 1998 - 2022, 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
Expand Down Expand Up @@ -93,7 +93,10 @@ curl_easy_setopt(curl, CURLOPT_CONV_TO_NETWORK_FUNCTION,
my_conv_from_ebcdic_to_ascii);
.fi
.SH AVAILABILITY
Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was built.
Not available since 7.82.0

Available only if \fBCURL_DOES_CONVERSIONS\fP was defined when libcurl was
built.
.SH RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
.SH "SEE ALSO"
Expand Down
8 changes: 4 additions & 4 deletions docs/libcurl/symbols-in-versions
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CURLE_BAD_FUNCTION_ARGUMENT 7.1
CURLE_BAD_PASSWORD_ENTERED 7.4.2 7.17.0
CURLE_CHUNK_FAILED 7.21.0
CURLE_CONV_FAILED 7.15.4
CURLE_CONV_REQD 7.15.4
CURLE_CONV_REQD 7.15.4 7.82.0
CURLE_COULDNT_CONNECT 7.1
CURLE_COULDNT_RESOLVE_HOST 7.1
CURLE_COULDNT_RESOLVE_PROXY 7.1
Expand Down Expand Up @@ -391,9 +391,9 @@ CURLOPT_CONNECTTIMEOUT 7.7
CURLOPT_CONNECTTIMEOUT_MS 7.16.2
CURLOPT_CONNECT_ONLY 7.15.2
CURLOPT_CONNECT_TO 7.49.0
CURLOPT_CONV_FROM_NETWORK_FUNCTION 7.15.4
CURLOPT_CONV_FROM_UTF8_FUNCTION 7.15.4
CURLOPT_CONV_TO_NETWORK_FUNCTION 7.15.4
CURLOPT_CONV_FROM_NETWORK_FUNCTION 7.15.4 7.82.0
CURLOPT_CONV_FROM_UTF8_FUNCTION 7.15.4 7.82.0
CURLOPT_CONV_TO_NETWORK_FUNCTION 7.15.4 7.82.0
CURLOPT_COOKIE 7.1
CURLOPT_COOKIEFILE 7.1
CURLOPT_COOKIEJAR 7.9
Expand Down
11 changes: 2 additions & 9 deletions include/curl/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,6 @@ typedef enum {
CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
CURLE_OUT_OF_MEMORY, /* 27 */
/* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
instead of a memory allocation error if CURL_DOES_CONVERSIONS
is defined
*/
CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
CURLE_OBSOLETE29, /* 29 - NOT USED */
CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
Expand Down Expand Up @@ -580,11 +576,7 @@ typedef enum {
CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
CURLE_CONV_FAILED, /* 75 - conversion failed */
CURLE_CONV_REQD, /* 76 - caller must register conversion
callbacks using curl_easy_setopt options
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
CURLOPT_CONV_FROM_UTF8_FUNCTION */
CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */
CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
or wrong format */
CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
Expand Down Expand Up @@ -684,6 +676,7 @@ typedef enum {
#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
#define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62
#define CURLE_CONV_REQD CURLE_OBSOLETE76

/* This was the error code 50 in 7.7.3 and a few earlier versions, this
is no longer used by libcurl but is instead #defined here only to not
Expand Down
2 changes: 0 additions & 2 deletions lib/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ LIB_CFILES = \
mqtt.c \
multi.c \
netrc.c \
non-ascii.c \
nonblock.c \
openldap.c \
parsedate.c \
Expand Down Expand Up @@ -289,7 +288,6 @@ LIB_HFILES = \
multihandle.h \
multiif.h \
netrc.h \
non-ascii.h \
nonblock.h \
parsedate.h \
pingpong.h \
Expand Down
31 changes: 4 additions & 27 deletions lib/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "urldata.h" /* for the Curl_easy definition */
#include "warnless.h"
#include "curl_base64.h"
#include "non-ascii.h"

/* The last 3 #include files should be in this order */
#include "curl_printf.h"
Expand Down Expand Up @@ -176,19 +175,15 @@ CURLcode Curl_base64_decode(const char *src,
}

static CURLcode base64_encode(const char *table64,
struct Curl_easy *data,
const char *inputbuff, size_t insize,
char **outptr, size_t *outlen)
{
CURLcode result;
unsigned char ibuf[3];
unsigned char obuf[4];
int i;
int inputparts;
char *output;
char *base64data;
char *convbuf = NULL;

const char *indata = inputbuff;

*outptr = NULL;
Expand All @@ -206,20 +201,6 @@ static CURLcode base64_encode(const char *table64,
if(!output)
return CURLE_OUT_OF_MEMORY;

/*
* The base64 data needs to be created using the network encoding
* not the host encoding. And we can't change the actual input
* so we copy it to a buffer, translate it, and use that instead.
*/
result = Curl_convert_clone(data, indata, insize, &convbuf);
if(result) {
free(output);
return result;
}

if(convbuf)
indata = (char *)convbuf;

while(insize > 0) {
for(i = inputparts = 0; i < 3; i++) {
if(insize > 0) {
Expand Down Expand Up @@ -270,8 +251,6 @@ static CURLcode base64_encode(const char *table64,
/* Return the pointer to the new data (allocated memory) */
*outptr = base64data;

free(convbuf);

/* Return the length of the new data */
*outlen = output - base64data;

Expand All @@ -295,11 +274,10 @@ static CURLcode base64_encode(const char *table64,
*
* @unittest: 1302
*/
CURLcode Curl_base64_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
CURLcode Curl_base64_encode(const char *inputbuff, size_t insize,
char **outptr, size_t *outlen)
{
return base64_encode(base64, data, inputbuff, insize, outptr, outlen);
return base64_encode(base64, inputbuff, insize, outptr, outlen);
}

/*
Expand All @@ -319,11 +297,10 @@ CURLcode Curl_base64_encode(struct Curl_easy *data,
*
* @unittest: 1302
*/
CURLcode Curl_base64url_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
CURLcode Curl_base64url_encode(const char *inputbuff, size_t insize,
char **outptr, size_t *outlen)
{
return base64_encode(base64url, data, inputbuff, insize, outptr, outlen);
return base64_encode(base64url, inputbuff, insize, outptr, outlen);
}

#endif /* no users so disabled */
9 changes: 3 additions & 6 deletions lib/curl_base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2022, 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
Expand All @@ -22,13 +22,10 @@
*
***************************************************************************/

CURLcode Curl_base64_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
CURLcode Curl_base64_encode(const char *inputbuff, size_t insize,
char **outptr, size_t *outlen);
CURLcode Curl_base64url_encode(struct Curl_easy *data,
const char *inputbuff, size_t insize,
CURLcode Curl_base64url_encode(const char *inputbuff, size_t insize,
char **outptr, size_t *outlen);

CURLcode Curl_base64_decode(const char *src,
unsigned char **outptr, size_t *outlen);

Expand Down
5 changes: 1 addition & 4 deletions lib/curl_ctype.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2022, 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
Expand All @@ -22,8 +22,6 @@

#include "curl_setup.h"

#ifndef CURL_DOES_CONVERSIONS

#undef _U
#define _U (1<<0) /* upper case */
#undef _L
Expand Down Expand Up @@ -130,4 +128,3 @@ int Curl_iscntrl(int c)
return (ascii[c] & (_C));
}

#endif /* !CURL_DOES_CONVERSIONS */
Loading

0 comments on commit 2610142

Please sign in to comment.