curl_version_info.3 11 KB

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