# curl_version_info

Definition: | include builtins\libcurl.e sequence res = curl_version_info()
Description: | Obtain extended version information. Returns {} if curl_version_info is not supported (eg 7.9.8 from 2002), otherwise a sequence which can be examined using the LIBCURL_VERSION_XXX constants (elements above LIBCURL_VERSION_PROTOCOLS[=8] may be missing).
pwa/p2js: | Not supported.
Comments: | The following constants are provided:
    global constant CURLVERSION_FIRST  = 0,
                    CURLVERSION_SECOND = 1,
                    CURLVERSION_THIRD  = 2,
                    CURLVERSION_FOURTH = 3,
                    CURLVERSION_FIFTH  = 4,
                    CURLVERSION_NOW = CURLVERSION_FIFTH

    global constant LIBCURL_VERSION_AGE          = 1,
                    LIBCURL_VERSION_STRING       = 2,
                    LIBCURL_VERSION_NUM          = 3,
                    LIBCURL_VERSION_HOST         = 4,
                    LIBCURL_VERSION_FEATURES     = 5,
                    LIBCURL_VERSION_SSL_VERSION  = 6,
                    LIBCURL_VERSION_LIBZ_VERSION = 7,
                    LIBCURL_VERSION_PROTOCOLS    = 8,
                    -- if LIBCURL_VERSION_AGE>=CURLVERSION_SECOND
                    LIBCURL_VERSION_ARES         = 9,
                    LIBCURL_VERSION_ARES_NUM     = 10,
                    -- if LIBCURL_VERSION_AGE>=CURLVERSION_THIRD
                    LIBCURL_VERSION_LIBIDN       = 11,
                    -- if LIBCURL_VERSION_AGE>=CURLVERSION_FOURTH
                    LIBCURL_VERSION_ICONV_VER_NUM = 12,
                    LIBCURL_VERSION_LIBSSH_VERSION = 13,
                    -- if LIBCURL_VERSION_AGE>=CURLVERSION_FIFTH
                    LIBCURL_VERSION_BROTLI_VER_NUM = 14,
                    LIBCURL_VERSION_BROTLI_VERSION = 15
res[LIBCURL_VERSION_AGE] will be CURLVERSION_FIRST..CURLVERSION_FIFTH (0..4), though personally I would recommend ignoring that field and testing length(res) against the LIBCURL_VERSION_XXX constants instead. res[LIBCURL_VERSION_FEATURES] can contain the following (literal) strings: {"IPV6", "KERBEROS4", "SSL", "LIBZ", "NTLM", "GSSNEGOTIATE", "DEBUG", "ASYNCHDNS", "SPNEGO", "LARGEFILE", "IDN", "SSPI", "CONV", "CURLDEBUG", "TLSAUTH_SRP", "NTLM_WB", "HTTP2", "GSSAPI", "KERBEROS5", "UNIX_SOCKETS", "PSL", "HTTPS_PROXY", "MULTI_SSL", "BROTLI"} See https://curl.haxx.se/libcurl/c/curl_version_info.html for their precise meanings, if you need to. res[LIBCURL_VERSION_PROTOCOLS] can contain the following (literal) strings: {"dict", "file", "ftp", "ftps", "gopher", "http", "https", "imap", "imaps", "ldap", "pop3", "pop3s", "rtsp", "smb", "smbs", "smtp", "smtps", "telnet", "tftp"} (and possibly others) The protocol names are the same as would be used in URLs. libraries built with SSH support will have a non-"NULL" string returned in res[LIBCURL_VERSION_LIBSSH_VERSION], but tend to be three times bigger.
Example: | Copy
    include libcurl.e
    ?curl_version()
    -- Output (eg):
    -- "libcurl/7.57.0 WinSSL zlib/1.2.11"
    object res = curl_version_info()
    pp(res,{pp_Nest,1,pp_StrFmt,-2})
    -- Output (eg):
    --  {4,
    --   "7.57.0",
    --   {7,57,0},
    --   "i386-pc-win32",
    --   {"IPV6", "SSL", "LIBZ", "NTLM", "ASYNCHDNS", "SPNEGO", "LARGEFILE", "SSPI",
    --    "KERBEROS5"},
    --   "WinSSL",
    --   "1.2.11",
    --   {"dict", "file", "ftp", "ftps", "gopher", "http", "https", "imap", "imaps",
    --    "ldap", "pop3", "pop3s", "rtsp", "smb", "smbs", "smtp", "smtps", "telnet",
    --    "tftp"},
    --   "NULL",
    --   0,
    --   "NULL",
    --   0,
    --   "NULL",
    --   0,
    --   "NULL"}
See Also: | curl_version, pp