]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
docs: add CURLOPT type change history, drop casts where present
authorViktor Szakats <commit@vsz.me>
Fri, 1 Aug 2025 10:49:40 +0000 (12:49 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 1 Aug 2025 22:05:33 +0000 (00:05 +0200)
Some CURLOPT constants defined in the curl public headers were initially
enums (= ints), or macros with bare numeric values. Recent curl releases
upgraded them to `long` constants, to make them pass correctly to
`curl_easy_setop()` by default, i.e. without requiring a `(long)` cast.

This patch drops such casts from the examples embedded in the docs. At
the same time it documents which curl release made them `long` types,
to keep them useful when working with previous libcurl versions.

Also:
- drop a `(long)` cast that was never necessary.
- CURLOPT_ALTSVC_CTRL.md: bump local copy of macros to long.
- test1119: make it ignore symbols ending with an underscore, to skip
  wildcard, e.g. `**CURLAUTH_***`.

Closes #18130

37 files changed:
.github/scripts/spellcheck.words
docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md
docs/libcurl/opts/CURLOPT_ALTSVC.md
docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md
docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md
docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md
docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md
docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md
docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md
docs/libcurl/opts/CURLOPT_HEADEROPT.md
docs/libcurl/opts/CURLOPT_HSTS_CTRL.md
docs/libcurl/opts/CURLOPT_HTTPAUTH.md
docs/libcurl/opts/CURLOPT_HTTP_VERSION.md
docs/libcurl/opts/CURLOPT_IPRESOLVE.md
docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md
docs/libcurl/opts/CURLOPT_NETRC.md
docs/libcurl/opts/CURLOPT_NETRC_FILE.md
docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md
docs/libcurl/opts/CURLOPT_POSTREDIR.md
docs/libcurl/opts/CURLOPT_PROTOCOLS.md
docs/libcurl/opts/CURLOPT_PROXYAUTH.md
docs/libcurl/opts/CURLOPT_PROXYTYPE.md
docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md
docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md
docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md
docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md
docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md
docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md
docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md
docs/libcurl/opts/CURLOPT_SSLVERSION.md
docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md
docs/libcurl/opts/CURLOPT_TIMECONDITION.md
docs/libcurl/opts/CURLOPT_TIMEVALUE.md
docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md
docs/libcurl/opts/CURLOPT_USE_SSL.md
docs/libcurl/opts/CURLOPT_WS_OPTIONS.md
tests/test1119.pl

index 90546bb65f5217e8d2933a40070d4897143762b3..3f615331b467dec297f265859490ae59473a4c42 100644 (file)
@@ -230,6 +230,7 @@ else's
 encodings
 enctype
 endianness
+enums
 Engler
 enum
 epoll
index bbbe42c48120fa48357aaac18ae67c8634877d37..5f13126ad7c4cb7e3046c8436bfbca8640adaa63 100644 (file)
@@ -54,8 +54,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
 
     /* If-Modified-Since the above time stamp */
-    curl_easy_setopt(curl, CURLOPT_TIMECONDITION,
-                     (long)CURL_TIMECOND_IFMODSINCE);
+    curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
 
     /* Perform the request */
     res = curl_easy_perform(curl);
index 14e3f31f92bec8c929ef99d5848b47ab95ba2a7e..b74565790cddef66b1a136b48cf031291fd2d04e 100644 (file)
@@ -60,13 +60,18 @@ int main(void)
 {
   CURL *curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, (long)CURLALTSVC_H1);
+    curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
     curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
     curl_easy_perform(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLALTSVC_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # FILE FORMAT
 
 A text based file with one line per alt-svc entry and each line consists of
index 5ae40b57bd1f909ba4dbe553df9fca124eaf264c..84e5d6657c0297bd319b1c93f04d3ac505f1279e 100644 (file)
@@ -22,10 +22,10 @@ CURLOPT_ALTSVC_CTRL - control alt-svc behavior
 ~~~c
 #include <curl/curl.h>
 
-#define CURLALTSVC_READONLYFILE (1<<2)
-#define CURLALTSVC_H1           (1<<3)
-#define CURLALTSVC_H2           (1<<4)
-#define CURLALTSVC_H3           (1<<5)
+#define CURLALTSVC_READONLYFILE (1L<<2)
+#define CURLALTSVC_H1           (1L<<3)
+#define CURLALTSVC_H2           (1L<<4)
+#define CURLALTSVC_H3           (1L<<5)
 
 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask);
 ~~~
@@ -84,13 +84,18 @@ int main(void)
 {
   CURL *curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, (long)CURLALTSVC_H1);
+    curl_easy_setopt(curl, CURLOPT_ALTSVC_CTRL, CURLALTSVC_H1);
     curl_easy_setopt(curl, CURLOPT_ALTSVC, "altsvc-cache.txt");
     curl_easy_perform(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLALTSVC_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 5252da7db5a2dab9b0687be4c6dd50fe63b6ac5a..a2021f830e96838b65197fe1e7a9b9efcaad2709 100644 (file)
@@ -61,13 +61,18 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
     curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);
     /* funny server, ask for SSL before TLS */
-    curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, (long)CURLFTPAUTH_SSL);
+    curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_SSL);
     res = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLFTPAUTH_*** enums became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index ea7d49d7765b3f7e5b6b8ccdfa912b11a9cc4aa3..d775e1b8267cf1e4311842cc88bf61d4cd7bcf91 100644 (file)
@@ -67,7 +67,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL,
                      "ftp://example.com/non-existing/new.txt");
     curl_easy_setopt(curl, CURLOPT_FTP_CREATE_MISSING_DIRS,
-                     (long)CURLFTP_CREATE_DIR_RETRY);
+                     CURLFTP_CREATE_DIR_RETRY);
 
     res = curl_easy_perform(curl);
 
@@ -76,6 +76,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLFTP_CREATE_*** enums became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 320b362f8f45db74ff2c64ceb4108a6ff6d0ff49..847a491a27b67a1dd67c3b2c53ce585e86faabd5 100644 (file)
@@ -68,8 +68,7 @@ int main(void)
   if(curl) {
     CURLcode res;
     curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/1/2/3/4/new.txt");
-    curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD,
-                     (long)CURLFTPMETHOD_SINGLECWD);
+    curl_easy_setopt(curl, CURLOPT_FTP_FILEMETHOD, CURLFTPMETHOD_SINGLECWD);
 
     res = curl_easy_perform(curl);
 
@@ -78,6 +77,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLFTPMETHOD_*** enums became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 12058b682671a3028e7bfa5e12002c0f08a32c32..cce1616d41f107a3f8ee9ca2b3771c50d617f07b 100644 (file)
@@ -63,13 +63,18 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/file.txt");
     curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_CONTROL);
     /* go back to clear-text FTP after authenticating */
-    curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, (long)CURLFTPSSL_CCC_ACTIVE);
+    curl_easy_setopt(curl, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_ACTIVE);
     res = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLFTPSSL_*** enums became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index ca049ab949efd5ccb0f739474f20ba91befff3c2..bedceaabcfb6ae11468d750dc4eccf0db9040d2d 100644 (file)
@@ -51,12 +51,17 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     /* delegate if okayed by policy */
     curl_easy_setopt(curl, CURLOPT_GSSAPI_DELEGATION,
-                     (long)CURLGSSAPI_DELEGATION_POLICY_FLAG);
+                     CURLGSSAPI_DELEGATION_POLICY_FLAG);
     ret = curl_easy_perform(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLGSSAPI_DELEGATION_*** macros became `long` types in 8.16.0, prior to this
+version a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 090781042c1ed030a17c4ce2fe88afd8e6a5e110..5695d3e0b71a7b7ac93d4981cd64bfdb60c42651 100644 (file)
@@ -65,7 +65,7 @@ int main(void)
     /* HTTPS over a proxy makes a separate CONNECT to the proxy, so tell
        libcurl to not send the custom headers to the proxy. Keep them
        separate. */
-    curl_easy_setopt(curl, CURLOPT_HEADEROPT, (long)CURLHEADER_SEPARATE);
+    curl_easy_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_SEPARATE);
     ret = curl_easy_perform(curl);
     curl_slist_free_all(list);
     curl_easy_cleanup(curl);
@@ -73,6 +73,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLHEADER_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 589f7aca13fcb8182a5f7ef8c7df8604f9b52720..9026dddc153ec9fe560409863806afb50ecceba2 100644 (file)
@@ -64,7 +64,7 @@ int main(void)
 {
   CURL *curl = curl_easy_init();
   if(curl) {
-    curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, (long)CURLHSTS_ENABLE);
+    curl_easy_setopt(curl, CURLOPT_HSTS_CTRL, CURLHSTS_ENABLE);
     curl_easy_perform(curl);
   }
 }
index 1146cab17e35626cedf6be19c6e80ca21547633f..b21647eda2aadf166cbb7225e594f51bb38db9b2 100644 (file)
@@ -137,7 +137,7 @@ int main(void)
     CURLcode ret;
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     /* allow whatever auth the server speaks */
-    curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);
+    curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
     curl_easy_setopt(curl, CURLOPT_USERPWD, "james:bond");
     ret = curl_easy_perform(curl);
   }
@@ -152,6 +152,9 @@ CURLAUTH_ONLY was added in 7.21.3
 
 CURLAUTH_NTLM_WB was added in 7.22.0
 
+**CURLAUTH_*** macros became `long` types in 7.26.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 CURLAUTH_BEARER was added in 7.61.0
 
 CURLAUTH_AWS_SIGV4 was added in 7.74.0
index 618a7123e91894c663266b36e6159b743fafc8d4..3cb0cded9826de5b66e359a1aa1d0ac5f776e771 100644 (file)
@@ -105,7 +105,7 @@ int main(void)
   if(curl) {
     CURLcode ret;
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
-    curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, (long)CURL_HTTP_VERSION_2TLS);
+    curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
     ret = curl_easy_perform(curl);
     if(ret == CURLE_HTTP_RETURNED_ERROR) {
       /* an HTTP response error problem */
@@ -114,6 +114,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_HTTP_VERSION_*** enums became `long` types in 8.13.0, prior to this
+version a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 1b13e3641d7643e3205452e71fffb09b591164c7..9d7bee31505b5f1deb406599ed479760412a80c2 100644 (file)
@@ -66,7 +66,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
 
     /* of all addresses example.com resolves to, only IPv6 ones are used */
-    curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V6);
+    curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
 
     res = curl_easy_perform(curl);
 
@@ -75,6 +75,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_IPRESOLVE_*** macros became `long` types in 8.15.0, before this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 8f17b14ed844433c76f8ea32cb9c401af0020bd1..4f94b899e6733fbb454df5d959dd129f87893f8e 100644 (file)
@@ -69,7 +69,7 @@ int main(void)
 
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
-    curl_easy_setopt(curl, CURLOPT_MIME_OPTIONS, (long)CURLMIMEOPT_FORMESCAPE);
+    curl_easy_setopt(curl, CURLOPT_MIME_OPTIONS, CURLMIMEOPT_FORMESCAPE);
 
     form = curl_mime_init(curl);
     if(form) {
@@ -91,6 +91,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLMIMEOPT_FORMESCAPE** macro became `long` type in 8.16.0, prior to this
+version a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index bda7a66c398943e6cb3613e4735859a39f07430d..aba4ed2ad9cb63758c1f89634631918eea7a82af 100644 (file)
@@ -139,6 +139,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_NETRC_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index bc69f2b3a8640c2f3d9fd0ad8ed81543874cc8fc..8863415910f2d46357f116aa45a45b96fc6205e4 100644 (file)
@@ -60,6 +60,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_NETRC_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 23e3bd3b6c29465a8a171fd04087451e1257cf8b..5871e91d9b304d462f00bd1757375e14cac7bd10 100644 (file)
@@ -54,7 +54,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
 
     /* size of the POST data */
-    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(data));
+    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(data));
 
     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
 
index 6f4d48b140b7c0a7cb76cdb20e6d6eba0258ea2a..efabddcefd89528bf10f2d6f3f412a6abc767572 100644 (file)
@@ -65,7 +65,7 @@ int main(void)
 
     /* example.com is redirected, so we tell libcurl to send POST on 301,
        302 and 303 HTTP response codes */
-    curl_easy_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_ALL);
+    curl_easy_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
 
     curl_easy_perform(curl);
   }
@@ -77,6 +77,9 @@ int main(void)
 This option was known as CURLOPT_POST301 up to 7.19.0 as it only supported the
 301 then. CURL_REDIR_POST_303 was added in 7.26.0.
 
+**CURL_REDIR_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index fd4d10adfaf933cfd83c9ee0888d1e1e839b08fe..37d1e5fe3e3de3f1ddc95efb2e06d96ca2e42d99 100644 (file)
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
 
     /* only allow HTTP, TFTP and SFTP */
     curl_easy_setopt(curl, CURLOPT_PROTOCOLS,
-                     (long)CURLPROTO_HTTP | CURLPROTO_TFTP | CURLPROTO_SFTP);
+                     CURLPROTO_HTTP | CURLPROTO_TFTP | CURLPROTO_SFTP);
 
     /* Perform the request */
     curl_easy_perform(curl);
@@ -96,6 +96,11 @@ int main(int argc, char **argv)
 }
 ~~~
 
+# HISTORY
+
+**CURLPROTO_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # DEPRECATED
 
 Deprecated since 7.85.0.
index a0df997aac47f2288b778bd979c3240d68b31597..c010c8fd0ccbf2342a8fd82ba2b592463cc5ff10 100644 (file)
@@ -67,6 +67,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLAUTH_*** macros became `long` types in 7.26.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 4680bbb7cc0e176ede2e5c12ee599c4c9f79e255..d7870efc571339671d1a23e12b66193a2d53ca24 100644 (file)
@@ -85,13 +85,18 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     curl_easy_setopt(curl, CURLOPT_PROXY, "local.example.com:1080");
     /* set the proxy type */
-    curl_easy_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_SOCKS5);
+    curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
     ret = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLPROXY_*** enums became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index f2f76bbf9c86ab0cc90b39364b01161d6cc17f23..7e1f6f140066b59a5ce8fb2da326c89cffc677e6 100644 (file)
@@ -116,7 +116,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
 
     /* ask libcurl to use TLS version 1.0 or later */
-    curl_easy_setopt(curl, CURLOPT_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
+    curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
 
     /* Perform the request */
     curl_easy_perform(curl);
@@ -124,6 +124,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_SSLVERSION_*** macros became `long` types in 8.16.0, prior to this
+version a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 68a34b2123fc066feed4a1e498ac9aecfe121875..0729518a0df119dc9c67be8936aa203439c8a692 100644 (file)
@@ -109,7 +109,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
     /* weaken TLS only for use with silly proxies */
-    curl_easy_setopt(curl, CURLOPT_PROXY_SSL_OPTIONS, (long)
+    curl_easy_setopt(curl, CURLOPT_PROXY_SSL_OPTIONS,
                      CURLSSLOPT_ALLOW_BEAST | CURLSSLOPT_NO_REVOKE);
     res = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
@@ -117,6 +117,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLSSLOPT_*** macros became `long` types in 8.15.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 9cbcc57b5faa812acb2941aa22a34e682019a4d6..d76bd0cf0a809aac6d77efd6ee9d4872f368bb49 100644 (file)
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
     curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
 
     /* only allow redirects to HTTP and HTTPS URLs */
-    curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, (long)
+    curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS,
                      CURLPROTO_HTTP | CURLPROTO_HTTPS);
 
     /* Perform the request */
@@ -106,6 +106,11 @@ int main(int argc, char **argv)
 }
 ~~~
 
+# HISTORY
+
+**CURLPROTO_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # DEPRECATED
 
 Deprecated since 7.85.0.
index e716572b3011f8cbb00e65598a56f2fc99cd43a5..89e303d4ab1ad14880973d54a494160f38df8752 100644 (file)
@@ -131,6 +131,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_RTSPREQ_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 221f2d1af6cf6e307b62e74c9c5f70c8fc13ca14..cba9b4ad539bbaf8e234bcc36c76a4c2f1a6376d 100644 (file)
@@ -59,6 +59,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_RTSPREQ_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 69932c7b028bbf68e5dafd3c9dc8e59379461824..a9adf6b77d5a4bf72be4a039688321e2616db14b 100644 (file)
@@ -52,7 +52,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://user:pass@myproxy.com");
 
     /* enable username/password authentication only */
-    curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, (long)CURLAUTH_BASIC);
+    curl_easy_setopt(curl, CURLOPT_SOCKS5_AUTH, CURLAUTH_BASIC);
 
     /* Perform the request */
     curl_easy_perform(curl);
@@ -60,6 +60,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLAUTH_*** macros became `long` types in 7.26.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 01ebd6f7a4cd9b209b55eb8097e438dec5321f67..60a6025c8c4169fa79aa1f53ae89d301989abb0f 100644 (file)
@@ -52,7 +52,7 @@ int main(void)
   if(curl) {
     CURLcode res;
     curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/file");
-    curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, (long)
+    curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES,
                      CURLSSH_AUTH_PUBLICKEY | CURLSSH_AUTH_KEYBOARD);
     res = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
@@ -60,6 +60,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURLSSH_AUTH_*** macros became `long` types in 8.16.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 63440b5576a62d6b0912c77af4eeef61f064bfd7..366edc0a7e2767c7fb049beba11b719153ce454f 100644 (file)
@@ -127,7 +127,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
 
     /* ask libcurl to use TLS version 1.0 or later */
-    curl_easy_setopt(curl, CURLOPT_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
+    curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
 
     /* Perform the request */
     curl_easy_perform(curl);
@@ -150,6 +150,9 @@ restricted the TLS version to only the specified one.
 
 Rustls support added in 8.10.0.
 
+**CURL_SSLVERSION_*** macros became `long` types in 8.16.0, prior to this
+version a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 38e002e8f46d3dc26f9524c2856470a6b8823249..89a1d430f789e821347933ad19fab328c9c834d0 100644 (file)
@@ -122,14 +122,19 @@ int main(void)
     CURLcode res;
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
     /* weaken TLS only for use with silly servers */
-    curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_ALLOW_BEAST |
-                     CURLSSLOPT_NO_REVOKE);
+    curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS,
+                     CURLSSLOPT_ALLOW_BEAST | CURLSSLOPT_NO_REVOKE);
     res = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLSSLOPT_*** macros became `long` types in 8.15.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 44a5d68d4080fa881f9b6778f96f0bb840466eb9..d17174c254ec52029b28b1d1ec05daffbce416d2 100644 (file)
@@ -55,8 +55,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
 
     /* If-Modified-Since the above time stamp */
-    curl_easy_setopt(curl, CURLOPT_TIMECONDITION,
-                     (long)CURL_TIMECOND_IFMODSINCE);
+    curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
 
     /* Perform the request */
     curl_easy_perform(curl);
@@ -64,6 +63,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_TIMECOND_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 68c722dd48b9e8943e9bda16f439431751330035..fde25a5cb8a888c8552609110f46532848b53513 100644 (file)
@@ -61,6 +61,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_TIMECOND_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 82e006c8a699b55b5701d40282ab1ae79d235de8..3e0e9146cf7d67ebe21aa437ac146fb46b7079e9 100644 (file)
@@ -63,6 +63,11 @@ int main(void)
 }
 ~~~
 
+# HISTORY
+
+**CURL_TIMECOND_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index adc32bb853ddf97e3bc38a129f6b68830eb6e411..9a2d2abe5e9a8c46f52187ccef9424ec3e4a554f 100644 (file)
@@ -71,7 +71,7 @@ int main(void)
     curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/file.ext");
 
     /* require use of SSL for this, or fail */
-    curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
+    curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_ALL);
 
     /* Perform the request */
     curl_easy_perform(curl);
@@ -84,6 +84,9 @@ int main(void)
 This option was known as CURLOPT_FTP_SSL up to 7.16.4. Supported by LDAP since
 7.81.0. Fully supported by the OpenLDAP backend only.
 
+**CURLUSESSL_*** enums became `long` types in 8.13.0, prior to this version
+a `long` cast was necessary when passed to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index 35ae17cf470503c64d689cf76b39bc2d71015ea5..95d56b0c4af29dd91ae378905e8fcef2437c2e97 100644 (file)
@@ -66,13 +66,19 @@ int main(void)
     CURLcode res;
     curl_easy_setopt(curl, CURLOPT_URL, "ws://example.com/");
     /* tell curl we deal with all the WebSocket magic ourselves */
-    curl_easy_setopt(curl, CURLOPT_WS_OPTIONS, (long)CURLWS_RAW_MODE);
+    curl_easy_setopt(curl, CURLOPT_WS_OPTIONS, CURLWS_RAW_MODE);
     res = curl_easy_perform(curl);
     curl_easy_cleanup(curl);
   }
 }
 ~~~
 
+# HISTORY
+
+**CURLWS_RAW_MODE** and **CURLWS_NOAUTOPONG** macros became `long` types
+in 8.16.0, prior to this version a `long` cast was necessary when passed
+to curl_easy_setopt(3).
+
 # %AVAILABILITY%
 
 # RETURN VALUE
index d1cdf4e11c23ab19a418b17fd543612ae0b62871..45196926c3619f0b864d3edc4e820a5c36b85eca 100755 (executable)
@@ -114,7 +114,7 @@ sub checkmanpage {
         while(s/\W(CURL(AUTH|E|H|MOPT|OPT|SHOPT|UE|M|SSH|SSLBACKEND|HEADER|FORM|FTP|PIPE|MIMEOPT|GSSAPI|ALTSVC|PROTO|PROXY|UPART|USESSL|_READFUNC|_WRITEFUNC|_CSELECT|_FORMADD|_IPRESOLVE|_REDIR|_RTSPREQ|_TIMECOND|_VERSION)_[a-zA-Z0-9_]+)//) {
             my $s = $1;
             # skip two "special" ones
-            if($s !~ /^(CURLE_OBSOLETE|CURLOPT_TEMPLATE)/) {
+            if($s !~ /(^(CURLE_OBSOLETE|CURLOPT_TEMPLATE))|_$/) {
                 push @manrefs, "$1:$m:$line";
             }
         }