curl_version_info.3 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2022, 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 7.40.0" "libcurl Manual"
  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. The curl_version_info_data struct looks like this
  48. .nf
  49. typedef struct {
  50. CURLversion age; /* see description below */
  51. const char *version; /* human readable string */
  52. unsigned int version_num; /* numeric representation */
  53. const char *host; /* human readable string */
  54. int features; /* bitmask, see below */
  55. char *ssl_version; /* human readable string */
  56. long ssl_version_num; /* not used, always zero */
  57. const char *libz_version; /* human readable string */
  58. const char *const *protocols; /* protocols */
  59. /* when 'age' is CURLVERSION_SECOND or higher, the members below exist */
  60. const char *ares; /* human readable string */
  61. int ares_num; /* number */
  62. /* when 'age' is CURLVERSION_THIRD or higher, the members below exist */
  63. const char *libidn; /* human readable string */
  64. /* when 'age' is CURLVERSION_FOURTH or higher (>= 7.16.1), the members
  65. below exist */
  66. int iconv_ver_num; /* '_libiconv_version' if iconv support enabled */
  67. const char *libssh_version; /* human readable string */
  68. /* when 'age' is CURLVERSION_FIFTH or higher (>= 7.57.0), the members
  69. below exist */
  70. unsigned int brotli_ver_num; /* Numeric Brotli version
  71. (MAJOR << 24) | (MINOR << 12) | PATCH */
  72. const char *brotli_version; /* human readable string. */
  73. /* when 'age' is CURLVERSION_SIXTH or higher (>= 7.66.0), the members
  74. below exist */
  75. unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
  76. (MAJOR << 16) | (MINOR << 8) | PATCH */
  77. const char *nghttp2_version; /* human readable string. */
  78. const char *quic_version; /* human readable quic (+ HTTP/3) library +
  79. version or NULL */
  80. /* when 'age' is CURLVERSION_SEVENTH or higher (>= 7.70.0), the members
  81. below exist */
  82. const char *cainfo; /* the built-in default CURLOPT_CAINFO, might
  83. be NULL */
  84. const char *capath; /* the built-in default CURLOPT_CAPATH, might
  85. be NULL */
  86. /* when 'age' is CURLVERSION_EIGHTH or higher (>= 7.71.0), the members
  87. below exist */
  88. unsigned int zstd_ver_num; /* Numeric Zstd version
  89. (MAJOR << 24) | (MINOR << 12) | PATCH */
  90. const char *zstd_version; /* human readable string. */
  91. /* when 'age' is CURLVERSION_NINTH or higher (>= 7.75.0), the members
  92. below exist */
  93. const char *hyper_version; /* human readable string. */
  94. /* when 'age' is CURLVERSION_TENTH or higher (>= 7.77.0), the members
  95. below exist */
  96. const char *gsasl_version; /* human readable string. */
  97. } curl_version_info_data;
  98. .fi
  99. \fIage\fP describes what the age of this struct is. The number depends on how
  100. new the libcurl you are using is. You are however guaranteed to get a struct
  101. that you have a matching struct for in the header, as you tell libcurl your
  102. "age" with the input argument.
  103. \fIversion\fP is just an ascii string for the libcurl version.
  104. \fIversion_num\fP is a 24 bit number created like this: <8 bits major number>
  105. | <8 bits minor number> | <8 bits patch number>. Version 7.9.8 is therefore
  106. returned as 0x070908.
  107. \fIhost\fP is an ascii string showing what host information that this libcurl
  108. was built for. As discovered by a configure script or set by the build
  109. environment.
  110. \fIfeatures\fP can have none, one or more bits set, and the currently defined
  111. bits are:
  112. .RS
  113. .IP CURL_VERSION_ALTSVC
  114. HTTP Alt-Svc parsing and the associated options (Added in 7.64.1)
  115. .IP CURL_VERSION_ASYNCHDNS
  116. libcurl was built with support for asynchronous name lookups, which allows
  117. more exact timeouts (even on Windows) and less blocking when using the multi
  118. interface. (added in 7.10.7)
  119. .IP CURL_VERSION_BROTLI
  120. supports HTTP Brotli content encoding using libbrotlidec (Added in 7.57.0)
  121. .IP CURL_VERSION_ZSTD
  122. supports HTTP zstd content encoding using zstd library (Added in 7.72.0)
  123. .IP CURL_VERSION_CONV
  124. libcurl was built with support for character conversions, as provided by the
  125. CURLOPT_CONV_* callbacks. (Added in 7.15.4)
  126. .IP CURL_VERSION_CURLDEBUG
  127. libcurl was built with memory tracking debug capabilities. This is mainly of
  128. interest for libcurl hackers. (added in 7.19.6)
  129. .IP CURL_VERSION_DEBUG
  130. libcurl was built with debug capabilities (added in 7.10.6)
  131. .IP CURL_VERSION_GSASL
  132. libcurl was built with libgsasl and thus with some extra SCRAM-SHA
  133. authentication methods. (added in 7.76.0)
  134. .IP CURL_VERSION_GSSAPI
  135. libcurl was built with support for GSS-API. This makes libcurl use provided
  136. functions for Kerberos and SPNEGO authentication. It also allows libcurl
  137. to use the current user credentials without the app having to pass them on.
  138. (Added in 7.38.0)
  139. .IP CURL_VERSION_GSSNEGOTIATE
  140. supports HTTP GSS-Negotiate (added in 7.10.6)
  141. .IP CURL_VERSION_HSTS
  142. libcurl was built with support for HSTS (HTTP Strict Transport Security)
  143. (Added in 7.74.0)
  144. .IP CURL_VERSION_HTTPS_PROXY
  145. libcurl was built with support for HTTPS-proxy.
  146. (Added in 7.52.0)
  147. .IP CURL_VERSION_HTTP2
  148. libcurl was built with support for HTTP2.
  149. (Added in 7.33.0)
  150. .IP CURL_VERSION_HTTP3
  151. HTTP/3 and QUIC support are built-in (Added in 7.66.0)
  152. .IP CURL_VERSION_IDN
  153. libcurl was built with support for IDNA, domain names with international
  154. letters. (Added in 7.12.0)
  155. .IP CURL_VERSION_IPV6
  156. supports IPv6
  157. .IP CURL_VERSION_KERBEROS4
  158. supports Kerberos V4 (when using FTP). Legacy bit. Deprecated since 7.33.0.
  159. .IP CURL_VERSION_KERBEROS5
  160. supports Kerberos V5 authentication for FTP, IMAP, LDAP, POP3, SMTP and
  161. SOCKSv5 proxy. (Added in 7.40.0)
  162. .IP CURL_VERSION_LARGEFILE
  163. libcurl was built with support for large files. (Added in 7.11.1)
  164. .IP CURL_VERSION_UNICODE
  165. libcurl was built with Unicode support on Windows. This makes non-ASCII
  166. characters work in filenames and options passed to libcurl. (Added in 7.72.0)
  167. .IP CURL_VERSION_LIBZ
  168. supports HTTP deflate using libz (Added in 7.10)
  169. .IP CURL_VERSION_MULTI_SSL
  170. libcurl was built with multiple SSL backends. For details, see
  171. \fIcurl_global_sslset(3)\fP.
  172. (Added in 7.56.0)
  173. .IP CURL_VERSION_NTLM
  174. supports HTTP NTLM (added in 7.10.6)
  175. .IP CURL_VERSION_NTLM_WB
  176. libcurl was built with support for NTLM delegation to a winbind helper.
  177. (Added in 7.22.0)
  178. .IP CURL_VERSION_PSL
  179. libcurl was built with support for Mozilla's Public Suffix List. This makes
  180. libcurl ignore cookies with a domain that is on the list.
  181. (Added in 7.47.0)
  182. .IP CURL_VERSION_SPNEGO
  183. libcurl was built with support for SPNEGO authentication (Simple and Protected
  184. GSS-API Negotiation Mechanism, defined in RFC 2478.) (added in 7.10.8)
  185. .IP CURL_VERSION_SSL
  186. supports SSL (HTTPS/FTPS) (Added in 7.10)
  187. .IP CURL_VERSION_SSPI
  188. libcurl was built with support for SSPI. This is only available on Windows and
  189. makes libcurl use Windows-provided functions for Kerberos, NTLM, SPNEGO and
  190. Digest authentication. It also allows libcurl to use the current user
  191. credentials without the app having to pass them on. (Added in 7.13.2)
  192. .IP CURL_VERSION_THREADSAFE
  193. libcurl was built with thread-safety support (Atomic or SRWLOCK) to protect
  194. curl initialization. (Added in 7.84.0) See \fIlibcurl-thread(3)\fP
  195. .IP CURL_VERSION_TLSAUTH_SRP
  196. libcurl was built with support for TLS-SRP (in one or more of the built-in TLS
  197. backends). (Added in 7.21.4)
  198. .IP CURL_VERSION_UNIX_SOCKETS
  199. libcurl was built with support for Unix domain sockets.
  200. (Added in 7.40.0)
  201. .RE
  202. \fIssl_version\fP is an ASCII string for the TLS library name + version
  203. used. If libcurl has no SSL support, this is NULL. For example "Schannel",
  204. \&"Secure Transport" or "OpenSSL/1.1.0g".
  205. \fIssl_version_num\fP is always 0.
  206. \fIlibz_version\fP is an ASCII string (there is no numerical version). If
  207. libcurl has no libz support, this is NULL.
  208. \fIprotocols\fP is a pointer to an array of char * pointers, containing the
  209. names protocols that libcurl supports (using lowercase letters). The protocol
  210. names are the same as would be used in URLs. The array is terminated by a NULL
  211. entry.
  212. .SH EXAMPLE
  213. .nf
  214. curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
  215. printf("libcurl version %u.%u.%u\\n",
  216. (ver->version_num >> 16) & 0xff,
  217. (ver->version_num >> 8) & 0xff,
  218. ver->version_num & 0xff,
  219. .fi
  220. .SH AVAILABILITY
  221. Added in 7.10
  222. .SH RETURN VALUE
  223. A pointer to a curl_version_info_data struct.
  224. .SH "SEE ALSO"
  225. \fIcurl_version(3)\fP