Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
curl_version_info(3) | Library Functions Manual | curl_version_info(3) |
NAME
curl_version_info - returns runtime libcurl version infoDESCRIPTION
Returns a pointer to a filled in static struct with information about various features in the running version of libcurl. age should be set to the version of this functionality by the time you write your program. This way, libcurl always returns a proper struct that your program understands, while programs in the future might get a different struct. CURLVERSION_NOW is the most recent one for the library you have installed:data = curl_version_info(CURLVERSION_NOW);
Applications should use this information to judge if things are possible to do or not, instead of using compile-time checks, as dynamic/DLL libraries can be changed independent of applications.
typedef struct {
CURLversion age; /* see description below */
const char *version; /* human readable string */
unsigned int version_num; /* numeric representation */
const char *host; /* human readable string */
int features; /* bitmask, see below */
char *ssl_version; /* human readable string */
long ssl_version_num; /* not used, always zero */
const char *libz_version; /* human readable string */
const char *const *protocols; /* protocols */
/* when 'age' is CURLVERSION_SECOND or higher, the members below exist */
const char *ares; /* human readable string */
int ares_num; /* number */
/* when 'age' is CURLVERSION_THIRD or higher, the members below exist */
const char *libidn; /* human readable string */
/* when 'age' is CURLVERSION_FOURTH or higher (>= 7.16.1), the members
below exist */
int iconv_ver_num; /* '_libiconv_version' if iconv support enabled */
const char *libssh_version; /* human readable string */
/* when 'age' is CURLVERSION_FIFTH or higher (>= 7.57.0), the members
below exist */
unsigned int brotli_ver_num; /* Numeric Brotli version
(MAJOR << 24) | (MINOR << 12) | PATCH */
const char *brotli_version; /* human readable string. */
/* when 'age' is CURLVERSION_SIXTH or higher (>= 7.66.0), the members
below exist */
unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
(MAJOR << 16) | (MINOR << 8) | PATCH */
const char *nghttp2_version; /* human readable string. */
const char *quic_version; /* human readable quic (+ HTTP/3) library +
version or NULL */
/* when 'age' is CURLVERSION_SEVENTH or higher (>= 7.70.0), the members
below exist */
const char *cainfo; /* the built-in default CURLOPT_CAINFO, might
be NULL */
const char *capath; /* the built-in default CURLOPT_CAPATH, might
be NULL */
/* when 'age' is CURLVERSION_EIGHTH or higher (>= 7.71.0), the members
below exist */
unsigned int zstd_ver_num; /* Numeric Zstd version
(MAJOR << 24) | (MINOR << 12) | PATCH */
const char *zstd_version; /* human readable string. */
/* when 'age' is CURLVERSION_NINTH or higher (>= 7.75.0), the members
below exist */
const char *hyper_version; /* human readable string. */
/* when 'age' is CURLVERSION_TENTH or higher (>= 7.77.0), the members
below exist */
const char *gsasl_version; /* human readable string. */
/* when 'age' is CURLVERSION_ELEVENTH or higher (>= 7.87.0), the members
below exist */
const char *const *feature_names; /* Feature names. */
/* when 'age' is CURLVERSION_TWELFTH or higher (>= 8.8.0), the members
below exist */
const char *const *rtmp_version; /* human readable string */
} curl_version_info_data;
FEATURES
- alt-svc
-
features mask bit: CURL_VERSION_ALTSVC
- AsynchDNS
-
features mask bit: CURL_VERSION_ASYNCHDNS
- brotli
-
features mask bit: CURL_VERSION_BROTLI
- Debug
-
features mask bit: CURL_VERSION_DEBUG
- ECH
-
features mask bit: non-existent
- gsasl
-
features mask bit: CURL_VERSION_GSASL
- GSS-API
-
features mask bit: CURL_VERSION_GSSAPI
- HSTS
-
features mask bit: CURL_VERSION_HSTS
- HTTP2
-
features mask bit: CURL_VERSION_HTTP2
- HTTP3
-
features mask bit: CURL_VERSION_HTTP3
- HTTPS-proxy
-
features mask bit: CURL_VERSION_HTTPS_PROXY
- IDN
-
features mask bit: CURL_VERSION_IDN
- IPv6
-
features mask bit: CURL_VERSION_IPV6
- Kerberos
-
features mask bit: CURL_VERSION_KERBEROS5
- Largefile
-
features mask bit: CURL_VERSION_LARGEFILE
- libz
-
features mask bit: CURL_VERSION_LIBZ
- MultiSSL
-
features mask bit: CURL_VERSION_MULTI_SSL
- NTLM
-
features mask bit: CURL_VERSION_NTLM
- NTLM_WB
-
features mask bit: CURL_VERSION_NTLM_WB
- PSL
-
features mask bit: CURL_VERSION_PSL
- SPNEGO
-
features mask bit: CURL_VERSION_SPNEGO
- SSL
-
features mask bit: CURL_VERSION_SSL
- SSPI
-
features mask bit: CURL_VERSION_SSPI
- threadsafe
-
features mask bit: CURL_VERSION_THREADSAFE
- TLS-SRP
-
features mask bit: CURL_VERSION_TLSAUTH_SRP
- TrackMemory
-
features mask bit: CURL_VERSION_CURLDEBUG
- Unicode
-
features mask bit: CURL_VERSION_UNICODE
- UnixSockets
-
features mask bit: CURL_VERSION_UNIX_SOCKETS
- zstd
-
features mask bit: CURL_VERSION_ZSTD
- no name
-
features mask bit: CURL_VERSION_CONV
- no name
-
features mask bit: CURL_VERSION_GSSNEGOTIATE
- no name
-
features mask bit: CURL_VERSION_KERBEROS4
PROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
printf("libcurl version %u.%u.%u\n",
(ver->version_num >> 16) & 0xff,
(ver->version_num >> 8) & 0xff,
ver->version_num & 0xff);
}
AVAILABILITY
Added in curl 7.10.0RETURN VALUE
A pointer to a curl_version_info_data struct.SEE ALSO
curl_version(3)2024-12-21 | libcurl |