1curl_version_info(3) libcurl Manual curl_version_info(3)
2
3
4
6 curl_version_info - returns run-time libcurl version info
7
9 #include <curl/curl.h>
10
11 curl_version_info_data *curl_version_info( CURLversion age);
12
14 Returns a pointer to a filled in static struct with information about
15 various features in the running version of libcurl. age should be set
16 to the version of this functionality by the time you write your pro‐
17 gram. This way, libcurl will always return a proper struct that your
18 program understands, while programs in the future might get a different
19 struct. CURLVERSION_NOW will be the most recent one for the library you
20 have installed:
21
22 data = curl_version_info(CURLVERSION_NOW);
23
24 Applications should use this information to judge if things are possi‐
25 ble to do or not, instead of using compile-time checks, as dynamic/DLL
26 libraries can be changed independent of applications.
27
28 The curl_version_info_data struct looks like this
29
30 typedef struct {
31 CURLversion age; /* see description below */
32
33 const char *version; /* human readable string */
34 unsigned int version_num; /* numeric representation */
35 const char *host; /* human readable string */
36 int features; /* bitmask, see below */
37 char *ssl_version; /* human readable string */
38 long ssl_version_num; /* not used, always zero */
39 const char *libz_version; /* human readable string */
40 const char * const *protocols; /* protocols */
41
42 /* when 'age' is CURLVERSION_SECOND or higher, the members below exist */
43 const char *ares; /* human readable string */
44 int ares_num; /* number */
45
46 /* when 'age' is CURLVERSION_THIRD or higher, the members below exist */
47 const char *libidn; /* human readable string */
48
49 /* when 'age' is CURLVERSION_FOURTH or higher (>= 7.16.1), the members
50 below exist */
51 int iconv_ver_num; /* '_libiconv_version' if iconv support enabled */
52
53 const char *libssh_version; /* human readable string */
54
55 /* when 'age' is CURLVERSION_FIFTH or higher (>= 7.57.0), the members
56 below exist */
57 unsigned int brotli_ver_num; /* Numeric Brotli version
58 (MAJOR << 24) | (MINOR << 12) | PATCH */
59 const char *brotli_version; /* human readable string. */
60
61 /* when 'age' is CURLVERSION_SIXTH or higher (>= 7.66.0), the members
62 below exist */
63 unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
64 (MAJOR << 16) | (MINOR << 8) | PATCH */
65 const char *nghttp2_version; /* human readable string. */
66
67 const char *quic_version; /* human readable quic (+ HTTP/3) library +
68 version or NULL */
69
70 /* when 'age' is CURLVERSION_SEVENTH or higher (>= 7.70.0), the members
71 below exist */
72 const char *cainfo; /* the built-in default CURLOPT_CAINFO, might
73 be NULL */
74 const char *capath; /* the built-in default CURLOPT_CAPATH, might
75 be NULL */
76 } curl_version_info_data;
77
78 age describes what the age of this struct is. The number depends on how
79 new the libcurl you're using is. You are however guaranteed to get a
80 struct that you have a matching struct for in the header, as you tell
81 libcurl your "age" with the input argument.
82
83 version is just an ascii string for the libcurl version.
84
85 version_num is a 24 bit number created like this: <8 bits major number>
86 | <8 bits minor number> | <8 bits patch number>. Version 7.9.8 is
87 therefore returned as 0x070908.
88
89 host is an ascii string showing what host information that this libcurl
90 was built for. As discovered by a configure script or set by the build
91 environment.
92
93 features can have none, one or more bits set, and the currently defined
94 bits are:
95
96 CURL_VERSION_ALTSVC
97 HTTP Alt-Svc parsing and the associated options (Added in
98 7.64.1)
99
100 CURL_VERSION_ASYNCHDNS
101 libcurl was built with support for asynchronous name
102 lookups, which allows more exact timeouts (even on Win‐
103 dows) and less blocking when using the multi interface.
104 (added in 7.10.7)
105
106 CURL_VERSION_BROTLI
107 supports HTTP Brotli content encoding using libbrotlidec
108 (Added in 7.57.0)
109
110 CURL_VERSION_CONV
111 libcurl was built with support for character conversions,
112 as provided by the CURLOPT_CONV_* callbacks. (Added in
113 7.15.4)
114
115 CURL_VERSION_CURLDEBUG
116 libcurl was built with memory tracking debug capabili‐
117 ties. This is mainly of interest for libcurl hackers.
118 (added in 7.19.6)
119
120 CURL_VERSION_DEBUG
121 libcurl was built with debug capabilities (added in
122 7.10.6)
123
124 CURL_VERSION_GSSAPI
125 libcurl was built with support for GSS-API. This makes
126 libcurl use provided functions for Kerberos and SPNEGO
127 authentication. It also allows libcurl to use the current
128 user credentials without the app having to pass them on.
129 (Added in 7.38.0)
130
131 CURL_VERSION_GSSNEGOTIATE
132 supports HTTP GSS-Negotiate (added in 7.10.6)
133
134 CURL_VERSION_HTTPS_PROXY
135 libcurl was built with support for HTTPS-proxy. (Added
136 in 7.52.0)
137
138 CURL_VERSION_HTTP2
139 libcurl was built with support for HTTP2. (Added in
140 7.33.0)
141
142 CURL_VERSION_HTTP3
143 HTTP/3 and QUIC support are built-in (Added in 7.66.0)
144
145 CURL_VERSION_IDN
146 libcurl was built with support for IDNA, domain names
147 with international letters. (Added in 7.12.0)
148
149 CURL_VERSION_IPV6
150 supports IPv6
151
152 CURL_VERSION_KERBEROS4
153 supports Kerberos V4 (when using FTP). Legacy bit. Depre‐
154 cated since 7.33.0.
155
156 CURL_VERSION_KERBEROS5
157 supports Kerberos V5 authentication for FTP, IMAP, POP3,
158 SMTP and SOCKSv5 proxy (Added in 7.40.0)
159
160 CURL_VERSION_LARGEFILE
161 libcurl was built with support for large files. (Added in
162 7.11.1)
163
164 CURL_VERSION_LIBZ
165 supports HTTP deflate using libz (Added in 7.10)
166
167 CURL_VERSION_MULTI_SSL
168 libcurl was built with multiple SSL backends. For
169 details, see curl_global_sslset(3). (Added in 7.56.0)
170
171 CURL_VERSION_NTLM
172 supports HTTP NTLM (added in 7.10.6)
173
174 CURL_VERSION_NTLM_WB
175 libcurl was built with support for NTLM delegation to a
176 winbind helper. (Added in 7.22.0)
177
178 CURL_VERSION_PSL
179 libcurl was built with support for Mozilla's Public Suf‐
180 fix List. This makes libcurl ignore cookies with a domain
181 that's on the list. (Added in 7.47.0)
182
183 CURL_VERSION_SPNEGO
184 libcurl was built with support for SPNEGO authentication
185 (Simple and Protected GSS-API Negotiation Mechanism,
186 defined in RFC 2478.) (added in 7.10.8)
187
188 CURL_VERSION_SSL
189 supports SSL (HTTPS/FTPS) (Added in 7.10)
190
191 CURL_VERSION_SSPI
192 libcurl was built with support for SSPI. This is only
193 available on Windows and makes libcurl use Windows-pro‐
194 vided functions for Kerberos, NTLM, SPNEGO and Digest
195 authentication. It also allows libcurl to use the current
196 user credentials without the app having to pass them on.
197 (Added in 7.13.2)
198
199 CURL_VERSION_TLSAUTH_SRP
200 libcurl was built with support for TLS-SRP. (Added in
201 7.21.4)
202
203 CURL_VERSION_UNIX_SOCKETS
204 libcurl was built with support for Unix domain sockets.
205 (Added in 7.40.0)
206 ssl_version is an ASCII string for the TLS library name + version used.
207 If libcurl has no SSL support, this is NULL. For example "Schannel",
208 "SecureTransport" or "OpenSSL/1.1.0g".
209
210 ssl_version_num is always 0.
211
212 libz_version is an ASCII string (there is no numerical version). If
213 libcurl has no libz support, this is NULL.
214
215 protocols is a pointer to an array of char * pointers, containing the
216 names protocols that libcurl supports (using lowercase letters). The
217 protocol names are the same as would be used in URLs. The array is ter‐
218 minated by a NULL entry.
219
221 A pointer to a curl_version_info_data struct.
222
224 curl_version(3)
225
226
227
228libcurl 7.71.1 March 26, 2020 curl_version_info(3)