diff --git a/build/SQLyogCommunity.vcxproj b/build/SQLyogCommunity.vcxproj
index 4ff37fc..8bf8418 100644
--- a/build/SQLyogCommunity.vcxproj
+++ b/build/SQLyogCommunity.vcxproj
@@ -205,7 +205,7 @@
ProgramDatabase
- shfolder.lib;version.lib;Ws2_32.lib;odbc32.lib;odbccp32.lib;wsock32.lib;comctl32.lib;htmlhelp.lib;wininet.lib;imm32.lib;gdiplus.lib;ole32.lib;msimg32.lib;sqlite3.lib;mariadbclient.lib;HTMLayout.lib;pcre.lib;Rpcrt4.lib;shlwapi.lib;vld.lib;winmm.lib;cryptlib.lib;tinyxml2.lib;%(AdditionalDependencies)
+ shfolder.lib;version.lib;Ws2_32.lib;odbc32.lib;odbccp32.lib;wsock32.lib;comctl32.lib;htmlhelp.lib;wininet.lib;imm32.lib;gdiplus.lib;ole32.lib;msimg32.lib;sqlite3.lib;mariadbclient.lib;HTMLayout.lib;pcre.lib;Rpcrt4.lib;shlwapi.lib;vld.lib;winmm.lib;cryptlib.lib;tinyxml2.lib;secur32.lib;%(AdditionalDependencies)
$(OutDir)$(TargetName)$(TargetExt)
false
LIBCD.lib;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)
diff --git a/include/AppInfo.h b/include/AppInfo.h
index dd7c400..36e3212 100644
--- a/include/AppInfo.h
+++ b/include/AppInfo.h
@@ -38,7 +38,7 @@
#define SQLITE_APPVERSION_MAJOR "10"
#define SQLITE_APPVERSION_MINOR "5"
-#define COMPANY_COPYRIGHT "(c) 2001-2023 Webyog Inc."
+#define COMPANY_COPYRIGHT "(c) 2001-2024 Webyog Inc."
#define FILEVER MAJOR_VERSION_INT ## , ## MINOR_VERSION_INT ## , ## UPDATE_VERSION_INT ## , ## RELEASE_VERSION_INT
#define STRFILEVER MAJOR_VERSION "." MINOR_VERSION "." STRINGIZE(UPDATE_VERSION_INT) "." STRINGIZE(RELEASE_VERSION_INT)
diff --git a/include/MySQLVersionHelper.h b/include/MySQLVersionHelper.h
index bc80914..cd7d1a8 100644
--- a/include/MySQLVersionHelper.h
+++ b/include/MySQLVersionHelper.h
@@ -160,6 +160,15 @@ wyBool IsMariaDB10309(Tunnel * tunnel, PMYSQL mysql);
//MariaDB 10.5.2 for new privileges
wyBool IsMariaDB100502(Tunnel * tunnel, PMYSQL mysql);
+//MariaDB 10.5.0 for new privileges
+wyBool IsMariaDB100500(Tunnel * tunnel, PMYSQL mysql);
+
+//MariaDB 10.7.0 for new privileges
+wyBool IsMariaDB100700(Tunnel * tunnel, PMYSQL mysql);
+
+//MariaDB 10.10.0 for new privileges
+wyBool IsMariaDB101000(Tunnel * tunnel, PMYSQL mysql);
+
//MySQL 5.7.0 for Virtual/Stored columns
wyBool IsMySQL57(Tunnel * tunnel, PMYSQL mysql);
diff --git a/include/TabFields.h b/include/TabFields.h
index 5c21382..d432c78 100644
--- a/include/TabFields.h
+++ b/include/TabFields.h
@@ -152,6 +152,15 @@ class TabFields
//is mariadb version>=10.3.9
wyBool m_ismariadb10309;
+ //is mariadb version>=10.10.0
+ wyBool m_ismariadb1010;
+
+ //is mariadb version>=10.5.0
+ wyBool m_ismariadb105;
+
+ //is mariadb version>=10.7.0
+ wyBool m_ismariadb107;
+
//is mysql version>=5.7
wyBool m_ismysql57;
@@ -573,7 +582,16 @@ class TabFields
@param index : Index
@returns wyTrue
*/
- wyBool HandleSetEnumValidation(HWND &hwndgrid, wyUInt32 &row, wyUInt32 &index);
+ wyBool HandleSetEnumValidation(HWND &hwndgrid, wyUInt32 &row, wyUInt32 &index);
+
+ /// Handles the Inet4, Inet6 and Uiud datatype validation
+ /**
+ @param hwndgrid : HANDLE to grid window
+ @param row : Row number
+ @param index : Index
+ @returns wyTrue
+ */
+ wyBool HandleInet4andInet6andUuidValidation(HWND &hwndgrid, wyUInt32 &row, wyUInt32 &index);
/// Handles if duplicate field name is present
/**
diff --git a/include/Version.h b/include/Version.h
index 8bc30e8..bbf4a22 100644
--- a/include/Version.h
+++ b/include/Version.h
@@ -1,5 +1,5 @@
#define MAJOR_VERSION_INT 13
-#define MINOR_VERSION_INT 2
-#define UPDATE_VERSION_INT 1
+#define MINOR_VERSION_INT 3
+#define UPDATE_VERSION_INT 0
#define RELEASE_VERSION_INT 0
#define EXTRAINFO ""
diff --git a/include/curl/curl.h b/include/curl/curl.h
index e7f812d..b2377b7 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_CURL_H
-#define __CURL_CURL_H
+#ifndef CURLINC_CURL_H
+#define CURLINC_CURL_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,45 +20,52 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/*
* If you have libcurl problems, all docs and details are found here:
- * https://curl.haxx.se/libcurl/
- *
- * curl-library mailing list subscription and unsubscription web interface:
- * https://cool.haxx.se/mailman/listinfo/curl-library/
+ * https://curl.se/libcurl/
*/
#ifdef CURL_NO_OLDIES
#define CURL_STRICTER
#endif
+/* Compile-time deprecation macros. */
+#if defined(__GNUC__) && \
+ ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) && \
+ !defined(__INTEL_COMPILER) && \
+ !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
+#define CURL_DEPRECATED(version, message) \
+ __attribute__((deprecated("since " # version ". " message)))
+#define CURL_IGNORE_DEPRECATION(statements) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
+ statements \
+ _Pragma("GCC diagnostic pop")
+#else
+#define CURL_DEPRECATED(version, message)
+#define CURL_IGNORE_DEPRECATION(statements) statements
+#endif
+
#include "curlver.h" /* libcurl version defines */
#include "system.h" /* determine things run-time */
-/*
- * Define WIN32 when build target is Win32 API
- */
-
-#if (defined(_WIN32) || defined(__WIN32__)) && \
- !defined(WIN32) && !defined(__SYMBIAN32__)
-#define WIN32
-#endif
-
#include
#include
-#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)
-/* Needed for __FreeBSD_version symbol definition */
-#include
+#if defined(__FreeBSD__) || defined(__MidnightBSD__)
+/* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
+#include
#endif
/* The include stuff here below is mainly for time_t! */
#include
#include
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
/* The check above prevents the winsock2 inclusion if winsock.h already was
@@ -72,25 +79,23 @@
libc5-based Linux systems. Only include it on systems that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
+ defined(__minix) || defined(__INTEGRITY) || \
defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
- defined(__CYGWIN__) || \
- (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
+ defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \
+ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \
+ (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \
+ defined(__sun__) || defined(__serenity__) || defined(__vxworks__)
#include
#endif
-#if !defined(WIN32) && !defined(_WIN32_WCE)
+#if !defined(_WIN32) && !defined(_WIN32_WCE)
#include
#endif
-#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
+#if !defined(_WIN32)
#include
#endif
-#ifdef __BEOS__
-#include
-#endif
-
/* Compatibility for non-Clang compilers */
#ifndef __has_declspec_attribute
# define __has_declspec_attribute(x) 0
@@ -114,7 +119,7 @@ typedef void CURLSH;
#ifdef CURL_STATICLIB
# define CURL_EXTERN
-#elif defined(WIN32) || defined(__SYMBIAN32__) || \
+#elif defined(_WIN32) || \
(__has_declspec_attribute(dllexport) && \
__has_declspec_attribute(dllimport))
# if defined(BUILDING_LIBCURL)
@@ -130,7 +135,7 @@ typedef void CURLSH;
#ifndef curl_socket_typedef
/* socket typedef */
-#if defined(WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
+#if defined(_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
@@ -145,21 +150,24 @@ typedef enum {
CURLSSLBACKEND_NONE = 0,
CURLSSLBACKEND_OPENSSL = 1,
CURLSSLBACKEND_GNUTLS = 2,
- CURLSSLBACKEND_NSS = 3,
+ CURLSSLBACKEND_NSS CURL_DEPRECATED(8.3.0, "") = 3,
CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
- CURLSSLBACKEND_GSKIT = 5,
- CURLSSLBACKEND_POLARSSL = 6,
+ CURLSSLBACKEND_GSKIT CURL_DEPRECATED(8.3.0, "") = 5,
+ CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6,
CURLSSLBACKEND_WOLFSSL = 7,
CURLSSLBACKEND_SCHANNEL = 8,
CURLSSLBACKEND_SECURETRANSPORT = 9,
- CURLSSLBACKEND_AXTLS = 10, /* never used since 7.63.0 */
+ CURLSSLBACKEND_AXTLS CURL_DEPRECATED(7.61.0, "") = 10,
CURLSSLBACKEND_MBEDTLS = 11,
- CURLSSLBACKEND_MESALINK = 12
+ CURLSSLBACKEND_MESALINK CURL_DEPRECATED(7.82.0, "") = 12,
+ CURLSSLBACKEND_BEARSSL = 13,
+ CURLSSLBACKEND_RUSTLS = 14
} curl_sslbackend;
/* aliases for library clones and renames */
-#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
+#define CURLSSLBACKEND_AWSLC CURLSSLBACKEND_OPENSSL
#define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL
+#define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
/* deprecated names: */
#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
@@ -209,6 +217,11 @@ struct curl_httppost {
set. Added in 7.46.0 */
};
+
+/* This is a return code for the progress callback that, when returned, will
+ signal libcurl to continue executing the default progress function */
+#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
+
/* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now
considered deprecated but was the only choice up until 7.31.0 */
typedef int (*curl_progress_callback)(void *clientp,
@@ -228,7 +241,7 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
#ifndef CURL_MAX_READ_SIZE
/* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
-#define CURL_MAX_READ_SIZE 524288
+#define CURL_MAX_READ_SIZE (10*1024*1024)
#endif
#ifndef CURL_MAX_WRITE_SIZE
@@ -252,6 +265,10 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001
+/* This is a magic return code for the write callback that, when returned,
+ will signal an error from the callback. */
+#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
+
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
@@ -284,10 +301,7 @@ typedef enum {
#define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
#define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
-/* Content of this structure depends on information which is known and is
- achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
- page for callbacks returning this structure -- some fields are mandatory,
- some others are optional. The FLAG field has special meaning. */
+/* Information about a single file, used when doing FTP wildcard matching */
struct curl_fileinfo {
char *filename;
curlfiletype filetype;
@@ -309,7 +323,8 @@ struct curl_fileinfo {
unsigned int flags;
- /* used internally */
+ /* These are libcurl private struct fields. Previously used by libcurl, so
+ they must never be interfered with. */
char *b_data;
size_t b_size;
size_t b_used;
@@ -367,7 +382,7 @@ typedef int (*curl_seek_callback)(void *instream,
#define CURL_READFUNC_PAUSE 0x10000001
/* Return code for when the trailing headers' callback has terminated
- without any errors*/
+ without any errors */
#define CURL_TRAILERFUNC_OK 0
/* Return code for when was an error in the trailing header's list and we
want to abort the request */
@@ -449,7 +464,7 @@ typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
#define CURL_DID_MEMORY_FUNC_TYPEDEFS
#endif
-/* the kind of data that is passed to information_callback*/
+/* the kind of data that is passed to information_callback */
typedef enum {
CURLINFO_TEXT = 0,
CURLINFO_HEADER_IN, /* 1 */
@@ -468,6 +483,20 @@ typedef int (*curl_debug_callback)
size_t size, /* size of the data pointed to */
void *userptr); /* whatever the user please */
+/* This is the CURLOPT_PREREQFUNCTION callback prototype. */
+typedef int (*curl_prereq_callback)(void *clientp,
+ char *conn_primary_ip,
+ char *conn_local_ip,
+ int conn_primary_port,
+ int conn_local_port);
+
+/* Return code for when the pre-request callback has terminated without
+ any errors */
+#define CURL_PREREQFUNC_OK 0
+/* Return code for when the pre-request callback wants to abort the
+ request */
+#define CURL_PREREQFUNC_ABORT 1
+
/* All possible error codes from all sorts of curl functions. Future versions
may return other values, stay prepared.
@@ -512,10 +541,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 */
@@ -537,7 +562,7 @@ typedef enum {
CURLE_OBSOLETE46, /* 46 - NOT USED */
CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX, /* 49 - Malformed telnet option */
+ CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */
CURLE_OBSOLETE50, /* 50 - NOT USED */
CURLE_OBSOLETE51, /* 51 - NOT USED */
CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
@@ -552,7 +577,7 @@ typedef enum {
CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
wasn't verified fine */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
- CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
+ CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
@@ -567,12 +592,8 @@ typedef enum {
CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
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_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */
+ 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 */
@@ -603,16 +624,24 @@ typedef enum {
*/
CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from
inside a callback */
+ CURLE_AUTH_ERROR, /* 94 - an authentication function returned an
+ error */
+ CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */
+ CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */
+ CURLE_PROXY, /* 97 - proxy handshake error */
+ CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */
+ CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */
+ CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */
CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
-/* Previously obsolete error code re-used in 7.38.0 */
+/* Previously obsolete error code reused in 7.38.0 */
#define CURLE_OBSOLETE16 CURLE_HTTP2
-/* Previously obsolete error codes re-used in 7.24.0 */
+/* Previously obsolete error codes reused in 7.24.0 */
#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
@@ -626,6 +655,9 @@ typedef enum {
/* The following were added in 7.21.5, April 2011 */
#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
+/* Added for 7.78.0 */
+#define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX
+
/* The following were added in 7.17.1 */
/* These are scheduled to disappear by 2009 */
#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
@@ -657,13 +689,14 @@ typedef enum {
/* The following were added earlier */
#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
-
#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
-
#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
+#define CURLE_CONV_FAILED CURLE_OBSOLETE75
/* 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
@@ -680,7 +713,49 @@ typedef enum {
#define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
#define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
-#endif /*!CURL_NO_OLDIES*/
+#endif /* !CURL_NO_OLDIES */
+
+/*
+ * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was
+ * return for the transfers.
+ */
+typedef enum {
+ CURLPX_OK,
+ CURLPX_BAD_ADDRESS_TYPE,
+ CURLPX_BAD_VERSION,
+ CURLPX_CLOSED,
+ CURLPX_GSSAPI,
+ CURLPX_GSSAPI_PERMSG,
+ CURLPX_GSSAPI_PROTECTION,
+ CURLPX_IDENTD,
+ CURLPX_IDENTD_DIFFER,
+ CURLPX_LONG_HOSTNAME,
+ CURLPX_LONG_PASSWD,
+ CURLPX_LONG_USER,
+ CURLPX_NO_AUTH,
+ CURLPX_RECV_ADDRESS,
+ CURLPX_RECV_AUTH,
+ CURLPX_RECV_CONNECT,
+ CURLPX_RECV_REQACK,
+ CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
+ CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
+ CURLPX_REPLY_CONNECTION_REFUSED,
+ CURLPX_REPLY_GENERAL_SERVER_FAILURE,
+ CURLPX_REPLY_HOST_UNREACHABLE,
+ CURLPX_REPLY_NETWORK_UNREACHABLE,
+ CURLPX_REPLY_NOT_ALLOWED,
+ CURLPX_REPLY_TTL_EXPIRED,
+ CURLPX_REPLY_UNASSIGNED,
+ CURLPX_REQUEST_FAILED,
+ CURLPX_RESOLVE_HOST,
+ CURLPX_SEND_AUTH,
+ CURLPX_SEND_CONNECT,
+ CURLPX_SEND_REQUEST,
+ CURLPX_UNKNOWN_FAIL,
+ CURLPX_UNKNOWN_MODE,
+ CURLPX_USER_REJECTED,
+ CURLPX_LAST /* never use */
+} CURLproxycode;
/* This prototype applies to all conversion callbacks */
typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
@@ -697,7 +772,8 @@ typedef enum {
CONNECT HTTP/1.1 */
CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
- CURLPROXY_HTTPS = 2, /* added in 7.52.0 */
+ CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */
+ CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
@@ -737,6 +813,7 @@ typedef enum {
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_BEARER (((unsigned long)1)<<6)
+#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
@@ -767,7 +844,7 @@ enum curl_khtype {
};
struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with base64
+ const char *key; /* points to a null-terminated string encoded with base64
if len is zero, otherwise to the "raw" data */
size_t len;
enum curl_khtype keytype;
@@ -779,9 +856,10 @@ enum curl_khstat {
CURLKHSTAT_FINE_ADD_TO_FILE,
CURLKHSTAT_FINE,
CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
- this causes a CURLE_DEFER error but otherwise the
+ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now.
+ Causes a CURLE_PEER_FAILED_VERIFICATION error but the
connection will be left intact etc */
+ CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */
CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
};
@@ -798,7 +876,18 @@ typedef int
const struct curl_khkey *knownkey, /* known */
const struct curl_khkey *foundkey, /* found */
enum curl_khmatch, /* libcurl's view on the keys */
- void *clientp); /* custom pointer passed from app */
+ void *clientp); /* custom pointer passed with */
+ /* CURLOPT_SSH_KEYDATA */
+
+typedef int
+ (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */
+ /* with CURLOPT_SSH_HOSTKEYDATA */
+ int keytype, /* CURLKHTYPE */
+ const char *key, /* hostkey to check */
+ size_t keylen); /* length of the key */
+ /* return CURLE_OK to accept */
+ /* or something else to refuse */
+
/* parameter for the CURLOPT_USE_SSL option */
typedef enum {
@@ -822,6 +911,23 @@ typedef enum {
SSL backends where such behavior is present. */
#define CURLSSLOPT_NO_REVOKE (1<<1)
+/* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
+ if possible. The OpenSSL backend has this ability. */
+#define CURLSSLOPT_NO_PARTIALCHAIN (1<<2)
+
+/* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
+ checks and ignore missing revocation list for those SSL backends where such
+ behavior is present. */
+#define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3)
+
+/* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
+ operating system. Currently implemented under MS-Windows. */
+#define CURLSSLOPT_NATIVE_CA (1<<4)
+
+/* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
+ a client certificate for authentication. (Schannel) */
+#define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5)
+
/* The default connection attempt delay in milliseconds for happy eyeballs.
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
this value, keep them in sync. */
@@ -842,7 +948,7 @@ typedef enum {
#define CURLFTPSSL_ALL CURLUSESSL_ALL
#define CURLFTPSSL_LAST CURLUSESSL_LAST
#define curl_ftpssl curl_usessl
-#endif /*!CURL_NO_OLDIES*/
+#endif /* !CURL_NO_OLDIES */
/* parameter for the CURLOPT_FTP_SSL_CCC option */
typedef enum {
@@ -885,14 +991,44 @@ typedef enum {
#define CURLHEADER_SEPARATE (1<<0)
/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
-#define CURLALTSVC_IMMEDIATELY (1<<0)
-#define CURLALTSVC_ALTUSED (1<<1)
#define CURLALTSVC_READONLYFILE (1<<2)
#define CURLALTSVC_H1 (1<<3)
#define CURLALTSVC_H2 (1<<4)
#define CURLALTSVC_H3 (1<<5)
-/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
+
+struct curl_hstsentry {
+ char *name;
+ size_t namelen;
+ unsigned int includeSubDomains:1;
+ char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */
+};
+
+struct curl_index {
+ size_t index; /* the provided entry's "index" or count */
+ size_t total; /* total number of entries to save */
+};
+
+typedef enum {
+ CURLSTS_OK,
+ CURLSTS_DONE,
+ CURLSTS_FAIL
+} CURLSTScode;
+
+typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,
+ struct curl_hstsentry *e,
+ void *userp);
+typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
+ struct curl_hstsentry *e,
+ struct curl_index *i,
+ void *userp);
+
+/* CURLHSTS_* are bits for the CURLOPT_HSTS option */
+#define CURLHSTS_ENABLE (long)(1<<0)
+#define CURLHSTS_READONLYFILE (long)(1<<1)
+
+/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
+ options. Do not use. */
#define CURLPROTO_HTTP (1<<0)
#define CURLPROTO_HTTPS (1<<1)
#define CURLPROTO_FTP (1<<2)
@@ -921,87 +1057,86 @@ typedef enum {
#define CURLPROTO_GOPHER (1<<25)
#define CURLPROTO_SMB (1<<26)
#define CURLPROTO_SMBS (1<<27)
+#define CURLPROTO_MQTT (1<<28)
+#define CURLPROTO_GOPHERS (1<<29)
#define CURLPROTO_ALL (~0) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
but 32 */
#define CURLOPTTYPE_LONG 0
#define CURLOPTTYPE_OBJECTPOINT 10000
-#define CURLOPTTYPE_STRINGPOINT 10000
#define CURLOPTTYPE_FUNCTIONPOINT 20000
#define CURLOPTTYPE_OFF_T 30000
+#define CURLOPTTYPE_BLOB 40000
/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
string options from the header file */
-/* name is uppercase CURLOPT_,
- type is one of the defined CURLOPTTYPE_
- number is unique identifier */
-#ifdef CINIT
-#undef CINIT
-#endif
-#ifdef CURL_ISOCPP
-#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG CURLOPTTYPE_LONG
-#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
-#define STRINGPOINT CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLOPT_/**/name = type + number
-#endif
+#define CURLOPT(na,t,nu) na = t + nu
+#define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
+
+/* CURLOPT aliases that make no run-time difference */
+
+/* 'char *' argument to a string with a trailing zero */
+#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
+
+/* 'struct curl_slist *' argument */
+#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT
+
+/* 'void *' argument passed untouched to callback */
+#define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT
+
+/* 'long' argument with a set of values/bitmask */
+#define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG
/*
- * This macro-mania below setups the CURLOPT_[what] enum, to be used with
- * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
- * word.
+ * All CURLOPT_* values.
*/
typedef enum {
/* This is the FILE * or void * the regular output should be written to. */
- CINIT(WRITEDATA, OBJECTPOINT, 1),
+ CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),
/* The full URL to get/put */
- CINIT(URL, STRINGPOINT, 2),
+ CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),
/* Port number to connect to, if other than default. */
- CINIT(PORT, LONG, 3),
+ CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),
/* Name of proxy to use. */
- CINIT(PROXY, STRINGPOINT, 4),
+ CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),
/* "user:password;options" to use when fetching. */
- CINIT(USERPWD, STRINGPOINT, 5),
+ CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),
/* "user:password" to use with proxy. */
- CINIT(PROXYUSERPWD, STRINGPOINT, 6),
+ CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),
/* Range to get, specified as an ASCII string. */
- CINIT(RANGE, STRINGPOINT, 7),
+ CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),
/* not used */
/* Specified file stream to upload from (use as input): */
- CINIT(READDATA, OBJECTPOINT, 9),
+ CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),
/* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
* bytes big. */
- CINIT(ERRORBUFFER, OBJECTPOINT, 10),
+ CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),
/* Function that will be called to store the output (instead of fwrite). The
* parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
+ CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),
/* Function that will be called to read the input (instead of fread). The
* parameters will use fread() syntax, make sure to follow them. */
- CINIT(READFUNCTION, FUNCTIONPOINT, 12),
+ CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),
/* Time-out the read operation after this amount of seconds */
- CINIT(TIMEOUT, LONG, 13),
+ CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),
- /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
+ /* If CURLOPT_READDATA is used, this can be used to inform libcurl about
* how large the file being sent really is. That allows better error
* checking and better verifies that the upload was successful. -1 means
* unknown size.
@@ -1010,20 +1145,20 @@ typedef enum {
* which takes an off_t type, allowing platforms with larger off_t
* sizes to handle larger files. See below for INFILESIZE_LARGE.
*/
- CINIT(INFILESIZE, LONG, 14),
+ CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),
/* POST static input fields. */
- CINIT(POSTFIELDS, OBJECTPOINT, 15),
+ CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),
/* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, STRINGPOINT, 16),
+ CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),
/* Set the FTP PORT string (interface name, named or numerical IP address)
Use i.e '-' to use default address. */
- CINIT(FTPPORT, STRINGPOINT, 17),
+ CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),
/* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, STRINGPOINT, 18),
+ CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),
/* If the download receives less than "low speed limit" bytes/second
* during "low speed time" seconds, the operations is aborted.
@@ -1032,10 +1167,10 @@ typedef enum {
*/
/* Set the "low speed limit" */
- CINIT(LOW_SPEED_LIMIT, LONG, 19),
+ CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),
/* Set the "low speed time" */
- CINIT(LOW_SPEED_TIME, LONG, 20),
+ CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),
/* Set the continuation offset.
*
@@ -1043,48 +1178,49 @@ typedef enum {
* off_t types, allowing for large file offsets on platforms which
* use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
*/
- CINIT(RESUME_FROM, LONG, 21),
+ CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),
/* Set cookie in request: */
- CINIT(COOKIE, STRINGPOINT, 22),
+ CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),
/* This points to a linked list of headers, struct curl_slist kind. This
list is also used for RTSP (in spite of its name) */
- CINIT(HTTPHEADER, OBJECTPOINT, 23),
+ CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),
/* This points to a linked list of post entries, struct curl_httppost */
- CINIT(HTTPPOST, OBJECTPOINT, 24),
+ CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
+ 7.56.0, "Use CURLOPT_MIMEPOST"),
/* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, STRINGPOINT, 25),
+ CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),
/* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, STRINGPOINT, 26),
+ CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),
/* send TYPE parameter? */
- CINIT(CRLF, LONG, 27),
+ CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),
/* send linked-list of QUOTE commands */
- CINIT(QUOTE, OBJECTPOINT, 28),
+ CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),
/* send FILE * or void * to store headers to, if you use a callback it
is simply passed to the callback unmodified */
- CINIT(HEADERDATA, OBJECTPOINT, 29),
+ CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),
/* point to a file to read the initial cookies from, also enables
"cookie awareness" */
- CINIT(COOKIEFILE, STRINGPOINT, 31),
+ CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),
/* What version to specifically try to use.
See CURL_SSLVERSION defines below. */
- CINIT(SSLVERSION, LONG, 32),
+ CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),
/* What kind of HTTP time condition to use, see defines */
- CINIT(TIMECONDITION, LONG, 33),
+ CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),
/* Time to use with the above condition. Specified in number of seconds
since 1 Jan 1970 */
- CINIT(TIMEVALUE, LONG, 34),
+ CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),
/* 35 = OBSOLETE */
@@ -1092,37 +1228,59 @@ typedef enum {
HTTP: DELETE, TRACE and others
FTP: to use a different list command
*/
- CINIT(CUSTOMREQUEST, STRINGPOINT, 36),
+ CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),
/* FILE handle to use instead of stderr */
- CINIT(STDERR, OBJECTPOINT, 37),
+ CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),
/* 38 is not used */
/* send linked-list of post-transfer QUOTE commands */
- CINIT(POSTQUOTE, OBJECTPOINT, 39),
+ CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),
+
+ /* OBSOLETE, do not use! */
+ CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40),
+
+ /* talk a lot */
+ CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),
+
+ /* throw the header out too */
+ CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),
+
+ /* shut off the progress meter */
+ CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),
+
+ /* use HEAD to get http document */
+ CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),
- CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */
+ /* no output on http error codes >= 400 */
+ CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),
- CINIT(VERBOSE, LONG, 41), /* talk a lot */
- CINIT(HEADER, LONG, 42), /* throw the header out too */
- CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
- CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 400 */
- CINIT(UPLOAD, LONG, 46), /* this is an upload */
- CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
+ /* this is an upload */
+ CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),
- CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
+ /* HTTP POST method */
+ CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),
+
+ /* bare names when listing directories */
+ CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),
+
+ /* Append instead of overwrite on upload! */
+ CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),
/* Specify whether to read the user+password from the .netrc or the URL.
* This must be one of the CURL_NETRC_* enums below. */
- CINIT(NETRC, LONG, 51),
+ CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),
- CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
+ /* use Location: Luke! */
+ CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),
- CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
- CINIT(PUT, LONG, 54), /* HTTP PUT */
+ /* transfer data in text/ASCII format */
+ CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),
+
+ /* HTTP PUT */
+ CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
+ 7.12.1, "Use CURLOPT_UPLOAD"),
/* 55 = OBSOLETE */
@@ -1130,265 +1288,270 @@ typedef enum {
* Function that will be called instead of the internal progress display
* function. This function should be defined as the curl_progress_callback
* prototype defines. */
- CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
+ CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,
+ 7.32.0, "Use CURLOPT_XFERINFOFUNCTION"),
/* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
callbacks */
- CINIT(PROGRESSDATA, OBJECTPOINT, 57),
-#define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA
+ CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),
+#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
/* We want the referrer field set automatically when following locations */
- CINIT(AUTOREFERER, LONG, 58),
+ CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),
/* Port of the proxy, can be set in the proxy string as well with:
"[host]:[port]" */
- CINIT(PROXYPORT, LONG, 59),
+ CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),
/* size of the POST input data, if strlen() is not good to use */
- CINIT(POSTFIELDSIZE, LONG, 60),
+ CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),
- /* tunnel non-http operations through a HTTP proxy */
- CINIT(HTTPPROXYTUNNEL, LONG, 61),
+ /* tunnel non-http operations through an HTTP proxy */
+ CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),
/* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, STRINGPOINT, 62),
+ CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),
/* Set the krb4/5 security level, this also enables krb4/5 awareness. This
* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
* is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, STRINGPOINT, 63),
+ CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),
/* Set if we should verify the peer in ssl handshake, set 1 to verify. */
- CINIT(SSL_VERIFYPEER, LONG, 64),
+ CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),
/* The CApath or CAfile used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, STRINGPOINT, 65),
+ CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),
/* 66 = OBSOLETE */
/* 67 = OBSOLETE */
/* Maximum number of http redirects to follow */
- CINIT(MAXREDIRS, LONG, 68),
+ CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),
/* Pass a long set to 1 to get the date of the requested document (if
possible)! Pass a zero to shut it off. */
- CINIT(FILETIME, LONG, 69),
+ CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),
/* This points to a linked list of telnet options */
- CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
+ CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),
/* Max amount of cached alive connections */
- CINIT(MAXCONNECTS, LONG, 71),
+ CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),
- CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */
+ /* OBSOLETE, do not use! */
+ CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72),
/* 73 = OBSOLETE */
/* Set to explicitly use a new connection for the upcoming transfer.
Do not use this unless you're absolutely sure of this, as it makes the
operation slower and is less friendly for the network. */
- CINIT(FRESH_CONNECT, LONG, 74),
+ CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),
- /* Set to explicitly forbid the upcoming transfer's connection to be re-used
+ /* Set to explicitly forbid the upcoming transfer's connection to be reused
when done. Do not use this unless you're absolutely sure of this, as it
makes the operation slower and is less friendly for the network. */
- CINIT(FORBID_REUSE, LONG, 75),
+ CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
/* Set to a file name that contains random data for libcurl to use to
seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, STRINGPOINT, 76),
+ CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,
+ 7.84.0, "Serves no purpose anymore"),
/* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, STRINGPOINT, 77),
+ CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,
+ 7.84.0, "Serves no purpose anymore"),
/* Time-out connect operations after this amount of seconds, if connects are
OK within this time, then fine... This only aborts the connect phase. */
- CINIT(CONNECTTIMEOUT, LONG, 78),
+ CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),
/* Function that will be called to store headers (instead of fwrite). The
* parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
+ CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),
/* Set this to force the HTTP request to get back to GET. Only really usable
if POST, PUT or a custom request have been used first.
*/
- CINIT(HTTPGET, LONG, 80),
+ CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),
/* Set if we should verify the Common name from the peer certificate in ssl
* handshake, set 1 to check existence, 2 to ensure that it matches the
* provided hostname. */
- CINIT(SSL_VERIFYHOST, LONG, 81),
+ CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),
/* Specify which file name to write all known cookies in after completed
operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, STRINGPOINT, 82),
+ CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),
/* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, STRINGPOINT, 83),
+ CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),
/* Specify which HTTP version to use! This must be set to one of the
CURL_HTTP_VERSION* enums set below. */
- CINIT(HTTP_VERSION, LONG, 84),
+ CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),
/* Specifically switch on or off the FTP engine's use of the EPSV command. By
default, that one will always be attempted before the more traditional
PASV command. */
- CINIT(FTP_USE_EPSV, LONG, 85),
+ CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),
/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, STRINGPOINT, 86),
+ CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),
/* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, STRINGPOINT, 87),
+ CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),
/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, STRINGPOINT, 88),
+ CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),
/* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, STRINGPOINT, 89),
+ CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),
/* set the crypto engine for the SSL-sub system as default
the param has no meaning...
*/
- CINIT(SSLENGINE_DEFAULT, LONG, 90),
+ CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),
/* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
+ /* DEPRECATED, do not use! */
+ CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
+ 7.11.1, "Use CURLOPT_SHARE"),
/* DNS cache timeout */
- CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
+ CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),
/* send linked-list of pre-transfer QUOTE commands */
- CINIT(PREQUOTE, OBJECTPOINT, 93),
+ CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),
/* set the debug function */
- CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
+ CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),
/* set the data for the debug function */
- CINIT(DEBUGDATA, OBJECTPOINT, 95),
+ CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),
/* mark this as start of a cookie session */
- CINIT(COOKIESESSION, LONG, 96),
+ CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),
/* The CApath directory used to validate the peer certificate
this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, STRINGPOINT, 97),
+ CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),
/* Instruct libcurl to use a smaller receive buffer */
- CINIT(BUFFERSIZE, LONG, 98),
+ CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),
/* Instruct libcurl to not use any signal/alarm handlers, even when using
timeouts. This option is useful for multi-threaded applications.
See libcurl-the-guide for more background information. */
- CINIT(NOSIGNAL, LONG, 99),
+ CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),
/* Provide a CURLShare for mutexing non-ts data */
- CINIT(SHARE, OBJECTPOINT, 100),
+ CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),
/* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
CURLPROXY_SOCKS5. */
- CINIT(PROXYTYPE, LONG, 101),
+ CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like
the response to be compressed. Before 7.21.6, this was known as
CURLOPT_ENCODING */
- CINIT(ACCEPT_ENCODING, STRINGPOINT, 102),
+ CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),
/* Set pointer to private data */
- CINIT(PRIVATE, OBJECTPOINT, 103),
+ CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),
/* Set aliases for HTTP 200 in the HTTP Response header */
- CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
+ CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),
/* Continue to send authentication (user+password) when following locations,
even when hostname changed. This can potentially send off the name
and password to whatever host the server decides. */
- CINIT(UNRESTRICTED_AUTH, LONG, 105),
+ CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),
/* Specifically switch on or off the FTP engine's use of the EPRT command (
it also disables the LPRT attempt). By default, those ones will always be
attempted before the good old traditional PORT command. */
- CINIT(FTP_USE_EPRT, LONG, 106),
+ CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),
/* Set this to a bitmask value to enable the particular authentications
methods you like. Use this in combination with CURLOPT_USERPWD.
Note that setting multiple bits may cause extra network round-trips. */
- CINIT(HTTPAUTH, LONG, 107),
+ CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),
/* Set the ssl context callback function, currently only for OpenSSL or
WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
The function must match the curl_ssl_ctx_callback prototype. */
- CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
+ CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),
/* Set the userdata for the ssl context callback function's third
argument */
- CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
+ CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),
/* FTP Option that causes missing dirs to be created on the remote server.
In 7.19.4 we introduced the convenience enums for this option using the
CURLFTP_CREATE_DIR prefix.
*/
- CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
+ CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),
/* Set this to a bitmask value to enable the particular authentications
methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
Note that setting multiple bits may cause extra network round-trips. */
- CINIT(PROXYAUTH, LONG, 111),
+ CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),
- /* FTP option that changes the timeout, in seconds, associated with
- getting a response. This is different from transfer timeout time and
- essentially places a demand on the FTP server to acknowledge commands
- in a timely manner. */
- CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
-#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
+ /* Option that changes the timeout, in seconds, associated with getting a
+ response. This is different from transfer timeout time and essentially
+ places a demand on the server to acknowledge commands in a timely
+ manner. For FTP, SMTP, IMAP and POP3. */
+ CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),
/* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
- tell libcurl to resolve names to those IP versions only. This only has
- affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
- CINIT(IPRESOLVE, LONG, 113),
+ tell libcurl to use those IP versions only. This only has effect on
+ systems with support for more than one, i.e IPv4 _and_ IPv6. */
+ CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),
/* Set this option to limit the size of a file that will be downloaded from
an HTTP or FTP server.
Note there is also _LARGE version which adds large file support for
platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
- CINIT(MAXFILESIZE, LONG, 114),
+ CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),
/* See the comment for INFILESIZE above, but in short, specifies
* the size of the file being uploaded. -1 means unknown.
*/
- CINIT(INFILESIZE_LARGE, OFF_T, 115),
+ CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),
- /* Sets the continuation offset. There is also a LONG version of this;
- * look above for RESUME_FROM.
+ /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version
+ * of this; look above for RESUME_FROM.
*/
- CINIT(RESUME_FROM_LARGE, OFF_T, 116),
+ CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),
/* Sets the maximum size of data that will be downloaded from
* an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
*/
- CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
+ CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),
/* Set this option to the file name of your .netrc file you want libcurl
to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
a poor attempt to find the user's home directory and check for a .netrc
file in there. */
- CINIT(NETRC_FILE, STRINGPOINT, 118),
+ CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),
/* Enable SSL/TLS for FTP, pick one of:
CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
CURLUSESSL_CONTROL - SSL for the control connection or fail
CURLUSESSL_ALL - SSL for all communication or fail
*/
- CINIT(USE_SSL, LONG, 119),
+ CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),
/* The _LARGE version of the standard POSTFIELDSIZE option */
- CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
+ CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),
/* Enable/disable the TCP Nagle algorithm */
- CINIT(TCP_NODELAY, LONG, 121),
+ CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),
/* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
/* 123 OBSOLETE. Gone in 7.16.0 */
@@ -1408,143 +1571,151 @@ typedef enum {
CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
*/
- CINIT(FTPSSLAUTH, LONG, 129),
+ CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),
- CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
- CINIT(IOCTLDATA, OBJECTPOINT, 131),
+ CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,
+ 7.18.0, "Use CURLOPT_SEEKFUNCTION"),
+ CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,
+ 7.18.0, "Use CURLOPT_SEEKDATA"),
/* 132 OBSOLETE. Gone in 7.16.0 */
/* 133 OBSOLETE. Gone in 7.16.0 */
- /* zero terminated string for pass on to the FTP server when asked for
+ /* null-terminated string for pass on to the FTP server when asked for
"account" info */
- CINIT(FTP_ACCOUNT, STRINGPOINT, 134),
+ CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),
/* feed cookie into cookie engine */
- CINIT(COOKIELIST, STRINGPOINT, 135),
+ CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),
/* ignore Content-Length */
- CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
+ CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),
/* Set to non-zero to skip the IP address received in a 227 PASV FTP server
response. Typically used for FTP-SSL purposes but is not restricted to
that. libcurl will then instead use the same IP address it used for the
control connection. */
- CINIT(FTP_SKIP_PASV_IP, LONG, 137),
+ CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),
/* Select "file method" to use when doing FTP, see the curl_ftpmethod
above. */
- CINIT(FTP_FILEMETHOD, LONG, 138),
+ CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),
/* Local port number to bind the socket to */
- CINIT(LOCALPORT, LONG, 139),
+ CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),
/* Number of ports to try, including the first one set with LOCALPORT.
Thus, setting it to 1 will make no additional attempts but the first.
*/
- CINIT(LOCALPORTRANGE, LONG, 140),
+ CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),
/* no transfer, set up connection and let application use the socket by
extracting it with CURLINFO_LASTSOCKET */
- CINIT(CONNECT_ONLY, LONG, 141),
+ CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),
/* Function that will be called to convert from the
network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
+ CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,
+ CURLOPTTYPE_FUNCTIONPOINT, 142,
+ 7.82.0, "Serves no purpose anymore"),
/* Function that will be called to convert to the
network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
+ CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,
+ CURLOPTTYPE_FUNCTIONPOINT, 143,
+ 7.82.0, "Serves no purpose anymore"),
/* Function that will be called to convert from UTF8
(instead of using the iconv calls in libcurl)
Note that this is used only for SSL certificate processing */
- CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
+ CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,
+ CURLOPTTYPE_FUNCTIONPOINT, 144,
+ 7.82.0, "Serves no purpose anymore"),
/* if the connection proceeds too quickly then need to slow it down */
/* limit-rate: maximum number of bytes per second to send or receive */
- CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
- CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
+ CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),
+ CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),
/* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, STRINGPOINT, 147),
+ CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),
/* callback function for setting socket options */
- CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
- CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
+ CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),
+ CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),
- /* set to 0 to disable session ID re-use for this transfer, default is
+ /* set to 0 to disable session ID reuse for this transfer, default is
enabled (== 1) */
- CINIT(SSL_SESSIONID_CACHE, LONG, 150),
+ CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),
/* allowed SSH authentication methods */
- CINIT(SSH_AUTH_TYPES, LONG, 151),
+ CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),
/* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, STRINGPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, STRINGPOINT, 153),
+ CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),
+ CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),
/* Send CCC (Clear Command Channel) after authentication */
- CINIT(FTP_SSL_CCC, LONG, 154),
+ CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),
/* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
- CINIT(TIMEOUT_MS, LONG, 155),
- CINIT(CONNECTTIMEOUT_MS, LONG, 156),
+ CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),
+ CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),
/* set to zero to disable the libcurl's decoding and thus pass the raw body
data to the application even when it is encoded/compressed */
- CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
- CINIT(HTTP_CONTENT_DECODING, LONG, 158),
+ CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),
+ CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),
/* Permission used when creating new files and directories on the remote
server for protocols that support it, SFTP/SCP/FILE */
- CINIT(NEW_FILE_PERMS, LONG, 159),
- CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
+ CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),
+ CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),
- /* Set the behaviour of POST when redirecting. Values must be set to one
+ /* Set the behavior of POST when redirecting. Values must be set to one
of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
- CINIT(POSTREDIR, LONG, 161),
+ CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),
/* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, STRINGPOINT, 162),
+ CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),
/* Callback function for opening socket (instead of socket(2)). Optionally,
callback is able change the address or refuse to connect returning
CURL_SOCKET_BAD. The callback should have type
curl_opensocket_callback */
- CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
- CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
+ CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),
+ CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),
/* POST volatile input fields. */
- CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
+ CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),
/* set transfer mode (;type=) when doing FTP via an HTTP proxy */
- CINIT(PROXY_TRANSFER_MODE, LONG, 166),
+ CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),
/* Callback function for seeking in the input stream */
- CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
- CINIT(SEEKDATA, OBJECTPOINT, 168),
+ CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),
+ CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),
/* CRL file */
- CINIT(CRLFILE, STRINGPOINT, 169),
+ CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),
/* Issuer certificate */
- CINIT(ISSUERCERT, STRINGPOINT, 170),
+ CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),
/* (IPv6) Address scope */
- CINIT(ADDRESS_SCOPE, LONG, 171),
+ CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),
/* Collect certificate chain info and allow it to get retrievable with
CURLINFO_CERTINFO after the transfer is complete. */
- CINIT(CERTINFO, LONG, 172),
+ CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),
/* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, STRINGPOINT, 173),
- CINIT(PASSWORD, STRINGPOINT, 174),
+ CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),
+ CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),
/* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, STRINGPOINT, 175),
- CINIT(PROXYPASSWORD, STRINGPOINT, 176),
+ CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),
+ CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),
/* Comma separated list of hostnames defining no-proxy zones. These should
match both hostnames directly, and hostnames within a domain. For
@@ -1553,103 +1724,107 @@ typedef enum {
implementations of this, .local.com will be considered to be the same as
local.com. A single * is the only valid wildcard, and effectively
disables the use of proxy. */
- CINIT(NOPROXY, STRINGPOINT, 177),
+ CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),
/* block size for TFTP transfers */
- CINIT(TFTP_BLKSIZE, LONG, 178),
+ CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),
/* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, STRINGPOINT, 179), /* DEPRECATED, do not use! */
+ /* DEPRECATED, do not use! */
+ CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,
+ CURLOPTTYPE_STRINGPOINT, 179,
+ 7.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),
/* Socks Service */
- CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
+ CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),
/* set the bitmask for the protocols that are allowed to be used for the
transfer, which thus helps the app which takes URLs from users or other
external inputs and want to restrict what protocol(s) to deal
with. Defaults to CURLPROTO_ALL. */
- CINIT(PROTOCOLS, LONG, 181),
+ CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
+ 7.85.0, "Use CURLOPT_PROTOCOLS_STR"),
/* set the bitmask for the protocols that libcurl is allowed to follow to,
as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
- to be set in both bitmasks to be allowed to get redirected to. Defaults
- to all protocols except FILE and SCP. */
- CINIT(REDIR_PROTOCOLS, LONG, 182),
+ to be set in both bitmasks to be allowed to get redirected to. */
+ CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,
+ 7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),
/* set the SSH knownhost file name to use */
- CINIT(SSH_KNOWNHOSTS, STRINGPOINT, 183),
+ CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),
/* set the SSH host key callback, must point to a curl_sshkeycallback
function */
- CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
+ CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),
/* set the SSH host key callback custom pointer */
- CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
+ CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),
/* set the SMTP mail originator */
- CINIT(MAIL_FROM, STRINGPOINT, 186),
+ CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),
/* set the list of SMTP mail receiver(s) */
- CINIT(MAIL_RCPT, OBJECTPOINT, 187),
+ CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),
/* FTP: send PRET before PASV */
- CINIT(FTP_USE_PRET, LONG, 188),
+ CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),
/* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
- CINIT(RTSP_REQUEST, LONG, 189),
+ CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),
/* The RTSP session identifier */
- CINIT(RTSP_SESSION_ID, STRINGPOINT, 190),
+ CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),
/* The RTSP stream URI */
- CINIT(RTSP_STREAM_URI, STRINGPOINT, 191),
+ CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),
/* The Transport: header to use in RTSP requests */
- CINIT(RTSP_TRANSPORT, STRINGPOINT, 192),
+ CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),
/* Manually initialize the client RTSP CSeq for this handle */
- CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
+ CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),
/* Manually initialize the server RTSP CSeq for this handle */
- CINIT(RTSP_SERVER_CSEQ, LONG, 194),
+ CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),
/* The stream to pass to INTERLEAVEFUNCTION. */
- CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),
+ CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),
/* Let the application define a custom write method for RTP data */
- CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
+ CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),
/* Turn on wildcard matching */
- CINIT(WILDCARDMATCH, LONG, 197),
+ CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),
/* Directory matching callback called before downloading of an
individual file (chunk) started */
- CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
+ CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),
/* Directory matching callback called after the file (chunk)
was downloaded, or skipped */
- CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
+ CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),
/* Change match (fnmatch-like) callback for wildcard matching */
- CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
+ CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),
/* Let the application define custom chunk data pointer */
- CINIT(CHUNK_DATA, OBJECTPOINT, 201),
+ CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),
/* FNMATCH_FUNCTION user pointer */
- CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
+ CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),
/* send linked-list of name:port:address sets */
- CINIT(RESOLVE, OBJECTPOINT, 203),
+ CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),
/* Set a username for authenticated TLS */
- CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
+ CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),
/* Set a password for authenticated TLS */
- CINIT(TLSAUTH_PASSWORD, STRINGPOINT, 205),
+ CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),
/* Set authentication type for authenticated TLS */
- CINIT(TLSAUTH_TYPE, STRINGPOINT, 206),
+ CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),
/* Set to 1 to enable the "TE:" header in HTTP requests to ask for
compressed transfer-encoded responses. Set to 0 to disable the use of TE:
@@ -1661,268 +1836,375 @@ typedef enum {
option is set to 1.
*/
- CINIT(TRANSFER_ENCODING, LONG, 207),
+ CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),
/* Callback function for closing socket (instead of close(2)). The callback
should have type curl_closesocket_callback */
- CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
- CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
+ CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),
+ CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),
/* allow GSSAPI credential delegation */
- CINIT(GSSAPI_DELEGATION, LONG, 210),
+ CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),
- /* Set the name servers to use for DNS resolution */
- CINIT(DNS_SERVERS, STRINGPOINT, 211),
+ /* Set the name servers to use for DNS resolution.
+ * Only supported by the c-ares DNS backend */
+ CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),
/* Time-out accept operations (currently for FTP only) after this amount
of milliseconds. */
- CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
+ CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),
/* Set TCP keepalive */
- CINIT(TCP_KEEPALIVE, LONG, 213),
+ CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),
/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
- CINIT(TCP_KEEPIDLE, LONG, 214),
- CINIT(TCP_KEEPINTVL, LONG, 215),
+ CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),
+ CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),
/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
- CINIT(SSL_OPTIONS, LONG, 216),
+ CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),
/* Set the SMTP auth originator */
- CINIT(MAIL_AUTH, STRINGPOINT, 217),
+ CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),
/* Enable/disable SASL initial response */
- CINIT(SASL_IR, LONG, 218),
+ CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),
/* Function that will be called instead of the internal progress display
* function. This function should be defined as the curl_xferinfo_callback
* prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
- CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219),
+ CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),
/* The XOAUTH2 bearer token */
- CINIT(XOAUTH2_BEARER, STRINGPOINT, 220),
+ CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),
/* Set the interface string to use as outgoing network
* interface for DNS requests.
* Only supported by the c-ares DNS backend */
- CINIT(DNS_INTERFACE, STRINGPOINT, 221),
+ CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),
/* Set the local IPv4 address to use for outgoing DNS requests.
* Only supported by the c-ares DNS backend */
- CINIT(DNS_LOCAL_IP4, STRINGPOINT, 222),
+ CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),
/* Set the local IPv6 address to use for outgoing DNS requests.
* Only supported by the c-ares DNS backend */
- CINIT(DNS_LOCAL_IP6, STRINGPOINT, 223),
+ CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),
/* Set authentication options directly */
- CINIT(LOGIN_OPTIONS, STRINGPOINT, 224),
+ CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),
/* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
- CINIT(SSL_ENABLE_NPN, LONG, 225),
+ CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,
+ 7.86.0, "Has no function"),
/* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
- CINIT(SSL_ENABLE_ALPN, LONG, 226),
+ CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),
- /* Time to wait for a response to a HTTP request containing an
+ /* Time to wait for a response to an HTTP request containing an
* Expect: 100-continue header before sending the data anyway. */
- CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227),
+ CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),
/* This points to a linked list of headers used for proxy requests only,
struct curl_slist kind */
- CINIT(PROXYHEADER, OBJECTPOINT, 228),
+ CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),
/* Pass in a bitmask of "header options" */
- CINIT(HEADEROPT, LONG, 229),
+ CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),
/* The public key in DER form used to validate the peer public key
this option is used only if SSL_VERIFYPEER is true */
- CINIT(PINNEDPUBLICKEY, STRINGPOINT, 230),
+ CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),
/* Path to Unix domain socket */
- CINIT(UNIX_SOCKET_PATH, STRINGPOINT, 231),
+ CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),
/* Set if we should verify the certificate status. */
- CINIT(SSL_VERIFYSTATUS, LONG, 232),
+ CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),
/* Set if we should enable TLS false start. */
- CINIT(SSL_FALSESTART, LONG, 233),
+ CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233),
/* Do not squash dot-dot sequences */
- CINIT(PATH_AS_IS, LONG, 234),
+ CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),
/* Proxy Service Name */
- CINIT(PROXY_SERVICE_NAME, STRINGPOINT, 235),
+ CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),
/* Service Name */
- CINIT(SERVICE_NAME, STRINGPOINT, 236),
+ CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),
/* Wait/don't wait for pipe/mutex to clarify */
- CINIT(PIPEWAIT, LONG, 237),
+ CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),
/* Set the protocol used when curl is given a URL without a protocol */
- CINIT(DEFAULT_PROTOCOL, STRINGPOINT, 238),
+ CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),
/* Set stream weight, 1 - 256 (default is 16) */
- CINIT(STREAM_WEIGHT, LONG, 239),
+ CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),
/* Set stream dependency on another CURL handle */
- CINIT(STREAM_DEPENDS, OBJECTPOINT, 240),
+ CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),
/* Set E-xclusive stream dependency on another CURL handle */
- CINIT(STREAM_DEPENDS_E, OBJECTPOINT, 241),
+ CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),
/* Do not send any tftp option requests to the server */
- CINIT(TFTP_NO_OPTIONS, LONG, 242),
+ CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),
/* Linked-list of host:port:connect-to-host:connect-to-port,
overrides the URL's host:port (only for the network layer) */
- CINIT(CONNECT_TO, OBJECTPOINT, 243),
+ CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),
/* Set TCP Fast Open */
- CINIT(TCP_FASTOPEN, LONG, 244),
+ CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),
/* Continue to send data if the server responds early with an
* HTTP status code >= 300 */
- CINIT(KEEP_SENDING_ON_ERROR, LONG, 245),
+ CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),
/* The CApath or CAfile used to validate the proxy certificate
this option is used only if PROXY_SSL_VERIFYPEER is true */
- CINIT(PROXY_CAINFO, STRINGPOINT, 246),
+ CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),
/* The CApath directory used to validate the proxy certificate
this option is used only if PROXY_SSL_VERIFYPEER is true */
- CINIT(PROXY_CAPATH, STRINGPOINT, 247),
+ CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),
/* Set if we should verify the proxy in ssl handshake,
set 1 to verify. */
- CINIT(PROXY_SSL_VERIFYPEER, LONG, 248),
+ CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),
/* Set if we should verify the Common name from the proxy certificate in ssl
* handshake, set 1 to check existence, 2 to ensure that it matches
* the provided hostname. */
- CINIT(PROXY_SSL_VERIFYHOST, LONG, 249),
+ CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),
/* What version to specifically try to use for proxy.
See CURL_SSLVERSION defines below. */
- CINIT(PROXY_SSLVERSION, LONG, 250),
+ CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),
/* Set a username for authenticated TLS for proxy */
- CINIT(PROXY_TLSAUTH_USERNAME, STRINGPOINT, 251),
+ CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),
/* Set a password for authenticated TLS for proxy */
- CINIT(PROXY_TLSAUTH_PASSWORD, STRINGPOINT, 252),
+ CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),
/* Set authentication type for authenticated TLS for proxy */
- CINIT(PROXY_TLSAUTH_TYPE, STRINGPOINT, 253),
+ CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),
/* name of the file keeping your private SSL-certificate for proxy */
- CINIT(PROXY_SSLCERT, STRINGPOINT, 254),
+ CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),
/* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
proxy */
- CINIT(PROXY_SSLCERTTYPE, STRINGPOINT, 255),
+ CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),
/* name of the file keeping your private SSL-key for proxy */
- CINIT(PROXY_SSLKEY, STRINGPOINT, 256),
+ CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),
/* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
proxy */
- CINIT(PROXY_SSLKEYTYPE, STRINGPOINT, 257),
+ CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),
/* password for the SSL private key for proxy */
- CINIT(PROXY_KEYPASSWD, STRINGPOINT, 258),
+ CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),
/* Specify which SSL ciphers to use for proxy */
- CINIT(PROXY_SSL_CIPHER_LIST, STRINGPOINT, 259),
+ CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),
/* CRL file for proxy */
- CINIT(PROXY_CRLFILE, STRINGPOINT, 260),
+ CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),
/* Enable/disable specific SSL features with a bitmask for proxy, see
CURLSSLOPT_* */
- CINIT(PROXY_SSL_OPTIONS, LONG, 261),
+ CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),
/* Name of pre proxy to use. */
- CINIT(PRE_PROXY, STRINGPOINT, 262),
+ CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),
/* The public key in DER form used to validate the proxy public key
this option is used only if PROXY_SSL_VERIFYPEER is true */
- CINIT(PROXY_PINNEDPUBLICKEY, STRINGPOINT, 263),
+ CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),
/* Path to an abstract Unix domain socket */
- CINIT(ABSTRACT_UNIX_SOCKET, STRINGPOINT, 264),
+ CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),
/* Suppress proxy CONNECT response headers from user callbacks */
- CINIT(SUPPRESS_CONNECT_HEADERS, LONG, 265),
+ CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),
/* The request target, instead of extracted from the URL */
- CINIT(REQUEST_TARGET, STRINGPOINT, 266),
+ CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),
/* bitmask of allowed auth methods for connections to SOCKS5 proxies */
- CINIT(SOCKS5_AUTH, LONG, 267),
+ CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),
/* Enable/disable SSH compression */
- CINIT(SSH_COMPRESSION, LONG, 268),
+ CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),
/* Post MIME data. */
- CINIT(MIMEPOST, OBJECTPOINT, 269),
+ CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),
/* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
seconds since 1 Jan 1970. */
- CINIT(TIMEVALUE_LARGE, OFF_T, 270),
+ CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),
/* Head start in milliseconds to give happy eyeballs. */
- CINIT(HAPPY_EYEBALLS_TIMEOUT_MS, LONG, 271),
+ CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),
/* Function that will be called before a resolver request is made */
- CINIT(RESOLVER_START_FUNCTION, FUNCTIONPOINT, 272),
+ CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),
/* User data to pass to the resolver start callback. */
- CINIT(RESOLVER_START_DATA, OBJECTPOINT, 273),
+ CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),
/* send HAProxy PROXY protocol header? */
- CINIT(HAPROXYPROTOCOL, LONG, 274),
+ CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),
/* shuffle addresses before use when DNS returns multiple */
- CINIT(DNS_SHUFFLE_ADDRESSES, LONG, 275),
+ CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),
/* Specify which TLS 1.3 ciphers suites to use */
- CINIT(TLS13_CIPHERS, STRINGPOINT, 276),
- CINIT(PROXY_TLS13_CIPHERS, STRINGPOINT, 277),
+ CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),
+ CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),
/* Disallow specifying username/login in URL. */
- CINIT(DISALLOW_USERNAME_IN_URL, LONG, 278),
+ CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),
/* DNS-over-HTTPS URL */
- CINIT(DOH_URL, STRINGPOINT, 279),
+ CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),
/* Preferred buffer size to use for uploads */
- CINIT(UPLOAD_BUFFERSIZE, LONG, 280),
+ CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),
/* Time in ms between connection upkeep calls for long-lived connections. */
- CINIT(UPKEEP_INTERVAL_MS, LONG, 281),
+ CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),
/* Specify URL using CURL URL API. */
- CINIT(CURLU, OBJECTPOINT, 282),
+ CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),
/* add trailing data just after no more data is available */
- CINIT(TRAILERFUNCTION, FUNCTIONPOINT, 283),
+ CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),
/* pointer to be passed to HTTP_TRAILER_FUNCTION */
- CINIT(TRAILERDATA, OBJECTPOINT, 284),
+ CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),
/* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
- CINIT(HTTP09_ALLOWED, LONG, 285),
+ CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),
/* alt-svc control bitmask */
- CINIT(ALTSVC_CTRL, LONG, 286),
+ CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),
/* alt-svc cache file name to possibly read from/write to */
- CINIT(ALTSVC, STRINGPOINT, 287),
+ CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
+
+ /* maximum age (idle time) of a connection to consider it for reuse
+ * (in seconds) */
+ CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),
+
+ /* SASL authorization identity */
+ CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),
+
+ /* allow RCPT TO command to fail for some recipients */
+ CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290),
- /* maximum age of a connection to consider it for reuse (in seconds) */
- CINIT(MAXAGE_CONN, LONG, 288),
+ /* the private SSL-certificate as a "blob" */
+ CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),
+ CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),
+ CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),
+ CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),
+ CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),
+
+ /* Issuer certificate for proxy */
+ CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),
+ CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),
+
+ /* the EC curves requested by the TLS client (RFC 8422, 5.1);
+ * OpenSSL support via 'set_groups'/'set_curves':
+ * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
+ */
+ CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),
+
+ /* HSTS bitmask */
+ CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),
+ /* HSTS file name */
+ CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),
+
+ /* HSTS read callback */
+ CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),
+ CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),
+
+ /* HSTS write callback */
+ CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),
+ CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),
+
+ /* Parameters for V4 signature */
+ CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),
+
+ /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */
+ CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),
+
+ /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */
+ CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),
+
+ /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */
+ CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),
+
+ /* The CA certificates as "blob" used to validate the peer certificate
+ this option is used only if SSL_VERIFYPEER is true */
+ CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),
+
+ /* The CA certificates as "blob" used to validate the proxy certificate
+ this option is used only if PROXY_SSL_VERIFYPEER is true */
+ CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),
+
+ /* used by scp/sftp to verify the host's public key */
+ CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
+
+ /* Function that will be called immediately before the initial request
+ is made on a connection (after any protocol negotiation step). */
+ CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
+
+ /* Data passed to the CURLOPT_PREREQFUNCTION callback */
+ CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),
+
+ /* maximum age (since creation) of a connection to consider it for reuse
+ * (in seconds) */
+ CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),
+
+ /* Set MIME option flags. */
+ CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),
+
+ /* set the SSH host key callback, must point to a curl_sshkeycallback
+ function */
+ CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),
+
+ /* set the SSH host key callback custom pointer */
+ CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),
+
+ /* specify which protocols that are allowed to be used for the transfer,
+ which thus helps the app which takes URLs from users or other external
+ inputs and want to restrict what protocol(s) to deal with. Defaults to
+ all built-in protocols. */
+ CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),
+
+ /* specify which protocols that libcurl is allowed to follow directs to */
+ CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
+
+ /* websockets options */
+ CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
+
+ /* CA cache timeout */
+ CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),
+
+ /* Can leak things, gonna exit() soon */
+ CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),
+
+ /* set a specific client IP for HAProxy PROXY protocol header? */
+ CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323),
+
+ /* millisecond version */
+ CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@@ -1949,6 +2231,12 @@ typedef enum {
#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
+/* */
+#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
+
+/* Added in 8.2.0 */
+#define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS
+
#else
/* This is set if CURL_NO_OLDIES is defined at compile-time */
#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
@@ -1958,12 +2246,12 @@ typedef enum {
/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
name resolves addresses using more than one IP protocol version, this
option might be handy to force libcurl to use a specific IP version. */
-#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
+#define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP
versions that your system allows */
-#define CURL_IPRESOLVE_V4 1 /* resolve to IPv4 addresses */
-#define CURL_IPRESOLVE_V6 2 /* resolve to IPv6 addresses */
+#define CURL_IPRESOLVE_V4 1 /* uses only IPv4 addresses/connections */
+#define CURL_IPRESOLVE_V6 2 /* uses only IPv6 addresses/connections */
- /* three convenient "aliases" that follow the name scheme better */
+ /* Convenient "aliases" */
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
/* These enums are for use with the CURLOPT_HTTP_VERSION option. */
@@ -1977,6 +2265,12 @@ enum {
CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
Upgrade */
+ CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
+ needed. For HTTPS only. For HTTP, this option
+ makes libcurl return error. */
+ CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
+ only. For HTTP, this makes libcurl
+ return error. */
CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
};
@@ -2070,7 +2364,7 @@ typedef enum {
CURL_TIMECOND_LAST
} curl_TimeCond;
-/* Special size_t value signaling a zero-terminated string. */
+/* Special size_t value signaling a null-terminated string. */
#define CURL_ZERO_TERMINATED ((size_t) -1)
/* curl_strequal() and curl_strnequal() are subject for removal in a future
@@ -2079,8 +2373,11 @@ CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
/* Mime/form handling support. */
-typedef struct curl_mime_s curl_mime; /* Mime context. */
-typedef struct curl_mimepart_s curl_mimepart; /* Mime part context. */
+typedef struct curl_mime curl_mime; /* Mime context. */
+typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
+
+/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
+#define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */
/*
* NAME curl_mime_init()
@@ -2203,52 +2500,37 @@ CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
struct curl_slist *headers,
int take_ownership);
-/* Old form API. */
-/* name is uppercase CURLFORM_ */
-#ifdef CFINIT
-#undef CFINIT
-#endif
-
-#ifdef CURL_ISOCPP
-#define CFINIT(name) CURLFORM_ ## name
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define CFINIT(name) CURLFORM_/**/name
-#endif
-
typedef enum {
- CFINIT(NOTHING), /********* the first one is unused ************/
-
- /* */
- CFINIT(COPYNAME),
- CFINIT(PTRNAME),
- CFINIT(NAMELENGTH),
- CFINIT(COPYCONTENTS),
- CFINIT(PTRCONTENTS),
- CFINIT(CONTENTSLENGTH),
- CFINIT(FILECONTENT),
- CFINIT(ARRAY),
- CFINIT(OBSOLETE),
- CFINIT(FILE),
-
- CFINIT(BUFFER),
- CFINIT(BUFFERPTR),
- CFINIT(BUFFERLENGTH),
-
- CFINIT(CONTENTTYPE),
- CFINIT(CONTENTHEADER),
- CFINIT(FILENAME),
- CFINIT(END),
- CFINIT(OBSOLETE2),
-
- CFINIT(STREAM),
- CFINIT(CONTENTLEN), /* added in 7.46.0, provide a curl_off_t length */
+ /********* the first one is unused ************/
+ CURLFORM_NOTHING CURL_DEPRECATED(7.56.0, ""),
+ CURLFORM_COPYNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
+ CURLFORM_PTRNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
+ CURLFORM_NAMELENGTH CURL_DEPRECATED(7.56.0, ""),
+ CURLFORM_COPYCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_PTRCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_CONTENTSLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_FILECONTENT CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
+ CURLFORM_ARRAY CURL_DEPRECATED(7.56.0, ""),
+ CURLFORM_OBSOLETE,
+ CURLFORM_FILE CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),
+
+ CURLFORM_BUFFER CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
+ CURLFORM_BUFFERPTR CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+ CURLFORM_BUFFERLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
+
+ CURLFORM_CONTENTTYPE CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
+ CURLFORM_CONTENTHEADER CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),
+ CURLFORM_FILENAME CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
+ CURLFORM_END,
+ CURLFORM_OBSOLETE2,
+
+ CURLFORM_STREAM CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
+ CURLFORM_CONTENTLEN /* added in 7.46.0, provide a curl_off_t length */
+ CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
CURLFORM_LASTENTRY /* the last unused */
} CURLformoption;
-#undef CFINIT /* done */
-
/* structure to be used as parameter for CURLFORM_ARRAY */
struct curl_forms {
CURLformoption option;
@@ -2272,15 +2554,16 @@ struct curl_forms {
*
***************************************************************************/
typedef enum {
- CURL_FORMADD_OK, /* first, no error */
+ CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */
- CURL_FORMADD_MEMORY,
- CURL_FORMADD_OPTION_TWICE,
- CURL_FORMADD_NULL,
- CURL_FORMADD_UNKNOWN_OPTION,
- CURL_FORMADD_INCOMPLETE,
- CURL_FORMADD_ILLEGAL_ARRAY,
- CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
+ CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_NULL CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_INCOMPLETE CURL_DEPRECATED(7.56.0, ""),
+ CURL_FORMADD_ILLEGAL_ARRAY CURL_DEPRECATED(7.56.0, ""),
+ /* libcurl was built with form api disabled */
+ CURL_FORMADD_DISABLED CURL_DEPRECATED(7.56.0, ""),
CURL_FORMADD_LAST /* last */
} CURLFORMcode;
@@ -2294,9 +2577,10 @@ typedef enum {
* adds one part that together construct a full post. Then use
* CURLOPT_HTTPPOST to send it off to libcurl.
*/
-CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- ...);
+CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")
+curl_formadd(struct curl_httppost **httppost,
+ struct curl_httppost **last_post,
+ ...);
/*
* callback function for curl_formget()
@@ -2319,8 +2603,9 @@ typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
* the curl_formget_callback function.
* Returns 0 on success.
*/
-CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
- curl_formget_callback append);
+CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")
+curl_formget(struct curl_httppost *form, void *arg,
+ curl_formget_callback append);
/*
* NAME curl_formfree()
*
@@ -2328,7 +2613,8 @@ CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
*
* Free a multipart formpost previously built with curl_formadd().
*/
-CURL_EXTERN void curl_formfree(struct curl_httppost *form);
+CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")
+curl_formfree(struct curl_httppost *form);
/*
* NAME curl_getenv()
@@ -2404,8 +2690,10 @@ CURL_EXTERN void curl_free(void *p);
*
* curl_global_init() should be invoked exactly once for each application that
* uses libcurl and before any call of other libcurl functions.
- *
- * This function is not thread-safe!
+
+ * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
+ * curl_version_info_data.features flag (fetch by curl_version_info()).
+
*/
CURL_EXTERN CURLcode curl_global_init(long flags);
@@ -2419,7 +2707,7 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
* initialize libcurl and set user defined memory management callback
* functions. Users can implement memory management routines to check for
* memory leaks, check for mis-use of the curl library etc. User registered
- * callback routines with be invoked by this library instead of the system
+ * callback routines will be invoked by this library instead of the system
* memory management routines like malloc, free etc.
*/
CURL_EXTERN CURLcode curl_global_init_mem(long flags,
@@ -2439,6 +2727,20 @@ CURL_EXTERN CURLcode curl_global_init_mem(long flags,
*/
CURL_EXTERN void curl_global_cleanup(void);
+/*
+ * NAME curl_global_trace()
+ *
+ * DESCRIPTION
+ *
+ * curl_global_trace() can be invoked at application start to
+ * configure which components in curl should participate in tracing.
+
+ * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
+ * curl_version_info_data.features flag (fetch by curl_version_info()).
+
+ */
+CURL_EXTERN CURLcode curl_global_trace(const char *config);
+
/* linked-list structure for the CURLOPT_QUOTE option (and other) */
struct curl_slist {
char *data;
@@ -2471,10 +2773,11 @@ struct curl_slist {
* subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
*/
-typedef struct {
+struct curl_ssl_backend {
curl_sslbackend id;
const char *name;
-} curl_ssl_backend;
+};
+typedef struct curl_ssl_backend curl_ssl_backend;
typedef enum {
CURLSSLSET_OK = 0,
@@ -2494,8 +2797,8 @@ CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
* Appends a string to a linked list. If no list exists, it will be created
* first. Returns the new list, after appending.
*/
-CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
- const char *);
+CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list,
+ const char *data);
/*
* NAME curl_slist_free_all()
@@ -2504,7 +2807,7 @@ CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
*
* free a previously built curl_slist.
*/
-CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
+CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
/*
* NAME curl_getdate()
@@ -2517,13 +2820,14 @@ CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
*/
CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
-/* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS
- and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
+/* info about the certificate chain, for SSL backends that support it. Asked
+ for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
struct curl_certinfo {
int num_of_certs; /* number of certificates with information */
struct curl_slist **certinfo; /* for each index in this array, there's a
- linked list with textual information in the
- format "name: value" */
+ linked list with textual information for a
+ certificate in the format "name:content".
+ eg "Subject:foo", "Issuer:bar", etc. */
};
/* Information about the SSL library used and the respective internal SSL
@@ -2552,22 +2856,35 @@ typedef enum {
CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
- CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
+ CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T")
+ = CURLINFO_DOUBLE + 7,
CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,
- CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
+ CURLINFO_SIZE_DOWNLOAD
+ CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T")
+ = CURLINFO_DOUBLE + 8,
CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,
- CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
+ CURLINFO_SPEED_DOWNLOAD
+ CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T")
+ = CURLINFO_DOUBLE + 9,
CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,
- CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
+ CURLINFO_SPEED_UPLOAD
+ CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T")
+ = CURLINFO_DOUBLE + 10,
CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,
CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
CURLINFO_FILETIME = CURLINFO_LONG + 14,
CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,
- CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
+ CURLINFO_CONTENT_LENGTH_DOWNLOAD
+ CURL_DEPRECATED(7.55.0,
+ "Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T")
+ = CURLINFO_DOUBLE + 15,
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,
- CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
+ CURLINFO_CONTENT_LENGTH_UPLOAD
+ CURL_DEPRECATED(7.55.0,
+ "Use CURLINFO_CONTENT_LENGTH_UPLOAD_T")
+ = CURLINFO_DOUBLE + 16,
CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,
CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
@@ -2581,7 +2898,8 @@ typedef enum {
CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
- CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
+ CURLINFO_LASTSOCKET CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET")
+ = CURLINFO_LONG + 29,
CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
@@ -2595,17 +2913,15 @@ typedef enum {
CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
- CURLINFO_TLS_SESSION = CURLINFO_PTR + 43,
+ CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR")
+ = CURLINFO_PTR + 43,
CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
- CURLINFO_PROTOCOL = CURLINFO_LONG + 48,
+ CURLINFO_PROTOCOL CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")
+ = CURLINFO_LONG + 48,
CURLINFO_SCHEME = CURLINFO_STRING + 49,
- /* Fill in new entries below here! */
-
- /* Preferably these would be defined conditionally based on the
- sizeof curl_off_t being 64-bits */
CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,
CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,
@@ -2613,8 +2929,17 @@ typedef enum {
CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,
CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
-
- CURLINFO_LASTONE = 56
+ CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57,
+ CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,
+ CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59,
+ CURLINFO_REFERER = CURLINFO_STRING + 60,
+ CURLINFO_CAINFO = CURLINFO_STRING + 61,
+ CURLINFO_CAPATH = CURLINFO_STRING + 62,
+ CURLINFO_XFER_ID = CURLINFO_OFF_T + 63,
+ CURLINFO_CONN_ID = CURLINFO_OFF_T + 64,
+ CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65,
+ CURLINFO_USED_PROXY = CURLINFO_LONG + 66,
+ CURLINFO_LASTONE = 66
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
@@ -2633,7 +2958,7 @@ typedef enum {
CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy;
-#define CURL_GLOBAL_SSL (1<<0) /* no purpose since since 7.57.0 */
+#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1<<1)
#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0
@@ -2658,6 +2983,7 @@ typedef enum {
CURL_LOCK_DATA_SSL_SESSION,
CURL_LOCK_DATA_CONNECT,
CURL_LOCK_DATA_PSL,
+ CURL_LOCK_DATA_HSTS,
CURL_LOCK_DATA_LAST
} curl_lock_data;
@@ -2700,8 +3026,9 @@ typedef enum {
} CURLSHoption;
CURL_EXTERN CURLSH *curl_share_init(void);
-CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
-CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
+CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option,
+ ...);
+CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share);
/****************************************************************************
* Structures for querying information about the curl library at runtime.
@@ -2713,6 +3040,12 @@ typedef enum {
CURLVERSION_THIRD,
CURLVERSION_FOURTH,
CURLVERSION_FIFTH,
+ CURLVERSION_SIXTH,
+ CURLVERSION_SEVENTH,
+ CURLVERSION_EIGHTH,
+ CURLVERSION_NINTH,
+ CURLVERSION_TENTH,
+ CURLVERSION_ELEVENTH,
CURLVERSION_LAST /* never actually use this */
} CURLversion;
@@ -2721,9 +3054,9 @@ typedef enum {
meant to be a built-in version number for what kind of struct the caller
expects. If the struct ever changes, we redefine the NOW to another enum
from above. */
-#define CURLVERSION_NOW CURLVERSION_FIFTH
+#define CURLVERSION_NOW CURLVERSION_ELEVENTH
-typedef struct {
+struct curl_version_info_data {
CURLversion age; /* age of the returned struct */
const char *version; /* LIBCURL_VERSION */
unsigned int version_num; /* LIBCURL_VERSION_NUM */
@@ -2750,12 +3083,39 @@ typedef struct {
const char *libssh_version; /* human readable string */
/* These fields were added in CURLVERSION_FIFTH */
-
unsigned int brotli_ver_num; /* Numeric Brotli version
(MAJOR << 24) | (MINOR << 12) | PATCH */
const char *brotli_version; /* human readable string. */
-} curl_version_info_data;
+ /* These fields were added in CURLVERSION_SIXTH */
+ unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
+ (MAJOR << 16) | (MINOR << 8) | PATCH */
+ const char *nghttp2_version; /* human readable string. */
+ const char *quic_version; /* human readable quic (+ HTTP/3) library +
+ version or NULL */
+
+ /* These fields were added in CURLVERSION_SEVENTH */
+ const char *cainfo; /* the built-in default CURLOPT_CAINFO, might
+ be NULL */
+ const char *capath; /* the built-in default CURLOPT_CAPATH, might
+ be NULL */
+
+ /* These fields were added in CURLVERSION_EIGHTH */
+ unsigned int zstd_ver_num; /* Numeric Zstd version
+ (MAJOR << 24) | (MINOR << 12) | PATCH */
+ const char *zstd_version; /* human readable string. */
+
+ /* These fields were added in CURLVERSION_NINTH */
+ const char *hyper_version; /* human readable string. */
+
+ /* These fields were added in CURLVERSION_TENTH */
+ const char *gsasl_version; /* human readable string. */
+
+ /* These fields were added in CURLVERSION_ELEVENTH */
+ /* feature_names is terminated by an entry with a NULL feature name */
+ const char * const *feature_names;
+};
+typedef struct curl_version_info_data curl_version_info_data;
#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
#define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported
@@ -2787,6 +3147,12 @@ typedef struct {
#define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */
#define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */
#define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */
+#define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */
+#define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */
+#define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */
+#define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */
+#define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */
+#define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */
/*
* NAME curl_version_info()
@@ -2841,7 +3207,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
#ifdef __cplusplus
-}
+} /* end of extern "C" */
#endif
/* unfortunately, the easy.h and multi.h include files need options and info
@@ -2849,6 +3215,10 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#include "easy.h" /* nothing in curl is fun without the easy stuff */
#include "multi.h"
#include "urlapi.h"
+#include "options.h"
+#include "header.h"
+#include "websockets.h"
+#include "mprintf.h"
/* the typechecker doesn't work in C++ (yet) */
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
@@ -2865,6 +3235,6 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
#endif /* __STDC__ >= 1 */
-#endif /* gcc >= 4.3 && !__cplusplus */
+#endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */
-#endif /* __CURL_CURL_H */
+#endif /* CURLINC_CURL_H */
diff --git a/include/curl/curlver.h b/include/curl/curlver.h
index 0f58874..52009e5 100644
--- a/include/curl/curlver.h
+++ b/include/curl/curlver.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_CURLVER_H
-#define __CURL_CURLVER_H
+#ifndef CURLINC_CURLVER_H
+#define CURLINC_CURLVER_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,26 +20,28 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/* This header file contains nothing but libcurl version info, generated by
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
-#define LIBCURL_COPYRIGHT "1996 - 2019 Daniel Stenberg, ."
+#define LIBCURL_COPYRIGHT "Daniel Stenberg, ."
/* This is the version number of the libcurl package from which this header
file origins: */
-#define LIBCURL_VERSION "7.65.1"
+#define LIBCURL_VERSION "8.7.0-DEV"
/* The numeric version number is also available "in parts" by using these
defines: */
-#define LIBCURL_VERSION_MAJOR 7
-#define LIBCURL_VERSION_MINOR 65
-#define LIBCURL_VERSION_PATCH 1
+#define LIBCURL_VERSION_MAJOR 8
+#define LIBCURL_VERSION_MINOR 7
+#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
- parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
+ parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
always follow this syntax:
0xXXYYZZ
@@ -57,7 +59,7 @@
CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number.
*/
-#define LIBCURL_VERSION_NUM 0x074101
+#define LIBCURL_VERSION_NUM 0x080700
/*
* This is the date and time when the full source package was created. The
@@ -68,10 +70,10 @@
*
* "2007-11-23"
*/
-#define LIBCURL_TIMESTAMP "2019-06-05"
+#define LIBCURL_TIMESTAMP "[unreleased]"
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \
(LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z))
-#endif /* __CURL_CURLVER_H */
+#endif /* CURLINC_CURLVER_H */
diff --git a/include/curl/easy.h b/include/curl/easy.h
index f42a8a9..1285101 100644
--- a/include/curl/easy.h
+++ b/include/curl/easy.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_EASY_H
-#define __CURL_EASY_H
+#ifndef CURLINC_EASY_H
+#define CURLINC_EASY_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,11 +20,24 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
+/* Flag bits in the curl_blob struct: */
+#define CURL_BLOB_COPY 1 /* tell libcurl to copy the data */
+#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
+
+struct curl_blob {
+ void *data;
+ size_t len;
+ unsigned int flags; /* bit 0 is defined, the rest are reserved and should be
+ left zeroes */
+};
+
CURL_EXTERN CURL *curl_easy_init(void);
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
@@ -35,13 +48,13 @@ CURL_EXTERN void curl_easy_cleanup(CURL *curl);
*
* DESCRIPTION
*
- * Request internal information from the curl session with this function. The
- * third argument MUST be a pointer to a long, a pointer to a char * or a
- * pointer to a double (as the documentation describes elsewhere). The data
- * pointed to will be filled in accordingly and can be relied upon only if the
- * function returns CURLE_OK. This function is intended to get used *AFTER* a
- * performed transfer, all results from this function are undefined until the
- * transfer is completed.
+ * Request internal information from the curl session with this function.
+ * The third argument MUST be pointing to the specific type of the used option
+ * which is documented in each man page of the option. The data pointed to
+ * will be filled in accordingly and can be relied upon only if the function
+ * returns CURLE_OK. This function is intended to get used *AFTER* a performed
+ * transfer, all results from this function are undefined until the transfer
+ * is completed.
*/
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
@@ -106,7 +119,7 @@ CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
#ifdef __cplusplus
-}
+} /* end of extern "C" */
#endif
#endif
diff --git a/include/curl/header.h b/include/curl/header.h
new file mode 100644
index 0000000..8df11e1
--- /dev/null
+++ b/include/curl/header.h
@@ -0,0 +1,74 @@
+#ifndef CURLINC_HEADER_H
+#define CURLINC_HEADER_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 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 https://curl.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.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct curl_header {
+ char *name; /* this might not use the same case */
+ char *value;
+ size_t amount; /* number of headers using this name */
+ size_t index; /* ... of this instance, 0 or higher */
+ unsigned int origin; /* see bits below */
+ void *anchor; /* handle privately used by libcurl */
+};
+
+/* 'origin' bits */
+#define CURLH_HEADER (1<<0) /* plain server header */
+#define CURLH_TRAILER (1<<1) /* trailers */
+#define CURLH_CONNECT (1<<2) /* CONNECT headers */
+#define CURLH_1XX (1<<3) /* 1xx headers */
+#define CURLH_PSEUDO (1<<4) /* pseudo headers */
+
+typedef enum {
+ CURLHE_OK,
+ CURLHE_BADINDEX, /* header exists but not with this index */
+ CURLHE_MISSING, /* no such header exists */
+ CURLHE_NOHEADERS, /* no headers at all exist (yet) */
+ CURLHE_NOREQUEST, /* no request with this number was used */
+ CURLHE_OUT_OF_MEMORY, /* out of memory while processing */
+ CURLHE_BAD_ARGUMENT, /* a function argument was not okay */
+ CURLHE_NOT_BUILT_IN /* if API was disabled in the build */
+} CURLHcode;
+
+CURL_EXTERN CURLHcode curl_easy_header(CURL *easy,
+ const char *name,
+ size_t index,
+ unsigned int origin,
+ int request,
+ struct curl_header **hout);
+
+CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
+ unsigned int origin,
+ int request,
+ struct curl_header *prev);
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
+#endif /* CURLINC_HEADER_H */
diff --git a/include/curl/mprintf.h b/include/curl/mprintf.h
index e20f546..4f70454 100644
--- a/include/curl/mprintf.h
+++ b/include/curl/mprintf.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_MPRINTF_H
-#define __CURL_MPRINTF_H
+#ifndef CURLINC_MPRINTF_H
+#define CURLINC_MPRINTF_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include
@@ -30,21 +32,47 @@
extern "C" {
#endif
-CURL_EXTERN int curl_mprintf(const char *format, ...);
-CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
-CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
+#if (defined(__GNUC__) || defined(__clang__)) && \
+ defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
+ !defined(CURL_NO_FMT_CHECKS)
+#if defined(__MINGW32__) && !defined(__clang__)
+#define CURL_TEMP_PRINTF(fmt, arg) \
+ __attribute__((format(gnu_printf, fmt, arg)))
+#else
+#define CURL_TEMP_PRINTF(fmt, arg) \
+ __attribute__((format(printf, fmt, arg)))
+#endif
+#else
+#define CURL_TEMP_PRINTF(fmt, arg)
+#endif
+
+CURL_EXTERN int curl_mprintf(const char *format, ...)
+ CURL_TEMP_PRINTF(1, 2);
+CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...)
+ CURL_TEMP_PRINTF(2, 3);
+CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...)
+ CURL_TEMP_PRINTF(2, 3);
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
- const char *format, ...);
-CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
-CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
-CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
+ const char *format, ...)
+ CURL_TEMP_PRINTF(3, 4);
+CURL_EXTERN int curl_mvprintf(const char *format, va_list args)
+ CURL_TEMP_PRINTF(1, 0);
+CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args)
+ CURL_TEMP_PRINTF(2, 0);
+CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args)
+ CURL_TEMP_PRINTF(2, 0);
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
- const char *format, va_list args);
-CURL_EXTERN char *curl_maprintf(const char *format, ...);
-CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
+ const char *format, va_list args)
+ CURL_TEMP_PRINTF(3, 0);
+CURL_EXTERN char *curl_maprintf(const char *format, ...)
+ CURL_TEMP_PRINTF(1, 2);
+CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args)
+ CURL_TEMP_PRINTF(1, 0);
+
+#undef CURL_TEMP_PRINTF
#ifdef __cplusplus
-}
+} /* end of extern "C" */
#endif
-#endif /* __CURL_MPRINTF_H */
+#endif /* CURLINC_MPRINTF_H */
diff --git a/include/curl/multi.h b/include/curl/multi.h
index b19dbaf..e79b48f 100644
--- a/include/curl/multi.h
+++ b/include/curl/multi.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_MULTI_H
-#define __CURL_MULTI_H
+#ifndef CURLINC_MULTI_H
+#define CURLINC_MULTI_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/*
This is an "external" header file. Don't give away any internals here!
@@ -72,6 +74,10 @@ typedef enum {
attempted to get added - again */
CURLM_RECURSIVE_API_CALL, /* an api function was called from inside a
callback */
+ CURLM_WAKEUP_FAILURE, /* wakeup is unavailable or failed */
+ CURLM_BAD_FUNCTION_ARGUMENT, /* function called with a bad parameter */
+ CURLM_ABORTED_BY_CALLBACK,
+ CURLM_UNRECOVERABLE_POLL,
CURLM_LAST
} CURLMcode;
@@ -112,13 +118,13 @@ typedef struct CURLMsg CURLMsg;
struct curl_waitfd {
curl_socket_t fd;
short events;
- short revents; /* not supported yet */
+ short revents;
};
/*
* Name: curl_multi_init()
*
- * Desc: inititalize multi-style curl usage
+ * Desc: initialize multi-style curl usage
*
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
*/
@@ -173,6 +179,29 @@ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
int timeout_ms,
int *ret);
+/*
+ * Name: curl_multi_poll()
+ *
+ * Desc: Poll on all fds within a CURLM set as well as any
+ * additional fds passed to the function.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
+CURL_EXTERN CURLMcode curl_multi_poll(CURLM *multi_handle,
+ struct curl_waitfd extra_fds[],
+ unsigned int extra_nfds,
+ int timeout_ms,
+ int *ret);
+
+/*
+ * Name: curl_multi_wakeup()
+ *
+ * Desc: wakes up a sleeping curl_multi_poll call.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
+CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
+
/*
* Name: curl_multi_perform()
*
@@ -242,7 +271,7 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
* value into the equivalent human readable error string. This is
* useful for printing meaningful error messages.
*
- * Returns: A pointer to a zero-terminated error message.
+ * Returns: A pointer to a null-terminated error message.
*/
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
@@ -289,16 +318,16 @@ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
void *userp); /* private callback
pointer */
-CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
- int *running_handles);
+CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
+curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
curl_socket_t s,
int ev_bitmask,
int *running_handles);
-CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
- int *running_handles);
+CURL_EXTERN CURLMcode CURL_DEPRECATED(7.19.5, "Use curl_multi_socket_action()")
+curl_multi_socket_all(CURLM *multi_handle, int *running_handles);
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
@@ -319,68 +348,56 @@ CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
long *milliseconds);
-#undef CINIT /* re-using the same name as in curl.h */
-
-#ifdef CURL_ISOCPP
-#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG CURLOPTTYPE_LONG
-#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
-#endif
-
typedef enum {
/* This is the socket callback function pointer */
- CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
+ CURLOPT(CURLMOPT_SOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 1),
/* This is the argument passed to the socket callback */
- CINIT(SOCKETDATA, OBJECTPOINT, 2),
+ CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2),
/* set to 1 to enable pipelining for this multi handle */
- CINIT(PIPELINING, LONG, 3),
+ CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3),
/* This is the timer callback function pointer */
- CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
+ CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4),
/* This is the argument passed to the timer callback */
- CINIT(TIMERDATA, OBJECTPOINT, 5),
+ CURLOPT(CURLMOPT_TIMERDATA, CURLOPTTYPE_OBJECTPOINT, 5),
/* maximum number of entries in the connection cache */
- CINIT(MAXCONNECTS, LONG, 6),
+ CURLOPT(CURLMOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 6),
/* maximum number of (pipelining) connections to one host */
- CINIT(MAX_HOST_CONNECTIONS, LONG, 7),
+ CURLOPT(CURLMOPT_MAX_HOST_CONNECTIONS, CURLOPTTYPE_LONG, 7),
/* maximum number of requests in a pipeline */
- CINIT(MAX_PIPELINE_LENGTH, LONG, 8),
+ CURLOPT(CURLMOPT_MAX_PIPELINE_LENGTH, CURLOPTTYPE_LONG, 8),
/* a connection with a content-length longer than this
will not be considered for pipelining */
- CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),
+ CURLOPT(CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 9),
/* a connection with a chunk length longer than this
will not be considered for pipelining */
- CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),
+ CURLOPT(CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLOPTTYPE_OFF_T, 10),
- /* a list of site names(+port) that are blacklisted from
- pipelining */
- CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),
+ /* a list of site names(+port) that are blocked from pipelining */
+ CURLOPT(CURLMOPT_PIPELINING_SITE_BL, CURLOPTTYPE_OBJECTPOINT, 11),
- /* a list of server types that are blacklisted from
- pipelining */
- CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),
+ /* a list of server types that are blocked from pipelining */
+ CURLOPT(CURLMOPT_PIPELINING_SERVER_BL, CURLOPTTYPE_OBJECTPOINT, 12),
/* maximum number of open connections in total */
- CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),
+ CURLOPT(CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPTTYPE_LONG, 13),
/* This is the server push callback function pointer */
- CINIT(PUSHFUNCTION, FUNCTIONPOINT, 14),
+ CURLOPT(CURLMOPT_PUSHFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 14),
/* This is the argument passed to the server push callback */
- CINIT(PUSHDATA, OBJECTPOINT, 15),
+ CURLOPT(CURLMOPT_PUSHDATA, CURLOPTTYPE_OBJECTPOINT, 15),
+
+ /* maximum number of concurrent streams to support on a connection */
+ CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16),
CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
@@ -409,17 +426,30 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
curl_socket_t sockfd, void *sockp);
+/*
+ * Name: curl_multi_get_handles()
+ *
+ * Desc: Returns an allocated array holding all handles currently added to
+ * the multi handle. Marks the final entry with a NULL pointer. If
+ * there is no easy handle added to the multi handle, this function
+ * returns an array with the first entry as a NULL pointer.
+ *
+ * Returns: NULL on failure, otherwise a CURL **array pointer
+ */
+CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle);
/*
* Name: curl_push_callback
*
* Desc: This callback gets called when a new stream is being pushed by the
- * server. It approves or denies the new stream.
+ * server. It approves or denies the new stream. It can also decide
+ * to completely fail the connection.
*
- * Returns: CURL_PUSH_OK or CURL_PUSH_DENY.
+ * Returns: CURL_PUSH_OK, CURL_PUSH_DENY or CURL_PUSH_ERROROUT
*/
-#define CURL_PUSH_OK 0
-#define CURL_PUSH_DENY 1
+#define CURL_PUSH_OK 0
+#define CURL_PUSH_DENY 1
+#define CURL_PUSH_ERROROUT 2 /* added in 7.72.0 */
struct curl_pushheaders; /* forward declaration only */
diff --git a/include/curl/options.h b/include/curl/options.h
new file mode 100644
index 0000000..1ed76a9
--- /dev/null
+++ b/include/curl/options.h
@@ -0,0 +1,70 @@
+#ifndef CURLINC_OPTIONS_H
+#define CURLINC_OPTIONS_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 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 https://curl.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.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ CURLOT_LONG, /* long (a range of values) */
+ CURLOT_VALUES, /* (a defined set or bitmask) */
+ CURLOT_OFF_T, /* curl_off_t (a range of values) */
+ CURLOT_OBJECT, /* pointer (void *) */
+ CURLOT_STRING, /* (char * to null-terminated buffer) */
+ CURLOT_SLIST, /* (struct curl_slist *) */
+ CURLOT_CBPTR, /* (void * passed as-is to a callback) */
+ CURLOT_BLOB, /* blob (struct curl_blob *) */
+ CURLOT_FUNCTION /* function pointer */
+} curl_easytype;
+
+/* Flag bits */
+
+/* "alias" means it is provided for old programs to remain functional,
+ we prefer another name */
+#define CURLOT_FLAG_ALIAS (1<<0)
+
+/* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
+ to use for curl_easy_setopt() for the given id */
+struct curl_easyoption {
+ const char *name;
+ CURLoption id;
+ curl_easytype type;
+ unsigned int flags;
+};
+
+CURL_EXTERN const struct curl_easyoption *
+curl_easy_option_by_name(const char *name);
+
+CURL_EXTERN const struct curl_easyoption *
+curl_easy_option_by_id(CURLoption id);
+
+CURL_EXTERN const struct curl_easyoption *
+curl_easy_option_next(const struct curl_easyoption *prev);
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+#endif /* CURLINC_OPTIONS_H */
diff --git a/include/curl/stdcheaders.h b/include/curl/stdcheaders.h
index 027b6f4..7451aa3 100644
--- a/include/curl/stdcheaders.h
+++ b/include/curl/stdcheaders.h
@@ -1,5 +1,5 @@
-#ifndef __STDC_HEADERS_H
-#define __STDC_HEADERS_H
+#ifndef CURLINC_STDCHEADERS_H
+#define CURLINC_STDCHEADERS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include
@@ -30,4 +32,4 @@ size_t fwrite(const void *, size_t, size_t, FILE *);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
-#endif /* __STDC_HEADERS_H */
+#endif /* CURLINC_STDCHEADERS_H */
diff --git a/include/curl/system.h b/include/curl/system.h
index 1e555ec..81a1b81 100644
--- a/include/curl/system.h
+++ b/include/curl/system.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_SYSTEM_H
-#define __CURL_SYSTEM_H
+#ifndef CURLINC_SYSTEM_H
+#define CURLINC_SYSTEM_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/*
@@ -98,22 +100,6 @@
# define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_TYPEOF_CURL_SOCKLEN_T int
-#elif defined(__WATCOMC__)
-# if defined(__386__)
-# define CURL_TYPEOF_CURL_OFF_T __int64
-# define CURL_FORMAT_CURL_OFF_T "I64d"
-# define CURL_FORMAT_CURL_OFF_TU "I64u"
-# define CURL_SUFFIX_CURL_OFF_T i64
-# define CURL_SUFFIX_CURL_OFF_TU ui64
-# else
-# define CURL_TYPEOF_CURL_OFF_T long
-# define CURL_FORMAT_CURL_OFF_T "ld"
-# define CURL_FORMAT_CURL_OFF_TU "lu"
-# define CURL_SUFFIX_CURL_OFF_T L
-# define CURL_SUFFIX_CURL_OFF_TU UL
-# endif
-# define CURL_TYPEOF_CURL_SOCKLEN_T int
-
#elif defined(__POCC__)
# if (__POCC__ < 280)
# define CURL_TYPEOF_CURL_OFF_T long
@@ -137,43 +123,51 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__LCC__)
-# define CURL_TYPEOF_CURL_OFF_T long
-# define CURL_FORMAT_CURL_OFF_T "ld"
-# define CURL_FORMAT_CURL_OFF_TU "lu"
-# define CURL_SUFFIX_CURL_OFF_T L
-# define CURL_SUFFIX_CURL_OFF_TU UL
-# define CURL_TYPEOF_CURL_SOCKLEN_T int
+# if defined(__MCST__) /* MCST eLbrus Compiler Collection */
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_PULL_SYS_TYPES_H 1
+# define CURL_PULL_SYS_SOCKET_H 1
+# else /* Local (or Little) C Compiler */
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# define CURL_TYPEOF_CURL_SOCKLEN_T int
+# endif
-#elif defined(__SYMBIAN32__)
-# if defined(__EABI__) /* Treat all ARM compilers equally */
+#elif defined(macintosh)
+# include
+# if TYPE_LONGLONG
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
-# elif defined(__CW32__)
-# pragma longlong on
-# define CURL_TYPEOF_CURL_OFF_T long long
-# define CURL_FORMAT_CURL_OFF_T "lld"
-# define CURL_FORMAT_CURL_OFF_TU "llu"
-# define CURL_SUFFIX_CURL_OFF_T LL
-# define CURL_SUFFIX_CURL_OFF_TU ULL
-# elif defined(__VC32__)
-# define CURL_TYPEOF_CURL_OFF_T __int64
-# define CURL_FORMAT_CURL_OFF_T "lld"
-# define CURL_FORMAT_CURL_OFF_TU "llu"
-# define CURL_SUFFIX_CURL_OFF_T LL
-# define CURL_SUFFIX_CURL_OFF_TU ULL
+# else
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
-#elif defined(__MWERKS__)
+#elif defined(__TANDEM)
+# if ! defined(__LP64)
+ /* Required for 32-bit NonStop builds only. */
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_TYPEOF_CURL_SOCKLEN_T int
+# endif
#elif defined(_WIN32_WCE)
# define CURL_TYPEOF_CURL_OFF_T __int64
@@ -184,14 +178,14 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__MINGW32__)
+# include
# define CURL_TYPEOF_CURL_OFF_T long long
-# define CURL_FORMAT_CURL_OFF_T "I64d"
-# define CURL_FORMAT_CURL_OFF_TU "I64u"
+# define CURL_FORMAT_CURL_OFF_T PRId64
+# define CURL_FORMAT_CURL_OFF_TU PRIu64
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
-# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_TYPEOF_CURL_SOCKLEN_T int
# define CURL_PULL_SYS_TYPES_H 1
-# define CURL_PULL_WS2TCPIP_H 1
#elif defined(__VMS)
# if defined(__VAX)
@@ -210,45 +204,38 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
#elif defined(__OS400__)
-# if defined(__ILEC400__)
+# define CURL_TYPEOF_CURL_OFF_T long long
+# define CURL_FORMAT_CURL_OFF_T "lld"
+# define CURL_FORMAT_CURL_OFF_TU "llu"
+# define CURL_SUFFIX_CURL_OFF_T LL
+# define CURL_SUFFIX_CURL_OFF_TU ULL
+# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_PULL_SYS_TYPES_H 1
+# define CURL_PULL_SYS_SOCKET_H 1
+
+#elif defined(__MVS__)
+# if defined(_LONG_LONG)
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
-# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
-# define CURL_PULL_SYS_TYPES_H 1
-# define CURL_PULL_SYS_SOCKET_H 1
-# endif
-
-#elif defined(__MVS__)
-# if defined(__IBMC__) || defined(__IBMCPP__)
-# if defined(_ILP32)
-# elif defined(_LP64)
-# endif
-# if defined(_LONG_LONG)
-# define CURL_TYPEOF_CURL_OFF_T long long
-# define CURL_FORMAT_CURL_OFF_T "lld"
-# define CURL_FORMAT_CURL_OFF_TU "llu"
-# define CURL_SUFFIX_CURL_OFF_T LL
-# define CURL_SUFFIX_CURL_OFF_TU ULL
-# elif defined(_LP64)
-# define CURL_TYPEOF_CURL_OFF_T long
-# define CURL_FORMAT_CURL_OFF_T "ld"
-# define CURL_FORMAT_CURL_OFF_TU "lu"
-# define CURL_SUFFIX_CURL_OFF_T L
-# define CURL_SUFFIX_CURL_OFF_TU UL
-# else
-# define CURL_TYPEOF_CURL_OFF_T long
-# define CURL_FORMAT_CURL_OFF_T "ld"
-# define CURL_FORMAT_CURL_OFF_TU "lu"
-# define CURL_SUFFIX_CURL_OFF_T L
-# define CURL_SUFFIX_CURL_OFF_TU UL
-# endif
-# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
-# define CURL_PULL_SYS_TYPES_H 1
-# define CURL_PULL_SYS_SOCKET_H 1
+# elif defined(_LP64)
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# else
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
# endif
+# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_PULL_SYS_TYPES_H 1
+# define CURL_PULL_SYS_SOCKET_H 1
#elif defined(__370__)
# if defined(__IBMC__) || defined(__IBMCPP__)
@@ -288,7 +275,6 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__TINYC__) /* also known as tcc */
-
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -338,12 +324,37 @@
# define CURL_PULL_SYS_TYPES_H 1
# define CURL_PULL_SYS_SOCKET_H 1
+#elif defined(__hpux) /* HP aCC compiler */
+# if !defined(_LP64)
+# define CURL_TYPEOF_CURL_OFF_T long long
+# define CURL_FORMAT_CURL_OFF_T "lld"
+# define CURL_FORMAT_CURL_OFF_TU "llu"
+# define CURL_SUFFIX_CURL_OFF_T LL
+# define CURL_SUFFIX_CURL_OFF_TU ULL
+# else
+# define CURL_TYPEOF_CURL_OFF_T long
+# define CURL_FORMAT_CURL_OFF_T "ld"
+# define CURL_FORMAT_CURL_OFF_TU "lu"
+# define CURL_SUFFIX_CURL_OFF_T L
+# define CURL_SUFFIX_CURL_OFF_TU UL
+# endif
+# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
+# define CURL_PULL_SYS_TYPES_H 1
+# define CURL_PULL_SYS_SOCKET_H 1
+
/* ===================================== */
/* KEEP MSVC THE PENULTIMATE ENTRY */
/* ===================================== */
#elif defined(_MSC_VER)
-# if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
+# if (_MSC_VER >= 1800)
+# include
+# define CURL_TYPEOF_CURL_OFF_T __int64
+# define CURL_FORMAT_CURL_OFF_T PRId64
+# define CURL_FORMAT_CURL_OFF_TU PRIu64
+# define CURL_SUFFIX_CURL_OFF_T i64
+# define CURL_SUFFIX_CURL_OFF_TU ui64
+# elif (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
# define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u"
@@ -377,6 +388,7 @@
# define CURL_SUFFIX_CURL_OFF_TU ULL
# elif defined(__LP64__) || \
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
+ defined(__e2k__) || \
(defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
(defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
# define CURL_TYPEOF_CURL_OFF_T long
@@ -404,15 +416,6 @@
#define CURL_PULL_SYS_POLL_H
#endif
-
-/* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */
-/* ws2tcpip.h is required here to properly make type definitions below. */
-#ifdef CURL_PULL_WS2TCPIP_H
-# include
-# include
-# include
-#endif
-
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
/* sys/types.h is required here to properly make type definitions below. */
#ifdef CURL_PULL_SYS_TYPES_H
@@ -473,21 +476,21 @@
*/
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
-# define __CURL_OFF_T_C_HLPR2(x) x
-# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
-# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
- __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
-# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
- __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
+# define CURLINC_OFF_T_C_HLPR2(x) x
+# define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x)
+# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
+ CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
+# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
+ CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
#else
# ifdef CURL_ISOCPP
-# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
+# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
# else
-# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
+# define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
# endif
-# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
-# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
-# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
+# define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix)
+# define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
+# define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
#endif
-#endif /* __CURL_SYSTEM_H */
+#endif /* CURLINC_SYSTEM_H */
diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h
index 2d1de4d..b880f3d 100644
--- a/include/curl/typecheck-gcc.h
+++ b/include/curl/typecheck-gcc.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_TYPECHECK_GCC_H
-#define __CURL_TYPECHECK_GCC_H
+#ifndef CURLINC_TYPECHECK_GCC_H
+#define CURLINC_TYPECHECK_GCC_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,15 +20,17 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
/* wraps curl_easy_setopt() with typechecking */
/* To add a new kind of warning, add an
- * if(_curl_is_sometype_option(_curl_opt))
- * if(!_curl_is_sometype(value))
+ * if(curlcheck_sometype_option(_curl_opt))
+ * if(!curlcheck_sometype(value))
* _curl_easy_setopt_err_sometype();
- * block and define _curl_is_sometype_option, _curl_is_sometype and
+ * block and define curlcheck_sometype_option, curlcheck_sometype and
* _curl_easy_setopt_err_sometype below
*
* NOTE: We use two nested 'if' statements here instead of the && operator, in
@@ -38,112 +40,116 @@
* To add an option that uses the same type as an existing option, you'll just
* need to extend the appropriate _curl_*_option macro
*/
-#define curl_easy_setopt(handle, option, value) \
-__extension__ ({ \
- __typeof__(option) _curl_opt = option; \
- if(__builtin_constant_p(_curl_opt)) { \
- if(_curl_is_long_option(_curl_opt)) \
- if(!_curl_is_long(value)) \
- _curl_easy_setopt_err_long(); \
- if(_curl_is_off_t_option(_curl_opt)) \
- if(!_curl_is_off_t(value)) \
- _curl_easy_setopt_err_curl_off_t(); \
- if(_curl_is_string_option(_curl_opt)) \
- if(!_curl_is_string(value)) \
- _curl_easy_setopt_err_string(); \
- if(_curl_is_write_cb_option(_curl_opt)) \
- if(!_curl_is_write_cb(value)) \
- _curl_easy_setopt_err_write_callback(); \
- if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
- if(!_curl_is_resolver_start_callback(value)) \
- _curl_easy_setopt_err_resolver_start_callback(); \
- if((_curl_opt) == CURLOPT_READFUNCTION) \
- if(!_curl_is_read_cb(value)) \
- _curl_easy_setopt_err_read_cb(); \
- if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
- if(!_curl_is_ioctl_cb(value)) \
- _curl_easy_setopt_err_ioctl_cb(); \
- if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
- if(!_curl_is_sockopt_cb(value)) \
- _curl_easy_setopt_err_sockopt_cb(); \
- if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
- if(!_curl_is_opensocket_cb(value)) \
- _curl_easy_setopt_err_opensocket_cb(); \
- if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
- if(!_curl_is_progress_cb(value)) \
- _curl_easy_setopt_err_progress_cb(); \
- if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
- if(!_curl_is_debug_cb(value)) \
- _curl_easy_setopt_err_debug_cb(); \
- if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
- if(!_curl_is_ssl_ctx_cb(value)) \
- _curl_easy_setopt_err_ssl_ctx_cb(); \
- if(_curl_is_conv_cb_option(_curl_opt)) \
- if(!_curl_is_conv_cb(value)) \
- _curl_easy_setopt_err_conv_cb(); \
- if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
- if(!_curl_is_seek_cb(value)) \
- _curl_easy_setopt_err_seek_cb(); \
- if(_curl_is_cb_data_option(_curl_opt)) \
- if(!_curl_is_cb_data(value)) \
- _curl_easy_setopt_err_cb_data(); \
- if((_curl_opt) == CURLOPT_ERRORBUFFER) \
- if(!_curl_is_error_buffer(value)) \
- _curl_easy_setopt_err_error_buffer(); \
- if((_curl_opt) == CURLOPT_STDERR) \
- if(!_curl_is_FILE(value)) \
- _curl_easy_setopt_err_FILE(); \
- if(_curl_is_postfields_option(_curl_opt)) \
- if(!_curl_is_postfields(value)) \
- _curl_easy_setopt_err_postfields(); \
- if((_curl_opt) == CURLOPT_HTTPPOST) \
- if(!_curl_is_arr((value), struct curl_httppost)) \
- _curl_easy_setopt_err_curl_httpost(); \
- if((_curl_opt) == CURLOPT_MIMEPOST) \
- if(!_curl_is_ptr((value), curl_mime)) \
- _curl_easy_setopt_err_curl_mimepost(); \
- if(_curl_is_slist_option(_curl_opt)) \
- if(!_curl_is_arr((value), struct curl_slist)) \
- _curl_easy_setopt_err_curl_slist(); \
- if((_curl_opt) == CURLOPT_SHARE) \
- if(!_curl_is_ptr((value), CURLSH)) \
- _curl_easy_setopt_err_CURLSH(); \
- } \
- curl_easy_setopt(handle, _curl_opt, value); \
-})
+#define curl_easy_setopt(handle, option, value) \
+ __extension__({ \
+ CURLoption _curl_opt = (option); \
+ if(__builtin_constant_p(_curl_opt)) { \
+ CURL_IGNORE_DEPRECATION( \
+ if(curlcheck_long_option(_curl_opt)) \
+ if(!curlcheck_long(value)) \
+ _curl_easy_setopt_err_long(); \
+ if(curlcheck_off_t_option(_curl_opt)) \
+ if(!curlcheck_off_t(value)) \
+ _curl_easy_setopt_err_curl_off_t(); \
+ if(curlcheck_string_option(_curl_opt)) \
+ if(!curlcheck_string(value)) \
+ _curl_easy_setopt_err_string(); \
+ if(curlcheck_write_cb_option(_curl_opt)) \
+ if(!curlcheck_write_cb(value)) \
+ _curl_easy_setopt_err_write_callback(); \
+ if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
+ if(!curlcheck_resolver_start_callback(value)) \
+ _curl_easy_setopt_err_resolver_start_callback(); \
+ if((_curl_opt) == CURLOPT_READFUNCTION) \
+ if(!curlcheck_read_cb(value)) \
+ _curl_easy_setopt_err_read_cb(); \
+ if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
+ if(!curlcheck_ioctl_cb(value)) \
+ _curl_easy_setopt_err_ioctl_cb(); \
+ if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
+ if(!curlcheck_sockopt_cb(value)) \
+ _curl_easy_setopt_err_sockopt_cb(); \
+ if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
+ if(!curlcheck_opensocket_cb(value)) \
+ _curl_easy_setopt_err_opensocket_cb(); \
+ if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
+ if(!curlcheck_progress_cb(value)) \
+ _curl_easy_setopt_err_progress_cb(); \
+ if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
+ if(!curlcheck_debug_cb(value)) \
+ _curl_easy_setopt_err_debug_cb(); \
+ if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
+ if(!curlcheck_ssl_ctx_cb(value)) \
+ _curl_easy_setopt_err_ssl_ctx_cb(); \
+ if(curlcheck_conv_cb_option(_curl_opt)) \
+ if(!curlcheck_conv_cb(value)) \
+ _curl_easy_setopt_err_conv_cb(); \
+ if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
+ if(!curlcheck_seek_cb(value)) \
+ _curl_easy_setopt_err_seek_cb(); \
+ if(curlcheck_cb_data_option(_curl_opt)) \
+ if(!curlcheck_cb_data(value)) \
+ _curl_easy_setopt_err_cb_data(); \
+ if((_curl_opt) == CURLOPT_ERRORBUFFER) \
+ if(!curlcheck_error_buffer(value)) \
+ _curl_easy_setopt_err_error_buffer(); \
+ if((_curl_opt) == CURLOPT_STDERR) \
+ if(!curlcheck_FILE(value)) \
+ _curl_easy_setopt_err_FILE(); \
+ if(curlcheck_postfields_option(_curl_opt)) \
+ if(!curlcheck_postfields(value)) \
+ _curl_easy_setopt_err_postfields(); \
+ if((_curl_opt) == CURLOPT_HTTPPOST) \
+ if(!curlcheck_arr((value), struct curl_httppost)) \
+ _curl_easy_setopt_err_curl_httpost(); \
+ if((_curl_opt) == CURLOPT_MIMEPOST) \
+ if(!curlcheck_ptr((value), curl_mime)) \
+ _curl_easy_setopt_err_curl_mimepost(); \
+ if(curlcheck_slist_option(_curl_opt)) \
+ if(!curlcheck_arr((value), struct curl_slist)) \
+ _curl_easy_setopt_err_curl_slist(); \
+ if((_curl_opt) == CURLOPT_SHARE) \
+ if(!curlcheck_ptr((value), CURLSH)) \
+ _curl_easy_setopt_err_CURLSH(); \
+ ) \
+ } \
+ curl_easy_setopt(handle, _curl_opt, value); \
+ })
/* wraps curl_easy_getinfo() with typechecking */
-#define curl_easy_getinfo(handle, info, arg) \
-__extension__ ({ \
- __typeof__(info) _curl_info = info; \
- if(__builtin_constant_p(_curl_info)) { \
- if(_curl_is_string_info(_curl_info)) \
- if(!_curl_is_arr((arg), char *)) \
- _curl_easy_getinfo_err_string(); \
- if(_curl_is_long_info(_curl_info)) \
- if(!_curl_is_arr((arg), long)) \
- _curl_easy_getinfo_err_long(); \
- if(_curl_is_double_info(_curl_info)) \
- if(!_curl_is_arr((arg), double)) \
- _curl_easy_getinfo_err_double(); \
- if(_curl_is_slist_info(_curl_info)) \
- if(!_curl_is_arr((arg), struct curl_slist *)) \
- _curl_easy_getinfo_err_curl_slist(); \
- if(_curl_is_tlssessioninfo_info(_curl_info)) \
- if(!_curl_is_arr((arg), struct curl_tlssessioninfo *)) \
- _curl_easy_getinfo_err_curl_tlssesssioninfo(); \
- if(_curl_is_certinfo_info(_curl_info)) \
- if(!_curl_is_arr((arg), struct curl_certinfo *)) \
- _curl_easy_getinfo_err_curl_certinfo(); \
- if(_curl_is_socket_info(_curl_info)) \
- if(!_curl_is_arr((arg), curl_socket_t)) \
- _curl_easy_getinfo_err_curl_socket(); \
- if(_curl_is_off_t_info(_curl_info)) \
- if(!_curl_is_arr((arg), curl_off_t)) \
- _curl_easy_getinfo_err_curl_off_t(); \
- } \
- curl_easy_getinfo(handle, _curl_info, arg); \
-})
+#define curl_easy_getinfo(handle, info, arg) \
+ __extension__({ \
+ CURLINFO _curl_info = (info); \
+ if(__builtin_constant_p(_curl_info)) { \
+ CURL_IGNORE_DEPRECATION( \
+ if(curlcheck_string_info(_curl_info)) \
+ if(!curlcheck_arr((arg), char *)) \
+ _curl_easy_getinfo_err_string(); \
+ if(curlcheck_long_info(_curl_info)) \
+ if(!curlcheck_arr((arg), long)) \
+ _curl_easy_getinfo_err_long(); \
+ if(curlcheck_double_info(_curl_info)) \
+ if(!curlcheck_arr((arg), double)) \
+ _curl_easy_getinfo_err_double(); \
+ if(curlcheck_slist_info(_curl_info)) \
+ if(!curlcheck_arr((arg), struct curl_slist *)) \
+ _curl_easy_getinfo_err_curl_slist(); \
+ if(curlcheck_tlssessioninfo_info(_curl_info)) \
+ if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
+ _curl_easy_getinfo_err_curl_tlssesssioninfo(); \
+ if(curlcheck_certinfo_info(_curl_info)) \
+ if(!curlcheck_arr((arg), struct curl_certinfo *)) \
+ _curl_easy_getinfo_err_curl_certinfo(); \
+ if(curlcheck_socket_info(_curl_info)) \
+ if(!curlcheck_arr((arg), curl_socket_t)) \
+ _curl_easy_getinfo_err_curl_socket(); \
+ if(curlcheck_off_t_info(_curl_info)) \
+ if(!curlcheck_arr((arg), curl_off_t)) \
+ _curl_easy_getinfo_err_curl_off_t(); \
+ ) \
+ } \
+ curl_easy_getinfo(handle, _curl_info, arg); \
+ })
/*
* For now, just make sure that the functions are called with three arguments
@@ -156,83 +162,83 @@ __extension__ ({ \
* functions */
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
-#define _CURL_WARNING(id, message) \
- static void __attribute__((__warning__(message))) \
- __attribute__((__unused__)) __attribute__((__noinline__)) \
+#define CURLWARNING(id, message) \
+ static void __attribute__((__warning__(message))) \
+ __attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
-_CURL_WARNING(_curl_easy_setopt_err_long,
+CURLWARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
+CURLWARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_string,
+CURLWARNING(_curl_easy_setopt_err_string,
"curl_easy_setopt expects a "
"string ('char *' or char[]) argument for this option"
)
-_CURL_WARNING(_curl_easy_setopt_err_write_callback,
+CURLWARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_resolver_start_callback,
+CURLWARNING(_curl_easy_setopt_err_resolver_start_callback,
"curl_easy_setopt expects a "
"curl_resolver_start_callback argument for this option"
)
-_CURL_WARNING(_curl_easy_setopt_err_read_cb,
+CURLWARNING(_curl_easy_setopt_err_read_cb,
"curl_easy_setopt expects a curl_read_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
+CURLWARNING(_curl_easy_setopt_err_ioctl_cb,
"curl_easy_setopt expects a curl_ioctl_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
+CURLWARNING(_curl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
+CURLWARNING(_curl_easy_setopt_err_opensocket_cb,
"curl_easy_setopt expects a "
"curl_opensocket_callback argument for this option"
)
-_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
+CURLWARNING(_curl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
+CURLWARNING(_curl_easy_setopt_err_debug_cb,
"curl_easy_setopt expects a curl_debug_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
+CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb,
"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
+CURLWARNING(_curl_easy_setopt_err_conv_cb,
"curl_easy_setopt expects a curl_conv_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
+CURLWARNING(_curl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_cb_data,
+CURLWARNING(_curl_easy_setopt_err_cb_data,
"curl_easy_setopt expects a "
"private data pointer as argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
+CURLWARNING(_curl_easy_setopt_err_error_buffer,
"curl_easy_setopt expects a "
"char buffer of CURL_ERROR_SIZE as argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_FILE,
+CURLWARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a 'FILE *' argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_postfields,
+CURLWARNING(_curl_easy_setopt_err_postfields,
"curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
+CURLWARNING(_curl_easy_setopt_err_curl_httpost,
"curl_easy_setopt expects a 'struct curl_httppost *' "
"argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_mimepost,
+CURLWARNING(_curl_easy_setopt_err_curl_mimepost,
"curl_easy_setopt expects a 'curl_mime *' "
"argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
+CURLWARNING(_curl_easy_setopt_err_curl_slist,
"curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
+CURLWARNING(_curl_easy_setopt_err_CURLSH,
"curl_easy_setopt expects a CURLSH* argument for this option")
-_CURL_WARNING(_curl_easy_getinfo_err_string,
+CURLWARNING(_curl_easy_getinfo_err_string,
"curl_easy_getinfo expects a pointer to 'char *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_long,
+CURLWARNING(_curl_easy_getinfo_err_long,
"curl_easy_getinfo expects a pointer to long for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_double,
+CURLWARNING(_curl_easy_getinfo_err_double,
"curl_easy_getinfo expects a pointer to double for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
+CURLWARNING(_curl_easy_getinfo_err_curl_slist,
"curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
+CURLWARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_tlssessioninfo *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_certinfo,
+CURLWARNING(_curl_easy_getinfo_err_curl_certinfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_certinfo *' for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_socket,
+CURLWARNING(_curl_easy_getinfo_err_curl_socket,
"curl_easy_getinfo expects a pointer to curl_socket_t for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
+CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
"curl_easy_getinfo expects a pointer to curl_off_t for this info")
/* groups of curl_easy_setops options that take the same type of argument */
@@ -244,14 +250,14 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
*/
/* evaluates to true if option takes a long argument */
-#define _curl_is_long_option(option) \
+#define curlcheck_long_option(option) \
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
-#define _curl_is_off_t_option(option) \
- ((option) > CURLOPTTYPE_OFF_T)
+#define curlcheck_off_t_option(option) \
+ (((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB))
/* evaluates to true if option takes a char* argument */
-#define _curl_is_string_option(option) \
+#define curlcheck_string_option(option) \
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
(option) == CURLOPT_ACCEPT_ENCODING || \
(option) == CURLOPT_ALTSVC || \
@@ -270,9 +276,11 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_DNS_SERVERS || \
(option) == CURLOPT_DOH_URL || \
(option) == CURLOPT_EGDSOCKET || \
- (option) == CURLOPT_FTPPORT || \
(option) == CURLOPT_FTP_ACCOUNT || \
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
+ (option) == CURLOPT_FTPPORT || \
+ (option) == CURLOPT_HSTS || \
+ (option) == CURLOPT_HAPROXY_CLIENT_IP || \
(option) == CURLOPT_INTERFACE || \
(option) == CURLOPT_ISSUERCERT || \
(option) == CURLOPT_KEYPASSWD || \
@@ -285,33 +293,40 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_PASSWORD || \
(option) == CURLOPT_PINNEDPUBLICKEY || \
(option) == CURLOPT_PRE_PROXY || \
+ (option) == CURLOPT_PROTOCOLS_STR || \
(option) == CURLOPT_PROXY || \
- (option) == CURLOPT_PROXYPASSWORD || \
- (option) == CURLOPT_PROXYUSERNAME || \
- (option) == CURLOPT_PROXYUSERPWD || \
(option) == CURLOPT_PROXY_CAINFO || \
(option) == CURLOPT_PROXY_CAPATH || \
(option) == CURLOPT_PROXY_CRLFILE || \
+ (option) == CURLOPT_PROXY_ISSUERCERT || \
(option) == CURLOPT_PROXY_KEYPASSWD || \
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
(option) == CURLOPT_PROXY_SERVICE_NAME || \
+ (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
(option) == CURLOPT_PROXY_SSLCERT || \
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
(option) == CURLOPT_PROXY_SSLKEY || \
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
- (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
+ (option) == CURLOPT_PROXY_TLS13_CIPHERS || \
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
- (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
+ (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
+ (option) == CURLOPT_PROXYPASSWORD || \
+ (option) == CURLOPT_PROXYUSERNAME || \
+ (option) == CURLOPT_PROXYUSERPWD || \
(option) == CURLOPT_RANDOM_FILE || \
(option) == CURLOPT_RANGE || \
+ (option) == CURLOPT_REDIR_PROTOCOLS_STR || \
(option) == CURLOPT_REFERER || \
+ (option) == CURLOPT_REQUEST_TARGET || \
(option) == CURLOPT_RTSP_SESSION_ID || \
(option) == CURLOPT_RTSP_STREAM_URI || \
(option) == CURLOPT_RTSP_TRANSPORT || \
+ (option) == CURLOPT_SASL_AUTHZID || \
(option) == CURLOPT_SERVICE_NAME || \
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
+ (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 || \
(option) == CURLOPT_SSH_KNOWNHOSTS || \
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
@@ -321,6 +336,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_SSLKEY || \
(option) == CURLOPT_SSLKEYTYPE || \
(option) == CURLOPT_SSL_CIPHER_LIST || \
+ (option) == CURLOPT_TLS13_CIPHERS || \
(option) == CURLOPT_TLSAUTH_PASSWORD || \
(option) == CURLOPT_TLSAUTH_TYPE || \
(option) == CURLOPT_TLSAUTH_USERNAME || \
@@ -328,32 +344,36 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_URL || \
(option) == CURLOPT_USERAGENT || \
(option) == CURLOPT_USERNAME || \
+ (option) == CURLOPT_AWS_SIGV4 || \
(option) == CURLOPT_USERPWD || \
(option) == CURLOPT_XOAUTH2_BEARER || \
+ (option) == CURLOPT_SSL_EC_CURVES || \
0)
/* evaluates to true if option takes a curl_write_callback argument */
-#define _curl_is_write_cb_option(option) \
- ((option) == CURLOPT_HEADERFUNCTION || \
+#define curlcheck_write_cb_option(option) \
+ ((option) == CURLOPT_HEADERFUNCTION || \
(option) == CURLOPT_WRITEFUNCTION)
/* evaluates to true if option takes a curl_conv_callback argument */
-#define _curl_is_conv_cb_option(option) \
- ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
- (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
+#define curlcheck_conv_cb_option(option) \
+ ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
+ (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
/* evaluates to true if option takes a data argument to pass to a callback */
-#define _curl_is_cb_data_option(option) \
+#define curlcheck_cb_data_option(option) \
((option) == CURLOPT_CHUNK_DATA || \
(option) == CURLOPT_CLOSESOCKETDATA || \
(option) == CURLOPT_DEBUGDATA || \
(option) == CURLOPT_FNMATCH_DATA || \
(option) == CURLOPT_HEADERDATA || \
+ (option) == CURLOPT_HSTSREADDATA || \
+ (option) == CURLOPT_HSTSWRITEDATA || \
(option) == CURLOPT_INTERLEAVEDATA || \
(option) == CURLOPT_IOCTLDATA || \
(option) == CURLOPT_OPENSOCKETDATA || \
- (option) == CURLOPT_PRIVATE || \
+ (option) == CURLOPT_PREREQDATA || \
(option) == CURLOPT_PROGRESSDATA || \
(option) == CURLOPT_READDATA || \
(option) == CURLOPT_SEEKDATA || \
@@ -362,17 +382,18 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_SSL_CTX_DATA || \
(option) == CURLOPT_WRITEDATA || \
(option) == CURLOPT_RESOLVER_START_DATA || \
- (option) == CURLOPT_CURLU || \
+ (option) == CURLOPT_TRAILERDATA || \
+ (option) == CURLOPT_SSH_HOSTKEYDATA || \
0)
/* evaluates to true if option takes a POST data argument (void* or char*) */
-#define _curl_is_postfields_option(option) \
+#define curlcheck_postfields_option(option) \
((option) == CURLOPT_POSTFIELDS || \
(option) == CURLOPT_COPYPOSTFIELDS || \
0)
/* evaluates to true if option takes a struct curl_slist * argument */
-#define _curl_is_slist_option(option) \
+#define curlcheck_slist_option(option) \
((option) == CURLOPT_HTTP200ALIASES || \
(option) == CURLOPT_HTTPHEADER || \
(option) == CURLOPT_MAIL_RCPT || \
@@ -382,45 +403,47 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_QUOTE || \
(option) == CURLOPT_RESOLVE || \
(option) == CURLOPT_TELNETOPTIONS || \
+ (option) == CURLOPT_CONNECT_TO || \
0)
/* groups of curl_easy_getinfo infos that take the same type of argument */
/* evaluates to true if info expects a pointer to char * argument */
-#define _curl_is_string_info(info) \
- (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
+#define curlcheck_string_info(info) \
+ (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
+ (info) != CURLINFO_PRIVATE)
/* evaluates to true if info expects a pointer to long argument */
-#define _curl_is_long_info(info) \
+#define curlcheck_long_info(info) \
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
/* evaluates to true if info expects a pointer to double argument */
-#define _curl_is_double_info(info) \
+#define curlcheck_double_info(info) \
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
/* true if info expects a pointer to struct curl_slist * argument */
-#define _curl_is_slist_info(info) \
+#define curlcheck_slist_info(info) \
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
-#define _curl_is_tlssessioninfo_info(info) \
+#define curlcheck_tlssessioninfo_info(info) \
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
/* true if info expects a pointer to struct curl_certinfo * argument */
-#define _curl_is_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
+#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
/* true if info expects a pointer to struct curl_socket_t argument */
-#define _curl_is_socket_info(info) \
+#define curlcheck_socket_info(info) \
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
/* true if info expects a pointer to curl_off_t argument */
-#define _curl_is_off_t_info(info) \
+#define curlcheck_off_t_info(info) \
(CURLINFO_OFF_T < (info))
-/* typecheck helpers -- check whether given expression has requested type*/
+/* typecheck helpers -- check whether given expression has requested type */
-/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
+/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros,
* otherwise define a new macro. Search for __builtin_types_compatible_p
* in the GCC manual.
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
@@ -430,35 +453,35 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
*/
/* XXX: should evaluate to true if expr is a pointer */
-#define _curl_is_any_ptr(expr) \
+#define curlcheck_any_ptr(expr) \
(sizeof(expr) == sizeof(void *))
/* evaluates to true if expr is NULL */
/* XXX: must not evaluate expr, so this check is not accurate */
-#define _curl_is_NULL(expr) \
+#define curlcheck_NULL(expr) \
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
/* evaluates to true if expr is type*, const type* or NULL */
-#define _curl_is_ptr(expr, type) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), type *) || \
+#define curlcheck_ptr(expr, type) \
+ (curlcheck_NULL(expr) || \
+ __builtin_types_compatible_p(__typeof__(expr), type *) || \
__builtin_types_compatible_p(__typeof__(expr), const type *))
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
-#define _curl_is_arr(expr, type) \
- (_curl_is_ptr((expr), type) || \
+#define curlcheck_arr(expr, type) \
+ (curlcheck_ptr((expr), type) || \
__builtin_types_compatible_p(__typeof__(expr), type []))
/* evaluates to true if expr is a string */
-#define _curl_is_string(expr) \
- (_curl_is_arr((expr), char) || \
- _curl_is_arr((expr), signed char) || \
- _curl_is_arr((expr), unsigned char))
+#define curlcheck_string(expr) \
+ (curlcheck_arr((expr), char) || \
+ curlcheck_arr((expr), signed char) || \
+ curlcheck_arr((expr), unsigned char))
/* evaluates to true if expr is a long (no matter the signedness)
* XXX: for now, int is also accepted (and therefore short and char, which
* are promoted to int when passed to a variadic function) */
-#define _curl_is_long(expr) \
+#define curlcheck_long(expr) \
(__builtin_types_compatible_p(__typeof__(expr), long) || \
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
@@ -473,59 +496,59 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
__builtin_types_compatible_p(__typeof__(expr), unsigned char))
/* evaluates to true if expr is of type curl_off_t */
-#define _curl_is_off_t(expr) \
+#define curlcheck_off_t(expr) \
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */
-#define _curl_is_error_buffer(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), char *) || \
+#define curlcheck_error_buffer(expr) \
+ (curlcheck_NULL(expr) || \
+ __builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
#if 0
-#define _curl_is_cb_data(expr) \
- (_curl_is_ptr((expr), void) || \
- _curl_is_ptr((expr), FILE))
+#define curlcheck_cb_data(expr) \
+ (curlcheck_ptr((expr), void) || \
+ curlcheck_ptr((expr), FILE))
#else /* be less strict */
-#define _curl_is_cb_data(expr) \
- _curl_is_any_ptr(expr)
+#define curlcheck_cb_data(expr) \
+ curlcheck_any_ptr(expr)
#endif
/* evaluates to true if expr is of type FILE* */
-#define _curl_is_FILE(expr) \
- (_curl_is_NULL(expr) || \
+#define curlcheck_FILE(expr) \
+ (curlcheck_NULL(expr) || \
(__builtin_types_compatible_p(__typeof__(expr), FILE *)))
/* evaluates to true if expr can be passed as POST data (void* or char*) */
-#define _curl_is_postfields(expr) \
- (_curl_is_ptr((expr), void) || \
- _curl_is_arr((expr), char) || \
- _curl_is_arr((expr), unsigned char))
+#define curlcheck_postfields(expr) \
+ (curlcheck_ptr((expr), void) || \
+ curlcheck_arr((expr), char) || \
+ curlcheck_arr((expr), unsigned char))
/* helper: __builtin_types_compatible_p distinguishes between functions and
* function pointers, hide it */
-#define _curl_callback_compatible(func, type) \
- (__builtin_types_compatible_p(__typeof__(func), type) || \
+#define curlcheck_cb_compatible(func, type) \
+ (__builtin_types_compatible_p(__typeof__(func), type) || \
__builtin_types_compatible_p(__typeof__(func) *, type))
/* evaluates to true if expr is of type curl_resolver_start_callback */
-#define _curl_is_resolver_start_callback(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_resolver_start_callback))
+#define curlcheck_resolver_start_callback(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_resolver_start_callback))
/* evaluates to true if expr is of type curl_read_callback or "similar" */
-#define _curl_is_read_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), __typeof__(fread) *) || \
- _curl_callback_compatible((expr), curl_read_callback) || \
- _curl_callback_compatible((expr), _curl_read_callback1) || \
- _curl_callback_compatible((expr), _curl_read_callback2) || \
- _curl_callback_compatible((expr), _curl_read_callback3) || \
- _curl_callback_compatible((expr), _curl_read_callback4) || \
- _curl_callback_compatible((expr), _curl_read_callback5) || \
- _curl_callback_compatible((expr), _curl_read_callback6))
+#define curlcheck_read_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), __typeof__(fread) *) || \
+ curlcheck_cb_compatible((expr), curl_read_callback) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_read_callback6))
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
@@ -534,16 +557,16 @@ typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_write_callback or "similar" */
-#define _curl_is_write_cb(expr) \
- (_curl_is_read_cb(expr) || \
- _curl_callback_compatible((expr), __typeof__(fwrite) *) || \
- _curl_callback_compatible((expr), curl_write_callback) || \
- _curl_callback_compatible((expr), _curl_write_callback1) || \
- _curl_callback_compatible((expr), _curl_write_callback2) || \
- _curl_callback_compatible((expr), _curl_write_callback3) || \
- _curl_callback_compatible((expr), _curl_write_callback4) || \
- _curl_callback_compatible((expr), _curl_write_callback5) || \
- _curl_callback_compatible((expr), _curl_write_callback6))
+#define curlcheck_write_cb(expr) \
+ (curlcheck_read_cb(expr) || \
+ curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \
+ curlcheck_cb_compatible((expr), curl_write_callback) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_write_callback6))
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
const void *);
@@ -554,37 +577,37 @@ typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
-#define _curl_is_ioctl_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_ioctl_callback) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback1) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback2) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback3) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback4))
+#define curlcheck_ioctl_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_ioctl_callback) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_ioctl_callback4))
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
-#define _curl_is_sockopt_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_sockopt_callback) || \
- _curl_callback_compatible((expr), _curl_sockopt_callback1) || \
- _curl_callback_compatible((expr), _curl_sockopt_callback2))
+#define curlcheck_sockopt_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_sockopt_callback) || \
+ curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_sockopt_callback2))
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or
"similar" */
-#define _curl_is_opensocket_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_opensocket_callback) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback1) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback2) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback3) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback4))
+#define curlcheck_opensocket_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_opensocket_callback) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_opensocket_callback4))
typedef curl_socket_t (*_curl_opensocket_callback1)
(void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (*_curl_opensocket_callback2)
@@ -595,28 +618,28 @@ typedef curl_socket_t (*_curl_opensocket_callback4)
(const void *, curlsocktype, const struct curl_sockaddr *);
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
-#define _curl_is_progress_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_progress_callback) || \
- _curl_callback_compatible((expr), _curl_progress_callback1) || \
- _curl_callback_compatible((expr), _curl_progress_callback2))
+#define curlcheck_progress_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_progress_callback) || \
+ curlcheck_cb_compatible((expr), _curl_progress_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_progress_callback2))
typedef int (*_curl_progress_callback1)(void *,
double, double, double, double);
typedef int (*_curl_progress_callback2)(const void *,
double, double, double, double);
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
-#define _curl_is_debug_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_debug_callback) || \
- _curl_callback_compatible((expr), _curl_debug_callback1) || \
- _curl_callback_compatible((expr), _curl_debug_callback2) || \
- _curl_callback_compatible((expr), _curl_debug_callback3) || \
- _curl_callback_compatible((expr), _curl_debug_callback4) || \
- _curl_callback_compatible((expr), _curl_debug_callback5) || \
- _curl_callback_compatible((expr), _curl_debug_callback6) || \
- _curl_callback_compatible((expr), _curl_debug_callback7) || \
- _curl_callback_compatible((expr), _curl_debug_callback8))
+#define curlcheck_debug_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_debug_callback) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback6) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback7) || \
+ curlcheck_cb_compatible((expr), _curl_debug_callback8))
typedef int (*_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (*_curl_debug_callback2) (CURL *,
@@ -636,17 +659,17 @@ typedef int (*_curl_debug_callback8) (CURL *,
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
-#define _curl_is_ssl_ctx_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_ssl_ctx_callback) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
+#define curlcheck_ssl_ctx_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \
+ curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8))
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
@@ -656,11 +679,11 @@ typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
* this will of course break if we're included before OpenSSL headers...
*/
-typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
-typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
-typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
-typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
- const void *);
+typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *);
+typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *);
+typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *);
+typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *,
+ const void *);
#else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
@@ -669,26 +692,26 @@ typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
#endif
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
-#define _curl_is_conv_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_conv_callback) || \
- _curl_callback_compatible((expr), _curl_conv_callback1) || \
- _curl_callback_compatible((expr), _curl_conv_callback2) || \
- _curl_callback_compatible((expr), _curl_conv_callback3) || \
- _curl_callback_compatible((expr), _curl_conv_callback4))
+#define curlcheck_conv_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_conv_callback) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback2) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback3) || \
+ curlcheck_cb_compatible((expr), _curl_conv_callback4))
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
-#define _curl_is_seek_cb(expr) \
- (_curl_is_NULL(expr) || \
- _curl_callback_compatible((expr), curl_seek_callback) || \
- _curl_callback_compatible((expr), _curl_seek_callback1) || \
- _curl_callback_compatible((expr), _curl_seek_callback2))
+#define curlcheck_seek_cb(expr) \
+ (curlcheck_NULL(expr) || \
+ curlcheck_cb_compatible((expr), curl_seek_callback) || \
+ curlcheck_cb_compatible((expr), _curl_seek_callback1) || \
+ curlcheck_cb_compatible((expr), _curl_seek_callback2))
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
-#endif /* __CURL_TYPECHECK_GCC_H */
+#endif /* CURLINC_TYPECHECK_GCC_H */
diff --git a/include/curl/urlapi.h b/include/curl/urlapi.h
index 58e89d8..91f8c45 100644
--- a/include/curl/urlapi.h
+++ b/include/curl/urlapi.h
@@ -1,5 +1,5 @@
-#ifndef __CURL_URLAPI_H
-#define __CURL_URLAPI_H
+#ifndef CURLINC_URLAPI_H
+#define CURLINC_URLAPI_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
@@ -7,11 +7,11 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2018 - 2019, Daniel Stenberg, , et al.
+ * Copyright (C) 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 https://curl.haxx.se/docs/copyright.html.
+ * are also available at https://curl.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
@@ -20,6 +20,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include "curl.h"
@@ -47,7 +49,22 @@ typedef enum {
CURLUE_NO_HOST, /* 14 */
CURLUE_NO_PORT, /* 15 */
CURLUE_NO_QUERY, /* 16 */
- CURLUE_NO_FRAGMENT /* 17 */
+ CURLUE_NO_FRAGMENT, /* 17 */
+ CURLUE_NO_ZONEID, /* 18 */
+ CURLUE_BAD_FILE_URL, /* 19 */
+ CURLUE_BAD_FRAGMENT, /* 20 */
+ CURLUE_BAD_HOSTNAME, /* 21 */
+ CURLUE_BAD_IPV6, /* 22 */
+ CURLUE_BAD_LOGIN, /* 23 */
+ CURLUE_BAD_PASSWORD, /* 24 */
+ CURLUE_BAD_PATH, /* 25 */
+ CURLUE_BAD_QUERY, /* 26 */
+ CURLUE_BAD_SCHEME, /* 27 */
+ CURLUE_BAD_SLASHES, /* 28 */
+ CURLUE_BAD_USER, /* 29 */
+ CURLUE_LACKS_IDN, /* 30 */
+ CURLUE_TOO_LARGE, /* 31 */
+ CURLUE_LAST
} CURLUcode;
typedef enum {
@@ -77,6 +94,11 @@ typedef enum {
#define CURLU_URLENCODE (1<<7) /* URL encode on set */
#define CURLU_APPENDQUERY (1<<8) /* append a form style part */
#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */
+#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the
+ scheme is unknown. */
+#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */
+#define CURLU_PUNYCODE (1<<12) /* get the host name in punycode */
+#define CURLU_PUNY2IDN (1<<13) /* punycode => IDN conversion */
typedef struct Curl_URL CURLU;
@@ -97,14 +119,14 @@ CURL_EXTERN void curl_url_cleanup(CURLU *handle);
* curl_url_dup() duplicates a CURLU handle and returns a new copy. The new
* handle must also be freed with curl_url_cleanup().
*/
-CURL_EXTERN CURLU *curl_url_dup(CURLU *in);
+CURL_EXTERN CURLU *curl_url_dup(const CURLU *in);
/*
* curl_url_get() extracts a specific part of the URL from a CURLU
* handle. Returns error code. The returned pointer MUST be freed with
* curl_free() afterwards.
*/
-CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
+CURL_EXTERN CURLUcode curl_url_get(const CURLU *handle, CURLUPart what,
char **part, unsigned int flags);
/*
@@ -115,9 +137,15 @@ CURL_EXTERN CURLUcode curl_url_get(CURLU *handle, CURLUPart what,
CURL_EXTERN CURLUcode curl_url_set(CURLU *handle, CURLUPart what,
const char *part, unsigned int flags);
+/*
+ * curl_url_strerror() turns a CURLUcode value into the equivalent human
+ * readable error string. This is useful for printing meaningful error
+ * messages.
+ */
+CURL_EXTERN const char *curl_url_strerror(CURLUcode);
#ifdef __cplusplus
} /* end of extern "C" */
#endif
-#endif
+#endif /* CURLINC_URLAPI_H */
diff --git a/include/curl/websockets.h b/include/curl/websockets.h
new file mode 100644
index 0000000..6ef6a2b
--- /dev/null
+++ b/include/curl/websockets.h
@@ -0,0 +1,84 @@
+#ifndef CURLINC_WEBSOCKETS_H
+#define CURLINC_WEBSOCKETS_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 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 https://curl.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.
+ *
+ * SPDX-License-Identifier: curl
+ *
+ ***************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct curl_ws_frame {
+ int age; /* zero */
+ int flags; /* See the CURLWS_* defines */
+ curl_off_t offset; /* the offset of this data into the frame */
+ curl_off_t bytesleft; /* number of pending bytes left of the payload */
+ size_t len; /* size of the current data chunk */
+};
+
+/* flag bits */
+#define CURLWS_TEXT (1<<0)
+#define CURLWS_BINARY (1<<1)
+#define CURLWS_CONT (1<<2)
+#define CURLWS_CLOSE (1<<3)
+#define CURLWS_PING (1<<4)
+#define CURLWS_OFFSET (1<<5)
+
+/*
+ * NAME curl_ws_recv()
+ *
+ * DESCRIPTION
+ *
+ * Receives data from the websocket connection. Use after successful
+ * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
+ */
+CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
+ size_t *recv,
+ const struct curl_ws_frame **metap);
+
+/* flags for curl_ws_send() */
+#define CURLWS_PONG (1<<6)
+
+/*
+ * NAME curl_ws_send()
+ *
+ * DESCRIPTION
+ *
+ * Sends data over the websocket connection. Use after successful
+ * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
+ */
+CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
+ size_t buflen, size_t *sent,
+ curl_off_t fragsize,
+ unsigned int flags);
+
+/* bits for the CURLOPT_WS_OPTIONS bitmask: */
+#define CURLWS_RAW_MODE (1<<0)
+
+CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CURLINC_WEBSOCKETS_H */
diff --git a/include/mysql/CMakeLists.txt b/include/mysql/CMakeLists.txt
index 1fca99e..b9eed53 100644
--- a/include/mysql/CMakeLists.txt
+++ b/include/mysql/CMakeLists.txt
@@ -8,6 +8,7 @@ SET(MARIADB_CLIENT_INCLUDES ${CC_SOURCE_DIR}/include/mariadb_com.h
${CC_SOURCE_DIR}/include/errmsg.h
${CC_SOURCE_DIR}/include/mariadb_dyncol.h
${CC_SOURCE_DIR}/include/mariadb_ctype.h
+ ${CC_SOURCE_DIR}/include/mariadb_rpl.h
)
IF(NOT IS_SUBPROJECT)
SET(MARIADB_CLIENT_INCLUDES ${MARIADB_CLIENT_INCLUDES}
diff --git a/include/mysql/config.h b/include/mysql/config.h
index 761a226..d03107c 100644
--- a/include/mysql/config.h
+++ b/include/mysql/config.h
@@ -11,6 +11,7 @@
#define HAVE_FCNTL_H 1
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
+/* #undef HAVE_LINUX_LIMITS_H */
/* #undef HAVE_PWD_H */
/* #undef HAVE_SELECT_H */
#define HAVE_STDDEF_H 1
@@ -21,6 +22,8 @@
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_SOCKET_H */
/* #undef HAVE_SYS_STREAM_H */
+#define HAVE_SYS_STAT_H 1
+/* #undef HAVE_SYS_SYSCTL_H */
#define HAVE_SYS_TYPES_H 1
/* #undef HAVE_SYS_UN_H */
/* #undef HAVE_UNISTD_H */
@@ -85,6 +88,11 @@
# define HAVE_UINT 1
#endif
+/* #undef SIZEOF_USHORT */
+#if defined(SIZEOF_USHORT)
+# define HAVE_USHORT 1
+#endif
+
/* #undef SIZEOF_ULONG */
#if defined(SIZEOF_ULONG)
# define HAVE_ULONG 1
@@ -138,5 +146,5 @@
#define LOCAL_INFILE_MODE_AUTO 2
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_AUTO
-#define MARIADB_DEFAULT_CHARSET "latin1"
+#define MARIADB_DEFAULT_CHARSET "utf8mb4"
diff --git a/include/mysql/errmsg.h b/include/mysql/errmsg.h
index 7ca3238..4afe8e8 100644
--- a/include/mysql/errmsg.h
+++ b/include/mysql/errmsg.h
@@ -31,16 +31,14 @@ extern const char *mariadb_client_errors[]; /* Error messages */
}
#endif
-
-
#define CR_MIN_ERROR 2000 /* For easier client code */
#define CR_MAX_ERROR 2999
#define CER_MIN_ERROR 5000
#define CER_MAX_ERROR 5999
-#define CER(X) mariadb_client_errors[(X)-CER_MIN_ERROR]
-#define ER(X) client_errors[(X)-CR_MIN_ERROR]
#define CLIENT_ERRMAP 2 /* Errormap used by ma_error() */
+#define ER_UNKNOWN_ERROR_CODE "Unknown or undefined error code (%d)"
+
#define CR_UNKNOWN_ERROR 2000
#define CR_SOCKET_CREATE_ERROR 2001
#define CR_CONNECTION_ERROR 2002
@@ -101,7 +99,33 @@ extern const char *mariadb_client_errors[]; /* Error messages */
#define CR_BULK_WITHOUT_PARAMETERS 5006
#define CR_INVALID_STMT 5007
#define CR_VERSION_MISMATCH 5008
+#define CR_INVALID_PARAMETER 5009
+#define CR_PLUGIN_NOT_ALLOWED 5010
+#define CR_CONNSTR_PARSE_ERROR 5011
+#define CR_ERR_LOAD_PLUGIN 5012
+#define CR_ERR_NET_READ 5013
+#define CR_ERR_NET_WRITE 5014
+#define CR_ERR_NET_UNCOMPRESS 5015
+#define CR_ERR_STMT_PARAM_CALLBACK 5016
+#define CR_ERR_BINLOG_UNCOMPRESS 5017
+#define CR_ERR_CHECKSUM_VERIFICATION_ERROR 5018
+#define CR_ERR_UNSUPPORTED_BINLOG_FORMAT 5019
+#define CR_UNKNOWN_BINLOG_EVENT 5020
+#define CR_BINLOG_ERROR 5021
+#define CR_BINLOG_INVALID_FILE 5022
+#define CR_BINLOG_SEMI_SYNC_ERROR 5023
+
/* Always last, if you add new error codes please update the
value for CR_MARIADB_LAST_ERROR */
-#define CR_MARIADB_LAST_ERROR CR_VERSION_MISMATCH
+#define CR_MARIADB_LAST_ERROR CR_BINLOG_INVALID_FILE
+
#endif
+
+#define IS_MYSQL_ERROR(code) ((code) > CR_MIN_ERROR && (code) <= CR_MYSQL_LAST_ERROR)
+#define IS_MARIADB_ERROR(code) ((code) > CER_MIN_ERROR && (code) <= CR_MARIADB_LAST_ERROR)
+
+#define ER(code) IS_MYSQL_ERROR((code)) ? client_errors[(code) - CR_MIN_ERROR] : \
+ IS_MARIADB_ERROR((code)) ? mariadb_client_errors[(code) - CER_MIN_ERROR] : \
+ "Unknown or undefined error code"
+#define CER(code) ER((code))
+
diff --git a/include/mysql/ma_common.h b/include/mysql/ma_common.h
index 123a510..1ac0cb6 100644
--- a/include/mysql/ma_common.h
+++ b/include/mysql/ma_common.h
@@ -21,7 +21,8 @@
#define _ma_common_h
#include
-#include
+#include
+#include
enum enum_multi_status {
COM_MULTI_OFF= 0,
@@ -54,7 +55,7 @@ struct st_mysql_options_extension {
char *ssl_crlpath;
char *server_public_key_path;
struct mysql_async_context *async_context;
- HASH connect_attrs;
+ MA_HASHTBL connect_attrs;
size_t connect_attrs_len;
void (*report_progress)(const MYSQL *mysql,
unsigned int stage,
@@ -74,11 +75,18 @@ struct st_mysql_options_extension {
my_bool read_only;
char *connection_handler;
my_bool (*set_option)(MYSQL *mysql, const char *config_option, const char *config_value);
- HASH userdata;
+ MA_HASHTBL userdata;
char *server_public_key;
char *proxy_header;
size_t proxy_header_len;
int (*io_wait)(my_socket handle, my_bool is_read, int timeout);
+ my_bool skip_read_response;
+ char *restricted_auth;
+ char *rpl_host;
+ unsigned short rpl_port;
+ void (*status_callback)(void *ptr, enum enum_mariadb_status_info type, ...);
+ void *status_data;
+ my_bool tls_verify_server_cert;
};
typedef struct st_connection_handler
@@ -92,6 +100,8 @@ typedef struct st_connection_handler
struct st_mariadb_net_extension {
enum enum_multi_status multi_status;
int extended_errno;
+ ma_compress_ctx *compression_ctx;
+ MARIADB_COMPRESSION_PLUGIN *compression_plugin;
};
struct st_mariadb_session_state
@@ -109,8 +119,8 @@ struct st_mariadb_extension {
};
#define OPT_EXT_VAL(a,key) \
- ((a)->options.extension && (a)->options.extension->key) ?\
- (a)->options.extension->key : 0
+ (((a)->options.extension && (a)->options.extension->key) ?\
+ (a)->options.extension->key : 0)
#endif
diff --git a/include/mysql/ma_compress.h b/include/mysql/ma_compress.h
new file mode 100644
index 0000000..a146745
--- /dev/null
+++ b/include/mysql/ma_compress.h
@@ -0,0 +1,48 @@
+/************************************************************************************
+ Copyright (C) 2022 MariaDB Corporation AB
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not see
+ or write to the Free Software Foundation, Inc.,
+ 51 Franklin St., Fifth Floor, Boston, MA 02110, USA
+
+*************************************************************************************/
+#ifndef __ma_compress_h__
+
+#include
+
+#define COMPRESSION_LEVEL_DEFAULT INT_MAX
+
+#define compression_plugin(net) (net)->extension->compression_plugin
+#define compression_ctx(net) (net)->extension->compression_ctx
+
+typedef struct {
+ void *compress_ctx;
+ void *decompress_ctx;
+ int compression_level;
+ void *extra; /* reserved */
+} ma_compress_ctx;
+
+enum enum_ma_compression_algorithm {
+ COMPRESSION_NONE= 0,
+ COMPRESSION_ZLIB,
+ COMPRESSION_ZSTD,
+ COMPRESSION_UNKNOWN
+};
+
+const char *_mariadb_compression_algorithm_str(enum enum_ma_compression_algorithm algorithm);
+my_bool _mariadb_compress(NET *net, unsigned char *, size_t *, size_t *);
+my_bool _mariadb_uncompress(NET *net, unsigned char *, size_t *, size_t *);
+unsigned char *_mariadb_compress_alloc(NET *net, const unsigned char *packet, size_t *len, size_t *complen);
+
+#endif
diff --git a/include/mysql/ma_config.h b/include/mysql/ma_config.h
index 761a226..d03107c 100644
--- a/include/mysql/ma_config.h
+++ b/include/mysql/ma_config.h
@@ -11,6 +11,7 @@
#define HAVE_FCNTL_H 1
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
+/* #undef HAVE_LINUX_LIMITS_H */
/* #undef HAVE_PWD_H */
/* #undef HAVE_SELECT_H */
#define HAVE_STDDEF_H 1
@@ -21,6 +22,8 @@
/* #undef HAVE_SYS_SELECT_H */
/* #undef HAVE_SYS_SOCKET_H */
/* #undef HAVE_SYS_STREAM_H */
+#define HAVE_SYS_STAT_H 1
+/* #undef HAVE_SYS_SYSCTL_H */
#define HAVE_SYS_TYPES_H 1
/* #undef HAVE_SYS_UN_H */
/* #undef HAVE_UNISTD_H */
@@ -85,6 +88,11 @@
# define HAVE_UINT 1
#endif
+/* #undef SIZEOF_USHORT */
+#if defined(SIZEOF_USHORT)
+# define HAVE_USHORT 1
+#endif
+
/* #undef SIZEOF_ULONG */
#if defined(SIZEOF_ULONG)
# define HAVE_ULONG 1
@@ -138,5 +146,5 @@
#define LOCAL_INFILE_MODE_AUTO 2
#define ENABLED_LOCAL_INFILE LOCAL_INFILE_MODE_AUTO
-#define MARIADB_DEFAULT_CHARSET "latin1"
+#define MARIADB_DEFAULT_CHARSET "utf8mb4"
diff --git a/include/mysql/ma_config.h.in b/include/mysql/ma_config.h.in
index 1e57257..c5c758d 100644
--- a/include/mysql/ma_config.h.in
+++ b/include/mysql/ma_config.h.in
@@ -11,6 +11,7 @@
#cmakedefine HAVE_FCNTL_H 1
#cmakedefine HAVE_FLOAT_H 1
#cmakedefine HAVE_LIMITS_H 1
+#cmakedefine HAVE_LINUX_LIMITS_H 1
#cmakedefine HAVE_PWD_H 1
#cmakedefine HAVE_SELECT_H 1
#cmakedefine HAVE_STDDEF_H 1
@@ -21,6 +22,8 @@
#cmakedefine HAVE_SYS_SELECT_H 1
#cmakedefine HAVE_SYS_SOCKET_H 1
#cmakedefine HAVE_SYS_STREAM_H 1
+#cmakedefine HAVE_SYS_STAT_H 1
+#cmakedefine HAVE_SYS_SYSCTL_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_SYS_UN_H 1
#cmakedefine HAVE_UNISTD_H 1
@@ -85,6 +88,11 @@
# define HAVE_UINT 1
#endif
+#cmakedefine SIZEOF_USHORT @SIZEOF_USHORT@
+#if defined(SIZEOF_USHORT)
+# define HAVE_USHORT 1
+#endif
+
#cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@
#if defined(SIZEOF_ULONG)
# define HAVE_ULONG 1
diff --git a/include/mysql/ma_context.h b/include/mysql/ma_context.h
index 2cc40d2..0ad7f68 100644
--- a/include/mysql/ma_context.h
+++ b/include/mysql/ma_context.h
@@ -1,5 +1,6 @@
/*
- Copyright 2011 Kristian Nielsen and Monty Program Ab
+ Copyright 2011 Kristian Nielsen and Monty Program Ab
+ 2015, 2022 MariaDB Corporation AB
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -113,16 +114,16 @@ struct my_context {
#endif
/*
- Initialize an asynchroneous context object.
+ Initialize an asynchronous context object.
Returns 0 on success, non-zero on failure.
*/
extern int my_context_init(struct my_context *c, size_t stack_size);
-/* Free an asynchroneous context object, deallocating any resources used. */
+/* Free an asynchronous context object, deallocating any resources used. */
extern void my_context_destroy(struct my_context *c);
/*
- Spawn an asynchroneous context. The context will run the supplied user
+ Spawn an asynchronous context. The context will run the supplied user
function, passing the supplied user data pointer.
The context must have been initialised with my_context_init() prior to
@@ -130,7 +131,7 @@ extern void my_context_destroy(struct my_context *c);
The user function may call my_context_yield(), which will cause this
function to return 1. Then later my_context_continue() may be called, which
- will resume the asynchroneous context by returning from the previous
+ will resume the asynchronous context by returning from the previous
my_context_yield() call.
When the user function returns, this function returns 0.
@@ -140,7 +141,7 @@ extern void my_context_destroy(struct my_context *c);
extern int my_context_spawn(struct my_context *c, void (*f)(void *), void *d);
/*
- Suspend an asynchroneous context started with my_context_spawn.
+ Suspend an asynchronous context started with my_context_spawn.
When my_context_yield() is called, execution immediately returns from the
last my_context_spawn() or my_context_continue() call. Then when later
@@ -152,10 +153,10 @@ extern int my_context_spawn(struct my_context *c, void (*f)(void *), void *d);
extern int my_context_yield(struct my_context *c);
/*
- Resume an asynchroneous context. The context was spawned by
+ Resume an asynchronous context. The context was spawned by
my_context_spawn(), and later suspended inside my_context_yield().
- The asynchroneous context may be repeatedly suspended with
+ The asynchronous context may be repeatedly suspended with
my_context_yield() and resumed with my_context_continue().
Each time it is suspended, this function returns 1. When the originally
@@ -178,7 +179,7 @@ struct mysql_async_context {
resumed, eg. whether we woke up due to connection completed or timeout
in mysql_real_connect_cont().
*/
- unsigned int events_occured;
+ unsigned int events_occurred;
/*
This is set to the result of the whole asynchronous operation when it
completes. It uses a union, as different calls have different return
@@ -223,6 +224,14 @@ struct mysql_async_context {
struct st_ma_pvio *pvio;
void (*suspend_resume_hook)(my_bool suspend, void *user_data);
void *suspend_resume_hook_user_data;
+
+ /* If non-NULL, this is a poitner to the result of getaddrinfo() currently
+ * under traversal in pvio_socket_connect(). It gets reset to NULL when a
+ * connection has been established to a server. The main objective is to
+ * free this memory resource in mysql_close() while an initiated connection
+ * has not been established. */
+ struct addrinfo* pending_gai_res;
+
/*
This is used to save the execution contexts so that we can suspend an
operation and switch back to the application context, to resume the
diff --git a/include/mysql/ma_crypt.h b/include/mysql/ma_crypt.h
index 182fa21..367488f 100644
--- a/include/mysql/ma_crypt.h
+++ b/include/mysql/ma_crypt.h
@@ -31,6 +31,7 @@
#define MA_HASH_SHA384 5
#define MA_HASH_SHA512 6
#define MA_HASH_RIPEMD160 7
+#define MA_HASH_MAX 8
/*! Hash digest sizes */
#define MA_MD5_HASH_SIZE 16
@@ -44,18 +45,11 @@
#define MA_MAX_HASH_SIZE 64
/** \typedef MRL hash context */
-#if defined(WIN32)
-#include
-#include
-typedef struct {
- char free_me;
- BCRYPT_ALG_HANDLE hAlg;
- BCRYPT_HASH_HANDLE hHash;
- PBYTE hashObject;
- DWORD digest_len;
-} MA_HASH_CTX;
-#elif defined(HAVE_OPENSSL)
+#if defined(HAVE_WINCRYPT)
typedef void MA_HASH_CTX;
+#elif defined(HAVE_OPENSSL)
+#include
+typedef EVP_MD_CTX MA_HASH_CTX;
#elif defined(HAVE_GNUTLS)
typedef struct {
void *ctx;
@@ -67,11 +61,10 @@ typedef struct {
@brief acquire and initialize new hash context
@param[in] algorithm hash algorithm
- @param[in] ctx pointer to a crypto context
@return hash context on success, NULL on error
*/
-MA_HASH_CTX *ma_hash_new(unsigned int algorithm, MA_HASH_CTX *ctx);
+MA_HASH_CTX *ma_hash_new(unsigned int algorithm);
/**
@brief release and deinitializes a hash context
@@ -113,7 +106,7 @@ void ma_hash_result(MA_HASH_CTX *ctx, unsigned char *digest);
@param[in] hash algorithm
- @retuns digest size or 0 on error
+ @returns digest size or 0 on error
*/
static inline size_t ma_hash_digest_size(unsigned int hash_alg)
{
@@ -153,11 +146,7 @@ static inline void ma_hash(unsigned int algorithm,
unsigned char *digest)
{
MA_HASH_CTX *ctx= NULL;
-#ifdef HAVE_SCHANNEL
- MA_HASH_CTX dctx;
- ctx= &dctx;
-#endif
- ctx= ma_hash_new(algorithm, ctx);
+ ctx= ma_hash_new(algorithm);
ma_hash_input(ctx, buffer, buffer_length);
ma_hash_result(ctx, digest);
ma_hash_free(ctx);
diff --git a/include/mysql/ma_decimal.h b/include/mysql/ma_decimal.h
new file mode 100644
index 0000000..e1f4fbf
--- /dev/null
+++ b/include/mysql/ma_decimal.h
@@ -0,0 +1,64 @@
+/* Copyright (C) 2000 Sergei Golubchik
+*/
+
+#ifndef _decimal_h
+#define _decimal_h
+
+typedef enum {TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} decimal_round_mode;
+typedef int32 decimal_digit;
+
+typedef struct st_decimal {
+ int intg, frac, len;
+ my_bool sign;
+ decimal_digit *buf;
+} decimal;
+
+int decimal2string(decimal *from, char *to, int *to_len);
+int bin2decimal(const char *from, decimal *to, int precision, int scale);
+
+int decimal_size(int precision, int scale);
+int decimal_bin_size(int precision, int scale);
+int decimal_result_size(decimal *from1, decimal *from2, char op, int param);
+
+
+/* set a decimal to zero */
+
+#define decimal_make_zero(dec) do { \
+ (dec)->buf[0]=0; \
+ (dec)->intg=1; \
+ (dec)->frac=0; \
+ (dec)->sign=0; \
+ } while(0)
+
+/*
+ returns the length of the buffer to hold string representation
+ of the decimal (including decimal dot, possible sign and \0)
+*/
+
+#define decimal_string_size(dec) ((dec)->intg + (dec)->frac + ((dec)->frac > 0) + 2)
+
+/* negate a decimal */
+#define decimal_neg(dec) do { (dec)->sign^=1; } while(0)
+
+/*
+ conventions:
+
+ decimal_smth() == 0 -- everything's ok
+ decimal_smth() <= 1 -- result is usable, but precision loss is possible
+ decimal_smth() <= 2 -- result can be unusable, most significant digits
+ could've been lost
+ decimal_smth() > 2 -- no result was generated
+*/
+
+#define E_DEC_OK 0
+#define E_DEC_TRUNCATED 1
+#define E_DEC_OVERFLOW 2
+#define E_DEC_DIV_ZERO 4
+#define E_DEC_BAD_NUM 8
+#define E_DEC_OOM 16
+
+#define E_DEC_ERROR 31
+#define E_DEC_FATAL_ERROR 30
+
+#endif
+
diff --git a/include/mysql/ma_global.h b/include/mysql/ma_global.h
index 0b93f7f..52f20f4 100644
--- a/include/mysql/ma_global.h
+++ b/include/mysql/ma_global.h
@@ -26,13 +26,10 @@
#include
#include
#define strcasecmp _stricmp
+#define strtok_r strtok_s
+#define strdup _strdup
#define sleep(x) Sleep(1000*(x))
-#ifdef _MSC_VER
-#define inline __inline
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
-#endif
+#define strerror_r(errno,buf,len) strerror_s(buf,len,errno)
#define STDCALL __stdcall
#endif
@@ -90,21 +87,6 @@
#endif /* THREAD */
/* Go around some bugs in different OS and compilers */
-#ifdef _AIX /* By soren@t.dk */
-#define _H_STRINGS
-#define _SYS_STREAM_H
-#define _AIX32_CURSES
-#define ulonglong2double(A) my_ulonglong2double(A)
-#define my_off_t2double(A) my_ulonglong2double(A)
-#ifdef __cplusplus
-extern "C" {
-#endif
-double my_ulonglong2double(unsigned long long A);
-#ifdef __cplusplus
-}
-#endif
-#endif /* _AIX */
-
#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
#undef HAVE_SNPRINTF
#endif
@@ -240,7 +222,7 @@ double my_ulonglong2double(unsigned long long A);
#endif
/* #define USE_some_charset 1 was deprecated by changes to configure */
-/* my_ctype my_to_upper, my_to_lower, my_sort_order gain theit right value */
+/* my_ctype my_to_upper, my_to_lower, my_sort_order gain their right value */
/* automagically during configuration */
/* Does the system remember a signal handler after a signal ? */
@@ -250,7 +232,7 @@ double my_ulonglong2double(unsigned long long A);
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
-#define LINT_INIT(var) var=0 /* No uninitialize-warning */
+#define LINT_INIT(var) do{var=0;}while(0) /* No uninitialize-warning */
#define LINT_INIT_STRUCT(var) memset(&var, 0, sizeof(var)) /* No uninitialize-warning */
#else
#define LINT_INIT(var)
@@ -268,14 +250,16 @@ double my_ulonglong2double(unsigned long long A);
#if defined(__EMX__) || !defined(HAVE_UINT)
typedef unsigned int uint;
+#endif
+#if defined(__EMX__) || !defined(HAVE_USHORT)
typedef unsigned short ushort;
#endif
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
-#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; }
+#define swap(t,a,b) do{register t dummy; dummy = a; a = b; b = dummy;}while(0)
#define test(a) ((a) ? 1 : 0)
-#define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); }
-#define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); }
+#define set_if_bigger(a,b) do{ if ((a) < (b)) (a)=(b); }while(0)
+#define set_if_smaller(a,b) do{ if ((a) > (b)) (a)=(b); }while(0)
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
@@ -440,11 +424,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
*/
#define MALLOC_OVERHEAD 8
/* get memory in huncs */
-#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD)
+#define ONCE_ALLOC_INIT ((uint) (4096-MALLOC_OVERHEAD))
/* Typical record cash */
-#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD)
+#define RECORD_CACHE_SIZE ((uint) (64*1024-MALLOC_OVERHEAD))
/* Typical key cash */
-#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD)
+#define KEY_CACHE_SIZE ((uint) (8*1024*1024-MALLOC_OVERHEAD))
/* Some things that this system doesn't have */
@@ -590,7 +574,7 @@ typedef long my_ptrdiff_t;
#define STDCALL
#endif
-/* Typdefs for easyier portability */
+/* Typedefs for easier portability */
#if defined(VOIDTYPE)
typedef void *gptr; /* Generic pointer */
@@ -598,8 +582,8 @@ typedef void *gptr; /* Generic pointer */
typedef char *gptr; /* Generic pointer */
#endif
#ifndef HAVE_INT_8_16_32
-typedef char int8; /* Signed integer >= 8 bits */
-typedef short int16; /* Signed integer >= 16 bits */
+typedef signed char int8; /* Signed integer >= 8 bits */
+typedef signed short int16; /* Signed integer >= 16 bits */
#endif
#ifndef HAVE_UCHAR
typedef unsigned char uchar; /* Short for unsigned char */
@@ -753,13 +737,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#endif /* L64 */
#endif /* _WIN32 */
/*
-** Define-funktions for reading and storing in machine independent format
+** Define functions for reading and storing in machine independent format
** (low byte first)
*/
/* Optimized store functions for Intel x86 */
#define int1store(T,A) *((int8*) (T)) = (A)
#define uint1korr(A) (*(((uint8*)(A))))
+#define sint1korr(A) (*(((int8*)(A))))
#if defined(__i386__) || defined(_WIN32)
#define sint2korr(A) (*((int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
@@ -800,9 +785,9 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define uint8korr(A) (*((ulonglong *) (A)))
#define sint8korr(A) (*((longlong *) (A)))
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
-#define int3store(T,A) do { *(T)= (uchar) ((A));\
- *(T+1)=(uchar) (((uint) (A) >> 8));\
- *(T+2)=(uchar) (((A) >> 16)); } while (0)
+#define int3store(T,A) do { *(T)= (uchar) ((A) & 0xff);\
+ *(T+1)=(uchar) (((uint) (A) >> 8) & 0xff);\
+ *(T+2)=(uchar) (((A) >> 16) & 0xff); } while (0)
#define int4store(T,A) *((long *) (T))= (long) (A)
#define int5store(T,A) do { *(T)= (uchar)((A));\
*((T)+1)=(uchar) (((A) >> 8));\
@@ -815,7 +800,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*((T)+3)=(uchar) (((A) >> 24)); \
*((T)+4)=(uchar) (((A) >> 32)); \
*((T)+5)=(uchar) (((A) >> 40)); } while(0)
-#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
+#define int8store(T,A) do {*((ulonglong *) (T))= (ulonglong) (A);} while(0)
typedef union {
double v;
@@ -973,7 +958,7 @@ do { doubleget_union _tmp; \
#define float8get(V,M) doubleget((V),(M))
#define float8store(V,M) doublestore((V),(M))
-#endif /* WORDS_BIGENDIAN */
+#endif /* HAVE_BIGENDIAN */
#endif /* __i386__ OR _WIN32 */
@@ -986,7 +971,7 @@ do { doubleget_union _tmp; \
(((uint32) ((uchar) (A)[1])) << 16) |\
(((uint32) ((uchar) (A)[0])) << 24))
/*
- Define-funktions for reading and storing in machine format from/to
+ Define functions for reading and storing in machine format from/to
short/long to/from some place in memory V should be a (not
register) variable, M is a pointer to byte
*/
@@ -1043,14 +1028,14 @@ do { doubleget_union _tmp; \
#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong))
#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong))
-#endif /* WORDS_BIGENDIAN */
+#endif /* HAVE_BIGENDIAN */
#ifndef THREAD
-#define thread_safe_increment(V,L) (V)++
-#define thread_safe_add(V,C,L) (V)+=(C)
-#define thread_safe_sub(V,C,L) (V)-=(C)
-#define statistic_increment(V,L) (V)++
-#define statistic_add(V,C,L) (V)+=(C)
+#define thread_safe_increment(V,L) ((V)++)
+#define thread_safe_add(V,C,L) ((V)+=(C))
+#define thread_safe_sub(V,C,L) ((V)-=(C))
+#define statistic_increment(V,L) ((V)++)
+#define statistic_add(V,C,L) ((V)+=(C))
#endif
#ifdef _WIN32
@@ -1069,9 +1054,9 @@ do { doubleget_union _tmp; \
#ifdef HAVE_DLOPEN
#ifdef _WIN32
-#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name)
+#define dlsym(lib, name) GetProcAddress((HMODULE)(lib), name)
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
-#define dlclose(lib) FreeLibrary((HMODULE)lib)
+#define dlclose(lib) FreeLibrary((HMODULE)(lib))
#elif defined(HAVE_DLFCN_H)
#include
#endif
diff --git a/include/mysql/ma_hashtbl.h b/include/mysql/ma_hashtbl.h
new file mode 100644
index 0000000..d095402
--- /dev/null
+++ b/include/mysql/ma_hashtbl.h
@@ -0,0 +1,70 @@
+/************************************************************************************
+ Copyright (C) 2000, 2012 MySQL AB & MySQL Finland AB & TCX DataKonsult AB,
+ Monty Program AB
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not see
+ or write to the Free Software Foundation, Inc.,
+ 51 Franklin St., Fifth Floor, Boston, MA 02110, USA
+
+ Part of this code includes code from the PHP project which
+ is freely available from http://www.php.net
+*************************************************************************************/
+
+#ifndef _ma_hashtbl_h
+#define _ma_hashtbl_h
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef uchar *(*hash_get_key)(const uchar *,uint*,my_bool);
+typedef void (*hash_free_key)(void *);
+
+ /* flags for hash_init */
+#define MA_HASHTBL_CASE_INSENSITIVE 1
+
+typedef struct st_hash_info {
+ uint next; /* index to next key */
+ uchar *data; /* data for current entry */
+} MA_HASHTBL_LINK;
+
+typedef struct st_hash {
+ uint key_offset,key_length; /* Length of key if const length */
+ uint records,blength,current_record;
+ uint flags;
+ DYNAMIC_ARRAY array; /* Place for hash_keys */
+ hash_get_key get_key;
+ void (*free)(void *);
+ uint (*calc_hashnr)(const uchar *key,uint length);
+} MA_HASHTBL;
+
+#define ma_hashtbl_init(A,B,C,D,E,F,G) _ma_hashtbl_init(A,B,C,D,E,F,G CALLER_INFO)
+my_bool _ma_hashtbl_init(MA_HASHTBL *hash,uint default_array_elements, uint key_offset,
+ uint key_length, hash_get_key get_key,
+ void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
+void ma_hashtbl_free(MA_HASHTBL *tree);
+uchar *ma_hashtbl_element(MA_HASHTBL *hash,uint idx);
+void * ma_hashtbl_search(MA_HASHTBL *info,const uchar *key,uint length);
+void * ma_hashtbl_next(MA_HASHTBL *info,const uchar *key,uint length);
+my_bool ma_hashtbl_insert(MA_HASHTBL *info,const uchar *data);
+my_bool ma_hashtbl_delete(MA_HASHTBL *hash,uchar *record);
+my_bool ma_hashtbl_update(MA_HASHTBL *hash,uchar *record,uchar *old_key,uint old_key_length);
+my_bool ma_hashtbl_check(MA_HASHTBL *hash); /* Only in debug library */
+
+#define ma_hashtbl_clear(H) memset((char*) (H), 0,sizeof(*(H)))
+#define ma_hashtbl_inited(H) ((H)->array.buffer != 0)
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/include/mysql/ma_list.h b/include/mysql/ma_list.h
index 549280d..ccd2bbd 100644
--- a/include/mysql/ma_list.h
+++ b/include/mysql/ma_list.h
@@ -39,7 +39,7 @@ extern int list_walk(LIST *list,list_walk_action action,char * argument);
#define list_rest(a) ((a)->next)
#define list_push(a,b) (a)=list_cons((b),(a))
-#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; ma_free((char *) old,MYF(MY_FAE)); }
+#define list_pop(A) do {LIST *old=(A); (A)=list_delete(old,old) ; ma_free((char *) old,MYF(MY_FAE)); } while(0)
#ifdef __cplusplus
}
diff --git a/include/mysql/ma_priv.h b/include/mysql/ma_priv.h
index 1ab8311..0fefd52 100644
--- a/include/mysql/ma_priv.h
+++ b/include/mysql/ma_priv.h
@@ -39,6 +39,13 @@ static inline uint ma_extended_type_info_rows(const MYSQL *mysql)
return ma_has_extended_type_info(mysql) ? 1 : 0;
}
+static inline my_bool ma_supports_cache_metadata(const MYSQL *mysql)
+{
+ return (mysql->extension->mariadb_server_capabilities &
+ (MARIADB_CLIENT_CACHE_METADATA >> 32)) != 0 ;
+}
+
+
static inline uint ma_result_set_rows(const MYSQL *mysql)
{
return ma_has_extended_type_info(mysql) ? 9 : 8;
@@ -47,4 +54,17 @@ static inline uint ma_result_set_rows(const MYSQL *mysql)
MA_FIELD_EXTENSION *ma_field_extension_deep_dup(MA_MEM_ROOT *memroot,
const MA_FIELD_EXTENSION *from);
+MYSQL_FIELD *ma_duplicate_resultset_metadata(MYSQL_FIELD *fields, size_t count,
+ MA_MEM_ROOT *memroot);
+
+extern void ma_save_session_track_info(void *ptr, enum enum_mariadb_status_info type, ...);
+
+#define ma_status_callback(mysql, last_status)\
+ if ((mysql)->server_status != last_status && \
+ (mysql)->options.extension->status_callback != ma_save_session_track_info)\
+ {\
+ (mysql)->options.extension->status_callback((mysql)->options.extension->status_data,\
+ STATUS_TYPE, (mysql)->server_status);\
+ }
+
#endif
diff --git a/include/mysql/ma_pvio.h b/include/mysql/ma_pvio.h
index 7e300fe..752ea03 100644
--- a/include/mysql/ma_pvio.h
+++ b/include/mysql/ma_pvio.h
@@ -8,6 +8,12 @@
#define MARIADB_TLS void
#endif
+/* CONC-492: Allow to build plugins outside of MariaDB Connector/C
+ source tree wnen ma_global.h was not included. */
+#if !defined(_global_h) && !defined(MY_GLOBAL_INCLUDED)
+typedef unsigned char uchar;
+#endif
+
#define PVIO_SET_ERROR if (pvio->set_error) \
pvio->set_error
@@ -78,6 +84,8 @@ struct st_ma_pvio {
PVIO_METHODS *methods;
void (*set_error)(MYSQL *mysql, unsigned int error_nr, const char *sqlstate, const char *format, ...);
void (*callback)(MARIADB_PVIO *pvio, my_bool is_read, const uchar *buffer, size_t length);
+ size_t bytes_read;
+ size_t bytes_sent;
};
typedef struct st_ma_pvio_cinfo
diff --git a/include/mysql/ma_sys.h b/include/mysql/ma_sys.h
index 45654b3..9b6cd00 100644
--- a/include/mysql/ma_sys.h
+++ b/include/mysql/ma_sys.h
@@ -35,9 +35,21 @@ typedef struct my_aio_result {
#include
-#define MYSYS_PROGRAM_USES_CURSES() { ma_error_handler_hook = ma_message_curses; mysys_uses_curses=1; }
-#define MYSYS_PROGRAM_DONT_USE_CURSES() { ma_error_handler_hook = ma_message_no_curses; mysys_uses_curses=0;}
-#define MY_INIT(name); { ma_progname= name; ma_init(); }
+#define MYSYS_PROGRAM_USES_CURSES() \
+do {\
+ ma_error_handler_hook = ma_message_curses;\
+ mysys_uses_curses=1;\
+} while(0)
+#define MYSYS_PROGRAM_DONT_USE_CURSES() \
+do {\
+ ma_error_handler_hook = ma_message_no_curses; \
+ mysys_uses_curses=0; \
+} while(0)
+#define MY_INIT(name) \
+do {\
+ ma_progname= name;\
+ ma_init();\
+} while(0)
#define MAXMAPS (4) /* Number of error message maps */
#define ERRMOD (1000) /* Max number of errors in a map */
@@ -100,7 +112,7 @@ typedef struct my_aio_result {
/* Some constants */
#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */
#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */
-#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */
+#define MIN_COMPRESS_LENGTH 150 /* Don't compress small bl. */
#define KEYCACHE_BLOCK_SIZE 1024
/* root_alloc flags */
@@ -134,22 +146,6 @@ typedef struct my_aio_result {
#define my_afree(PTR) ma_free(PTR)
#endif /* HAVE_ALLOCA */
-#ifdef MSDOS
-#ifdef __ZTC__
-void * __CDECL halloc(long count,size_t length);
-void __CDECL hfree(void *ptr);
-#endif
-#if defined(USE_HALLOC)
-#if defined(_VCM_) || defined(M_IC80386)
-#undef USE_HALLOC
-#endif
-#endif
-#ifdef USE_HALLOC
-#define malloc(a) halloc((long) (a),1)
-#define free(a) hfree(a)
-#endif
-#endif /* MSDOS */
-
#ifndef errno
#ifdef HAVE_ERRNO_AS_DEFINE
#include /* errno is a define */
@@ -213,7 +209,7 @@ extern char *defaults_extra_file;
typedef struct wild_file_pack /* Struct to hold info when selecting files */
{
uint wilds; /* How many wildcards */
- uint not_pos; /* Start of not-theese-files */
+ uint not_pos; /* Start of not-these-files */
my_string *wild; /* Pointer to wildcards */
} WF_PACK;
@@ -285,15 +281,15 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
/* defines for mf_iocache */
/* Test if buffer is inited */
-#define my_b_clear(info) (info)->buffer=0
-#define my_b_inited(info) (info)->buffer
+#define my_b_clear(info) do{(info)->buffer= 0;} while (0)
+#define my_b_inited(info) ((info)->buffer)
#define my_b_EOF INT_MIN
#define my_b_read(info,Buffer,Count) \
((info)->rc_pos + (Count) <= (info)->rc_end ?\
- (memcpy(Buffer,(info)->rc_pos,(size_t) (Count)), \
+ (memcpy((Buffer),(info)->rc_pos,(size_t) (Count)), \
((info)->rc_pos+=(Count)),0) :\
- (*(info)->read_function)((info),Buffer,Count))
+ (*(info)->read_function)((info),(Buffer),(Count)))
#define my_b_get(info) \
((info)->rc_pos != (info)->rc_end ?\
@@ -302,18 +298,18 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
#define my_b_write(info,Buffer,Count) \
((info)->rc_pos + (Count) <= (info)->rc_end ?\
- (memcpy((info)->rc_pos,Buffer,(size_t) (Count)), \
+ (memcpy((info)->rc_pos,(Buffer),(size_t) (Count)), \
((info)->rc_pos+=(Count)),0) :\
- _my_b_write(info,Buffer,Count))
+ _my_b_write((info),(Buffer),(Count)))
/* my_b_write_byte doesn't have any err-check */
#define my_b_write_byte(info,chr) \
(((info)->rc_pos < (info)->rc_end) ?\
((*(info)->rc_pos++)=(chr)) :\
- (_my_b_write(info,0,0) , ((*(info)->rc_pos++)=(chr))))
+ (_my_b_write((info),0,0) , ((*(info)->rc_pos++)=(chr))))
#define my_b_fill_cache(info) \
- (((info)->rc_end=(info)->rc_pos),(*(info)->read_function)(info,0,0))
+ (((info)->rc_end=(info)->rc_pos),(*(info)->read_function)((info),0,0))
#define my_b_tell(info) ((info)->pos_in_file + \
((info)->rc_pos - (info)->rc_request_pos))
@@ -401,7 +397,7 @@ extern void casedn_str(my_string str);
extern void case_sort(my_string str,uint length);
extern uint ma_dirname_part(my_string to,const char *name);
extern uint ma_dirname_length(const char *name);
-#define base_name(A) (A+dirname_length(A))
+#define base_name(A) ((A)+dirname_length(A))
extern int test_if_hard_path(const char *dir_name);
extern char *ma_convert_dirname(my_string name);
extern void to_unix_path(my_string name);
@@ -531,9 +527,6 @@ char *ma_strdup_root(MA_MEM_ROOT *root,const char *str);
char *ma_memdup_root(MA_MEM_ROOT *root,const char *str, size_t len);
void ma_free_defaults(char **argv);
void ma_print_defaults(const char *conf_file, const char **groups);
-my_bool _mariadb_compress(unsigned char *, size_t *, size_t *);
-my_bool _mariadb_uncompress(unsigned char *, size_t *, size_t *);
-unsigned char *_mariadb_compress_alloc(const unsigned char *packet, size_t *len, size_t *complen);
ulong checksum(const unsigned char *mem, uint count);
#if defined(_MSC_VER) && !defined(_WIN32)
diff --git a/include/mysql/ma_tls.h b/include/mysql/ma_tls.h
index 9ce49e7..ec8bc23 100644
--- a/include/mysql/ma_tls.h
+++ b/include/mysql/ma_tls.h
@@ -145,6 +145,7 @@ unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int f
int ma_tls_get_protocol_version(MARIADB_TLS *ctls);
const char *ma_pvio_tls_get_protocol_version(MARIADB_TLS *ctls);
int ma_pvio_tls_get_protocol_version_id(MARIADB_TLS *ctls);
+void ma_tls_set_connection(MYSQL *mysql);
/* Function prototypes */
MARIADB_TLS *ma_pvio_tls_init(MYSQL *mysql);
@@ -156,6 +157,7 @@ int ma_pvio_tls_verify_server_cert(MARIADB_TLS *ctls);
const char *ma_pvio_tls_cipher(MARIADB_TLS *ctls);
my_bool ma_pvio_tls_check_fp(MARIADB_TLS *ctls, const char *fp, const char *fp_list);
my_bool ma_pvio_start_ssl(MARIADB_PVIO *pvio);
+void ma_pvio_tls_set_connection(MYSQL *mysql);
void ma_pvio_tls_end();
#endif /* _ma_tls_h_ */
diff --git a/include/mysql/mariadb_async.h b/include/mysql/mariadb_async.h
index cd5385b..d5c13b2 100644
--- a/include/mysql/mariadb_async.h
+++ b/include/mysql/mariadb_async.h
@@ -1,8 +1,10 @@
/* Copyright (C) 2012 MariaDB Services and Kristian Nielsen
+ 2015,2020 MariaDB Corporation AB
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
+ This file is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/include/mysql/mariadb_com.h b/include/mysql/mariadb_com.h
index c63e5b0..67461b4 100644
--- a/include/mysql/mariadb_com.h
+++ b/include/mysql/mariadb_com.h
@@ -31,10 +31,10 @@
#define NAME_CHAR_LEN 64
#define NAME_LEN 256 /* Field/table name length */
-#define HOSTNAME_LENGTH 60
+#define HOSTNAME_LENGTH 255
#define SYSTEM_MB_MAX_CHAR_LENGTH 4
#define USERNAME_CHAR_LENGTH 128
-#define USERNAME_LENGTH USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH
+#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH)
#define SERVER_VERSION_LENGTH 60
#define SQLSTATE_LENGTH 5
#define SCRAMBLE_LENGTH 20
@@ -94,7 +94,7 @@ enum enum_server_command
COM_UNSUPPORTED= 30,
COM_RESET_CONNECTION = 31,
COM_STMT_BULK_EXECUTE = 250,
- COM_MULTI = 254,
+ COM_RESERVED_1 = 254, /* former COM_MULTI, now removed */
COM_END
};
@@ -158,28 +158,33 @@ enum enum_server_command
#define CLIENT_PS_MULTI_RESULTS (1UL << 18)
#define CLIENT_PLUGIN_AUTH (1UL << 19)
#define CLIENT_CONNECT_ATTRS (1UL << 20)
+#define CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA (1UL << 21)
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22)
#define CLIENT_SESSION_TRACKING (1UL << 23)
+#define CLIENT_ZSTD_COMPRESSION (1UL << 26)
#define CLIENT_PROGRESS (1UL << 29) /* client supports progress indicator */
#define CLIENT_PROGRESS_OBSOLETE CLIENT_PROGRESS
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
+#define CLIENT_SSL_VERIFY_SERVER_CERT_OBSOLETE CLIENT_SSL_VERIFY_SERVER_CERT
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
/* MariaDB specific capabilities */
#define MARIADB_CLIENT_FLAGS 0xFFFFFFFF00000000ULL
#define MARIADB_CLIENT_PROGRESS (1ULL << 32)
-#define MARIADB_CLIENT_COM_MULTI (1ULL << 33)
+#define MARIADB_CLIENT_RESERVED_1 (1ULL << 33) /* Former COM_MULTI, don't use */
#define MARIADB_CLIENT_STMT_BULK_OPERATIONS (1ULL << 34)
/* support of extended data type/format information, since 10.5.0 */
#define MARIADB_CLIENT_EXTENDED_METADATA (1ULL << 35)
+/* Do not resend metadata for prepared statements, since 10.6*/
+#define MARIADB_CLIENT_CACHE_METADATA (1ULL << 36)
#define IS_MARIADB_EXTENDED_SERVER(mysql)\
- !(mysql->server_capabilities & CLIENT_MYSQL)
+ (!(mysql->server_capabilities & CLIENT_MYSQL))
#define MARIADB_CLIENT_SUPPORTED_FLAGS (MARIADB_CLIENT_PROGRESS |\
- MARIADB_CLIENT_COM_MULTI |\
MARIADB_CLIENT_STMT_BULK_OPERATIONS|\
- MARIADB_CLIENT_EXTENDED_METADATA)
+ MARIADB_CLIENT_EXTENDED_METADATA|\
+ MARIADB_CLIENT_CACHE_METADATA)
#define CLIENT_SUPPORTED_FLAGS (CLIENT_MYSQL |\
CLIENT_FOUND_ROWS |\
@@ -205,8 +210,7 @@ enum enum_server_command
CLIENT_PLUGIN_AUTH |\
CLIENT_SESSION_TRACKING |\
CLIENT_CONNECT_ATTRS)
-
-#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \
+#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \
CLIENT_LONG_FLAG |\
CLIENT_TRANSACTIONS |\
CLIENT_SECURE_CONNECTION |\
@@ -214,6 +218,7 @@ enum enum_server_command
CLIENT_PS_MULTI_RESULTS |\
CLIENT_PROTOCOL_41 |\
CLIENT_PLUGIN_AUTH |\
+ CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
CLIENT_SESSION_TRACKING |\
CLIENT_CONNECT_ATTRS)
@@ -239,7 +244,7 @@ enum enum_server_command
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
#define NET_WRITE_TIMEOUT 60 /* Timeout on write */
-#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */
+#define NET_WAIT_TIMEOUT (8*60*60) /* Wait for new query */
/* for server integration (mysqlbinlog) */
#define LIST_PROCESS_HOST_LEN 64
@@ -302,6 +307,13 @@ enum enum_mysql_set_option
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
+/* for status callback function */
+enum enum_mariadb_status_info
+{
+ STATUS_TYPE= 0,
+ SESSION_TRACK_TYPE
+};
+
enum enum_session_state_type
{
SESSION_TRACK_SYSTEM_VARIABLES= 0,
@@ -310,13 +322,19 @@ enum enum_session_state_type
/* currently not supported by MariaDB Server */
SESSION_TRACK_GTIDS,
SESSION_TRACK_TRANSACTION_CHARACTERISTICS,
- SESSION_TRACK_TRANSACTION_TYPE /* make sure that SESSION_TRACK_END always points
+ SESSION_TRACK_TRANSACTION_STATE /* make sure that SESSION_TRACK_END always points
to last element of enum !! */
};
#define SESSION_TRACK_BEGIN 0
-#define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_TYPE
-#define SESSION_TRACK_TYPES SESSION_TRACK_END + 1
+#define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_STATE
+#define SESSION_TRACK_TYPES (SESSION_TRACK_END + 1)
+
+/* SESSION_TRACK_TRANSACTION_TYPE was renamed to SESSION_TRACK_TRANSACTION_STATE
+ in 3e699a1738cdfb0a2c5b8eabfa8301b8d11cf711.
+ This is a workaround to prevent breaking of travis and buildbot tests.
+ TODO: Remove this after server fixes */
+#define SESSION_TRACK_TRANSACTION_TYPE SESSION_TRACK_TRANSACTION_STATE
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
diff --git a/include/mysql/mariadb_ctype.h b/include/mysql/mariadb_ctype.h
index bc65fcd..3b218c3 100644
--- a/include/mysql/mariadb_ctype.h
+++ b/include/mysql/mariadb_ctype.h
@@ -16,7 +16,7 @@
MA 02111-1301, USA */
/*
- A better inplementation of the UNIX ctype(3) library.
+ A better implementation of the UNIX ctype(3) library.
Notes: my_global.h should be included before ctype.h
*/
diff --git a/include/mysql/mariadb_dyncol.h b/include/mysql/mariadb_dyncol.h
index a6084fd..6500907 100644
--- a/include/mysql/mariadb_dyncol.h
+++ b/include/mysql/mariadb_dyncol.h
@@ -1,5 +1,6 @@
/* Copyright (c) 2011, Monty Program Ab
Copyright (c) 2011, Oleksandr Byelkin
+ Copyright (c) 2012, 2022 MariaDB Corporation AB
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -81,7 +82,7 @@ enum enum_dyncol_func_result
ER_DYNCOL_YES= 1, /* For functions returning 0/1 */
ER_DYNCOL_FORMAT= -1, /* Wrong format of the encoded string */
ER_DYNCOL_LIMIT= -2, /* Some limit reached */
- ER_DYNCOL_RESOURCE= -3, /* Out of resourses */
+ ER_DYNCOL_RESOURCE= -3, /* Out of resources */
ER_DYNCOL_DATA= -4, /* Incorrect input data */
ER_DYNCOL_UNKNOWN_CHARSET= -5, /* Unknown character set */
ER_DYNCOL_TRUNCATED= 2 /* OK, but data was truncated */
@@ -242,7 +243,10 @@ int mariadb_dyncol_column_cmp_named(const MYSQL_LEX_STRING *s1,
enum enum_dyncol_func_result
mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count);
-#define mariadb_dyncol_value_init(V) (V)->type= DYN_COL_NULL
+#define mariadb_dyncol_value_init(V) \
+do {\
+ (V)->type= DYN_COL_NULL;\
+} while(0)
/*
Prepare value for using as decimal
diff --git a/include/mysql/mariadb_rpl.h b/include/mysql/mariadb_rpl.h
index 315543f..ea0ca4d 100644
--- a/include/mysql/mariadb_rpl.h
+++ b/include/mysql/mariadb_rpl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018 MariaDB Corporation AB
+/* Copyright (C) 2018-2022 MariaDB Corporation AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -22,9 +22,13 @@ extern "C" {
#endif
#include
+#include
-#define MARIADB_RPL_VERSION 0x0001
-#define MARIADB_RPL_REQUIRED_VERSION 0x0001
+#define MARIADB_RPL_VERSION 0x0002
+#define MARIADB_RPL_REQUIRED_VERSION 0x0002
+
+#define RPL_BINLOG_MAGIC (const uchar*) "\xFE\x62\x69\x6E"
+#define RPL_BINLOG_MAGIC_SIZE 4
/* Protocol flags */
#define MARIADB_RPL_BINLOG_DUMP_NON_BLOCK 1
@@ -33,11 +37,41 @@ extern "C" {
#define EVENT_HEADER_OFS 20
-#define FL_GROUP_COMMIT_ID 2
#define FL_STMT_END 1
-#define LOG_EVENT_ARTIFICIAL_F 0x20
+/* GTID flags */
+
+/* FL_STANDALONE is set in case there is no terminating COMMIT event. */
+#define FL_STANDALONE 0x01
+
+/* FL_GROUP_COMMIT_ID is set when event group is part of a group commit */
+#define FL_GROUP_COMMIT_ID 0x02
+
+/* FL_TRANSACTIONAL is set for an event group that can be safely rolled back
+ (no MyISAM, eg.).
+ */
+#define FL_TRANSACTIONAL 0x04
+ /*
+ FL_ALLOW_PARALLEL reflects the (negation of the) value of
+ @@SESSION.skip_parallel_replication at the time of commit.
+ */
+#define FL_ALLOW_PARALLEL 0x08;
+ /*
+ FL_WAITED is set if a row lock wait (or other wait) is detected during the
+ execution of the transaction.
+ */
+#define FL_WAITED 0x10
+ /* FL_DDL is set for event group containing DDL. */
+#define FL_DDL 0x20
+ /* FL_PREPARED_XA is set for XA transaction. */
+#define FL_PREPARED_XA 0x40
+ /* FL_"COMMITTED or ROLLED-BACK"_XA is set for XA transaction. */
+#define FL_COMPLETED_XA 0x80
+
+/* SEMI SYNCHRONOUS REPLICATION */
+#define SEMI_SYNC_INDICATOR 0xEF
+#define SEMI_SYNC_ACK_REQ 0x01
/* Options */
enum mariadb_rpl_option {
@@ -47,7 +81,13 @@ enum mariadb_rpl_option {
MARIADB_RPL_FLAGS, /* Protocol flags */
MARIADB_RPL_GTID_CALLBACK, /* GTID callback function */
MARIADB_RPL_GTID_DATA, /* GTID data */
- MARIADB_RPL_BUFFER
+ MARIADB_RPL_BUFFER,
+ MARIADB_RPL_VERIFY_CHECKSUM,
+ MARIADB_RPL_UNCOMPRESS,
+ MARIADB_RPL_HOST,
+ MARIADB_RPL_PORT,
+ MARIADB_RPL_EXTRACT_VALUES,
+ MARIADB_RPL_SEMI_SYNC,
};
/* Event types: From MariaDB Server sql/log_event.h */
@@ -93,13 +133,14 @@ enum mariadb_rpl_event {
TRANSACTION_CONTEXT_EVENT= 36,
VIEW_CHANGE_EVENT= 37,
XA_PREPARE_LOG_EVENT= 38,
+ PARTIAL_UPDATE_ROWS_EVENT = 39,
/*
Add new events here - right above this comment!
Existing events (except ENUM_END_EVENT) should never change their numbers
*/
- /* New MySQL/Sun events are to be added right above this comment */
+ /* New MySQL events are to be added right above this comment */
MYSQL_EVENTS_END,
MARIA_EVENTS_BEGIN= 160,
@@ -121,6 +162,143 @@ enum mariadb_rpl_event {
ENUM_END_EVENT /* end marker */
};
+/* ROWS_EVENT flags */
+
+#define STMT_END_F 0x01
+#define NO_FOREIGN_KEY_CHECKS_F 0x02
+#define RELAXED_UNIQUE_KEY_CHECKS_F 0x04
+#define COMPLETE_ROWS_F 0x08
+#define NO_CHECK_CONSTRAINT_CHECKS_F 0x80
+
+
+enum mariadb_rpl_status_code {
+ Q_FLAGS2_CODE= 0x00,
+ Q_SQL_MODE_CODE= 0x01,
+ Q_CATALOG_CODE= 0x02,
+ Q_AUTO_INCREMENT_CODE= 0x03,
+ Q_CHARSET_CODE= 0x04,
+ Q_TIMEZONE_CODE= 0x05,
+ Q_CATALOG_NZ_CODE= 0x06,
+ Q_LC_TIME_NAMES_CODE= 0x07,
+ Q_CHARSET_DATABASE_CODE= 0x08,
+ Q_TABLE_MAP_FOR_UPDATE_CODE= 0x09,
+ Q_MASTER_DATA_WRITTEN_CODE= 0x0A,
+ Q_INVOKERS_CODE= 0x0B,
+ Q_UPDATED_DB_NAMES_CODE= 0x0C,
+ Q_MICROSECONDS_CODE= 0x0D,
+ Q_COMMIT_TS_CODE= 0x0E, /* unused */
+ Q_COMMIT_TS2_CODE= 0x0F, /* unused */
+ Q_EXPLICIT_DEFAULTS_FOR_TIMESTAMP_CODE= 0x10,
+ Q_DDL_LOGGED_WITH_XID_CODE= 0x11,
+ Q_DEFAULT_COLLATION_FOR_UTF8_CODE= 0x12,
+ Q_SQL_REQUIRE_PRIMARY_KEY_CODE= 0x13,
+ Q_DEFAULT_TABLE_ENCRYPTION_CODE= 0x14,
+ Q_HRNOW= 128, /* second part: 3 bytes */
+ Q_XID= 129 /* xid: 8 bytes */
+};
+
+#ifdef DEFAULT_CHARSET
+#undef DEFAULT_CHARSET
+#endif
+
+enum opt_metadata_field_type
+{
+ SIGNEDNESS = 1,
+ DEFAULT_CHARSET,
+ COLUMN_CHARSET,
+ COLUMN_NAME,
+ SET_STR_VALUE,
+ ENUM_STR_VALUE,
+ GEOMETRY_TYPE,
+ SIMPLE_PRIMARY_KEY,
+ PRIMARY_KEY_WITH_PREFIX,
+ ENUM_AND_SET_DEFAULT_CHARSET,
+ ENUM_AND_SET_COLUMN_CHARSET
+};
+
+/* QFLAGS2 codes */
+#define OPTION_AUTO_IS_NULL 0x00040000
+#define OPTION_NOT_AUTOCOMMIT 0x00080000
+#define OPTION_NO_FOREIGN_KEY_CHECKS 0x04000000
+#define OPTION_RELAXED_UNIQUE_CHECKS 0x08000000
+
+/* SQL modes */
+#define MODE_REAL_AS_FLOAT 0x00000001
+#define MODE_PIPES_AS_CONCAT 0x00000002
+#define MODE_ANSI_QUOTES 0x00000004
+#define MODE_IGNORE_SPACE 0x00000008
+#define MODE_NOT_USED 0x00000010
+#define MODE_ONLY_FULL_GROUP_BY 0x00000020
+#define MODE_NO_UNSIGNED_SUBTRACTION 0x00000040
+#define MODE_NO_DIR_IN_CREATE 0x00000080
+#define MODE_POSTGRESQL 0x00000100
+#define MODE_ORACLE 0x00000200
+#define MODE_MSSQL 0x00000400
+#define MODE_DB2 0x00000800
+#define MODE_MAXDB 0x00001000
+#define MODE_NO_KEY_OPTIONS 0x00002000
+#define MODE_NO_TABLE_OPTIONS 0x00004000
+#define MODE_NO_FIELD_OPTIONS 0x00008000
+#define MODE_MYSQL323 0x00010000
+#define MODE_MYSQL40 0x00020000
+#define MODE_ANSI 0x00040000
+#define MODE_NO_AUTO_VALUE_ON_ZERO 0x00080000
+#define MODE_NO_BACKSLASH_ESCAPES 0x00100000
+#define MODE_STRICT_TRANS_TABLES 0x00200000
+#define MODE_STRICT_ALL_TABLES 0x00400000
+#define MODE_NO_ZERO_IN_DATE 0x00800000
+#define MODE_NO_ZERO_DATE 0x01000000
+#define MODE_INVALID_DATES 0x02000000
+#define MODE_ERROR_FOR_DIVISION_BY_ZERO 0x04000000
+#define MODE_TRADITIONAL 0x08000000
+#define MODE_NO_AUTO_CREATE_USER 0x10000000
+#define MODE_HIGH_NOT_PRECEDENCE 0x20000000
+#define MODE_NO_ENGINE_SUBSTITUTION 0x40000000
+#define MODE_PAD_CHAR_TO_FULL_LENGTH 0x80000000
+
+/* Log Event flags */
+
+/* used in FOMRAT_DESCRIPTION_EVENT. Indicates if it
+ is the active binary log.
+ Note: When reading data via COM_BINLOG_DUMP this
+ flag is never set.
+*/
+#define LOG_EVENT_BINLOG_IN_USE_F 0x0001
+
+/* Looks like this flag is no longer in use */
+#define LOG_EVENT_FORCED_ROTATE_F 0x0002
+
+/* Log entry depends on thread, e.g. when using user variables
+ or temporary tables */
+#define LOG_EVENT_THREAD_SPECIFIC_F 0x0004
+
+/* Indicates that the USE command can be suppressed before
+ executing a statement: e.g. DRIP SCHEMA */
+#define LOG_EVENT_SUPPRESS_USE_F 0x0008
+
+/* ??? */
+#define LOG_EVENT_UPDATE_TABLE_MAP_F 0x0010
+
+/* Artifical event */
+#define LOG_EVENT_ARTIFICIAL_F 0x0020
+
+/* ??? */
+#define LOG_EVENT_RELAY_LOG_F 0x0040
+
+/* If an event is not supported, and LOG_EVENT_IGNORABLE_F was not
+ set, an error will be reported. */
+#define LOG_EVENT_IGNORABLE_F 0x0080
+
+/* ??? */
+#define LOG_EVENT_NO_FILTER_F 0x0100
+
+/* ?? */
+#define LOG_EVENT_MTS_ISOLATE_F 0x0200
+
+/* if session variable @@skip_repliation was set, this flag will be
+ reported for events which should be skipped. */
+#define LOG_EVENT_SKIP_REPLICATION_F 0x8000
+
typedef struct {
char *str;
size_t length;
@@ -139,20 +317,52 @@ typedef struct st_mariadb_gtid {
unsigned long long sequence_nr;
} MARIADB_GTID;
+
/* Generic replication handle */
typedef struct st_mariadb_rpl {
unsigned int version;
MYSQL *mysql;
char *filename;
uint32_t filename_length;
- unsigned char *buffer;
- unsigned long buffer_size;
uint32_t server_id;
unsigned long start_position;
- uint32_t flags;
+ uint16_t flags;
uint8_t fd_header_len; /* header len from last format description event */
uint8_t use_checksum;
-} MARIADB_RPL;
+ uint8_t artificial_checksum;
+ uint8_t verify_checksum;
+ uint8_t post_header_len[ENUM_END_EVENT];
+ MA_FILE *fp;
+ uint32_t error_no;
+ char error_msg[MYSQL_ERRMSG_SIZE];
+ uint8_t uncompress;
+ char *host;
+ uint32_t port;
+ uint8_t extract_values;
+ char nonce[12];
+ uint8_t encrypted;
+ uint8_t is_semi_sync;
+}MARIADB_RPL;
+
+typedef struct st_mariadb_rpl_value {
+ enum enum_field_types field_type;
+ uint8_t is_null;
+ uint8_t is_signed;
+ union {
+ int64_t ll;
+ uint64_t ull;
+ float f;
+ double d;
+ MYSQL_TIME tm;
+ MARIADB_STRING str;
+ } val;
+} MARIADB_RPL_VALUE;
+
+typedef struct st_rpl_mariadb_row {
+ uint32_t column_count;
+ MARIADB_RPL_VALUE *columns;
+ struct st_rpl_mariadb_row *next;
+} MARIADB_RPL_ROW;
/* Event header */
struct st_mariadb_rpl_rotate_event {
@@ -169,6 +379,10 @@ struct st_mariadb_rpl_query_event {
MARIADB_STRING statement;
};
+struct st_mariadb_rpl_previous_gtid_event {
+ MARIADB_CONST_DATA content;
+};
+
struct st_mariadb_rpl_gtid_list_event {
uint32_t gtid_cnt;
MARIADB_GTID *gtid;
@@ -180,6 +394,7 @@ struct st_mariadb_rpl_format_description_event
char *server_version;
uint32_t timestamp;
uint8_t header_len;
+ MARIADB_STRING post_header_lengths;
};
struct st_mariadb_rpl_checkpoint_event {
@@ -195,6 +410,10 @@ struct st_mariadb_rpl_gtid_event {
uint32_t domain_id;
uint8_t flags;
uint64_t commit_id;
+ uint32_t format_id;
+ uint8_t gtrid_len;
+ uint8_t bqual_len;
+ MARIADB_STRING xid;
};
struct st_mariadb_rpl_annotate_rows_event {
@@ -205,10 +424,21 @@ struct st_mariadb_rpl_table_map_event {
unsigned long long table_id;
MARIADB_STRING database;
MARIADB_STRING table;
- unsigned int column_count;
+ uint32_t column_count;
MARIADB_STRING column_types;
MARIADB_STRING metadata;
- char *null_indicator;
+ unsigned char *null_indicator;
+ unsigned char *signed_indicator;
+ MARIADB_CONST_DATA column_names;
+ MARIADB_CONST_DATA geometry_types;
+ uint32_t default_charset;
+ MARIADB_CONST_DATA column_charsets;
+ MARIADB_CONST_DATA simple_primary_keys;
+ MARIADB_CONST_DATA prefixed_primary_keys;
+ MARIADB_CONST_DATA set_values;
+ MARIADB_CONST_DATA enum_values;
+ uint8_t enum_set_default_charset;
+ MARIADB_CONST_DATA enum_set_column_charsets;
};
struct st_mariadb_rpl_rand_event {
@@ -216,15 +446,33 @@ struct st_mariadb_rpl_rand_event {
unsigned long long second_seed;
};
-struct st_mariadb_rpl_encryption_event {
- char scheme;
- unsigned int key_version;
- char *nonce;
-};
-
struct st_mariadb_rpl_intvar_event {
- char type;
unsigned long long value;
+ uint8_t type;
+};
+
+struct st_mariadb_begin_load_query_event {
+ uint32_t file_id;
+ unsigned char *data;
+};
+
+struct st_mariadb_start_encryption_event {
+ uint8_t scheme;
+ uint32_t key_version;
+ char nonce[12];
+};
+
+struct st_mariadb_execute_load_query_event {
+ uint32_t thread_id;
+ uint32_t execution_time;
+ MARIADB_STRING schema;
+ uint16_t error_code;
+ uint32_t file_id;
+ uint32_t ofs1;
+ uint32_t ofs2;
+ uint8_t duplicate_flag;
+ MARIADB_STRING status_vars;
+ MARIADB_STRING statement;
};
struct st_mariadb_rpl_uservar_event {
@@ -241,10 +489,15 @@ struct st_mariadb_rpl_rows_event {
uint64_t table_id;
uint16_t flags;
uint32_t column_count;
- char *column_bitmap;
- char *column_update_bitmap;
+ unsigned char *column_bitmap;
+ unsigned char *column_update_bitmap;
+ unsigned char *null_bitmap;
size_t row_data_size;
void *row_data;
+ size_t extra_data_size;
+ void *extra_data;
+ uint8_t compressed;
+ uint32_t row_count;
};
struct st_mariadb_rpl_heartbeat_event {
@@ -254,10 +507,27 @@ struct st_mariadb_rpl_heartbeat_event {
uint16_t flags;
};
+struct st_mariadb_rpl_xa_prepare_log_event {
+ uint8_t one_phase;
+ uint32_t format_id;
+ uint32_t gtrid_len;
+ uint32_t bqual_len;
+ MARIADB_STRING xid;
+};
+
+struct st_mariadb_gtid_log_event {
+ uint8_t commit_flag;
+ char source_id[16];
+ uint64_t sequence_nr;
+};
+
typedef struct st_mariadb_rpl_event
{
/* common header */
MA_MEM_ROOT memroot;
+ unsigned char *raw_data;
+ size_t raw_data_size;
+ size_t raw_data_ofs;
unsigned int checksum;
char ok;
enum mariadb_rpl_event event_type;
@@ -278,27 +548,105 @@ typedef struct st_mariadb_rpl_event
struct st_mariadb_rpl_annotate_rows_event annotate_rows;
struct st_mariadb_rpl_table_map_event table_map;
struct st_mariadb_rpl_rand_event rand;
- struct st_mariadb_rpl_encryption_event encryption;
struct st_mariadb_rpl_intvar_event intvar;
struct st_mariadb_rpl_uservar_event uservar;
struct st_mariadb_rpl_rows_event rows;
struct st_mariadb_rpl_heartbeat_event heartbeat;
+ struct st_mariadb_rpl_xa_prepare_log_event xa_prepare_log;
+ struct st_mariadb_begin_load_query_event begin_load_query;
+ struct st_mariadb_execute_load_query_event execute_load_query;
+ struct st_mariadb_gtid_log_event gtid_log;
+ struct st_mariadb_start_encryption_event start_encryption;
+ struct st_mariadb_rpl_previous_gtid_event previous_gtid;
} event;
+ /* Added in C/C 3.3.0 */
+ uint8_t is_semi_sync;
+ uint8_t semi_sync_flags;
+ /* Added in C/C 3.3.5 */
+ MARIADB_RPL *rpl;
} MARIADB_RPL_EVENT;
+/* compression uses myisampack format */
+#define myisam_uint1korr(B) ((uint8_t)(*B))
+#define myisam_sint1korr(B) ((int8_t)(*B))
+#define myisam_uint2korr(B)\
+((uint16_t)(((uint16_t)(((const uchar*)(B))[1])) | ((uint16_t) (((const uchar*) (B))[0]) << 8)))
+#define myisam_sint2korr(B)\
+((int16_t)(((int16_t)(((const uchar*)(B))[1])) | ((int16_t) (((const uchar*) (B))[0]) << 8)))
+#define myisam_uint3korr(B)\
+((uint32_t)(((uint32_t)(((const uchar*)(B))[2])) |\
+(((uint32_t)(((const uchar*)(B))[1])) << 8) |\
+(((uint32_t)(((const uchar*)(B))[0])) << 16)))
+#define myisam_sint3korr(B)\
+((int32_t)(((int32_t)(((const uchar*)(B))[2])) |\
+(((int32_t)(((const uchar*)(B))[1])) << 8) |\
+(((int32_t)(((const uchar*)(B))[0])) << 16)))
+#define myisam_uint4korr(B)\
+((uint32_t)(((uint32_t)(((const uchar*)(B))[3])) |\
+(((uint32_t)(((const uchar*)(B))[2])) << 8) |\
+(((uint32_t)(((const uchar*) (B))[1])) << 16) |\
+(((uint32_t)(((const uchar*) (B))[0])) << 24)))
+#define myisam_sint4korr(B)\
+((int32_t)(((int32_t)(((const uchar*)(B))[3])) |\
+(((int32_t)(((const uchar*)(B))[2])) << 8) |\
+(((int32_t)(((const uchar*) (B))[1])) << 16) |\
+(((int32_t)(((const uchar*) (B))[0])) << 24)))
+#define mi_uint5korr(B)\
+((uint64_t)(((uint32_t) (((const uchar*) (B))[4])) |\
+(((uint32_t) (((const uchar*) (B))[3])) << 8) |\
+(((uint32_t) (((const uchar*) (B))[2])) << 16) |\
+(((uint32_t) (((const uchar*) (B))[1])) << 24)) |\
+(((uint64_t) (((const uchar*) (B))[0])) << 32))
+
+#define RPL_SAFEGUARD(rpl, event, condition) \
+if (!(condition))\
+{\
+ my_set_error((rpl)->mysql, CR_BINLOG_ERROR, SQLSTATE_UNKNOWN, 0,\
+ (rpl)->filename_length, (rpl)->filename,\
+ (rpl)->start_position,\
+ "Packet corrupted");\
+ mariadb_free_rpl_event((event));\
+ return 0;\
+}
+
#define mariadb_rpl_init(a) mariadb_rpl_init_ex((a), MARIADB_RPL_VERSION)
+#define rpl_clear_error(rpl)\
+(rpl)->error_no= (rpl)->error_msg[0]= 0
+
+#define IS_ROW_VERSION2(a)\
+ ((a) == WRITE_ROWS_EVENT || (a) == UPDATE_ROWS_EVENT || \
+ (a) == DELETE_ROWS_EVENT || (a) == WRITE_ROWS_COMPRESSED_EVENT ||\
+ (a) == UPDATE_ROWS_COMPRESSED_EVENT || (a) == DELETE_ROWS_COMPRESSED_EVENT)
+
+#define IS_ROW_EVENT(a)\
+((a)->event_type == WRITE_ROWS_COMPRESSED_EVENT_V1 ||\
+(a)->event_type == UPDATE_ROWS_COMPRESSED_EVENT_V1 ||\
+(a)->event_type == DELETE_ROWS_COMPRESSED_EVENT_V1 ||\
+(a)->event_type == WRITE_ROWS_EVENT_V1 ||\
+(a)->event_type == UPDATE_ROWS_EVENT_V1 ||\
+(a)->event_type == DELETE_ROWS_EVENT_V1 ||\
+(a)->event_type == WRITE_ROWS_EVENT ||\
+(a)->event_type == UPDATE_ROWS_EVENT ||\
+(a)->event_type == DELETE_ROWS_EVENT)
/* Function prototypes */
MARIADB_RPL * STDCALL mariadb_rpl_init_ex(MYSQL *mysql, unsigned int version);
+const char * STDCALL mariadb_rpl_error(MARIADB_RPL *rpl);
+uint32_t STDCALL mariadb_rpl_errno(MARIADB_RPL *rpl);
-int mariadb_rpl_optionsv(MARIADB_RPL *rpl, enum mariadb_rpl_option, ...);
-int mariadb_rpl_get_optionsv(MARIADB_RPL *rpl, enum mariadb_rpl_option, ...);
+int STDCALL mariadb_rpl_optionsv(MARIADB_RPL *rpl, enum mariadb_rpl_option, ...);
+int STDCALL mariadb_rpl_get_optionsv(MARIADB_RPL *rpl, enum mariadb_rpl_option, ...);
int STDCALL mariadb_rpl_open(MARIADB_RPL *rpl);
void STDCALL mariadb_rpl_close(MARIADB_RPL *rpl);
MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVENT *event);
void STDCALL mariadb_free_rpl_event(MARIADB_RPL_EVENT *event);
+MARIADB_RPL_ROW * STDCALL
+mariadb_rpl_extract_rows(MARIADB_RPL *rpl,
+ MARIADB_RPL_EVENT *tm_event,
+ MARIADB_RPL_EVENT *row_event);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/mysql/mariadb_stmt.h b/include/mysql/mariadb_stmt.h
index 0aa1436..531c218 100644
--- a/include/mysql/mariadb_stmt.h
+++ b/include/mysql/mariadb_stmt.h
@@ -34,21 +34,12 @@
((stmt)->mysql->extension->mariadb_server_capabilities & \
(MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32))))
-#define SET_CLIENT_STMT_ERROR(a, b, c, d) \
-{ \
- (a)->last_errno= (b);\
- strncpy((a)->sqlstate, (c), SQLSTATE_LENGTH);\
- (a)->sqlstate[SQLSTATE_LENGTH]= 0;\
- strncpy((a)->last_error, (d) ? (d) : ER((b)), MYSQL_ERRMSG_SIZE);\
- (a)->last_error[MYSQL_ERRMSG_SIZE - 1]= 0;\
-}
-
#define CLEAR_CLIENT_STMT_ERROR(a) \
-{ \
+do { \
(a)->last_errno= 0;\
strcpy((a)->sqlstate, "00000");\
(a)->last_error[0]= 0;\
-}
+} while (0)
#define MYSQL_PS_SKIP_RESULT_W_LEN -1
#define MYSQL_PS_SKIP_RESULT_STR -2
@@ -161,46 +152,6 @@ typedef struct st_mysql_error_info
char sqlstate[SQLSTATE_LENGTH + 1];
} mysql_error_info;
-
-struct st_mysqlnd_stmt_methods
-{
- my_bool (*prepare)(const MYSQL_STMT * stmt, const char * const query, size_t query_len);
- my_bool (*execute)(const MYSQL_STMT * stmt);
- MYSQL_RES * (*use_result)(const MYSQL_STMT * stmt);
- MYSQL_RES * (*store_result)(const MYSQL_STMT * stmt);
- MYSQL_RES * (*get_result)(const MYSQL_STMT * stmt);
- my_bool (*free_result)(const MYSQL_STMT * stmt);
- my_bool (*seek_data)(const MYSQL_STMT * stmt, unsigned long long row);
- my_bool (*reset)(const MYSQL_STMT * stmt);
- my_bool (*close)(const MYSQL_STMT * stmt); /* private */
- my_bool (*dtor)(const MYSQL_STMT * stmt); /* use this for mysqlnd_stmt_close */
-
- my_bool (*fetch)(const MYSQL_STMT * stmt, my_bool * const fetched_anything);
-
- my_bool (*bind_param)(const MYSQL_STMT * stmt, const MYSQL_BIND bind);
- my_bool (*refresh_bind_param)(const MYSQL_STMT * stmt);
- my_bool (*bind_result)(const MYSQL_STMT * stmt, const MYSQL_BIND *bind);
- my_bool (*send_long_data)(const MYSQL_STMT * stmt, unsigned int param_num,
- const char * const data, size_t length);
- MYSQL_RES *(*get_parameter_metadata)(const MYSQL_STMT * stmt);
- MYSQL_RES *(*get_result_metadata)(const MYSQL_STMT * stmt);
- unsigned long long (*get_last_insert_id)(const MYSQL_STMT * stmt);
- unsigned long long (*get_affected_rows)(const MYSQL_STMT * stmt);
- unsigned long long (*get_num_rows)(const MYSQL_STMT * stmt);
-
- unsigned int (*get_param_count)(const MYSQL_STMT * stmt);
- unsigned int (*get_field_count)(const MYSQL_STMT * stmt);
- unsigned int (*get_warning_count)(const MYSQL_STMT * stmt);
-
- unsigned int (*get_error_no)(const MYSQL_STMT * stmt);
- const char * (*get_error_str)(const MYSQL_STMT * stmt);
- const char * (*get_sqlstate)(const MYSQL_STMT * stmt);
-
- my_bool (*get_attribute)(const MYSQL_STMT * stmt, enum enum_stmt_attr_type attr_type, const void * value);
- my_bool (*set_attribute)(const MYSQL_STMT * stmt, enum enum_stmt_attr_type attr_type, const void * value);
- void (*set_error)(MYSQL_STMT *stmt, unsigned int error_nr, const char *sqlstate, const char *format, ...);
-};
-
typedef int (*mysql_stmt_fetch_row_func)(MYSQL_STMT *stmt, unsigned char **row);
typedef void (*ps_result_callback)(void *data, unsigned int column, unsigned char **row);
typedef my_bool *(*ps_param_callback)(void *data, MYSQL_BIND *bind, unsigned int row_nr);
@@ -239,13 +190,14 @@ struct st_mysql_stmt
mysql_stmt_fetch_row_func fetch_row_func;
unsigned int execute_count;/* count how many times the stmt was executed */
mysql_stmt_use_or_store_func default_rset_handler;
- struct st_mysqlnd_stmt_methods *m;
+ unsigned char *request_buffer;
unsigned int array_size;
size_t row_size;
unsigned int prebind_params;
void *user_data;
ps_result_callback result_callback;
ps_param_callback param_callback;
+ size_t request_length;
};
typedef void (*ps_field_fetch_func)(MYSQL_BIND *r_param, const MYSQL_FIELD * field, unsigned char **row);
@@ -262,6 +214,11 @@ void mysql_init_ps_subsystem(void);
unsigned long net_field_length(unsigned char **packet);
int ma_simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
size_t length, my_bool skipp_check, void *opt_arg);
+void stmt_set_error(MYSQL_STMT *stmt,
+ unsigned int error_nr,
+ const char *sqlstate,
+ const char *format,
+ ...);
/*
* function prototypes
*/
diff --git a/include/mysql/mariadb_version.h b/include/mysql/mariadb_version.h
index 7e59525..40b68ae 100644
--- a/include/mysql/mariadb_version.h
+++ b/include/mysql/mariadb_version.h
@@ -10,18 +10,24 @@
#include
#else
#define PROTOCOL_VERSION 10
-#define MARIADB_CLIENT_VERSION_STR "10.4.3"
-#define MARIADB_BASE_VERSION "mariadb-10.4"
-#define MARIADB_VERSION_ID 100403
+#define MARIADB_CLIENT_VERSION_STR "10.8.8"
+#define MARIADB_BASE_VERSION "mariadb-10.8"
+#define MARIADB_VERSION_ID 100808
#define MARIADB_PORT 3306
#define MARIADB_UNIX_ADDR "/tmp/mysql.sock"
+#ifndef MYSQL_UNIX_ADDR
+#define MYSQL_UNIX_ADDR MARIADB_UNIX_ADDR
+#endif
+#ifndef MYSQL_PORT
+#define MYSQL_PORT MARIADB_PORT
+#endif
#define MYSQL_CONFIG_NAME "my"
-#define MYSQL_VERSION_ID 100403
-#define MYSQL_SERVER_VERSION "10.4.3-MariaDB"
+#define MYSQL_VERSION_ID 100808
+#define MYSQL_SERVER_VERSION "10.8.8-MariaDB"
-#define MARIADB_PACKAGE_VERSION "3.1.8"
-#define MARIADB_PACKAGE_VERSION_ID 30108
+#define MARIADB_PACKAGE_VERSION "3.3.8"
+#define MARIADB_PACKAGE_VERSION_ID 30308
#define MARIADB_SYSTEM_TYPE "Windows"
#define MARIADB_MACHINE_TYPE "AMD64"
#define MARIADB_PLUGINDIR "C:/Program Files/mariadb-connector-c/lib/mariadb/plugin"
diff --git a/include/mysql/mariadb_version.h.in b/include/mysql/mariadb_version.h.in
index f45e22d..a82dbb7 100644
--- a/include/mysql/mariadb_version.h.in
+++ b/include/mysql/mariadb_version.h.in
@@ -15,6 +15,12 @@
#define MARIADB_VERSION_ID @MARIADB_VERSION_ID@
#define MARIADB_PORT @MARIADB_PORT@
#define MARIADB_UNIX_ADDR "@MARIADB_UNIX_ADDR@"
+#ifndef MYSQL_UNIX_ADDR
+#define MYSQL_UNIX_ADDR MARIADB_UNIX_ADDR
+#endif
+#ifndef MYSQL_PORT
+#define MYSQL_PORT MARIADB_PORT
+#endif
#define MYSQL_CONFIG_NAME "my"
#define MYSQL_VERSION_ID @MARIADB_VERSION_ID@
diff --git a/include/mysql/mysql.h b/include/mysql/mysql.h
index a160de0..76b1683 100644
--- a/include/mysql/mysql.h
+++ b/include/mysql/mysql.h
@@ -68,6 +68,12 @@ typedef struct st_ma_const_string
size_t length;
} MARIADB_CONST_STRING;
+typedef struct st_ma_const_data
+{
+ const unsigned char *data;
+ size_t length;
+} MARIADB_CONST_DATA;
+
#ifndef ST_MA_USED_MEM_DEFINED
#define ST_MA_USED_MEM_DEFINED
@@ -130,13 +136,13 @@ extern unsigned int mariadb_deinitialize_ssl;
typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
#define SET_CLIENT_ERROR(a, b, c, d) \
- { \
+ do { \
(a)->net.last_errno= (b);\
strncpy((a)->net.sqlstate, (c), SQLSTATE_LENGTH);\
(a)->net.sqlstate[SQLSTATE_LENGTH]= 0;\
strncpy((a)->net.last_error, (d) ? (d) : ER((b)), MYSQL_ERRMSG_SIZE - 1);\
(a)->net.last_error[MYSQL_ERRMSG_SIZE - 1]= 0;\
- }
+ } while(0)
/* For mysql_async.c */
#define set_mariadb_error(A,B,C) SET_CLIENT_ERROR((A),(B),(C),0)
@@ -144,12 +150,13 @@ extern const char *SQLSTATE_UNKNOWN;
#define unknown_sqlstate SQLSTATE_UNKNOWN
#define CLEAR_CLIENT_ERROR(a) \
- { \
+ do { \
(a)->net.last_errno= 0;\
strcpy((a)->net.sqlstate, "00000");\
(a)->net.last_error[0]= '\0';\
- (a)->net.extension->extended_errno= 0;\
- }
+ if ((a)->net.extension)\
+ (a)->net.extension->extended_errno= 0;\
+ } while (0)
#define MYSQL_COUNT_ERROR (~(unsigned long long) 0)
@@ -245,7 +252,12 @@ extern const char *SQLSTATE_UNKNOWN;
MARIADB_OPT_MULTI_STATEMENTS,
MARIADB_OPT_INTERACTIVE,
MARIADB_OPT_PROXY_HEADER,
- MARIADB_OPT_IO_WAIT
+ MARIADB_OPT_IO_WAIT,
+ MARIADB_OPT_SKIP_READ_RESPONSE,
+ MARIADB_OPT_RESTRICTED_AUTH,
+ MARIADB_OPT_RPL_REGISTER_REPLICA,
+ MARIADB_OPT_STATUS_CALLBACK,
+ MARIADB_OPT_SERVER_PLUGINS
};
enum mariadb_value {
@@ -282,7 +294,9 @@ extern const char *SQLSTATE_UNKNOWN;
MARIADB_CONNECTION_SERVER_STATUS,
MARIADB_CONNECTION_SERVER_CAPABILITIES,
MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES,
- MARIADB_CONNECTION_CLIENT_CAPABILITIES
+ MARIADB_CONNECTION_CLIENT_CAPABILITIES,
+ MARIADB_CONNECTION_BYTES_READ,
+ MARIADB_CONNECTION_BYTES_SENT
};
enum mysql_status { MYSQL_STATUS_READY,
@@ -425,7 +439,7 @@ typedef struct st_mysql_time
#define SEC_PART_DIGITS 6
#define MARIADB_INVALID_SOCKET -1
-/* Ansynchronous API constants */
+/* Asynchronous API constants */
#define MYSQL_WAIT_READ 1
#define MYSQL_WAIT_WRITE 2
#define MYSQL_WAIT_EXCEPT 4
@@ -457,9 +471,9 @@ typedef struct character_set
const char *desc; \
unsigned int version[3]; \
const char *license; \
- void *mariadb_api; \
+ void *mysql_api; \
int (*init)(char *, size_t, int, va_list); \
- int (*deinit)(); \
+ int (*deinit)(void); \
int (*options)(const char *option, const void *);
struct st_mysql_client_plugin
{
@@ -728,7 +742,7 @@ int STDCALL mysql_stmt_send_long_data_cont(my_bool *ret, MYSQL_STMT *stmt,
int status);
int STDCALL mysql_reset_connection(MYSQL *mysql);
-/* API function calls (used by dynmic plugins) */
+/* API function calls (used by dynamic plugins) */
struct st_mariadb_api {
unsigned long long (STDCALL *mysql_num_rows)(MYSQL_RES *res);
unsigned int (STDCALL *mysql_num_fields)(MYSQL_RES *res);
@@ -853,7 +867,7 @@ struct st_mariadb_methods {
const char *db, unsigned int port, const char *unix_socket, unsigned long clientflag);
void (*db_close)(MYSQL *mysql);
int (*db_command)(MYSQL *mysql,enum enum_server_command command, const char *arg,
- size_t length, my_bool skipp_check, void *opt_arg);
+ size_t length, my_bool skip_check, void *opt_arg);
void (*db_skip_result)(MYSQL *mysql);
int (*db_read_query_result)(MYSQL *mysql);
MYSQL_DATA *(*db_read_rows)(MYSQL *mysql,MYSQL_FIELD *fields, unsigned int field_count);
@@ -871,12 +885,15 @@ struct st_mariadb_methods {
void (*set_error)(MYSQL *mysql, unsigned int error_nr, const char *sqlstate, const char *format, ...);
void (*invalidate_stmts)(MYSQL *mysql, const char *function_name);
struct st_mariadb_api *api;
+ int (*db_read_execute_response)(MYSQL_STMT *stmt);
+ unsigned char* (*db_execute_generate_request)(MYSQL_STMT *stmt, size_t *request_len, my_bool internal);
};
/* synonyms/aliases functions */
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
#define mysql_library_init mysql_server_init
#define mysql_library_end mysql_server_end
+#define mariadb_connect(hdl, conn_str) mysql_real_connect((hdl),(conn_str), NULL, NULL, NULL, 0, NULL, 0)
/* new api functions */
diff --git a/include/mysql/mysql/client_plugin.h b/include/mysql/mysql/client_plugin.h
index ac29afd..262fd4a 100644
--- a/include/mysql/mysql/client_plugin.h
+++ b/include/mysql/mysql/client_plugin.h
@@ -1,5 +1,5 @@
/* Copyright (C) 2010 - 2012 Sergei Golubchik and Monty Program Ab
- 2014 MariaDB Corporation AB
+ 2014, 2022 MariaDB Corporation AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -51,13 +51,15 @@
#define MARIADB_CLIENT_PVIO_PLUGIN 101
#define MARIADB_CLIENT_TRACE_PLUGIN 102
#define MARIADB_CLIENT_CONNECTION_PLUGIN 103
+#define MARIADB_CLIENT_COMPRESSION_PLUGIN 104
#define MARIADB_CLIENT_REMOTEIO_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_PVIO_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION 0x0100
#define MARIADB_CLIENT_CONNECTION_PLUGIN_INTERFACE_VERSION 0x0100
+#define MARIADB_CLIENT_COMPRESSION_PLUGIN_INTERFACE_VERSION 0x0100
-#define MARIADB_CLIENT_MAX_PLUGINS 4
+#define MARIADB_CLIENT_MAX_PLUGINS 5
#define mysql_declare_client_plugin(X) \
struct st_mysql_client_plugin_ ## X \
@@ -78,8 +80,9 @@
const char *license; \
void *mysql_api; \
int (*init)(char *, size_t, int, va_list); \
- int (*deinit)(); \
+ int (*deinit)(void); \
int (*options)(const char *option, const void *);
+
struct st_mysql_client_plugin
{
MYSQL_CLIENT_PLUGIN_HEADER
@@ -133,6 +136,17 @@ struct st_mysql_client_plugin_TRACE
MYSQL_CLIENT_PLUGIN_HEADER
};
+#include
+
+typedef struct st_mariadb_client_plugin_COMPRESS
+{
+ MYSQL_CLIENT_PLUGIN_HEADER
+ ma_compress_ctx *(*init_ctx)(int compression_level);
+ void (*free_ctx)(ma_compress_ctx *ctx);
+ my_bool (*compress)(ma_compress_ctx *ctx, void *dst, size_t *dst_len, void *source, size_t source_len);
+ my_bool (*decompress)(ma_compress_ctx *ctx, void *dst, size_t *dst_len, void *source, size_t *source_len);
+} MARIADB_COMPRESSION_PLUGIN;
+
/**
type of the mysql_authentication_dialog_ask function
diff --git a/include/mysql/mysqld_error.h b/include/mysql/mysqld_error.h
index 6a42ffc..1336543 100644
--- a/include/mysql/mysqld_error.h
+++ b/include/mysql/mysqld_error.h
@@ -1,8 +1,6 @@
-/* Autogenerated file, please don't edit
- branch: 10.2
- revision id: 01a4eb8f761eb669fe2ae5139c73a7434b141a8f
- */
+/* Autogenerated file, please don't edit */
+#ifndef ER_ERROR_FIRST
#define ER_ERROR_FIRST 1000
#define ER_HASHCHK 1000
#define ER_NISAMCHK 1001
@@ -76,11 +74,11 @@
#define ER_TOO_MANY_KEYS 1069
#define ER_TOO_MANY_KEY_PARTS 1070
#define ER_TOO_LONG_KEY 1071
-#define ER_KEY_COLUMN_DOES_NOT_EXITS 1072
+#define ER_KEY_COLUMN_DOES_NOT_EXIST 1072
#define ER_BLOB_USED_AS_KEY 1073
#define ER_TOO_BIG_FIELDLENGTH 1074
#define ER_WRONG_AUTO_KEY 1075
-#define ER_UNUSED_9 1076
+#define ER_BINLOG_CANT_DELETE_GTID_DOMAIN 1076
#define ER_NORMAL_SHUTDOWN 1077
#define ER_GOT_SIGNAL 1078
#define ER_SHUTDOWN_COMPLETE 1079
@@ -105,7 +103,7 @@
#define ER_NO_UNIQUE_LOGFILE 1098
#define ER_TABLE_NOT_LOCKED_FOR_WRITE 1099
#define ER_TABLE_NOT_LOCKED 1100
-#define ER_BLOB_CANT_HAVE_DEFAULT 1101
+#define ER_UNUSED_17 1101
#define ER_WRONG_DB_NAME 1102
#define ER_WRONG_TABLE_NAME 1103
#define ER_TOO_BIG_SELECT 1104
@@ -491,7 +489,7 @@
#define ER_PARTITION_WRONG_NO_PART_ERROR 1484
#define ER_PARTITION_WRONG_NO_SUBPART_ERROR 1485
#define ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR 1486
-#define ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR 1487
+#define ER_NOT_CONSTANT_EXPRESSION 1487
#define ER_FIELD_NOT_FOUND_PART_ERROR 1488
#define ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR 1489
#define ER_INCONSISTENT_PARTITION_INFO_ERROR 1490
@@ -510,8 +508,8 @@
#define ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF 1503
#define ER_NO_PARTS_ERROR 1504
#define ER_PARTITION_MGMT_ON_NONPARTITIONED 1505
-#define ER_FOREIGN_KEY_ON_PARTITIONED 1506
-#define ER_DROP_PARTITION_NON_EXISTENT 1507
+#define ER_FEATURE_NOT_SUPPORTED_WITH_PARTITIONING 1506
+#define ER_PARTITION_DOES_NOT_EXIST 1507
#define ER_DROP_LAST_PARTITION 1508
#define ER_COALESCE_ONLY_ON_HASH_PARTITION 1509
#define ER_REORG_HASH_ONLY_ON_SAME_NO 1510
@@ -729,8 +727,8 @@
#define ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT 1722
#define ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC 1723
#define ER_BINLOG_UNSAFE_INSERT_TWO_KEYS 1724
-#define ER_TABLE_IN_FK_CHECK 1725
-#define ER_UNUSED_1 1726
+#define ER_UNUSED_28 1725
+#define ER_VERS_NOT_ALLOWED 1726
#define ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST 1727
#define ER_CANNOT_LOAD_FROM_TABLE_V2 1728
#define ER_MASTER_DELAY_VALUE_OUT_OF_RANGE 1729
@@ -811,7 +809,7 @@
#define ER_MTS_RESET_WORKERS 1804
#define ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2 1805
#define ER_SLAVE_SILENT_RETRY_TRANSACTION 1806
-#define ER_DISCARD_FK_CHECKS_RUNNING 1807
+#define ER_UNUSED_22 1807
#define ER_TABLE_SCHEMA_MISMATCH 1808
#define ER_TABLE_IN_SYSTEM_TABLESPACE 1809
#define ER_IO_READ_ERROR 1810
@@ -962,7 +960,7 @@
#define ER_STATEMENT_TIMEOUT 1969
#define ER_SUBQUERIES_NOT_SUPPORTED 1970
#define ER_SET_STATEMENT_NOT_SUPPORTED 1971
-#define ER_UNUSED_17 1972
+#define ER_UNUSED_9 1972
#define ER_USER_CREATE_EXISTS 1973
#define ER_USER_DROP_EXISTS 1974
#define ER_ROLE_CREATE_EXISTS 1975
@@ -972,7 +970,8 @@
#define ER_KILL_QUERY_DENIED_ERROR 1979
#define ER_NO_EIS_FOR_FIELD 1980
#define ER_WARN_AGGFUNC_DEPENDENCE 1981
-#define ER_ERROR_LAST_SECTION_2 1981
+#define WARN_INNODB_PARTITION_OPTION_IGNORED 1982
+#define ER_ERROR_LAST_SECTION_2 1982
/* New section */
@@ -1048,8 +1047,8 @@
/* New section */
#define ER_ERROR_FIRST_SECTION_5 4000
-#define ER_COMMULTI_BADCONTEXT 4000
-#define ER_BAD_COMMAND_IN_MULTI 4001
+#define ER_UNUSED_26 4000
+#define ER_UNUSED_27 4001
#define ER_WITH_COL_WRONG_LIST 4002
#define ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE 4003
#define ER_DUP_QUERY_NAME 4004
@@ -1095,7 +1094,7 @@
#define ER_JSON_PATH_NO_WILDCARD 4044
#define ER_JSON_PATH_ARRAY 4045
#define ER_JSON_ONE_OR_ALL 4046
-#define ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE 4047
+#define ER_UNSUPPORTED_COMPRESSED_TABLE 4047
#define ER_GEOJSON_INCORRECT 4048
#define ER_GEOJSON_TOO_FEW_POINTS 4049
#define ER_GEOJSON_NOT_CLOSED 4050
@@ -1113,14 +1112,129 @@
#define ER_ISOLATION_LEVEL_WITH_CONSISTENT_SNAPSHOT 4062
#define ER_UNSUPPORTED_COLLATION 4063
#define ER_METADATA_INCONSISTENCY 4064
-#define ER_KEY_CREATE_DURING_ALTER 4065
-#define ER_SK_POPULATE_DURING_ALTER 4066
-#define ER_CF_DIFFERENT 4067
-#define ER_RDB_STATUS_GENERAL 4068
-#define ER_RDB_STATUS_MSG 4069
-#define ER_NET_OK_PACKET_TOO_LARGE 4070
-#define ER_RDB_TTL_UNSUPPORTED 4071
-#define ER_RDB_TTL_COL_FORMAT 4072
-#define ER_RDB_TTL_DURATION_FORMAT 4073
-#define ER_PER_INDEX_CF_DEPRECATED 4074
-#define ER_ERROR_LAST 4074
+#define ER_CF_DIFFERENT 4065
+#define ER_RDB_TTL_DURATION_FORMAT 4066
+#define ER_RDB_STATUS_GENERAL 4067
+#define ER_RDB_STATUS_MSG 4068
+#define ER_RDB_TTL_UNSUPPORTED 4069
+#define ER_RDB_TTL_COL_FORMAT 4070
+#define ER_PER_INDEX_CF_DEPRECATED 4071
+#define ER_KEY_CREATE_DURING_ALTER 4072
+#define ER_SK_POPULATE_DURING_ALTER 4073
+#define ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG 4074
+#define ER_NET_OK_PACKET_TOO_LARGE 4075
+#define ER_GEOJSON_EMPTY_COORDINATES 4076
+#define ER_MYROCKS_CANT_NOPAD_COLLATION 4077
+#define ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION 4078
+#define ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION 4079
+#define ER_WRONG_PARAMCOUNT_TO_CURSOR 4080
+#define ER_UNKNOWN_STRUCTURED_VARIABLE 4081
+#define ER_ROW_VARIABLE_DOES_NOT_HAVE_FIELD 4082
+#define ER_END_IDENTIFIER_DOES_NOT_MATCH 4083
+#define ER_SEQUENCE_RUN_OUT 4084
+#define ER_SEQUENCE_INVALID_DATA 4085
+#define ER_SEQUENCE_INVALID_TABLE_STRUCTURE 4086
+#define ER_SEQUENCE_ACCESS_ERROR 4087
+#define ER_SEQUENCE_BINLOG_FORMAT 4088
+#define ER_NOT_SEQUENCE 4089
+#define ER_NOT_SEQUENCE2 4090
+#define ER_UNKNOWN_SEQUENCES 4091
+#define ER_UNKNOWN_VIEW 4092
+#define ER_WRONG_INSERT_INTO_SEQUENCE 4093
+#define ER_SP_STACK_TRACE 4094
+#define ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY 4095
+#define ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED 4096
+#define ER_COMPRESSED_COLUMN_USED_AS_KEY 4097
+#define ER_UNKNOWN_COMPRESSION_METHOD 4098
+#define ER_WRONG_NUMBER_OF_VALUES_IN_TVC 4099
+#define ER_FIELD_REFERENCE_IN_TVC 4100
+#define ER_WRONG_TYPE_FOR_PERCENTILE_FUNC 4101
+#define ER_ARGUMENT_NOT_CONSTANT 4102
+#define ER_ARGUMENT_OUT_OF_RANGE 4103
+#define ER_WRONG_TYPE_OF_ARGUMENT 4104
+#define ER_NOT_AGGREGATE_FUNCTION 4105
+#define ER_INVALID_AGGREGATE_FUNCTION 4106
+#define ER_INVALID_VALUE_TO_LIMIT 4107
+#define ER_INVISIBLE_NOT_NULL_WITHOUT_DEFAULT 4108
+#define ER_UPDATE_INFO_WITH_SYSTEM_VERSIONING 4109
+#define ER_VERS_FIELD_WRONG_TYPE 4110
+#define ER_VERS_ENGINE_UNSUPPORTED 4111
+#define ER_UNUSED_23 4112
+#define ER_PARTITION_WRONG_TYPE 4113
+#define WARN_VERS_PART_FULL 4114
+#define WARN_VERS_PARAMETERS 4115
+#define ER_VERS_DROP_PARTITION_INTERVAL 4116
+#define ER_UNUSED_25 4117
+#define WARN_VERS_PART_NON_HISTORICAL 4118
+#define ER_VERS_ALTER_NOT_ALLOWED 4119
+#define ER_VERS_ALTER_ENGINE_PROHIBITED 4120
+#define ER_VERS_RANGE_PROHIBITED 4121
+#define ER_CONFLICTING_FOR_SYSTEM_TIME 4122
+#define ER_VERS_TABLE_MUST_HAVE_COLUMNS 4123
+#define ER_VERS_NOT_VERSIONED 4124
+#define ER_MISSING 4125
+#define ER_VERS_PERIOD_COLUMNS 4126
+#define ER_PART_WRONG_VALUE 4127
+#define ER_VERS_WRONG_PARTS 4128
+#define ER_VERS_NO_TRX_ID 4129
+#define ER_VERS_ALTER_SYSTEM_FIELD 4130
+#define ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION 4131
+#define ER_VERS_DB_NOT_SUPPORTED 4132
+#define ER_VERS_TRT_IS_DISABLED 4133
+#define ER_VERS_DUPLICATE_ROW_START_END 4134
+#define ER_VERS_ALREADY_VERSIONED 4135
+#define ER_UNUSED_24 4136
+#define ER_VERS_NOT_SUPPORTED 4137
+#define ER_VERS_TRX_PART_HISTORIC_ROW_NOT_SUPPORTED 4138
+#define ER_INDEX_FILE_FULL 4139
+#define ER_UPDATED_COLUMN_ONLY_ONCE 4140
+#define ER_EMPTY_ROW_IN_TVC 4141
+#define ER_VERS_QUERY_IN_PARTITION 4142
+#define ER_KEY_DOESNT_SUPPORT 4143
+#define ER_ALTER_OPERATION_TABLE_OPTIONS_NEED_REBUILD 4144
+#define ER_BACKUP_LOCK_IS_ACTIVE 4145
+#define ER_BACKUP_NOT_RUNNING 4146
+#define ER_BACKUP_WRONG_STAGE 4147
+#define ER_BACKUP_STAGE_FAILED 4148
+#define ER_BACKUP_UNKNOWN_STAGE 4149
+#define ER_USER_IS_BLOCKED 4150
+#define ER_ACCOUNT_HAS_BEEN_LOCKED 4151
+#define ER_PERIOD_TEMPORARY_NOT_ALLOWED 4152
+#define ER_PERIOD_TYPES_MISMATCH 4153
+#define ER_MORE_THAN_ONE_PERIOD 4154
+#define ER_PERIOD_FIELD_WRONG_ATTRIBUTES 4155
+#define ER_PERIOD_NOT_FOUND 4156
+#define ER_PERIOD_COLUMNS_UPDATED 4157
+#define ER_PERIOD_CONSTRAINT_DROP 4158
+#define ER_TOO_LONG_KEYPART 4159
+#define ER_TOO_LONG_DATABASE_COMMENT 4160
+#define ER_UNKNOWN_DATA_TYPE 4161
+#define ER_UNKNOWN_OPERATOR 4162
+#define ER_WARN_HISTORY_ROW_START_TIME 4163
+#define ER_PART_STARTS_BEYOND_INTERVAL 4164
+#define ER_GALERA_REPLICATION_NOT_SUPPORTED 4165
+#define ER_LOAD_INFILE_CAPABILITY_DISABLED 4166
+#define ER_NO_SECURE_TRANSPORTS_CONFIGURED 4167
+#define ER_SLAVE_IGNORED_SHARED_TABLE 4168
+#define ER_NO_AUTOINCREMENT_WITH_UNIQUE 4169
+#define ER_KEY_CONTAINS_PERIOD_FIELDS 4170
+#define ER_KEY_CANT_HAVE_WITHOUT_OVERLAPS 4171
+#define ER_NOT_ALLOWED_IN_THIS_CONTEXT 4172
+#define ER_DATA_WAS_COMMITED_UNDER_ROLLBACK 4173
+#define ER_PK_INDEX_CANT_BE_IGNORED 4174
+#define ER_BINLOG_UNSAFE_SKIP_LOCKED 4175
+#define ER_JSON_TABLE_ERROR_ON_FIELD 4176
+#define ER_JSON_TABLE_ALIAS_REQUIRED 4177
+#define ER_JSON_TABLE_SCALAR_EXPECTED 4178
+#define ER_JSON_TABLE_MULTIPLE_MATCHES 4179
+#define ER_WITH_TIES_NEEDS_ORDER 4180
+#define ER_REMOVED_ORPHAN_TRIGGER 4181
+#define ER_STORAGE_ENGINE_DISABLED 4182
+#define WARN_SFORMAT_ERROR 4183
+#define ER_PARTITION_CONVERT_SUBPARTITIONED 4184
+#define ER_PROVIDER_NOT_LOADED 4185
+#define ER_JSON_HISTOGRAM_PARSE_FAILED 4186
+#define ER_SF_OUT_INOUT_ARG_NOT_ALLOWED 4187
+#define ER_INCONSISTENT_SLAVE_TEMP_TABLE 4188
+#define ER_ERROR_LAST 4188
+#endif /* ER_ERROR_FIRST */
diff --git a/lib/x64/debug/caching_sha2_password.dll b/lib/x64/debug/caching_sha2_password.dll
index c3e9950..468c340 100644
Binary files a/lib/x64/debug/caching_sha2_password.dll and b/lib/x64/debug/caching_sha2_password.dll differ
diff --git a/lib/x64/debug/caching_sha2_password.lib b/lib/x64/debug/caching_sha2_password.lib
index 255d635..ced20a3 100644
Binary files a/lib/x64/debug/caching_sha2_password.lib and b/lib/x64/debug/caching_sha2_password.lib differ
diff --git a/lib/x64/debug/client_ed25519.dll b/lib/x64/debug/client_ed25519.dll
new file mode 100644
index 0000000..bf96b63
Binary files /dev/null and b/lib/x64/debug/client_ed25519.dll differ
diff --git a/lib/x64/debug/client_ed25519.lib b/lib/x64/debug/client_ed25519.lib
new file mode 100644
index 0000000..de0c6b9
Binary files /dev/null and b/lib/x64/debug/client_ed25519.lib differ
diff --git a/lib/x64/debug/dialog.dll b/lib/x64/debug/dialog.dll
index 112b2ae..e717261 100644
Binary files a/lib/x64/debug/dialog.dll and b/lib/x64/debug/dialog.dll differ
diff --git a/lib/x64/debug/dialog.lib b/lib/x64/debug/dialog.lib
index a3d49e3..169b373 100644
Binary files a/lib/x64/debug/dialog.lib and b/lib/x64/debug/dialog.lib differ
diff --git a/lib/x64/debug/libcrypto-3-x64.dll b/lib/x64/debug/libcrypto-3-x64.dll
new file mode 100644
index 0000000..22a5e59
Binary files /dev/null and b/lib/x64/debug/libcrypto-3-x64.dll differ
diff --git a/lib/x64/debug/libcurl_a_debug.lib b/lib/x64/debug/libcurl_a_debug.lib
index 174d3b8..c01159c 100644
Binary files a/lib/x64/debug/libcurl_a_debug.lib and b/lib/x64/debug/libcurl_a_debug.lib differ
diff --git a/lib/x64/debug/libssl-3-x64.dll b/lib/x64/debug/libssl-3-x64.dll
new file mode 100644
index 0000000..6bf5e8f
Binary files /dev/null and b/lib/x64/debug/libssl-3-x64.dll differ
diff --git a/lib/x64/debug/mariadbclient.lib b/lib/x64/debug/mariadbclient.lib
index a9c93ad..e0fbf67 100644
Binary files a/lib/x64/debug/mariadbclient.lib and b/lib/x64/debug/mariadbclient.lib differ
diff --git a/lib/x64/debug/mysql_clear_password.dll b/lib/x64/debug/mysql_clear_password.dll
index 20bf75d..27a85a2 100644
Binary files a/lib/x64/debug/mysql_clear_password.dll and b/lib/x64/debug/mysql_clear_password.dll differ
diff --git a/lib/x64/debug/mysql_clear_password.lib b/lib/x64/debug/mysql_clear_password.lib
index 78149cc..1ea8b9d 100644
Binary files a/lib/x64/debug/mysql_clear_password.lib and b/lib/x64/debug/mysql_clear_password.lib differ
diff --git a/lib/x64/debug/pvio_shmem.dll b/lib/x64/debug/pvio_shmem.dll
new file mode 100644
index 0000000..62b4832
Binary files /dev/null and b/lib/x64/debug/pvio_shmem.dll differ
diff --git a/lib/x64/debug/pvio_shmem.lib b/lib/x64/debug/pvio_shmem.lib
new file mode 100644
index 0000000..e511817
Binary files /dev/null and b/lib/x64/debug/pvio_shmem.lib differ
diff --git a/lib/x64/debug/sha256_password.dll b/lib/x64/debug/sha256_password.dll
index 9cf24e7..5ff6619 100644
Binary files a/lib/x64/debug/sha256_password.dll and b/lib/x64/debug/sha256_password.dll differ
diff --git a/lib/x64/debug/sha256_password.lib b/lib/x64/debug/sha256_password.lib
index ce8913e..0858e52 100644
Binary files a/lib/x64/debug/sha256_password.lib and b/lib/x64/debug/sha256_password.lib differ
diff --git a/lib/x64/linux/auth_gssapi_client.so b/lib/x64/linux/auth_gssapi_client.so
index f922bb3..4b2ccf0 100644
Binary files a/lib/x64/linux/auth_gssapi_client.so and b/lib/x64/linux/auth_gssapi_client.so differ
diff --git a/lib/x64/linux/caching_sha2_password.so b/lib/x64/linux/caching_sha2_password.so
index bcad934..bdb09ac 100644
Binary files a/lib/x64/linux/caching_sha2_password.so and b/lib/x64/linux/caching_sha2_password.so differ
diff --git a/lib/x64/linux/client_ed25519.so b/lib/x64/linux/client_ed25519.so
new file mode 100644
index 0000000..cf84cc2
Binary files /dev/null and b/lib/x64/linux/client_ed25519.so differ
diff --git a/lib/x64/linux/libcrypto.so b/lib/x64/linux/libcrypto.so
index 7650a42..e6d0d80 100644
Binary files a/lib/x64/linux/libcrypto.so and b/lib/x64/linux/libcrypto.so differ
diff --git a/lib/x64/linux/libcrypto.so.3 b/lib/x64/linux/libcrypto.so.3
new file mode 100644
index 0000000..e0d8e75
Binary files /dev/null and b/lib/x64/linux/libcrypto.so.3 differ
diff --git a/lib/x64/linux/libssl.so b/lib/x64/linux/libssl.so
index 1e688e4..7481049 100644
Binary files a/lib/x64/linux/libssl.so and b/lib/x64/linux/libssl.so differ
diff --git a/lib/x64/linux/libssl.so.3 b/lib/x64/linux/libssl.so.3
new file mode 100644
index 0000000..21542d6
Binary files /dev/null and b/lib/x64/linux/libssl.so.3 differ
diff --git a/lib/x64/linux/mysql_clear_password.so b/lib/x64/linux/mysql_clear_password.so
index b09418f..e6e3986 100644
Binary files a/lib/x64/linux/mysql_clear_password.so and b/lib/x64/linux/mysql_clear_password.so differ
diff --git a/lib/x64/linux/sha256_password.so b/lib/x64/linux/sha256_password.so
index ea3c629..b85471d 100644
Binary files a/lib/x64/linux/sha256_password.so and b/lib/x64/linux/sha256_password.so differ
diff --git a/lib/x64/release/caching_sha2_password.dll b/lib/x64/release/caching_sha2_password.dll
index 071bbfb..468c340 100644
Binary files a/lib/x64/release/caching_sha2_password.dll and b/lib/x64/release/caching_sha2_password.dll differ
diff --git a/lib/x64/release/caching_sha2_password.exp b/lib/x64/release/caching_sha2_password.exp
new file mode 100644
index 0000000..e8df21f
Binary files /dev/null and b/lib/x64/release/caching_sha2_password.exp differ
diff --git a/lib/x64/release/caching_sha2_password.lib b/lib/x64/release/caching_sha2_password.lib
index b92767a..ced20a3 100644
Binary files a/lib/x64/release/caching_sha2_password.lib and b/lib/x64/release/caching_sha2_password.lib differ
diff --git a/lib/x64/release/client_ed25519.dll b/lib/x64/release/client_ed25519.dll
new file mode 100644
index 0000000..bf96b63
Binary files /dev/null and b/lib/x64/release/client_ed25519.dll differ
diff --git a/lib/x64/release/client_ed25519.exp b/lib/x64/release/client_ed25519.exp
new file mode 100644
index 0000000..53d6020
Binary files /dev/null and b/lib/x64/release/client_ed25519.exp differ
diff --git a/lib/x64/release/client_ed25519.lib b/lib/x64/release/client_ed25519.lib
new file mode 100644
index 0000000..de0c6b9
Binary files /dev/null and b/lib/x64/release/client_ed25519.lib differ
diff --git a/lib/x64/release/cryptlib.lib b/lib/x64/release/cryptlib.lib
new file mode 100644
index 0000000..f48d6e0
Binary files /dev/null and b/lib/x64/release/cryptlib.lib differ
diff --git a/lib/x64/release/dialog.dll b/lib/x64/release/dialog.dll
index 8bf0e92..e717261 100644
Binary files a/lib/x64/release/dialog.dll and b/lib/x64/release/dialog.dll differ
diff --git a/lib/x64/release/dialog.exp b/lib/x64/release/dialog.exp
index b3400ec..a91bd1d 100644
Binary files a/lib/x64/release/dialog.exp and b/lib/x64/release/dialog.exp differ
diff --git a/lib/x64/release/dialog.lib b/lib/x64/release/dialog.lib
index 1cffc7b..169b373 100644
Binary files a/lib/x64/release/dialog.lib and b/lib/x64/release/dialog.lib differ
diff --git a/lib/x64/release/libcrypto-3-x64.dll b/lib/x64/release/libcrypto-3-x64.dll
new file mode 100644
index 0000000..22a5e59
Binary files /dev/null and b/lib/x64/release/libcrypto-3-x64.dll differ
diff --git a/lib/x64/release/libcrypto.lib b/lib/x64/release/libcrypto.lib
new file mode 100644
index 0000000..29370be
Binary files /dev/null and b/lib/x64/release/libcrypto.lib differ
diff --git a/lib/x64/release/libcurl_a.lib b/lib/x64/release/libcurl_a.lib
index 4c709d0..42cd9ee 100644
Binary files a/lib/x64/release/libcurl_a.lib and b/lib/x64/release/libcurl_a.lib differ
diff --git a/lib/x64/release/libssl-3-x64.dll b/lib/x64/release/libssl-3-x64.dll
new file mode 100644
index 0000000..6bf5e8f
Binary files /dev/null and b/lib/x64/release/libssl-3-x64.dll differ
diff --git a/lib/x64/release/libssl.lib b/lib/x64/release/libssl.lib
new file mode 100644
index 0000000..68d01bd
Binary files /dev/null and b/lib/x64/release/libssl.lib differ
diff --git a/lib/x64/release/mariadbclient.lib b/lib/x64/release/mariadbclient.lib
index b991f2c..e0fbf67 100644
Binary files a/lib/x64/release/mariadbclient.lib and b/lib/x64/release/mariadbclient.lib differ
diff --git a/lib/x64/release/mysql_clear_password.dll b/lib/x64/release/mysql_clear_password.dll
index a174880..27a85a2 100644
Binary files a/lib/x64/release/mysql_clear_password.dll and b/lib/x64/release/mysql_clear_password.dll differ
diff --git a/lib/x64/release/mysql_clear_password.exp b/lib/x64/release/mysql_clear_password.exp
index 4021603..77273c5 100644
Binary files a/lib/x64/release/mysql_clear_password.exp and b/lib/x64/release/mysql_clear_password.exp differ
diff --git a/lib/x64/release/mysql_clear_password.lib b/lib/x64/release/mysql_clear_password.lib
index 2a6e1ff..1ea8b9d 100644
Binary files a/lib/x64/release/mysql_clear_password.lib and b/lib/x64/release/mysql_clear_password.lib differ
diff --git a/lib/x64/release/pvio_shmem.dll b/lib/x64/release/pvio_shmem.dll
new file mode 100644
index 0000000..62b4832
Binary files /dev/null and b/lib/x64/release/pvio_shmem.dll differ
diff --git a/lib/x64/release/pvio_shmem.exp b/lib/x64/release/pvio_shmem.exp
new file mode 100644
index 0000000..d866e50
Binary files /dev/null and b/lib/x64/release/pvio_shmem.exp differ
diff --git a/lib/x64/release/pvio_shmem.lib b/lib/x64/release/pvio_shmem.lib
new file mode 100644
index 0000000..e511817
Binary files /dev/null and b/lib/x64/release/pvio_shmem.lib differ
diff --git a/lib/x64/release/sha256_password.dll b/lib/x64/release/sha256_password.dll
index 69e3fe5..5ff6619 100644
Binary files a/lib/x64/release/sha256_password.dll and b/lib/x64/release/sha256_password.dll differ
diff --git a/lib/x64/release/sha256_password.exp b/lib/x64/release/sha256_password.exp
new file mode 100644
index 0000000..9ddc234
Binary files /dev/null and b/lib/x64/release/sha256_password.exp differ
diff --git a/lib/x64/release/sha256_password.lib b/lib/x64/release/sha256_password.lib
index c4aecd7..0858e52 100644
Binary files a/lib/x64/release/sha256_password.lib and b/lib/x64/release/sha256_password.lib differ
diff --git a/src/FrameWindow.cpp b/src/FrameWindow.cpp
index 3018cb5..de5f309 100644
--- a/src/FrameWindow.cpp
+++ b/src/FrameWindow.cpp
@@ -5522,11 +5522,29 @@ FrameWindow::InitCollationCombo(HWND hwnd)
wyString query, collationstr;
MYSQL_ROW myrow;
MYSQL_RES *myres;
- wyInt32 index;
-
+ wyInt32 index, width;
+
HWND hwndcombo = GetDlgItem(hwnd, IDC_COLLATECOMBO);
- query.SetAs("show collation");
+ // Check for MariaDB connection
+ if (IsMariaDB(wnd->m_tunnel, &wnd->m_mysql))
+ {
+ if (IsMariaDB101000(wnd->m_tunnel, &wnd->m_mysql))
+ {
+ // For MariaDB 10.10.0 or higher, use the FULL_COLLATION_NAME
+ query.SetAs("SELECT DISTINCT FULL_COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ else
+ {
+ // For MariaDB versions lower than 10.10.0, use the COLLATION_NAME
+ query.SetAs("SELECT DISTINCT COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ }
+ else
+ {
+ // For other Database server existing flow will work and SHOW COLLATION will work to get the list of collations
+ query.SetAs("SHOW COLLATION");
+ }
myres = ExecuteAndGetResult(wnd, wnd->m_tunnel, &wnd->m_mysql, query);
if(!myres)
{
@@ -5544,6 +5562,10 @@ FrameWindow::InitCollationCombo(HWND hwnd)
{
wnd->m_tunnel->mysql_free_result(myres);
}
+
+ // Set the width of the collation combo box based on the widest item
+ width = SetComboWidth(hwndcombo);
+ SendMessage(hwndcombo, CB_SETDROPPEDWIDTH, width + COMBOWIDTHMARGIN, 0);
}
wyBool
@@ -9056,49 +9078,85 @@ FrameWindow::FetchSelectedCollation(HWND hwnd)
void
FrameWindow::ReInitRelatedCollations(HWND hwnd)
{
- MDIWindow *pcquerywnd = GetActiveWin();
+ MDIWindow *pcquerywnd = GetActiveWin();
MYSQL_RES *myres;
MYSQL_ROW myrow;
wyWChar *relcollation = NULL;
- wyString query, collationstr;
- wyInt32 ret, index = 0;
-
+ wyString query, collationstr, selectedcharset;
+ wyInt32 ret, index = 0, width;
+
HWND hwndcombo = GetDlgItem(hwnd, IDC_COLLATECOMBO);
-
- query.SetAs("show collation");
+
+ bool isMariaDbSelectedCharSet = false;
+
+ // Check for MariaDB connection
+ if (IsMariaDB(pcquerywnd->m_tunnel, &pcquerywnd->m_mysql))
+ {
+ selectedcharset.SetAs(pcquerywnd->m_pcqueryobject->m_dbcharset);
+ isMariaDbSelectedCharSet = selectedcharset.CompareI(STR_DEFAULT) != 0;
+ if (IsMariaDB101000(pcquerywnd->m_tunnel, &pcquerywnd->m_mysql))
+ {
+ // For MariaDB 10.10.0 or higher, use the FULL_COLLATION_NAME
+ query.SetAs("SELECT DISTINCT FULL_COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ else
+ {
+ // For MariaDB versions lower than 10.10.0, use the COLLATION_NAME
+ query.SetAs("SELECT DISTINCT COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+
+ if (isMariaDbSelectedCharSet) {
+ query.Add(" WHERE CHARACTER_SET_NAME = '");
+ query.Add(selectedcharset.GetString());
+ query.Add("' ");
+ }
+ }
+ else
+ {
+ // For other Database server existing flow will work and SHOW COLLATION will work to get the list of collations
+ query.SetAs("SHOW COLLATION");
+ }
+
myres = ExecuteAndGetResult(pcquerywnd, pcquerywnd->m_tunnel, &pcquerywnd->m_mysql, query);
- if(!myres)
- {
+ if (!myres) {
ShowMySQLError(hwnd, pcquerywnd->m_tunnel, &pcquerywnd->m_mysql, query.GetString());
- return;
- }
-
+ return;
+ }
+
VERIFY(SendMessage(hwndcombo, CB_RESETCONTENT, 0, 0));
-
- while(myrow = pcquerywnd->m_tunnel->mysql_fetch_row(myres))
- {
+
+ while ((myrow = pcquerywnd->m_tunnel->mysql_fetch_row(myres)))
+ {
collationstr.SetAs(myrow[0]);
- ret = SendMessage(hwndcombo, CB_FINDSTRINGEXACT, -1,(LPARAM)collationstr.GetAsWideChar());
- if(ret != CB_ERR)
- {
- if(wcsstr(collationstr.GetAsWideChar(), pcquerywnd->m_pcqueryobject->m_dbcharset.GetAsWideChar()) == NULL)
+ ret = SendMessage(hwndcombo, CB_FINDSTRINGEXACT, -1, (LPARAM)collationstr.GetAsWideChar());
+ if (ret != CB_ERR)
+ {
+ if (wcsstr(collationstr.GetAsWideChar(), pcquerywnd->m_pcqueryobject->m_dbcharset.GetAsWideChar()) == NULL)
SendMessage(hwndcombo, CB_DELETESTRING, ret, 0);
}
- else if((relcollation = wcsstr(collationstr.GetAsWideChar(), pcquerywnd->m_pcqueryobject->m_dbcharset.GetAsWideChar())) != NULL)
+ else if (isMariaDbSelectedCharSet)
{
- if(collationstr.GetCharAt(pcquerywnd->m_pcqueryobject->m_dbcharset.GetLength()) == '_')
+ SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)collationstr.GetAsWideChar());
+ }
+ else if ((relcollation = wcsstr(collationstr.GetAsWideChar(), pcquerywnd->m_pcqueryobject->m_dbcharset.GetAsWideChar())) != NULL) {
+ if (collationstr.GetCharAt(pcquerywnd->m_pcqueryobject->m_dbcharset.GetLength()) == '_')
SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)collationstr.GetAsWideChar());
}
- else if(pcquerywnd->m_pcqueryobject->m_dbcharset.CompareI(STR_DEFAULT) == 0)
+ else if (pcquerywnd->m_pcqueryobject->m_dbcharset.CompareI(STR_DEFAULT) == 0) {
SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)collationstr.GetAsWideChar());
+ }
}
-
- //Select 'Default'
- if((index = SendMessage(hwndcombo , CB_ADDSTRING, 0,(LPARAM)TEXT(STR_DEFAULT))) != CB_ERR)
+
+ //Select 'Default'
+ if ((index = SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)TEXT(STR_DEFAULT))) != CB_ERR)
SendMessage(hwndcombo, CB_SELECTSTRING, 0, (LPARAM)TEXT(STR_DEFAULT));
pcquerywnd->m_tunnel->mysql_free_result(myres);
+
+ // Set the width of the collation combo box based on the widest item
+ width = SetComboWidth(hwndcombo);
+ SendMessage(hwndcombo, CB_SETDROPPEDWIDTH, width + COMBOWIDTHMARGIN, 0);
}
wyBool
diff --git a/src/MySQLVersionHelper.cpp b/src/MySQLVersionHelper.cpp
index 24a6fc5..20e7b8c 100644
--- a/src/MySQLVersionHelper.cpp
+++ b/src/MySQLVersionHelper.cpp
@@ -576,6 +576,43 @@ wyBool IsMariaDB100502(Tunnel * tunnel, PMYSQL mysql)
return wyFalse;
}
+
+// Check the version of MariaDB for 10.10.0 and above
+wyBool IsMariaDB101000(Tunnel * tunnel, PMYSQL mysql)
+{
+ long me = mysql_get_server_version(*mysql);
+ const char *dbString = mysql_get_server_info(*mysql);
+
+ if (me >= 101000 && strstr(dbString, "MariaDB"))
+ return wyTrue;
+ else
+ return wyFalse;
+}
+
+// Check the version of MariaDB for 10.5.0 and above
+wyBool IsMariaDB100500(Tunnel * tunnel, PMYSQL mysql)
+{
+ long me = mysql_get_server_version(*mysql);
+ const char *dbString = mysql_get_server_info(*mysql);
+
+ if (me >= 100500 && strstr(dbString, "MariaDB"))
+ return wyTrue;
+ else
+ return wyFalse;
+}
+
+// Check the version of MariaDB for 10.7.0 and above
+wyBool IsMariaDB100700(Tunnel * tunnel, PMYSQL mysql)
+{
+ long me = mysql_get_server_version(*mysql);
+ const char *dbString = mysql_get_server_info(*mysql);
+
+ if (me >= 100700 && strstr(dbString, "MariaDB"))
+ return wyTrue;
+ else
+ return wyFalse;
+}
+
// MySQL version check for 5.7.6 and above for Alter/Create query
wyBool IsMySQL576(Tunnel * tunnel, PMYSQL mysql)
{
diff --git a/src/TabFields.cpp b/src/TabFields.cpp
index b0c8d5a..5bbf122 100644
--- a/src/TabFields.cpp
+++ b/src/TabFields.cpp
@@ -125,6 +125,9 @@ TabFields::TabFields(HWND hwnd, TableTabInterfaceTabMgmt* ptabmgmt)
m_mdiwnd = GetActiveWin();
m_ismysql41 = IsMySQL41(m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql));
m_ismariadb52 = IsMariaDB52(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
+ m_ismariadb1010 = IsMariaDB101000(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
+ m_ismariadb105 = IsMariaDB100500(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
+ m_ismariadb107 = IsMariaDB100700(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
m_ismysql57 = IsMySQL57(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
m_ismysql578 = IsMySQL578(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
m_ismariadb10309 = IsMariaDB10309(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql);
@@ -1120,23 +1123,50 @@ TabFields::CreateGrid(HWND hwnd)
wyBool
TabFields::InitGrid()
{
- wyInt32 counter; // normal counter
+ wyInt32 counter,index; // normal counter
wyInt32 num_cols; // number of columns
GVCOLUMN gvcol; // structure used to create columns for grid
- //wyWChar (*type)[33][20];
- wyWChar type[33][20] = { L"tinyint", L"smallint", L"mediumint", L"int", L"bigint", L"real", L"bit", L"bool", L"boolean",
- L"float", L"double", L"decimal", L"date", L"datetime", L"timestamp", L"numeric", L"time", L"year", L"char",
- L"varchar", L"tinyblob", L"tinytext", L"text",L"blob" ,L"mediumblob", L"mediumtext", L"longblob", L"longtext",
- L"enum", L"set", L"binary", L"varbinary" };
- if(m_ismysql578)
+ wyWChar type[36][20] = { L"tinyint",L"smallint", L"mediumint", L"int", L"bigint", L"real", L"bit", L"bool", L"boolean",
+ L"float", L"double", L"decimal", L"date", L"datetime", L"timestamp", L"numeric", L"time", L"year", L"char",
+ L"varchar", L"tinyblob", L"tinytext", L"text", L"blob", L"mediumblob", L"mediumtext", L"longblob", L"longtext",
+ L"enum", L"set", L"binary", L"varbinary"};
+
+ //set visiblity off for new data types based on maria db versions.
+ index = 31;
+
+ if (m_ismysql578)
{
- type[32][0]='j';
- type[32][1]='s';
- type[32][2]='o';
- type[32][3]='n';
+ index++;
+ type[index][0] = 'j';
+ type[index][1] = 's';
+ type[index][2] = 'o';
+ type[index][3] = 'n';
+
+ }
+ if (m_ismariadb105) {
+ index++;
+ type[index][0] = 'i';
+ type[index][1] = 'n';
+ type[index][2] = 'e';
+ type[index][3] = 't';
+ type[index][4] = '6';
+ }
+ if (m_ismariadb1010) {
+ index++;
+ type[index][0] = 'i';
+ type[index][1] = 'n';
+ type[index][2] = 'e';
+ type[index][3] = 't';
+ type[index][4] = '4';
+ }
+ if (m_ismariadb107) {
+ index++;
+ type[index][0] = 'u';
+ type[index][1] = 'u';
+ type[index][2] = 'i';
+ type[index][3] = 'd';
}
-
wyWChar virtuallity[3][20]= { L"(none)", L"VIRTUAL",NULL};
if (m_ismariadb10309)
mbstowcs(virtuallity[2], "STORED", strlen("STORED") + 1);
@@ -1167,10 +1197,8 @@ TabFields::InitGrid()
VOID *listtype[] = {NULL, (VOID*)type, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, (void*)virtuallity,NULL,NULL};
wyInt32 elemsize[] = { 0, sizeof(type[0]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,sizeof(virtuallity[0]),0,0};
- wyInt32 elemcount[] = {0, sizeof(type)/sizeof(type[0]), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, sizeof(virtuallity)/sizeof(virtuallity[0]),0,0};
+ wyInt32 elemcount[] = {0, index + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, sizeof(virtuallity)/sizeof(virtuallity[0]),0,0};
- if(! m_ismysql578) // to avoid extra counting of the new datatype json
- elemcount[1]=elemcount[1]-1;
for (counter=0; counter < num_cols ; counter++ )
{
@@ -2480,13 +2508,32 @@ TabFields::FilterCollationColumn(wyInt32 row, wyInt32 charsetlen)
selcharset = AllocateBuffWChar(charsetlen + 1);
- CustomGrid_GetItemText(m_hgridfields, row, CHARSETCOL, selcharset);
+ CustomGrid_GetItemText(m_hgridfields, row, CHARSETCOL, selcharset);
CustomGrid_DeleteListContent(m_hgridfields, COLLATIONCOL);
selcharsetstr.SetAs(selcharset);
free(selcharset);
- query.SetAs("show collation");
+ // Check for MariaDB connection
+ if (IsMariaDB(m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql)))
+ {
+ // Compare version number
+ if (IsMariaDB101000(m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql)))
+ {
+ // For MariaDB 10.10.0 or higher, use the FULL_COLLATION_NAME
+ query.SetAs("SELECT DISTINCT FULL_COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ else
+ {
+ // For MariaDB versions lower than 10.10.0, use the COLLATION_NAME
+ query.SetAs("SELECT DISTINCT COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ }
+ else
+ {
+ // For other Database server existing flow will work and SHOW COLLATION will work to get the list of collations
+ query.SetAs("SHOW COLLATION");
+ }
myres = ExecuteAndGetResult(m_mdiwnd, m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql), query);
if(!myres)
{
@@ -2519,7 +2566,25 @@ TabFields::InitCollationCol()
MYSQL_RES *myres = NULL;
MYSQL_ROW myrow;
- query.SetAs("show collation");
+ // Check for MariaDB connection
+ if (IsMariaDB(m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql)))
+ {
+ if (IsMariaDB101000(m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql)))
+ {
+ // For MariaDB 10.10.0 or higher, use the FULL_COLLATION_NAME
+ query.SetAs("SELECT DISTINCT FULL_COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ else
+ {
+ // For MariaDB versions lower than 10.10.0, use the COLLATION_NAME
+ query.SetAs("SELECT DISTINCT COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ }
+ else
+ {
+ // For other Database server existing flow will work and SHOW COLLATION will work to get the list of collations
+ query.SetAs("SHOW COLLATION");
+ }
myres = ExecuteAndGetResult(m_mdiwnd, m_mdiwnd->m_tunnel, &(m_mdiwnd->m_mysql), query);
if(!myres)
{
@@ -4670,6 +4735,51 @@ TabFields::HandleSetEnumValidation(HWND &hwndgrid, wyUInt32 &row, wyUInt32 &inde
return wyTrue;
}
+wyBool
+TabFields::HandleInet4andInet6andUuidValidation(HWND &hwndgrid, wyUInt32 &row, wyUInt32 &index)
+{
+ FieldStructWrapper *cwrapobj = NULL;
+
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, CHARSET, wyTrue);
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, COLLATION, wyTrue);
+
+ CustomGrid_SetText(hwndgrid, row, CHARSET, "");
+ CustomGrid_SetText(hwndgrid, row, COLLATION, "");
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, DEFVALUE, wyFalse);
+
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, PRIMARY, wyFalse);
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, UNSIGNED + index, wyFalse);
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, ZEROFILL + index, wyFalse);
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, LENGTH, wyTrue);
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, AUTOINCR + index, wyFalse);
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, ONUPDATECT, wyTrue);
+ CustomGrid_SetBoolValue(hwndgrid, row, ONUPDATECT, GV_FALSE);
+
+ // Handle BINARY column if MySQL version is less than 4.1
+ if (m_ismysql41 == wyFalse)
+ {
+ CustomGrid_SetColumnReadOnly(hwndgrid, row, BINARY, wyTrue);
+ CustomGrid_SetBoolValue(hwndgrid, row, BINARY, GV_FALSE);
+ }
+
+ // Get the FieldStructWrapper object
+ cwrapobj = (FieldStructWrapper *)CustomGrid_GetRowLongData(m_hgridfields, row);
+ if (cwrapobj && cwrapobj->m_newval)
+ {
+ // Clear CHARSET and COLLATION values in newval object
+ cwrapobj->m_newval->m_charset.Clear();
+ cwrapobj->m_newval->m_collation.Clear();
+
+ // Set other attributes in newval object
+ cwrapobj->m_newval->m_onupdate = wyFalse;
+ if (m_ismysql41 == wyFalse)
+ cwrapobj->m_newval->m_binary = wyFalse;
+ }
+
+ return wyTrue;
+}
+
+
wyBool
TabFields::SetValidation(wyUInt32 row, wyChar* datatype)
{
@@ -4769,7 +4879,12 @@ TabFields::SetValidation(wyUInt32 row, wyChar* datatype)
if ((stricmp (datatype , "set" ) == 0 ) ||
(stricmp (datatype , "enum" ) == 0 ) )
return HandleSetEnumValidation(hwndgrid, row, index);
-
+ if ((stricmp(datatype, "inet4") == 0) ||
+ (stricmp(datatype, "inet6") == 0) ||
+ (stricmp(datatype, "uuid") == 0))
+ {
+ return HandleInet4andInet6andUuidValidation(hwndgrid, row, index);
+ }
return wyTrue;
}
diff --git a/src/TableTabInterface.cpp b/src/TableTabInterface.cpp
index a44cb68..0a172cc 100644
--- a/src/TableTabInterface.cpp
+++ b/src/TableTabInterface.cpp
@@ -1480,25 +1480,52 @@ TableTabInterface::HandleTabCharset()
}
void
-TableTabInterface::ReInitRelatedCollations(HWND hwnd, wyWChar *charsetname)
+TableTabInterface::ReInitRelatedCollations(HWND hwnd, wyWChar *charsetname)
{
- MYSQL_RES *myres;
- MYSQL_ROW myrow;
- wyWChar *relcollation = NULL;
- wyString query, collationstr;
- wyInt32 ret, selcharsetlen = 0;
+ MYSQL_RES *myres;
+ MYSQL_ROW myrow;
+ wyWChar *relcollation = NULL;
+ wyString query, collationstr, charsetstr;
+ wyInt32 ret, selcharsetlen = 0, width;
- HWND hwndcombo = m_hcmbcollation;// GetDlgItem(hwnd, IDC_TABCOLLATION);
+ HWND hwndcombo = m_hcmbcollation; // GetDlgItem(hwnd, IDC_TABCOLLATION);
+
+ bool isMariaDbSelectedCharSet = false;
+ charsetstr.SetAs(charsetname);
- query.SetAs("show collation");
+ // Check for MariaDB connection
+ if (IsMariaDB(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql))
+ {
+ isMariaDbSelectedCharSet = charsetname && wcscmp(charsetname, TEXT(STR_DEFAULT)) != 0;
+ if (IsMariaDB101000(m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql))
+ {
+ // For MariaDB 10.10.0 or higher, use the FULL_COLLATION_NAME
+ query.SetAs("SELECT DISTINCT FULL_COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ else
+ {
+ // For MariaDB versions lower than 10.10.0, use the COLLATION_NAME
+ query.SetAs("SELECT DISTINCT COLLATION_NAME, CHARACTER_SET_NAME FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY");
+ }
+ if (isMariaDbSelectedCharSet) {
+ query.Add(" WHERE CHARACTER_SET_NAME = '");
+ query.Add(charsetstr.GetString());
+ query.Add("' ");
+ }
+ }
+ else
+ {
+ // For other Database server existing flow will work and SHOW COLLATION will work to get the list of collations
+ query.SetAs("SHOW COLLATION");
+ }
myres = ExecuteAndGetResult(m_mdiwnd, m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql, query);
if(!myres)
- {
+ {
ShowMySQLError(hwnd, m_mdiwnd->m_tunnel, &m_mdiwnd->m_mysql, query.GetString());
- return;
- }
+ return;
+ }
- VERIFY((hwndcombo, CB_RESETCONTENT, 0, 0));
+ VERIFY(SendMessage(hwndcombo, CB_RESETCONTENT, 0, 0));
if(charsetname)
selcharsetlen = wcslen(charsetname);
@@ -1507,12 +1534,16 @@ TableTabInterface::ReInitRelatedCollations(HWND hwnd, wyWChar *charsetname)
{
collationstr.SetAs(myrow[0]);
ret = SendMessage(hwndcombo, CB_FINDSTRINGEXACT, -1,(LPARAM)collationstr.GetAsWideChar());
- if(ret != CB_ERR)
+ if(ret != CB_ERR)
{
//delete the items which are not relevent
if(wcsstr(collationstr.GetAsWideChar(), charsetname) == NULL)
SendMessage(hwndcombo, CB_DELETESTRING, ret, 0);
}
+ else if (isMariaDbSelectedCharSet)
+ {
+ SendMessage(hwndcombo, CB_ADDSTRING, 0, (LPARAM)collationstr.GetAsWideChar());
+ }
else if((relcollation = wcsstr(collationstr.GetAsWideChar(), charsetname)) != NULL)
{
// Add the relevent items
@@ -1522,9 +1553,6 @@ TableTabInterface::ReInitRelatedCollations(HWND hwnd, wyWChar *charsetname)
}
m_mdiwnd->m_tunnel->mysql_free_result(myres);
-
- wyString charsetstr;
- charsetstr.SetAs(charsetname);
ret = SendMessage(hwndcombo, CB_FINDSTRINGEXACT, -1,(LPARAM)TEXT(STR_DEFAULT));
@@ -1544,6 +1572,10 @@ TableTabInterface::ReInitRelatedCollations(HWND hwnd, wyWChar *charsetname)
else
SendMessage(hwndcombo, CB_SETCURSEL, (WPARAM)0, 0);
}
+
+ // Set the width of the collation combo box based on the widest item
+ width = SetComboWidth(m_hcmbcollation);
+ SendMessage(m_hcmbcollation, CB_SETDROPPEDWIDTH, width + COMBOWIDTHMARGIN, 0);
}
LRESULT CALLBACK
@@ -1876,7 +1908,7 @@ TableTabInterface::CreateOtherWindows()
//...Creating Colation Windows (Static & Combo)
m_hstatcollation = CreateWindowEx(0, WC_STATIC, _(TEXT("Collation")),
- style, 0, 0, 0, 0, m_hwnd, (HMENU) 0,
+ style, 0, 0, 0, 0, m_hwnd, (HMENU) 0,
(HINSTANCE)pGlobals->m_hinstance, NULL);
if(m_hstatcollation)
{
@@ -1884,15 +1916,18 @@ TableTabInterface::CreateOtherWindows()
UpdateWindow(m_hstatcollation);
}
- m_hcmbcollation = CreateWindowEx(WS_EX_CLIENTEDGE, WC_COMBOBOX, _(TEXT("")),
- style | CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP | WS_GROUP,
- 0, 0, 0, 0, m_hwnd,
- (HMENU) IDC_TABCOLLATION, (HINSTANCE)pGlobals->m_hinstance, NULL);
+ m_hcmbcollation = CreateWindowEx(WS_EX_CLIENTEDGE, WC_COMBOBOX, _(TEXT("")),
+ style | CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP | WS_GROUP,
+ 0, 0, 0, 0, m_hwnd,
+ (HMENU)IDC_TABCOLLATION, (HINSTANCE)pGlobals->m_hinstance, NULL);
+
+
if(m_hcmbcollation)
{
ShowWindow(m_hcmbcollation, SW_SHOW);
- UpdateWindow(m_hcmbcollation);
- }
+ UpdateWindow(m_hcmbcollation);
+
+ }
m_hbtnsave = CreateWindowEx(0, WC_BUTTON, _(TEXT("&Save")), style | WS_TABSTOP| WS_GROUP , 0,0, 0,0,
m_hwnd, (HMENU)IDC_SAVE,