From e540b32562a0844e2241b624deb7d9e25ac46b2d Mon Sep 17 00:00:00 2001 From: Martin Halle Date: Sat, 3 Apr 2021 06:42:01 +0200 Subject: [PATCH] version: add gsasl_version to curl_version_info_data - Add gsasl_version string and bump to CURLVERSION_TENTH. Ref: https://curl.se/mail/lib-2021-04/0003.html Closes https://github.com/curl/curl/pull/6843 --- docs/libcurl/curl_version_info.3 | 6 ++++++ docs/libcurl/symbols-in-versions | 1 + include/curl/curl.h | 6 +++++- lib/version.c | 13 ++++++++++++- packages/OS400/ccsidcurl.c | 5 +++-- packages/OS400/curl.inc.in | 6 +++++- 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/docs/libcurl/curl_version_info.3 b/docs/libcurl/curl_version_info.3 index 8c93a8c7d..e518bf968 100644 --- a/docs/libcurl/curl_version_info.3 +++ b/docs/libcurl/curl_version_info.3 @@ -97,6 +97,12 @@ typedef struct { unsigned int zstd_ver_num; /* Numeric Zstd version (MAJOR << 24) | (MINOR << 12) | PATCH */ const char *zstd_version; /* human readable string. */ + /* when 'age' is CURLVERSION_NINTH or higher (>= 7.75.0), the members + below exist */ + const char *hyper_version; /* human readable string. */ + /* when 'age' is CURLVERSION_TENTH or higher (>= 7.77.0), the members + below exist */ + const char *gsasl_version; /* human readable string. */ } curl_version_info_data; .fi diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions index 0f5e95740..0d089ec43 100644 --- a/docs/libcurl/symbols-in-versions +++ b/docs/libcurl/symbols-in-versions @@ -881,6 +881,7 @@ CURLVERSION_NOW 7.10 CURLVERSION_SECOND 7.11.1 CURLVERSION_SEVENTH 7.70.0 CURLVERSION_SIXTH 7.66.0 +CURLVERSION_TENTH 7.77.0 CURLVERSION_THIRD 7.12.0 CURL_CHUNK_BGN_FUNC_FAIL 7.21.0 CURL_CHUNK_BGN_FUNC_OK 7.21.0 diff --git a/include/curl/curl.h b/include/curl/curl.h index 40b5ed129..cd3207b1f 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -2870,6 +2870,7 @@ typedef enum { CURLVERSION_SEVENTH, CURLVERSION_EIGHTH, CURLVERSION_NINTH, + CURLVERSION_TENTH, CURLVERSION_LAST /* never actually use this */ } CURLversion; @@ -2878,7 +2879,7 @@ 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_NINTH +#define CURLVERSION_NOW CURLVERSION_TENTH struct curl_version_info_data { CURLversion age; /* age of the returned struct */ @@ -2931,6 +2932,9 @@ struct curl_version_info_data { /* 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. */ }; typedef struct curl_version_info_data curl_version_info_data; diff --git a/lib/version.c b/lib/version.c index d2c86baac..4b1e7542c 100644 --- a/lib/version.c +++ b/lib/version.c @@ -66,6 +66,10 @@ #include #endif +#ifdef USE_GSASL +#include +#endif + #ifdef HAVE_BROTLI static size_t brotli_version(char *buf, size_t bufsz) { @@ -469,7 +473,8 @@ static curl_version_info_data version_info = { #endif 0, /* zstd_ver_num */ NULL, /* zstd version */ - NULL /* Hyper version */ + NULL, /* Hyper version */ + NULL /* gsasl version */ }; curl_version_info_data *curl_version_info(CURLversion stamp) @@ -573,6 +578,12 @@ curl_version_info_data *curl_version_info(CURLversion stamp) } #endif +#ifdef USE_GSASL + { + version_info.gsasl_version = gsasl_check_version(NULL); + } +#endif + (void)stamp; /* avoid compiler warnings, we don't use this */ return &version_info; } diff --git a/packages/OS400/ccsidcurl.c b/packages/OS400/ccsidcurl.c index 8b515fb8f..e006cd1bb 100644 --- a/packages/OS400/ccsidcurl.c +++ b/packages/OS400/ccsidcurl.c @@ -411,14 +411,15 @@ curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid) offsetof(curl_version_info_data, cainfo), offsetof(curl_version_info_data, capath), offsetof(curl_version_info_data, zstd_version), - offsetof(curl_version_info_data, hyper_version) + offsetof(curl_version_info_data, hyper_version), + offsetof(curl_version_info_data, gsasl_version) }; /* The assertion below is possible, because although the second operand is an enum member, the first is a #define. In that case, the OS/400 C compiler seems to compare string values after substitution. */ -#if CURLVERSION_NOW != CURLVERSION_NINTH +#if CURLVERSION_NOW != CURLVERSION_TENTH #error curl_version_info_data structure has changed: upgrade this procedure. #endif diff --git a/packages/OS400/curl.inc.in b/packages/OS400/curl.inc.in index 979820650..73aaaccb1 100644 --- a/packages/OS400/curl.inc.in +++ b/packages/OS400/curl.inc.in @@ -1960,8 +1960,10 @@ d c 7 d CURLVERSION_NINTH... d c 8 + d CURLVERSION_TENTH... + d c 9 d CURLVERSION_NOW... - d c 8 CURLVERSION_NINTH + d c 9 CURLVERSION_TENTH * d curlsocktype s 10i 0 based(######ptr######) Enum d CURLSOCKTYPE_IPCXN... @@ -2259,6 +2261,8 @@ d zstd_version... d * const char * d hyper_version... + d * const char * + d gsasl_version... d * const char * * d curl_certinfo ds based(######ptr######)