1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 00:28:48 -05:00

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
This commit is contained in:
Martin Halle 2021-04-03 06:42:01 +02:00 committed by Jay Satiro
parent 67d3afa73f
commit e540b32562
6 changed files with 32 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -66,6 +66,10 @@
#include <zstd.h>
#endif
#ifdef USE_GSASL
#include <gsasl.h>
#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;
}

View File

@ -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

View File

@ -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######)