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

NAME

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

EXAMPLE

247       curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
248       printf("libcurl version %u.%u.%u\n",
249              (ver->version_num >> 16) & 0xff,
250              (ver->version_num >> 8) & 0xff,
251              ver->version_num & 0xff,
252

AVAILABILITY

254       Added in 7.10
255

RETURN VALUE

257       A pointer to a curl_version_info_data struct.
258

SEE ALSO

260       curl_version(3)
261
262
263
264libcurl 7.82.0                 January 10, 2022           curl_version_info(3)
Impressum