1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

tools/check_curl_symbols.py: fix CURLOPT handling

The curl option handling seems to be non-functional since it suffers
from two distinct issues. The regular expression tries to match options
that we're not interested in and the symbol name is lacking the proper
prefix.

Adjust to match only on what we need and construct the name
appropriately... Fix the issues flagged by the updated script.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov
2024-09-29 16:28:57 +01:00
committed by Sébastien Helleu
parent 90c23ef418
commit ba746dcb1b
2 changed files with 6 additions and 8 deletions
+3 -3
View File
@@ -431,7 +431,7 @@ struct t_url_option url_options[] =
URL_DEF_OPTION(HEADER, LONG, NULL),
URL_DEF_OPTION(NOPROGRESS, LONG, NULL),
#endif
#if LIBCURL_VERSION_NUM >= 0x070A00 /* 7.10.0 */
#if LIBCURL_VERSION_NUM >= 0x070A00 /* 7.10.0 */
URL_DEF_OPTION(NOSIGNAL, LONG, NULL),
#endif
#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
@@ -674,7 +674,7 @@ struct t_url_option url_options[] =
#if LIBCURL_VERSION_NUM >= 0x071900 /* 7.25.0 */
URL_DEF_OPTION(MAIL_AUTH, STRING, NULL),
#endif
#if LIBCURL_VERSION_NUM >= 0x074500 /* 7.69.0 */
#if LIBCURL_VERSION_NUM >= 0x074500 && LIBCURL_VERSION_NUM < 0x080200 /* 7.69.0 < 8.2.0 */
URL_DEF_OPTION(MAIL_RCPT_ALLLOWFAILS, LONG, NULL),
#endif
@@ -823,7 +823,7 @@ struct t_url_option url_options[] =
#if LIBCURL_VERSION_NUM >= 0x074100 /* 7.65.0 */
URL_DEF_OPTION(MAXAGE_CONN, LONG, NULL),
#endif
#if LIBCURL_VERSION_NUM >= 0x071003 /* 7.16.3 */
#if LIBCURL_VERSION_NUM >= 0x070700 /* 7.7.0 */
URL_DEF_OPTION(MAXCONNECTS, LONG, NULL),
#endif
#if LIBCURL_VERSION_NUM >= 0x071100 /* 7.17.0 */
+3 -5
View File
@@ -66,8 +66,7 @@ WEECHAT_CURL_CONSTANT_RE = (
r" URL_DEF_CONST\((?P<prefix>[A-Z0-9_]+), (?P<name>[A-Z0-9_]+)\),"
)
WEECHAT_CURL_OPTION_RE = (
r" URL_DEF_OPTION\((?P<name>[A-Z0-9_]+), (?P<type>[A-Z]+)\), "
r"(?P<values>[A-Za-z0-9_]+)\),"
r" URL_DEF_OPTION\((?P<name>[A-Z0-9_]+), .*\),"
)
CURL_SYMBOL_RE = r"[A-Z][A-Z0-9_]"
@@ -215,9 +214,8 @@ def get_weechat_curl_symbols() -> Tuple[List[WeechatCurlSymbol], int]:
# Curl option
match = re.match(option_pattern, line)
if match:
symbols.append(
WeechatCurlSymbol(match["name"], v_min, v_max, line_no)
)
name = f"CURLOPT_{match['name']}"
symbols.append(WeechatCurlSymbol(name, v_min, v_max, line_no))
continue
return symbols, errors