]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
version: include hyper version
authorDaniel Stenberg <daniel@haxx.se>
Mon, 14 Dec 2020 13:10:33 +0000 (14:10 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 18 Dec 2020 08:58:03 +0000 (09:58 +0100)
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/version.c

index 861aaf88f48ab6a9c803f2d22b56ba29eaaa7e45..9abd3d67863fd5beb77f4f28675de9139bf96a00 100644 (file)
@@ -867,6 +867,7 @@ CURLVERSION_EIGHTH              7.72.0
 CURLVERSION_FIFTH               7.57.0
 CURLVERSION_FIRST               7.10
 CURLVERSION_FOURTH              7.16.1
+CURLVERSION_NINTH               7.75.0
 CURLVERSION_NOW                 7.10
 CURLVERSION_SECOND              7.11.1
 CURLVERSION_SEVENTH             7.70.0
index a73418dcea0de8ab95bfd4d6aaad3d39ba07b1f3..76ebd8993c47a026679dd5d162b94c68320ed77f 100644 (file)
@@ -2849,6 +2849,7 @@ typedef enum {
   CURLVERSION_SIXTH,
   CURLVERSION_SEVENTH,
   CURLVERSION_EIGHTH,
+  CURLVERSION_NINTH,
   CURLVERSION_LAST /* never actually use this */
 } CURLversion;
 
@@ -2857,7 +2858,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_EIGHTH
+#define CURLVERSION_NOW CURLVERSION_NINTH
 
 struct curl_version_info_data {
   CURLversion age;          /* age of the returned struct */
@@ -2908,6 +2909,8 @@ struct curl_version_info_data {
                                   (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. */
 };
 typedef struct curl_version_info_data curl_version_info_data;
 
index ab2c0d812af8edd0c616aa7c616ec9ff1d30be2d..a9102ec1ea57911e3f3c71383f16dfb546c7d3aa 100644 (file)
@@ -100,7 +100,7 @@ static size_t zstd_version(char *buf, size_t bufsz)
  * zeros in the data.
  */
 
-#define VERSION_PARTS 14 /* number of substrings we can concatenate */
+#define VERSION_PARTS 15 /* number of substrings we can concatenate */
 
 char *curl_version(void)
 {
@@ -143,6 +143,9 @@ char *curl_version(void)
 #endif
 #ifdef USE_LIBRTMP
   char rtmp_version[40];
+#endif
+#ifdef USE_HYPER
+  char hyper_buf[30];
 #endif
   int i = 0;
   int j;
@@ -228,6 +231,10 @@ char *curl_version(void)
     src[i++] = rtmp_version;
   }
 #endif
+#ifdef USE_HYPER
+  msnprintf(hyper_buf, sizeof(hyper_buf), "Hyper/%s", hyper_version());
+  src[i++] = hyper_buf;
+#endif
 
   DEBUGASSERT(i <= VERSION_PARTS);
 
@@ -397,7 +404,7 @@ static curl_version_info_data version_info = {
 #if defined(USE_TLS_SRP)
   | CURL_VERSION_TLSAUTH_SRP
 #endif
-#if defined(USE_NGHTTP2)
+#if defined(USE_NGHTTP2) || defined(USE_HYPER)
   | CURL_VERSION_HTTP2
 #endif
 #if defined(ENABLE_QUIC)
@@ -450,7 +457,8 @@ static curl_version_info_data version_info = {
   NULL,
 #endif
   0,    /* zstd_ver_num */
-  NULL  /* zstd version */
+  NULL, /* zstd version */
+  NULL  /* Hyper version */
 };
 
 curl_version_info_data *curl_version_info(CURLversion stamp)
@@ -472,7 +480,6 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
   static char zstd_buffer[80];
 #endif
 
-
 #ifdef USE_SSL
   Curl_ssl_version(ssl_buffer, sizeof(ssl_buffer));
   version_info.ssl_version = ssl_buffer;
@@ -547,6 +554,14 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
   }
 #endif
 
+#ifdef USE_HYPER
+  {
+    static char hyper_buffer[30];
+    msnprintf(hyper_buffer, sizeof(hyper_buffer), "Hyper/%s", hyper_version());
+    version_info.hyper_version = hyper_buffer;
+  }
+#endif
+
   (void)stamp; /* avoid compiler warnings, we don't use this */
   return &version_info;
 }