From d01d2ec9f1039e94f8d6bbfd216fae4d9bde9ba6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 1 Aug 2025 12:49:40 +0200 Subject: [PATCH] docs: add CURLOPT type change history, drop casts where present 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 --- .github/scripts/spellcheck.words | 1 + docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md | 3 +-- docs/libcurl/opts/CURLOPT_ALTSVC.md | 7 ++++++- docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md | 15 ++++++++++----- docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md | 7 ++++++- .../opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md | 7 ++++++- docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md | 8 ++++++-- docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md | 7 ++++++- docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md | 7 ++++++- docs/libcurl/opts/CURLOPT_HEADEROPT.md | 7 ++++++- docs/libcurl/opts/CURLOPT_HSTS_CTRL.md | 2 +- docs/libcurl/opts/CURLOPT_HTTPAUTH.md | 5 ++++- docs/libcurl/opts/CURLOPT_HTTP_VERSION.md | 7 ++++++- docs/libcurl/opts/CURLOPT_IPRESOLVE.md | 7 ++++++- docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md | 7 ++++++- docs/libcurl/opts/CURLOPT_NETRC.md | 5 +++++ docs/libcurl/opts/CURLOPT_NETRC_FILE.md | 5 +++++ docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md | 2 +- docs/libcurl/opts/CURLOPT_POSTREDIR.md | 5 ++++- docs/libcurl/opts/CURLOPT_PROTOCOLS.md | 7 ++++++- docs/libcurl/opts/CURLOPT_PROXYAUTH.md | 5 +++++ docs/libcurl/opts/CURLOPT_PROXYTYPE.md | 7 ++++++- docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md | 7 ++++++- docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md | 7 ++++++- docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md | 7 ++++++- docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md | 5 +++++ docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md | 5 +++++ docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md | 7 ++++++- docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md | 7 ++++++- docs/libcurl/opts/CURLOPT_SSLVERSION.md | 5 ++++- docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md | 9 +++++++-- docs/libcurl/opts/CURLOPT_TIMECONDITION.md | 8 ++++++-- docs/libcurl/opts/CURLOPT_TIMEVALUE.md | 5 +++++ docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md | 5 +++++ docs/libcurl/opts/CURLOPT_USE_SSL.md | 5 ++++- docs/libcurl/opts/CURLOPT_WS_OPTIONS.md | 8 +++++++- tests/test1119.pl | 2 +- 37 files changed, 188 insertions(+), 37 deletions(-) diff --git a/.github/scripts/spellcheck.words b/.github/scripts/spellcheck.words index 90546bb65f..3f615331b4 100644 --- a/.github/scripts/spellcheck.words +++ b/.github/scripts/spellcheck.words @@ -230,6 +230,7 @@ else's encodings enctype endianness +enums Engler enum epoll diff --git a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md index bbbe42c481..5f13126ad7 100644 --- a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md +++ b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.md @@ -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); diff --git a/docs/libcurl/opts/CURLOPT_ALTSVC.md b/docs/libcurl/opts/CURLOPT_ALTSVC.md index 14e3f31f92..b74565790c 100644 --- a/docs/libcurl/opts/CURLOPT_ALTSVC.md +++ b/docs/libcurl/opts/CURLOPT_ALTSVC.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md b/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md index 5ae40b57bd..84e5d6657c 100644 --- a/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md +++ b/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md @@ -22,10 +22,10 @@ CURLOPT_ALTSVC_CTRL - control alt-svc behavior ~~~c #include -#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 diff --git a/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md b/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md index 5252da7db5..a2021f830e 100644 --- a/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md +++ b/docs/libcurl/opts/CURLOPT_FTPSSLAUTH.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md b/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md index ea7d49d776..d775e1b826 100644 --- a/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md +++ b/docs/libcurl/opts/CURLOPT_FTP_CREATE_MISSING_DIRS.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md b/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md index 320b362f8f..847a491a27 100644 --- a/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md +++ b/docs/libcurl/opts/CURLOPT_FTP_FILEMETHOD.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md b/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md index 12058b6826..cce1616d41 100644 --- a/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md +++ b/docs/libcurl/opts/CURLOPT_FTP_SSL_CCC.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md b/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md index ca049ab949..bedceaabcf 100644 --- a/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md +++ b/docs/libcurl/opts/CURLOPT_GSSAPI_DELEGATION.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_HEADEROPT.md b/docs/libcurl/opts/CURLOPT_HEADEROPT.md index 090781042c..5695d3e0b7 100644 --- a/docs/libcurl/opts/CURLOPT_HEADEROPT.md +++ b/docs/libcurl/opts/CURLOPT_HEADEROPT.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md b/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md index 589f7aca13..9026dddc15 100644 --- a/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md +++ b/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md @@ -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); } } diff --git a/docs/libcurl/opts/CURLOPT_HTTPAUTH.md b/docs/libcurl/opts/CURLOPT_HTTPAUTH.md index 1146cab17e..b21647eda2 100644 --- a/docs/libcurl/opts/CURLOPT_HTTPAUTH.md +++ b/docs/libcurl/opts/CURLOPT_HTTPAUTH.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md b/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md index 618a7123e9..3cb0cded98 100644 --- a/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md +++ b/docs/libcurl/opts/CURLOPT_HTTP_VERSION.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_IPRESOLVE.md b/docs/libcurl/opts/CURLOPT_IPRESOLVE.md index 1b13e3641d..9d7bee3150 100644 --- a/docs/libcurl/opts/CURLOPT_IPRESOLVE.md +++ b/docs/libcurl/opts/CURLOPT_IPRESOLVE.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md b/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md index 8f17b14ed8..4f94b899e6 100644 --- a/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_MIME_OPTIONS.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_NETRC.md b/docs/libcurl/opts/CURLOPT_NETRC.md index bda7a66c39..aba4ed2ad9 100644 --- a/docs/libcurl/opts/CURLOPT_NETRC.md +++ b/docs/libcurl/opts/CURLOPT_NETRC.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_NETRC_FILE.md b/docs/libcurl/opts/CURLOPT_NETRC_FILE.md index bc69f2b3a8..8863415910 100644 --- a/docs/libcurl/opts/CURLOPT_NETRC_FILE.md +++ b/docs/libcurl/opts/CURLOPT_NETRC_FILE.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md index 23e3bd3b6c..5871e91d9b 100644 --- a/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md +++ b/docs/libcurl/opts/CURLOPT_POSTFIELDSIZE.md @@ -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); diff --git a/docs/libcurl/opts/CURLOPT_POSTREDIR.md b/docs/libcurl/opts/CURLOPT_POSTREDIR.md index 6f4d48b140..efabddcefd 100644 --- a/docs/libcurl/opts/CURLOPT_POSTREDIR.md +++ b/docs/libcurl/opts/CURLOPT_POSTREDIR.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_PROTOCOLS.md b/docs/libcurl/opts/CURLOPT_PROTOCOLS.md index fd4d10adfa..37d1e5fe3e 100644 --- a/docs/libcurl/opts/CURLOPT_PROTOCOLS.md +++ b/docs/libcurl/opts/CURLOPT_PROTOCOLS.md @@ -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. diff --git a/docs/libcurl/opts/CURLOPT_PROXYAUTH.md b/docs/libcurl/opts/CURLOPT_PROXYAUTH.md index a0df997aac..c010c8fd0c 100644 --- a/docs/libcurl/opts/CURLOPT_PROXYAUTH.md +++ b/docs/libcurl/opts/CURLOPT_PROXYAUTH.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_PROXYTYPE.md b/docs/libcurl/opts/CURLOPT_PROXYTYPE.md index 4680bbb7cc..d7870efc57 100644 --- a/docs/libcurl/opts/CURLOPT_PROXYTYPE.md +++ b/docs/libcurl/opts/CURLOPT_PROXYTYPE.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md b/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md index f2f76bbf9c..7e1f6f1400 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSLVERSION.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md b/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md index 68a34b2123..0729518a0d 100644 --- a/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_PROXY_SSL_OPTIONS.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md b/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md index 9cbcc57b5f..d76bd0cf0a 100644 --- a/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md +++ b/docs/libcurl/opts/CURLOPT_REDIR_PROTOCOLS.md @@ -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. diff --git a/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md b/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md index e716572b30..89e303d4ab 100644 --- a/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md +++ b/docs/libcurl/opts/CURLOPT_RTSP_REQUEST.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md b/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md index 221f2d1af6..cba9b4ad53 100644 --- a/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md +++ b/docs/libcurl/opts/CURLOPT_RTSP_TRANSPORT.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md b/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md index 69932c7b02..a9adf6b77d 100644 --- a/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md +++ b/docs/libcurl/opts/CURLOPT_SOCKS5_AUTH.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md b/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md index 01ebd6f7a4..60a6025c8c 100644 --- a/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md +++ b/docs/libcurl/opts/CURLOPT_SSH_AUTH_TYPES.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_SSLVERSION.md b/docs/libcurl/opts/CURLOPT_SSLVERSION.md index 63440b5576..366edc0a7e 100644 --- a/docs/libcurl/opts/CURLOPT_SSLVERSION.md +++ b/docs/libcurl/opts/CURLOPT_SSLVERSION.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md b/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md index 38e002e8f4..89a1d430f7 100644 --- a/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_SSL_OPTIONS.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_TIMECONDITION.md b/docs/libcurl/opts/CURLOPT_TIMECONDITION.md index 44a5d68d40..d17174c254 100644 --- a/docs/libcurl/opts/CURLOPT_TIMECONDITION.md +++ b/docs/libcurl/opts/CURLOPT_TIMECONDITION.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_TIMEVALUE.md b/docs/libcurl/opts/CURLOPT_TIMEVALUE.md index 68c722dd48..fde25a5cb8 100644 --- a/docs/libcurl/opts/CURLOPT_TIMEVALUE.md +++ b/docs/libcurl/opts/CURLOPT_TIMEVALUE.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md b/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md index 82e006c8a6..3e0e9146cf 100644 --- a/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md +++ b/docs/libcurl/opts/CURLOPT_TIMEVALUE_LARGE.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_USE_SSL.md b/docs/libcurl/opts/CURLOPT_USE_SSL.md index adc32bb853..9a2d2abe5e 100644 --- a/docs/libcurl/opts/CURLOPT_USE_SSL.md +++ b/docs/libcurl/opts/CURLOPT_USE_SSL.md @@ -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 diff --git a/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md b/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md index 35ae17cf47..95d56b0c4a 100644 --- a/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md +++ b/docs/libcurl/opts/CURLOPT_WS_OPTIONS.md @@ -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 diff --git a/tests/test1119.pl b/tests/test1119.pl index d1cdf4e11c..45196926c3 100755 --- a/tests/test1119.pl +++ b/tests/test1119.pl @@ -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"; } } -- 2.47.2