1curl_version_info(3)            libcurl Manual            curl_version_info(3)
2
3
4

NAME

6       curl_version_info - returns runtime libcurl version info
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       curl_version_info_data *curl_version_info( CURLversion age);
12

DESCRIPTION

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         data = curl_version_info(CURLVERSION_NOW);
22       Applications  should use this information to judge if things are possi‐
23       ble to do or not, instead of using compile-time checks, as  dynamic/DLL
24       libraries can be changed independent of applications.
25
26       This   function   can  alter  the  returned  static  data  as  long  as
27       curl_global_init has not been called. It is therefore  not  thread-safe
28       before libcurl initialization occurs.
29
30       The curl_version_info_data struct looks like this
31
32       typedef struct {
33         CURLversion age;          /* see description below */
34
35         const char *version;      /* human readable string */
36         unsigned int version_num; /* numeric representation */
37         const char *host;         /* human readable string */
38         int features;             /* bitmask, see below */
39         char *ssl_version;        /* human readable string */
40         long ssl_version_num;     /* not used, always zero */
41         const char *libz_version; /* human readable string */
42         const char *const *protocols; /* protocols */
43
44         /* when 'age' is CURLVERSION_SECOND or higher, the members below exist */
45         const char *ares;         /* human readable string */
46         int ares_num;             /* number */
47
48         /* when 'age' is CURLVERSION_THIRD or higher, the members below exist */
49         const char *libidn;       /* human readable string */
50
51         /* when 'age' is CURLVERSION_FOURTH or higher (>= 7.16.1), the members
52            below exist */
53         int iconv_ver_num;       /* '_libiconv_version' if iconv support enabled */
54
55         const char *libssh_version; /* human readable string */
56
57         /* when 'age' is CURLVERSION_FIFTH or higher (>= 7.57.0), the members
58            below exist */
59         unsigned int brotli_ver_num; /* Numeric Brotli version
60                                         (MAJOR << 24) | (MINOR << 12) | PATCH */
61         const char *brotli_version; /* human readable string. */
62
63         /* when 'age' is CURLVERSION_SIXTH or higher (>= 7.66.0), the members
64            below exist */
65         unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
66                                          (MAJOR << 16) | (MINOR << 8) | PATCH */
67         const char *nghttp2_version; /* human readable string. */
68
69         const char *quic_version;    /* human readable quic (+ HTTP/3) library +
70                                         version or NULL */
71
72         /* when 'age' is CURLVERSION_SEVENTH or higher (>= 7.70.0), the members
73            below exist */
74         const char *cainfo;          /* the built-in default CURLOPT_CAINFO, might
75                                         be NULL */
76         const char *capath;          /* the built-in default CURLOPT_CAPATH, might
77                                         be NULL */
78         /* when 'age' is CURLVERSION_EIGHTH or higher (>= 7.71.0), the members
79            below exist */
80         unsigned int zstd_ver_num; /* Numeric Zstd version
81                                         (MAJOR << 24) | (MINOR << 12) | PATCH */
82         const char *zstd_version; /* human readable string. */
83         /* when 'age' is CURLVERSION_NINTH or higher (>= 7.75.0), the members
84            below exist */
85         const char *hyper_version; /* human readable string. */
86         /* when 'age' is CURLVERSION_TENTH or higher (>= 7.77.0), the members
87            below exist */
88         const char *gsasl_version; /* human readable string. */
89         /* when 'age' is CURLVERSION_ELEVENTH or higher (>= 7.87.0), the members
90            below exist */
91         const char *const *feature_names; /* Feature names. */
92       } curl_version_info_data;
93
94       age describes what the age of this struct is. The number depends on how
95       new the libcurl you are using is. You are however guaranteed to  get  a
96       struct  that  you have a matching struct for in the header, as you tell
97       libcurl your "age" with the input argument.
98
99       version is just an ascii string for the libcurl version.
100
101       version_num is a 24 bit number created like this: <8 bits major number>
102       |  <8  bits  minor  number>  |  <8 bits patch number>. Version 7.9.8 is
103       therefore returned as 0x070908.
104
105       host is an ascii string showing what host information that this libcurl
106       was  built for. As discovered by a configure script or set by the build
107       environment.
108
109       features is a bit mask representing available  features.  It  can  have
110       none,  one  or more bits set.  The use of this field is deprecated: use
111       feature_names instead.  The feature names description below  lists  the
112       associated bits.
113
114       feature_names  is  a pointer to an array of string pointers, containing
115       the names of the features that libcurl supports. The  array  is  termi‐
116       nated by a NULL entry. Currently defined names are:
117
118              "alt-svc"
119                     features mask bit: CURL_VERSION_ALTSVC
120                     HTTP Alt-Svc parsing and the associated options (Added in
121                     7.64.1)
122
123              "AsynchDNS"
124                     features mask bit: CURL_VERSION_ASYNCHDNS
125                     libcurl was built  with  support  for  asynchronous  name
126                     lookups,  which  allows more exact timeouts (even on Win‐
127                     dows) and less blocking when using the  multi  interface.
128                     (added in 7.10.7)
129
130              "brotli"
131                     features mask bit: CURL_VERSION_BROTLI
132                     supports  HTTP Brotli content encoding using libbrotlidec
133                     (Added in 7.57.0)
134
135              "Debug"
136                     features mask bit: CURL_VERSION_DEBUG
137                     libcurl was  built  with  debug  capabilities  (added  in
138                     7.10.6)
139
140              "gsasl"
141                     features mask bit: CURL_VERSION_GSASL
142                     libcurl  was built with libgsasl and thus with some extra
143                     SCRAM-SHA authentication methods. (added in 7.76.0)
144
145              "GSS-API"
146                     features mask bit: CURL_VERSION_GSSAPI
147                     libcurl was built with support for  GSS-API.  This  makes
148                     libcurl  use  provided  functions for Kerberos and SPNEGO
149                     authentication. It also allows libcurl to use the current
150                     user  credentials without the app having to pass them on.
151                     (Added in 7.38.0)
152
153              "HSTS" features mask bit: CURL_VERSION_HSTS
154                     libcurl was built with  support  for  HSTS  (HTTP  Strict
155                     Transport Security) (Added in 7.74.0)
156
157              "HTTP2"
158                     features mask bit: CURL_VERSION_HTTP2
159                     libcurl  was  built  with  support  for HTTP2.  (Added in
160                     7.33.0)
161
162              "HTTP3"
163                     features mask bit: CURL_VERSION_HTTP3
164                     HTTP/3 and QUIC support are built-in (Added in 7.66.0)
165
166              "HTTPS-proxy"
167                     features mask bit: CURL_VERSION_HTTPS_PROXY
168                     libcurl was built with support for  HTTPS-proxy.   (Added
169                     in 7.52.0)
170
171              "IDN"  features mask bit: CURL_VERSION_IDN
172                     libcurl  was  built  with  support for IDNA, domain names
173                     with international letters. (Added in 7.12.0)
174
175              "IPv6" features mask bit: CURL_VERSION_IPV6
176                     supports IPv6
177
178              "Kerberos"
179                     features mask bit: CURL_VERSION_KERBEROS5
180                     supports Kerberos V5 authentication for FTP, IMAP,  LDAP,
181                     POP3, SMTP and SOCKSv5 proxy. (Added in 7.40.0)
182
183              "Largefile"
184                     features mask bit: CURL_VERSION_LARGEFILE
185                     libcurl was built with support for large files. (Added in
186                     7.11.1)
187
188              "libz" features mask bit: CURL_VERSION_LIBZ
189                     supports HTTP deflate using libz (Added in 7.10)
190
191              "MultiSSL"
192                     features mask bit: CURL_VERSION_MULTI_SSL
193                     libcurl was built with multiple  SSL  backends.  For  de‐
194                     tails, see curl_global_sslset(3).  (Added in 7.56.0)
195
196              "NTLM" features mask bit: CURL_VERSION_NTLM
197                     supports HTTP NTLM (added in 7.10.6)
198
199              "NTLM_WB"
200                     features mask bit: CURL_VERSION_NTLM_WB
201                     libcurl  was  built with support for NTLM delegation to a
202                     winbind helper.  (Added in 7.22.0)
203
204              "PSL"  features mask bit: CURL_VERSION_PSL
205                     libcurl was built with support for Mozilla's Public  Suf‐
206                     fix List. This makes libcurl ignore cookies with a domain
207                     that is on the list.  (Added in 7.47.0)
208
209              "SPNEGO"
210                     features mask bit: CURL_VERSION_SPNEGO
211                     libcurl was built with support for SPNEGO  authentication
212                     (Simple  and Protected GSS-API Negotiation Mechanism, de‐
213                     fined in RFC 2478.) (added in 7.10.8)
214
215              "SSL"  features mask bit: CURL_VERSION_SSL
216                     supports SSL (HTTPS/FTPS) (Added in 7.10)
217
218              "SSPI" features mask bit: CURL_VERSION_SSPI
219                     libcurl was built with support for  SSPI.  This  is  only
220                     available  on  Windows and makes libcurl use Windows-pro‐
221                     vided functions for Kerberos, NTLM, SPNEGO and Digest au‐
222                     thentication.  It  also allows libcurl to use the current
223                     user credentials without the app having to pass them  on.
224                     (Added in 7.13.2)
225
226              "threadsafe"
227                     features mask bit: CURL_VERSION_THREADSAFE
228                     libcurl  was  built with thread-safety support (Atomic or
229                     SRWLOCK)  to  protect  curl  initialization.  (Added   in
230                     7.84.0) See libcurl-thread(3)
231
232              "TLS-SRP"
233                     features mask bit: CURL_VERSION_TLSAUTH_SRP
234                     libcurl  was  built  with  support for TLS-SRP (in one or
235                     more of the built-in TLS backends). (Added in 7.21.4)
236
237              "TrackMemory"
238                     features mask bit: CURL_VERSION_CURLDEBUG
239                     libcurl was built with memory  tracking  debug  capabili‐
240                     ties.  This  is  mainly  of interest for libcurl hackers.
241                     (added in 7.19.6)
242
243              "Unicode"
244                     features mask bit: CURL_VERSION_UNICODE
245                     libcurl was built with Unicode support on  Windows.  This
246                     makes  non-ASCII characters work in filenames and options
247                     passed to libcurl. (Added in 7.72.0)
248
249              "UnixSockets"
250                     features mask bit: CURL_VERSION_UNIX_SOCKETS
251                     libcurl was built with support for Unix  domain  sockets.
252                     (Added in 7.40.0)
253
254              "zstd" features mask bit: CURL_VERSION_ZSTD
255                     supports  HTTP  zstd  content encoding using zstd library
256                     (Added in 7.72.0)
257
258              none   features mask bit: CURL_VERSION_CONV
259                     libcurl was built with support for character conversions,
260                     as  provided  by  the  CURLOPT_CONV_* callbacks. Always 0
261                     since 7.82.0. (Added in 7.15.4)
262
263              none   features mask bit: CURL_VERSION_GSSNEGOTIATE
264                     supports HTTP GSS-Negotiate (added in 7.10.6,  deprecated
265                     in 7.38.0)
266
267              none   features mask bit: CURL_VERSION_KERBEROS4
268                     supports Kerberos V4 (when using FTP). Legacy bit. Depre‐
269                     cated since 7.33.0.
270
271       ssl_version is an ASCII string for the TLS library name + version used.
272       If  libcurl  has  no SSL support, this is NULL. For example "Schannel",
273       "Secure Transport" or "OpenSSL/1.1.0g".
274
275       ssl_version_num is always 0.
276
277       libz_version is an ASCII string (there is  no  numerical  version).  If
278       libcurl has no libz support, this is NULL.
279
280       protocols  is  a pointer to an array of char * pointers, containing the
281       names protocols that libcurl supports (using  lowercase  letters).  The
282       protocol names are the same as would be used in URLs. The array is ter‐
283       minated by a NULL entry.
284

EXAMPLE

286       curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
287       printf("libcurl version %u.%u.%u\n",
288              (ver->version_num >> 16) & 0xff,
289              (ver->version_num >> 8) & 0xff,
290              ver->version_num & 0xff);
291

AVAILABILITY

293       Added in 7.10
294

RETURN VALUE

296       A pointer to a curl_version_info_data struct.
297

SEE ALSO

299       curl_version(3)
300
301
302
303libcurl 8.0.1                  January 16, 2023           curl_version_info(3)
Impressum