crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
curl.h
Go to the documentation of this file.
1 /*
2  *
3  * ---
4  *
5  * Copyright (C) 2020 Anselm Schmidt (ans[ät]ohai.su)
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version in addition to the terms of any
11  * licences already herein identified.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  *
21  * ---
22  *
23  * curl.h
24  *
25  * Define libcurl flags that are not defined yet.
26  * Used for compiling with older versions of libcurl.
27  *
28  * Created on: Jul 30, 2020
29  * Author: ans
30  */
31 
32 #ifndef HELPER_PORTABILITY_CURL_H_
33 #define HELPER_PORTABILITY_CURL_H_
34 
35 #include <curl/curl.h>
36 
37 /*
38  * CHECK LIBRARY (HEADER) VERSION
39  */
40 
41 #if LIBCURL_VERSION_NUM < 0x071100 /* 7.17.0 */
42 #error Your libcurl library is hopelessly outdated (< 7.17.0).
43 #endif
44 
45 #if LIBCURL_VERSION_NUM < 0x074400 /* 7.68.0 */
46 #warning Your libcurl library is outdated (< 7.68.0), consider updating it.
47 #endif
48 
49 /*
50  * MACROS FOR UNDEFINED OPTIONS
51  */
52 
53 #if LIBCURL_VERSION_NUM < 0x072100 /* 7.33.0 */
54 #define CURL_HTTP_VERSION_2_0 3
55 #endif
56 
57 #if LIBCURL_VERSION_NUM < 0x072F00 /* 7.47.0 */
58 #define CURL_HTTP_VERSION_2TLS 4
59 #endif
60 
61 #if LIBCURL_VERSION_NUM < 0x073100 /* 7.49.0 */
62 #define CURLOPT_TCP_FASTOPEN static_cast<CURLoption>(CURLOPTTYPE_LONG + 244)
63 #define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5
64 #endif
65 
66 #if LIBCURL_VERSION_NUM < 0x073400 /* 7.52.0 */
67 #define CURLOPT_PROXY_SSL_VERIFYPEER static_cast<CURLoption>(CURLOPTTYPE_LONG + 248)
68 #define CURLOPT_PROXY_SSL_VERIFYHOST static_cast<CURLoption>(CURLOPTTYPE_LONG + 249)
69 #define CURLOPT_PROXY_TLSAUTH_USERNAME static_cast<CURLoption>(CURLOPTTYPE_OBJECTPOINT + 251)
70 #define CURLOPT_PROXY_TLSAUTH_PASSWORD static_cast<CURLoption>(CURLOPTTYPE_OBJECTPOINT + 252)
71 #define CURLOPT_PROXY_TLSAUTH_TYPE static_cast<CURLoption>(CURLOPTTYPE_OBJECTPOINT + 253)
72 #define CURLOPT_PRE_PROXY static_cast<CURLoption>(CURLOPTTYPE_OBJECTPOINT + 262)
73 #endif
74 
75 #if LIBCURL_VERSION_NUM < 0x073B00 /* 7.59.0 */
76 #define CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS static_cast<CURLoption>(CURLOPTTYPE_LONG + 271)
77 #define CURL_HET_DEFAULT 200L
78 #endif
79 
80 #if LIBCURL_VERSION_NUM < 0x073C00 /* 7.60.0 */
81 #define CURLOPT_DNS_SHUFFLE_ADDRESSES static_cast<CURLoption>(CURLOPTTYPE_LONG + 275)
82 #endif
83 
84 #if LIBCURL_VERSION_NUM < 0x073E00 /* 7.62.0 */
85 #define CURLOPT_DOH_URL static_cast<CURLoption>(CURLOPTTYPE_OBJECTPOINT + 279)
86 #endif
87 
88 #if LIBCURL_VERSION_NUM < 0x074200 /* 7.66.0 */
89 #define CURL_HTTP_VERSION_3 30
90 #endif
91 
92 /*
93  * MACROS FOR UNDEFINED FEATURES
94  */
95 
96 #ifndef CURL_VERSION_SSL
97 #define CURL_VERSION_SSL (1<<2)
98 #endif
99 
100 #ifndef CURL_VERSION_LIBZ
101 #define CURL_VERSION_LIBZ (1<<3)
102 #endif
103 
104 #ifndef CURL_VERSION_TLSAUTH_SRP
105 #define CURL_VERSION_TLSAUTH_SRP (1<<14)
106 #endif
107 
108 #ifndef CURL_VERSION_HTTP2
109 #define CURL_VERSION_HTTP2 (1<<16)
110 #endif
111 
112 #ifndef CURL_VERSION_BROTLI
113 #define CURL_VERSION_BROTLI (1<<23)
114 #endif
115 
116 #ifndef CURL_VERSION_HTTP3
117 #define CURL_VERSION_HTTP3 (1<<25)
118 #endif
119 
120 #ifndef CURL_VERSION_ZSTD
121 #define CURL_VERSION_ZSTD (1<<26)
122 #endif
123 
124 #endif /* HELPER_PORTABILITY_CURL_H_ */