curl.h: reverse the enum/define setup for old symbols

We now provide the "real" names in the CINIT() macro setup for CURLOPT_*
symbols, and we provide backwards compatibility defines for the old
symbols as defines instead of vice versa.

This allows us to better use the CINIT() list to check for existing and
current option names.
This commit is contained in:
Daniel Stenberg 2014-06-17 10:02:41 +02:00
parent 89a2178bc9
commit 5fcef972b2
2 changed files with 10 additions and 8 deletions

View File

@ -579,6 +579,11 @@ typedef enum {
make programs break */
#define CURLE_ALREADY_COMPLETE 99999
/* Provide defines for really old option names */
#define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
#define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
#define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
#endif /*!CURL_NO_OLDIES*/
/* This prototype applies to all conversion callbacks */
@ -820,7 +825,7 @@ typedef enum {
typedef enum {
/* This is the FILE * or void * the regular output should be written to. */
CINIT(FILE, OBJECTPOINT, 1),
CINIT(WRITEDATA, OBJECTPOINT, 1),
/* The full URL to get/put */
CINIT(URL, OBJECTPOINT, 2),
@ -843,7 +848,7 @@ typedef enum {
/* not used */
/* Specified file stream to upload from (use as input): */
CINIT(INFILE, OBJECTPOINT, 9),
CINIT(READDATA, OBJECTPOINT, 9),
/* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
* bytes big. If this is not used, error messages go to stderr instead: */
@ -928,7 +933,7 @@ typedef enum {
/* send FILE * or void * to store headers to, if you use a callback it
is simply passed to the callback unmodified */
CINIT(WRITEHEADER, OBJECTPOINT, 29),
CINIT(HEADERDATA, OBJECTPOINT, 29),
/* point to a file to read the initial cookies from, also enables
"cookie awareness" */
@ -1633,9 +1638,6 @@ typedef enum {
#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
/* three convenient "aliases" that follow the name scheme better */
#define CURLOPT_WRITEDATA CURLOPT_FILE
#define CURLOPT_READDATA CURLOPT_INFILE
#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2014, 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
@ -291,7 +291,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_SOCKOPTDATA || \
(option) == CURLOPT_OPENSOCKETDATA || \
(option) == CURLOPT_PROGRESSDATA || \
(option) == CURLOPT_WRITEHEADER || \
(option) == CURLOPT_HEADERDATA || \
(option) == CURLOPT_DEBUGDATA || \
(option) == CURLOPT_SSL_CTX_DATA || \
(option) == CURLOPT_SEEKDATA || \