]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
version: add gsasl_version to curl_version_info_data
authorMartin Halle <Martin.Halle@tuhh.de>
Sat, 3 Apr 2021 04:42:01 +0000 (06:42 +0200)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 22 Apr 2021 22:28:28 +0000 (18:28 -0400)
- 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
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/version.c
packages/OS400/ccsidcurl.c
packages/OS400/curl.inc.in

index 8c93a8c7d2408849f5134f3a1c5dc79b9c451d65..e518bf968587212711ca045e4e7360048f1bc658 100644 (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
 
index 0f5e95740c829c2387cff77d8676159eee010f3c..0d089ec434acdbe808dd532dbbd4e13f508b743f 100644 (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
index 40b5ed12961f95a425ac61e5b0bfa0340399e5da..cd3207b1f976f48cf0c2d8c1096988941cd25777 100644 (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;
 
index d2c86baace14ba37ce1637b945410400b71bacaf..4b1e7542cbc0f53037b85f100584be0f431ff559 100644 (file)
 #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;
 }
index 8b515fb8f3617835828f83dedcdbde344f9a98c4..e006cd1bba8635b77a216d9ef4db107ae3685a7c 100644 (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
 
index 979820650d93d7224eba4815c56c742b3ecf4f37..73aaaccb144f30c76a662b4c1267139d9fa194be 100644 (file)
      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...
      d  zstd_version...
      d                                 *                                        const char *
      d  hyper_version...
+     d                                 *                                        const char *
+     d  gsasl_version...
      d                                 *                                        const char *
       *
      d curl_certinfo   ds                  based(######ptr######)