2
0

curl_version_info.3 12 KB

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