curl_version_info.3 12 KB

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