([]);
16 |
17 | useEffect(() => {
18 | fetchPresets();
19 | }, []);
20 |
21 | const fetchPresets = async () => {
22 | try {
23 | const response = await fetch('https://extravi.dev/update/presets.json');
24 | const data = await response.json();
25 | setPresets(data.presets);
26 | } catch (error) {
27 | console.error('Error fetching presets:', error);
28 | }
29 | };
30 |
31 | const openLink = async (url: string) => {
32 | try {
33 | await open(url);
34 | console.log('Link opened successfully');
35 | } catch (error) {
36 | console.error('Error opening link:', error);
37 | }
38 | };
39 |
40 | function checkCheckboxStatus(): void {
41 | const checkboxes = ["box-0", "box-1", "box-2", "box-3"];
42 | const links = [
43 | 'https://www.youtube.com/channel/UCOZnRzWstxDLyW30TjWEevQ?sub_confirmation=1',
44 | 'https://discord.gg/TNG5yHsEwu',
45 | 'https://www.roblox.com/groups/34468021/Bloxshade-Community',
46 | 'https://extravi.dev/'
47 | ];
48 |
49 | checkboxes.forEach((box, index) => {
50 | const checkbox = document.getElementById(box) as HTMLInputElement;
51 | if (checkbox.checked) {
52 | openLink(links[index]);
53 | }
54 | });
55 | // close installer
56 | window.close();
57 | }
58 |
59 | async function createBloxshadeFolder() {
60 | const bloxshadeFolderPath = 'C:\\Program Files\\Bloxshade';
61 | const installLogPath = `${bloxshadeFolderPath}\\install.txt`; // install log path
62 |
63 | try {
64 | await fs.writeFile(installLogPath, ''); // create install log file
65 |
66 | // start installer
67 | invoke('cmd', { executable_path: `${bloxshadeFolderPath}\\installer.exe`, arguments: '' });
68 |
69 | let lastReadPosition = 0;
70 |
71 | while (true) {
72 | const fileContent = await fs.readTextFile(installLogPath);
73 |
74 | const newContent = fileContent.substring(lastReadPosition);
75 | const lines = newContent.split('\n');
76 |
77 | let newText = '';
78 |
79 | for (const line of lines) {
80 | if (line.trim() !== '') {
81 | newText += `${line.trim()} `;
82 | }
83 |
84 | if (line.trim() === '0') {
85 | console.log('0');
86 |
87 | // done installing go to last page
88 | const element1: HTMLElement | null = document.getElementById("con-1");
89 | const element2: HTMLElement | null = document.getElementById("con-4");
90 |
91 | if (element1 && element2) {
92 | element1.classList.remove("show");
93 | element1.classList.add("hide");
94 |
95 | element2.classList.remove("hide");
96 | element2.classList.add("show");
97 | } else {
98 | console.error("One or both elements not found.");
99 | }
100 |
101 | return; // exit loop
102 | }
103 | }
104 |
105 | // scroll down the textbox
106 | const textbox: HTMLElement | null = document.getElementById('textbox');
107 |
108 | function scrollTextbox(): void {
109 | if (textbox) {
110 | textbox.scrollTop = textbox.scrollHeight;
111 | }
112 | }
113 |
114 | // update textbox
115 | const textBox = document.querySelector('.textbox p');
116 | if (textBox) {
117 | textBox.innerHTML += newText;
118 | scrollTextbox();
119 | }
120 |
121 | lastReadPosition = fileContent.length;
122 |
123 | await new Promise(resolve => setTimeout(resolve, 50)); // wait
124 | }
125 |
126 | } catch (error) {
127 | console.error('Error creating Bloxshade folder:', error);
128 | }
129 | }
130 |
131 | async function createBloxshadeNVFolder() {
132 | const bloxshadeFolderPath = 'C:\\Program Files\\Bloxshade';
133 | const installLogPath = `${bloxshadeFolderPath}\\install.txt`; // install log path
134 |
135 | try {
136 | await fs.writeFile(installLogPath, ''); // create install log file
137 |
138 | // start installer
139 | invoke('cmd', { executable_path: `${bloxshadeFolderPath}\\installer.exe`, arguments: '-nv' });
140 |
141 | let lastReadPosition = 0;
142 |
143 | while (true) {
144 | const fileContent = await fs.readTextFile(installLogPath);
145 |
146 | const newContent = fileContent.substring(lastReadPosition);
147 | const lines = newContent.split('\n');
148 |
149 | let newText = '';
150 |
151 | for (const line of lines) {
152 | if (line.trim() !== '') {
153 | newText += `${line.trim()} `;
154 | }
155 |
156 | if (line.trim() === '0') {
157 | console.log('0');
158 |
159 | // done installing go to last page
160 | const element1: HTMLElement | null = document.getElementById("con-6");
161 | const element2: HTMLElement | null = document.getElementById("con-0");
162 |
163 | if (element1 && element2) {
164 | element1.classList.remove("show");
165 | element1.classList.add("hide");
166 |
167 | element2.classList.remove("hide");
168 | element2.classList.add("show");
169 | } else {
170 | console.error("One or both elements not found.");
171 | }
172 |
173 | return; // exit loop
174 | }
175 | }
176 |
177 | // scroll down the textbox
178 | const textbox: HTMLElement | null = document.getElementById('textbox-2');
179 |
180 | function scrollTextbox(): void {
181 | if (textbox) {
182 | textbox.scrollTop = textbox.scrollHeight;
183 | }
184 | }
185 |
186 | // update textbox
187 | const textBox = document.querySelector('.textbox-2 p');
188 | if (textBox) {
189 | textBox.innerHTML += newText;
190 | scrollTextbox();
191 | }
192 |
193 | lastReadPosition = fileContent.length;
194 |
195 | await new Promise(resolve => setTimeout(resolve, 50)); // wait
196 | }
197 |
198 | } catch (error) {
199 | console.error('Error creating Bloxshade folder:', error);
200 | }
201 | }
202 |
203 | async function shortcut() {
204 | const bloxshadeFolderPath = 'C:\\Program Files\\Bloxshade';
205 | const installLogPath = `${bloxshadeFolderPath}\\install.txt`; // install log path
206 |
207 | try {
208 | await fs.writeFile(installLogPath, ''); // create install log file
209 |
210 | // start installer
211 | invoke('cmd', { executable_path: `${bloxshadeFolderPath}\\installer.exe`, arguments: '-shortcut' });
212 | } catch (error) {
213 | console.error(error);
214 | }
215 | }
216 |
217 | async function importPreset() {
218 | const bloxshadeFolderPath = 'C:\\Program Files\\Bloxshade';
219 | const installLogPath = `${bloxshadeFolderPath}\\install.txt`; // install log path
220 |
221 | try {
222 | await fs.writeFile(installLogPath, ''); // create install log file
223 |
224 | // start installer
225 | invoke('cmd', { executable_path: `${bloxshadeFolderPath}\\installer.exe`, arguments: '-import' });
226 | } catch (error) {
227 | console.error(error);
228 | }
229 | }
230 |
231 | async function fix() {
232 | const bloxshadeFolderPath = 'C:\\Program Files\\Bloxshade';
233 | const installLogPath = `${bloxshadeFolderPath}\\install.txt`; // install log path
234 |
235 | try {
236 | await fs.writeFile(installLogPath, ''); // create install log file
237 |
238 | // start installer
239 | invoke('cmd', { executable_path: `${bloxshadeFolderPath}\\installer.exe`, arguments: '-fix' });
240 | } catch (error) {
241 | console.error(error);
242 | }
243 | }
244 |
245 | const userPreset = async (source: string) => {
246 | const bloxshadeFolderPath = 'C:\\Program Files\\Bloxshade';
247 | try {
248 | console.log(source);
249 | // todo
250 | invoke('cmd', { executable_path: `${bloxshadeFolderPath}\\installer.exe`, arguments: `-install "${source}"` });
251 | } catch (error) {
252 | console.error(error);
253 | }
254 | };
255 |
256 | return (
257 | <>
258 |
259 | {/* content 0 */}
260 |
261 |
Bloxshade - Improve Roblox with shaders.
262 |
This installer will set up and configure ReShade
263 | FX shaders tailored for Nvidia Ansel on
264 | your computer.
265 |
266 |
267 | Before continuing, ensure that Roblox is closed.
268 | If Roblox is open, the installer will terminate
269 | the process before it begins.
270 |
271 |
272 | There may be issues with the setup.
273 | If that's the case, it's recommended that you ask
274 | your questions in Bloxshade's Discord server.
275 |
276 |
277 | Click Install to continue.
278 |
279 |
Settings
280 |
Acknowledgements
281 |
Install
282 |
283 | {/* content 1 */}
284 |
285 |
Bloxshade - Improve Roblox with shaders.
286 |
Installing...
287 |
Please wait while Bloxshade is being installed.
288 |
291 |
Next
292 |
293 | {/* content 2 */}
294 |
295 |
Bloxshade - Improve Roblox with shaders.
296 |
Setup has finished installing Bloxshade on your
297 | computer. The effects will be applied the next
298 | time you launch Roblox.
299 |
300 |
301 | Click Finish to exit Setup.
302 |
303 |
304 |
305 |
306 | Subscribe to Extravi on Youtube
307 |
308 |
309 |
310 |
311 |
312 | Join our Discord server
313 |
314 |
315 |
316 |
317 |
318 | Join our Roblox group
319 |
320 |
321 |
322 |
323 |
324 | Visit extravi.dev
325 |
326 |
327 |
Finish
328 |
329 | {/* content 3 */}
330 |
331 |
Bloxshade - Improve Roblox with shaders.
332 |
If you have already installed Bloxshade, you can manage Roblox from here or configure your installation.
333 |
Create shortcuts
334 |
Bloxshade FX issues (menu/effects not working).
335 |
Fix Bloxshade FX
336 |
Install your own Ansel presets.
337 |
Import your own Ansel preset
338 |
openLink('https://discord.com/invite/TNG5yHsEwu')}>Discord
339 |
Patch Nvidia App
340 |
Back
341 |
342 | {/* content 4 */}
343 |
344 |
Community presets
345 |
Download and install community presets
346 |
347 | {presets.map((preset, index) => (
348 |
355 | ))}
356 |
357 |
Next
358 |
359 | {/* content 5 */}
360 |
361 |
Acknowledgements
362 |
Open source repositories Bloxshade uses
363 |
364 |
370 |
376 |
382 |
388 |
394 |
400 |
406 |
412 |
418 |
424 |
430 |
436 |
442 |
443 |
Back
444 |
445 | {/* content 6 */}
446 |
447 |
Bloxshade - Improve Roblox with shaders.
448 |
Patching the Nvidia App...
449 |
Please wait while Bloxshade is working.
450 |
453 |
Next
454 |
455 | >
456 | )
457 | }
458 |
459 | export default App
460 |
--------------------------------------------------------------------------------
/bloxshade/installer/src/curl/system.h:
--------------------------------------------------------------------------------
1 | #ifndef CURLINC_SYSTEM_H
2 | #define CURLINC_SYSTEM_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /*
26 | * Try to keep one section per platform, compiler and architecture, otherwise,
27 | * if an existing section is reused for a different one and later on the
28 | * original is adjusted, probably the piggybacking one can be adversely
29 | * changed.
30 | *
31 | * In order to differentiate between platforms/compilers/architectures use
32 | * only compiler built in predefined preprocessor symbols.
33 | *
34 | * curl_off_t
35 | * ----------
36 | *
37 | * For any given platform/compiler curl_off_t must be typedef'ed to a 64-bit
38 | * wide signed integral data type. The width of this data type must remain
39 | * constant and independent of any possible large file support settings.
40 | *
41 | * As an exception to the above, curl_off_t shall be typedef'ed to a 32-bit
42 | * wide signed integral data type if there is no 64-bit type.
43 | *
44 | * As a general rule, curl_off_t shall not be mapped to off_t. This rule shall
45 | * only be violated if off_t is the only 64-bit data type available and the
46 | * size of off_t is independent of large file support settings. Keep your
47 | * build on the safe side avoiding an off_t gating. If you have a 64-bit
48 | * off_t then take for sure that another 64-bit data type exists, dig deeper
49 | * and you will find it.
50 | *
51 | */
52 |
53 | #if defined(__DJGPP__) || defined(__GO32__)
54 | # if defined(__DJGPP__) && (__DJGPP__ > 1)
55 | # define CURL_TYPEOF_CURL_OFF_T long long
56 | # define CURL_FORMAT_CURL_OFF_T "lld"
57 | # define CURL_FORMAT_CURL_OFF_TU "llu"
58 | # define CURL_SUFFIX_CURL_OFF_T LL
59 | # define CURL_SUFFIX_CURL_OFF_TU ULL
60 | # else
61 | # define CURL_TYPEOF_CURL_OFF_T long
62 | # define CURL_FORMAT_CURL_OFF_T "ld"
63 | # define CURL_FORMAT_CURL_OFF_TU "lu"
64 | # define CURL_SUFFIX_CURL_OFF_T L
65 | # define CURL_SUFFIX_CURL_OFF_TU UL
66 | # endif
67 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
68 |
69 | #elif defined(__SALFORDC__)
70 | # define CURL_TYPEOF_CURL_OFF_T long
71 | # define CURL_FORMAT_CURL_OFF_T "ld"
72 | # define CURL_FORMAT_CURL_OFF_TU "lu"
73 | # define CURL_SUFFIX_CURL_OFF_T L
74 | # define CURL_SUFFIX_CURL_OFF_TU UL
75 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
76 |
77 | #elif defined(__BORLANDC__)
78 | # if (__BORLANDC__ < 0x520)
79 | # define CURL_TYPEOF_CURL_OFF_T long
80 | # define CURL_FORMAT_CURL_OFF_T "ld"
81 | # define CURL_FORMAT_CURL_OFF_TU "lu"
82 | # define CURL_SUFFIX_CURL_OFF_T L
83 | # define CURL_SUFFIX_CURL_OFF_TU UL
84 | # else
85 | # define CURL_TYPEOF_CURL_OFF_T __int64
86 | # define CURL_FORMAT_CURL_OFF_T "I64d"
87 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
88 | # define CURL_SUFFIX_CURL_OFF_T i64
89 | # define CURL_SUFFIX_CURL_OFF_TU ui64
90 | # endif
91 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
92 |
93 | #elif defined(__TURBOC__)
94 | # define CURL_TYPEOF_CURL_OFF_T long
95 | # define CURL_FORMAT_CURL_OFF_T "ld"
96 | # define CURL_FORMAT_CURL_OFF_TU "lu"
97 | # define CURL_SUFFIX_CURL_OFF_T L
98 | # define CURL_SUFFIX_CURL_OFF_TU UL
99 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
100 |
101 | #elif defined(__WATCOMC__)
102 | # if defined(__386__)
103 | # define CURL_TYPEOF_CURL_OFF_T __int64
104 | # define CURL_FORMAT_CURL_OFF_T "I64d"
105 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
106 | # define CURL_SUFFIX_CURL_OFF_T i64
107 | # define CURL_SUFFIX_CURL_OFF_TU ui64
108 | # else
109 | # define CURL_TYPEOF_CURL_OFF_T long
110 | # define CURL_FORMAT_CURL_OFF_T "ld"
111 | # define CURL_FORMAT_CURL_OFF_TU "lu"
112 | # define CURL_SUFFIX_CURL_OFF_T L
113 | # define CURL_SUFFIX_CURL_OFF_TU UL
114 | # endif
115 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
116 |
117 | #elif defined(__POCC__)
118 | # if (__POCC__ < 280)
119 | # define CURL_TYPEOF_CURL_OFF_T long
120 | # define CURL_FORMAT_CURL_OFF_T "ld"
121 | # define CURL_FORMAT_CURL_OFF_TU "lu"
122 | # define CURL_SUFFIX_CURL_OFF_T L
123 | # define CURL_SUFFIX_CURL_OFF_TU UL
124 | # elif defined(_MSC_VER)
125 | # define CURL_TYPEOF_CURL_OFF_T __int64
126 | # define CURL_FORMAT_CURL_OFF_T "I64d"
127 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
128 | # define CURL_SUFFIX_CURL_OFF_T i64
129 | # define CURL_SUFFIX_CURL_OFF_TU ui64
130 | # else
131 | # define CURL_TYPEOF_CURL_OFF_T long long
132 | # define CURL_FORMAT_CURL_OFF_T "lld"
133 | # define CURL_FORMAT_CURL_OFF_TU "llu"
134 | # define CURL_SUFFIX_CURL_OFF_T LL
135 | # define CURL_SUFFIX_CURL_OFF_TU ULL
136 | # endif
137 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
138 |
139 | #elif defined(__LCC__)
140 | # define CURL_TYPEOF_CURL_OFF_T long
141 | # define CURL_FORMAT_CURL_OFF_T "ld"
142 | # define CURL_FORMAT_CURL_OFF_TU "lu"
143 | # define CURL_SUFFIX_CURL_OFF_T L
144 | # define CURL_SUFFIX_CURL_OFF_TU UL
145 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
146 |
147 | #elif defined(__SYMBIAN32__)
148 | # if defined(__EABI__) /* Treat all ARM compilers equally */
149 | # define CURL_TYPEOF_CURL_OFF_T long long
150 | # define CURL_FORMAT_CURL_OFF_T "lld"
151 | # define CURL_FORMAT_CURL_OFF_TU "llu"
152 | # define CURL_SUFFIX_CURL_OFF_T LL
153 | # define CURL_SUFFIX_CURL_OFF_TU ULL
154 | # elif defined(__CW32__)
155 | # pragma longlong on
156 | # define CURL_TYPEOF_CURL_OFF_T long long
157 | # define CURL_FORMAT_CURL_OFF_T "lld"
158 | # define CURL_FORMAT_CURL_OFF_TU "llu"
159 | # define CURL_SUFFIX_CURL_OFF_T LL
160 | # define CURL_SUFFIX_CURL_OFF_TU ULL
161 | # elif defined(__VC32__)
162 | # define CURL_TYPEOF_CURL_OFF_T __int64
163 | # define CURL_FORMAT_CURL_OFF_T "lld"
164 | # define CURL_FORMAT_CURL_OFF_TU "llu"
165 | # define CURL_SUFFIX_CURL_OFF_T LL
166 | # define CURL_SUFFIX_CURL_OFF_TU ULL
167 | # endif
168 | # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
169 |
170 | #elif defined(__MWERKS__)
171 | # define CURL_TYPEOF_CURL_OFF_T long long
172 | # define CURL_FORMAT_CURL_OFF_T "lld"
173 | # define CURL_FORMAT_CURL_OFF_TU "llu"
174 | # define CURL_SUFFIX_CURL_OFF_T LL
175 | # define CURL_SUFFIX_CURL_OFF_TU ULL
176 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
177 |
178 | #elif defined(_WIN32_WCE)
179 | # define CURL_TYPEOF_CURL_OFF_T __int64
180 | # define CURL_FORMAT_CURL_OFF_T "I64d"
181 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
182 | # define CURL_SUFFIX_CURL_OFF_T i64
183 | # define CURL_SUFFIX_CURL_OFF_TU ui64
184 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
185 |
186 | #elif defined(__MINGW32__)
187 | # define CURL_TYPEOF_CURL_OFF_T long long
188 | # define CURL_FORMAT_CURL_OFF_T "I64d"
189 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
190 | # define CURL_SUFFIX_CURL_OFF_T LL
191 | # define CURL_SUFFIX_CURL_OFF_TU ULL
192 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
193 | # define CURL_PULL_SYS_TYPES_H 1
194 | # define CURL_PULL_WS2TCPIP_H 1
195 |
196 | #elif defined(__VMS)
197 | # if defined(__VAX)
198 | # define CURL_TYPEOF_CURL_OFF_T long
199 | # define CURL_FORMAT_CURL_OFF_T "ld"
200 | # define CURL_FORMAT_CURL_OFF_TU "lu"
201 | # define CURL_SUFFIX_CURL_OFF_T L
202 | # define CURL_SUFFIX_CURL_OFF_TU UL
203 | # else
204 | # define CURL_TYPEOF_CURL_OFF_T long long
205 | # define CURL_FORMAT_CURL_OFF_T "lld"
206 | # define CURL_FORMAT_CURL_OFF_TU "llu"
207 | # define CURL_SUFFIX_CURL_OFF_T LL
208 | # define CURL_SUFFIX_CURL_OFF_TU ULL
209 | # endif
210 | # define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
211 |
212 | #elif defined(__OS400__)
213 | # if defined(__ILEC400__)
214 | # define CURL_TYPEOF_CURL_OFF_T long long
215 | # define CURL_FORMAT_CURL_OFF_T "lld"
216 | # define CURL_FORMAT_CURL_OFF_TU "llu"
217 | # define CURL_SUFFIX_CURL_OFF_T LL
218 | # define CURL_SUFFIX_CURL_OFF_TU ULL
219 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
220 | # define CURL_PULL_SYS_TYPES_H 1
221 | # define CURL_PULL_SYS_SOCKET_H 1
222 | # endif
223 |
224 | #elif defined(__MVS__)
225 | # if defined(__IBMC__) || defined(__IBMCPP__)
226 | # if defined(_ILP32)
227 | # elif defined(_LP64)
228 | # endif
229 | # if defined(_LONG_LONG)
230 | # define CURL_TYPEOF_CURL_OFF_T long long
231 | # define CURL_FORMAT_CURL_OFF_T "lld"
232 | # define CURL_FORMAT_CURL_OFF_TU "llu"
233 | # define CURL_SUFFIX_CURL_OFF_T LL
234 | # define CURL_SUFFIX_CURL_OFF_TU ULL
235 | # elif defined(_LP64)
236 | # define CURL_TYPEOF_CURL_OFF_T long
237 | # define CURL_FORMAT_CURL_OFF_T "ld"
238 | # define CURL_FORMAT_CURL_OFF_TU "lu"
239 | # define CURL_SUFFIX_CURL_OFF_T L
240 | # define CURL_SUFFIX_CURL_OFF_TU UL
241 | # else
242 | # define CURL_TYPEOF_CURL_OFF_T long
243 | # define CURL_FORMAT_CURL_OFF_T "ld"
244 | # define CURL_FORMAT_CURL_OFF_TU "lu"
245 | # define CURL_SUFFIX_CURL_OFF_T L
246 | # define CURL_SUFFIX_CURL_OFF_TU UL
247 | # endif
248 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
249 | # define CURL_PULL_SYS_TYPES_H 1
250 | # define CURL_PULL_SYS_SOCKET_H 1
251 | # endif
252 |
253 | #elif defined(__370__)
254 | # if defined(__IBMC__) || defined(__IBMCPP__)
255 | # if defined(_ILP32)
256 | # elif defined(_LP64)
257 | # endif
258 | # if defined(_LONG_LONG)
259 | # define CURL_TYPEOF_CURL_OFF_T long long
260 | # define CURL_FORMAT_CURL_OFF_T "lld"
261 | # define CURL_FORMAT_CURL_OFF_TU "llu"
262 | # define CURL_SUFFIX_CURL_OFF_T LL
263 | # define CURL_SUFFIX_CURL_OFF_TU ULL
264 | # elif defined(_LP64)
265 | # define CURL_TYPEOF_CURL_OFF_T long
266 | # define CURL_FORMAT_CURL_OFF_T "ld"
267 | # define CURL_FORMAT_CURL_OFF_TU "lu"
268 | # define CURL_SUFFIX_CURL_OFF_T L
269 | # define CURL_SUFFIX_CURL_OFF_TU UL
270 | # else
271 | # define CURL_TYPEOF_CURL_OFF_T long
272 | # define CURL_FORMAT_CURL_OFF_T "ld"
273 | # define CURL_FORMAT_CURL_OFF_TU "lu"
274 | # define CURL_SUFFIX_CURL_OFF_T L
275 | # define CURL_SUFFIX_CURL_OFF_TU UL
276 | # endif
277 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
278 | # define CURL_PULL_SYS_TYPES_H 1
279 | # define CURL_PULL_SYS_SOCKET_H 1
280 | # endif
281 |
282 | #elif defined(TPF)
283 | # define CURL_TYPEOF_CURL_OFF_T long
284 | # define CURL_FORMAT_CURL_OFF_T "ld"
285 | # define CURL_FORMAT_CURL_OFF_TU "lu"
286 | # define CURL_SUFFIX_CURL_OFF_T L
287 | # define CURL_SUFFIX_CURL_OFF_TU UL
288 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
289 |
290 | #elif defined(__TINYC__) /* also known as tcc */
291 |
292 | # define CURL_TYPEOF_CURL_OFF_T long long
293 | # define CURL_FORMAT_CURL_OFF_T "lld"
294 | # define CURL_FORMAT_CURL_OFF_TU "llu"
295 | # define CURL_SUFFIX_CURL_OFF_T LL
296 | # define CURL_SUFFIX_CURL_OFF_TU ULL
297 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
298 | # define CURL_PULL_SYS_TYPES_H 1
299 | # define CURL_PULL_SYS_SOCKET_H 1
300 |
301 | #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Oracle Solaris Studio */
302 | # if !defined(__LP64) && (defined(__ILP32) || \
303 | defined(__i386) || \
304 | defined(__sparcv8) || \
305 | defined(__sparcv8plus))
306 | # define CURL_TYPEOF_CURL_OFF_T long long
307 | # define CURL_FORMAT_CURL_OFF_T "lld"
308 | # define CURL_FORMAT_CURL_OFF_TU "llu"
309 | # define CURL_SUFFIX_CURL_OFF_T LL
310 | # define CURL_SUFFIX_CURL_OFF_TU ULL
311 | # elif defined(__LP64) || \
312 | defined(__amd64) || defined(__sparcv9)
313 | # define CURL_TYPEOF_CURL_OFF_T long
314 | # define CURL_FORMAT_CURL_OFF_T "ld"
315 | # define CURL_FORMAT_CURL_OFF_TU "lu"
316 | # define CURL_SUFFIX_CURL_OFF_T L
317 | # define CURL_SUFFIX_CURL_OFF_TU UL
318 | # endif
319 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
320 | # define CURL_PULL_SYS_TYPES_H 1
321 | # define CURL_PULL_SYS_SOCKET_H 1
322 |
323 | #elif defined(__xlc__) /* IBM xlc compiler */
324 | # if !defined(_LP64)
325 | # define CURL_TYPEOF_CURL_OFF_T long long
326 | # define CURL_FORMAT_CURL_OFF_T "lld"
327 | # define CURL_FORMAT_CURL_OFF_TU "llu"
328 | # define CURL_SUFFIX_CURL_OFF_T LL
329 | # define CURL_SUFFIX_CURL_OFF_TU ULL
330 | # else
331 | # define CURL_TYPEOF_CURL_OFF_T long
332 | # define CURL_FORMAT_CURL_OFF_T "ld"
333 | # define CURL_FORMAT_CURL_OFF_TU "lu"
334 | # define CURL_SUFFIX_CURL_OFF_T L
335 | # define CURL_SUFFIX_CURL_OFF_TU UL
336 | # endif
337 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
338 | # define CURL_PULL_SYS_TYPES_H 1
339 | # define CURL_PULL_SYS_SOCKET_H 1
340 |
341 | /* ===================================== */
342 | /* KEEP MSVC THE PENULTIMATE ENTRY */
343 | /* ===================================== */
344 |
345 | #elif defined(_MSC_VER)
346 | # if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)
347 | # define CURL_TYPEOF_CURL_OFF_T __int64
348 | # define CURL_FORMAT_CURL_OFF_T "I64d"
349 | # define CURL_FORMAT_CURL_OFF_TU "I64u"
350 | # define CURL_SUFFIX_CURL_OFF_T i64
351 | # define CURL_SUFFIX_CURL_OFF_TU ui64
352 | # else
353 | # define CURL_TYPEOF_CURL_OFF_T long
354 | # define CURL_FORMAT_CURL_OFF_T "ld"
355 | # define CURL_FORMAT_CURL_OFF_TU "lu"
356 | # define CURL_SUFFIX_CURL_OFF_T L
357 | # define CURL_SUFFIX_CURL_OFF_TU UL
358 | # endif
359 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
360 |
361 | /* ===================================== */
362 | /* KEEP GENERIC GCC THE LAST ENTRY */
363 | /* ===================================== */
364 |
365 | #elif defined(__GNUC__) && !defined(_SCO_DS)
366 | # if !defined(__LP64__) && \
367 | (defined(__ILP32__) || defined(__i386__) || defined(__hppa__) || \
368 | defined(__ppc__) || defined(__powerpc__) || defined(__arm__) || \
369 | defined(__sparc__) || defined(__mips__) || defined(__sh__) || \
370 | defined(__XTENSA__) || \
371 | (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4) || \
372 | (defined(__LONG_MAX__) && __LONG_MAX__ == 2147483647L))
373 | # define CURL_TYPEOF_CURL_OFF_T long long
374 | # define CURL_FORMAT_CURL_OFF_T "lld"
375 | # define CURL_FORMAT_CURL_OFF_TU "llu"
376 | # define CURL_SUFFIX_CURL_OFF_T LL
377 | # define CURL_SUFFIX_CURL_OFF_TU ULL
378 | # elif defined(__LP64__) || \
379 | defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
380 | (defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8) || \
381 | (defined(__LONG_MAX__) && __LONG_MAX__ == 9223372036854775807L)
382 | # define CURL_TYPEOF_CURL_OFF_T long
383 | # define CURL_FORMAT_CURL_OFF_T "ld"
384 | # define CURL_FORMAT_CURL_OFF_TU "lu"
385 | # define CURL_SUFFIX_CURL_OFF_T L
386 | # define CURL_SUFFIX_CURL_OFF_TU UL
387 | # endif
388 | # define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
389 | # define CURL_PULL_SYS_TYPES_H 1
390 | # define CURL_PULL_SYS_SOCKET_H 1
391 |
392 | #else
393 | /* generic "safe guess" on old 32 bit style */
394 | # define CURL_TYPEOF_CURL_OFF_T long
395 | # define CURL_FORMAT_CURL_OFF_T "ld"
396 | # define CURL_FORMAT_CURL_OFF_TU "lu"
397 | # define CURL_SUFFIX_CURL_OFF_T L
398 | # define CURL_SUFFIX_CURL_OFF_TU UL
399 | # define CURL_TYPEOF_CURL_SOCKLEN_T int
400 | #endif
401 |
402 | #ifdef _AIX
403 | /* AIX needs */
404 | #define CURL_PULL_SYS_POLL_H
405 | #endif
406 |
407 |
408 | /* CURL_PULL_WS2TCPIP_H is defined above when inclusion of header file */
409 | /* ws2tcpip.h is required here to properly make type definitions below. */
410 | #ifdef CURL_PULL_WS2TCPIP_H
411 | # include
412 | # include
413 | # include
414 | #endif
415 |
416 | /* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
417 | /* sys/types.h is required here to properly make type definitions below. */
418 | #ifdef CURL_PULL_SYS_TYPES_H
419 | # include
420 | #endif
421 |
422 | /* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
423 | /* sys/socket.h is required here to properly make type definitions below. */
424 | #ifdef CURL_PULL_SYS_SOCKET_H
425 | # include
426 | #endif
427 |
428 | /* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
429 | /* sys/poll.h is required here to properly make type definitions below. */
430 | #ifdef CURL_PULL_SYS_POLL_H
431 | # include
432 | #endif
433 |
434 | /* Data type definition of curl_socklen_t. */
435 | #ifdef CURL_TYPEOF_CURL_SOCKLEN_T
436 | typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
437 | #endif
438 |
439 | /* Data type definition of curl_off_t. */
440 |
441 | #ifdef CURL_TYPEOF_CURL_OFF_T
442 | typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
443 | #endif
444 |
445 | /*
446 | * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
447 | * these to be visible and exported by the external libcurl interface API,
448 | * while also making them visible to the library internals, simply including
449 | * curl_setup.h, without actually needing to include curl.h internally.
450 | * If some day this section would grow big enough, all this should be moved
451 | * to its own header file.
452 | */
453 |
454 | /*
455 | * Figure out if we can use the ## preprocessor operator, which is supported
456 | * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
457 | * or __cplusplus so we need to carefully check for them too.
458 | */
459 |
460 | #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
461 | defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
462 | defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
463 | defined(__ILEC400__)
464 | /* This compiler is believed to have an ISO compatible preprocessor */
465 | #define CURL_ISOCPP
466 | #else
467 | /* This compiler is believed NOT to have an ISO compatible preprocessor */
468 | #undef CURL_ISOCPP
469 | #endif
470 |
471 | /*
472 | * Macros for minimum-width signed and unsigned curl_off_t integer constants.
473 | */
474 |
475 | #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
476 | # define CURLINC_OFF_T_C_HLPR2(x) x
477 | # define CURLINC_OFF_T_C_HLPR1(x) CURLINC_OFF_T_C_HLPR2(x)
478 | # define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
479 | CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
480 | # define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val) ## \
481 | CURLINC_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
482 | #else
483 | # ifdef CURL_ISOCPP
484 | # define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
485 | # else
486 | # define CURLINC_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
487 | # endif
488 | # define CURLINC_OFF_T_C_HLPR1(Val,Suffix) CURLINC_OFF_T_C_HLPR2(Val,Suffix)
489 | # define CURL_OFF_T_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
490 | # define CURL_OFF_TU_C(Val) CURLINC_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
491 | #endif
492 |
493 | #endif /* CURLINC_SYSTEM_H */
494 |
--------------------------------------------------------------------------------
/bloxshade/installer/src/curl/typecheck-gcc.h:
--------------------------------------------------------------------------------
1 | #ifndef CURLINC_TYPECHECK_GCC_H
2 | #define CURLINC_TYPECHECK_GCC_H
3 | /***************************************************************************
4 | * _ _ ____ _
5 | * Project ___| | | | _ \| |
6 | * / __| | | | |_) | |
7 | * | (__| |_| | _ <| |___
8 | * \___|\___/|_| \_\_____|
9 | *
10 | * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
11 | *
12 | * This software is licensed as described in the file COPYING, which
13 | * you should have received as part of this distribution. The terms
14 | * are also available at https://curl.haxx.se/docs/copyright.html.
15 | *
16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 | * copies of the Software, and permit persons to whom the Software is
18 | * furnished to do so, under the terms of the COPYING file.
19 | *
20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 | * KIND, either express or implied.
22 | *
23 | ***************************************************************************/
24 |
25 | /* wraps curl_easy_setopt() with typechecking */
26 |
27 | /* To add a new kind of warning, add an
28 | * if(curlcheck_sometype_option(_curl_opt))
29 | * if(!curlcheck_sometype(value))
30 | * _curl_easy_setopt_err_sometype();
31 | * block and define curlcheck_sometype_option, curlcheck_sometype and
32 | * _curl_easy_setopt_err_sometype below
33 | *
34 | * NOTE: We use two nested 'if' statements here instead of the && operator, in
35 | * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
36 | * when compiling with -Wlogical-op.
37 | *
38 | * To add an option that uses the same type as an existing option, you'll just
39 | * need to extend the appropriate _curl_*_option macro
40 | */
41 | #define curl_easy_setopt(handle, option, value) \
42 | __extension__({ \
43 | __typeof__(option) _curl_opt = option; \
44 | if(__builtin_constant_p(_curl_opt)) { \
45 | if(curlcheck_long_option(_curl_opt)) \
46 | if(!curlcheck_long(value)) \
47 | _curl_easy_setopt_err_long(); \
48 | if(curlcheck_off_t_option(_curl_opt)) \
49 | if(!curlcheck_off_t(value)) \
50 | _curl_easy_setopt_err_curl_off_t(); \
51 | if(curlcheck_string_option(_curl_opt)) \
52 | if(!curlcheck_string(value)) \
53 | _curl_easy_setopt_err_string(); \
54 | if(curlcheck_write_cb_option(_curl_opt)) \
55 | if(!curlcheck_write_cb(value)) \
56 | _curl_easy_setopt_err_write_callback(); \
57 | if((_curl_opt) == CURLOPT_RESOLVER_START_FUNCTION) \
58 | if(!curlcheck_resolver_start_callback(value)) \
59 | _curl_easy_setopt_err_resolver_start_callback(); \
60 | if((_curl_opt) == CURLOPT_READFUNCTION) \
61 | if(!curlcheck_read_cb(value)) \
62 | _curl_easy_setopt_err_read_cb(); \
63 | if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
64 | if(!curlcheck_ioctl_cb(value)) \
65 | _curl_easy_setopt_err_ioctl_cb(); \
66 | if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
67 | if(!curlcheck_sockopt_cb(value)) \
68 | _curl_easy_setopt_err_sockopt_cb(); \
69 | if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
70 | if(!curlcheck_opensocket_cb(value)) \
71 | _curl_easy_setopt_err_opensocket_cb(); \
72 | if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
73 | if(!curlcheck_progress_cb(value)) \
74 | _curl_easy_setopt_err_progress_cb(); \
75 | if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
76 | if(!curlcheck_debug_cb(value)) \
77 | _curl_easy_setopt_err_debug_cb(); \
78 | if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
79 | if(!curlcheck_ssl_ctx_cb(value)) \
80 | _curl_easy_setopt_err_ssl_ctx_cb(); \
81 | if(curlcheck_conv_cb_option(_curl_opt)) \
82 | if(!curlcheck_conv_cb(value)) \
83 | _curl_easy_setopt_err_conv_cb(); \
84 | if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
85 | if(!curlcheck_seek_cb(value)) \
86 | _curl_easy_setopt_err_seek_cb(); \
87 | if(curlcheck_cb_data_option(_curl_opt)) \
88 | if(!curlcheck_cb_data(value)) \
89 | _curl_easy_setopt_err_cb_data(); \
90 | if((_curl_opt) == CURLOPT_ERRORBUFFER) \
91 | if(!curlcheck_error_buffer(value)) \
92 | _curl_easy_setopt_err_error_buffer(); \
93 | if((_curl_opt) == CURLOPT_STDERR) \
94 | if(!curlcheck_FILE(value)) \
95 | _curl_easy_setopt_err_FILE(); \
96 | if(curlcheck_postfields_option(_curl_opt)) \
97 | if(!curlcheck_postfields(value)) \
98 | _curl_easy_setopt_err_postfields(); \
99 | if((_curl_opt) == CURLOPT_HTTPPOST) \
100 | if(!curlcheck_arr((value), struct curl_httppost)) \
101 | _curl_easy_setopt_err_curl_httpost(); \
102 | if((_curl_opt) == CURLOPT_MIMEPOST) \
103 | if(!curlcheck_ptr((value), curl_mime)) \
104 | _curl_easy_setopt_err_curl_mimepost(); \
105 | if(curlcheck_slist_option(_curl_opt)) \
106 | if(!curlcheck_arr((value), struct curl_slist)) \
107 | _curl_easy_setopt_err_curl_slist(); \
108 | if((_curl_opt) == CURLOPT_SHARE) \
109 | if(!curlcheck_ptr((value), CURLSH)) \
110 | _curl_easy_setopt_err_CURLSH(); \
111 | } \
112 | curl_easy_setopt(handle, _curl_opt, value); \
113 | })
114 |
115 | /* wraps curl_easy_getinfo() with typechecking */
116 | #define curl_easy_getinfo(handle, info, arg) \
117 | __extension__({ \
118 | __typeof__(info) _curl_info = info; \
119 | if(__builtin_constant_p(_curl_info)) { \
120 | if(curlcheck_string_info(_curl_info)) \
121 | if(!curlcheck_arr((arg), char *)) \
122 | _curl_easy_getinfo_err_string(); \
123 | if(curlcheck_long_info(_curl_info)) \
124 | if(!curlcheck_arr((arg), long)) \
125 | _curl_easy_getinfo_err_long(); \
126 | if(curlcheck_double_info(_curl_info)) \
127 | if(!curlcheck_arr((arg), double)) \
128 | _curl_easy_getinfo_err_double(); \
129 | if(curlcheck_slist_info(_curl_info)) \
130 | if(!curlcheck_arr((arg), struct curl_slist *)) \
131 | _curl_easy_getinfo_err_curl_slist(); \
132 | if(curlcheck_tlssessioninfo_info(_curl_info)) \
133 | if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
134 | _curl_easy_getinfo_err_curl_tlssesssioninfo(); \
135 | if(curlcheck_certinfo_info(_curl_info)) \
136 | if(!curlcheck_arr((arg), struct curl_certinfo *)) \
137 | _curl_easy_getinfo_err_curl_certinfo(); \
138 | if(curlcheck_socket_info(_curl_info)) \
139 | if(!curlcheck_arr((arg), curl_socket_t)) \
140 | _curl_easy_getinfo_err_curl_socket(); \
141 | if(curlcheck_off_t_info(_curl_info)) \
142 | if(!curlcheck_arr((arg), curl_off_t)) \
143 | _curl_easy_getinfo_err_curl_off_t(); \
144 | } \
145 | curl_easy_getinfo(handle, _curl_info, arg); \
146 | })
147 |
148 | /*
149 | * For now, just make sure that the functions are called with three arguments
150 | */
151 | #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
152 | #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
153 |
154 |
155 | /* the actual warnings, triggered by calling the _curl_easy_setopt_err*
156 | * functions */
157 |
158 | /* To define a new warning, use _CURL_WARNING(identifier, "message") */
159 | #define CURLWARNING(id, message) \
160 | static void __attribute__((__warning__(message))) \
161 | __attribute__((__unused__)) __attribute__((__noinline__)) \
162 | id(void) { __asm__(""); }
163 |
164 | CURLWARNING(_curl_easy_setopt_err_long,
165 | "curl_easy_setopt expects a long argument for this option")
166 | CURLWARNING(_curl_easy_setopt_err_curl_off_t,
167 | "curl_easy_setopt expects a curl_off_t argument for this option")
168 | CURLWARNING(_curl_easy_setopt_err_string,
169 | "curl_easy_setopt expects a "
170 | "string ('char *' or char[]) argument for this option"
171 | )
172 | CURLWARNING(_curl_easy_setopt_err_write_callback,
173 | "curl_easy_setopt expects a curl_write_callback argument for this option")
174 | CURLWARNING(_curl_easy_setopt_err_resolver_start_callback,
175 | "curl_easy_setopt expects a "
176 | "curl_resolver_start_callback argument for this option"
177 | )
178 | CURLWARNING(_curl_easy_setopt_err_read_cb,
179 | "curl_easy_setopt expects a curl_read_callback argument for this option")
180 | CURLWARNING(_curl_easy_setopt_err_ioctl_cb,
181 | "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
182 | CURLWARNING(_curl_easy_setopt_err_sockopt_cb,
183 | "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
184 | CURLWARNING(_curl_easy_setopt_err_opensocket_cb,
185 | "curl_easy_setopt expects a "
186 | "curl_opensocket_callback argument for this option"
187 | )
188 | CURLWARNING(_curl_easy_setopt_err_progress_cb,
189 | "curl_easy_setopt expects a curl_progress_callback argument for this option")
190 | CURLWARNING(_curl_easy_setopt_err_debug_cb,
191 | "curl_easy_setopt expects a curl_debug_callback argument for this option")
192 | CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb,
193 | "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
194 | CURLWARNING(_curl_easy_setopt_err_conv_cb,
195 | "curl_easy_setopt expects a curl_conv_callback argument for this option")
196 | CURLWARNING(_curl_easy_setopt_err_seek_cb,
197 | "curl_easy_setopt expects a curl_seek_callback argument for this option")
198 | CURLWARNING(_curl_easy_setopt_err_cb_data,
199 | "curl_easy_setopt expects a "
200 | "private data pointer as argument for this option")
201 | CURLWARNING(_curl_easy_setopt_err_error_buffer,
202 | "curl_easy_setopt expects a "
203 | "char buffer of CURL_ERROR_SIZE as argument for this option")
204 | CURLWARNING(_curl_easy_setopt_err_FILE,
205 | "curl_easy_setopt expects a 'FILE *' argument for this option")
206 | CURLWARNING(_curl_easy_setopt_err_postfields,
207 | "curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
208 | CURLWARNING(_curl_easy_setopt_err_curl_httpost,
209 | "curl_easy_setopt expects a 'struct curl_httppost *' "
210 | "argument for this option")
211 | CURLWARNING(_curl_easy_setopt_err_curl_mimepost,
212 | "curl_easy_setopt expects a 'curl_mime *' "
213 | "argument for this option")
214 | CURLWARNING(_curl_easy_setopt_err_curl_slist,
215 | "curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
216 | CURLWARNING(_curl_easy_setopt_err_CURLSH,
217 | "curl_easy_setopt expects a CURLSH* argument for this option")
218 |
219 | CURLWARNING(_curl_easy_getinfo_err_string,
220 | "curl_easy_getinfo expects a pointer to 'char *' for this info")
221 | CURLWARNING(_curl_easy_getinfo_err_long,
222 | "curl_easy_getinfo expects a pointer to long for this info")
223 | CURLWARNING(_curl_easy_getinfo_err_double,
224 | "curl_easy_getinfo expects a pointer to double for this info")
225 | CURLWARNING(_curl_easy_getinfo_err_curl_slist,
226 | "curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
227 | CURLWARNING(_curl_easy_getinfo_err_curl_tlssesssioninfo,
228 | "curl_easy_getinfo expects a pointer to "
229 | "'struct curl_tlssessioninfo *' for this info")
230 | CURLWARNING(_curl_easy_getinfo_err_curl_certinfo,
231 | "curl_easy_getinfo expects a pointer to "
232 | "'struct curl_certinfo *' for this info")
233 | CURLWARNING(_curl_easy_getinfo_err_curl_socket,
234 | "curl_easy_getinfo expects a pointer to curl_socket_t for this info")
235 | CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
236 | "curl_easy_getinfo expects a pointer to curl_off_t for this info")
237 |
238 | /* groups of curl_easy_setops options that take the same type of argument */
239 |
240 | /* To add a new option to one of the groups, just add
241 | * (option) == CURLOPT_SOMETHING
242 | * to the or-expression. If the option takes a long or curl_off_t, you don't
243 | * have to do anything
244 | */
245 |
246 | /* evaluates to true if option takes a long argument */
247 | #define curlcheck_long_option(option) \
248 | (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
249 |
250 | #define curlcheck_off_t_option(option) \
251 | ((option) > CURLOPTTYPE_OFF_T)
252 |
253 | /* evaluates to true if option takes a char* argument */
254 | #define curlcheck_string_option(option) \
255 | ((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
256 | (option) == CURLOPT_ACCEPT_ENCODING || \
257 | (option) == CURLOPT_ALTSVC || \
258 | (option) == CURLOPT_CAINFO || \
259 | (option) == CURLOPT_CAPATH || \
260 | (option) == CURLOPT_COOKIE || \
261 | (option) == CURLOPT_COOKIEFILE || \
262 | (option) == CURLOPT_COOKIEJAR || \
263 | (option) == CURLOPT_COOKIELIST || \
264 | (option) == CURLOPT_CRLFILE || \
265 | (option) == CURLOPT_CUSTOMREQUEST || \
266 | (option) == CURLOPT_DEFAULT_PROTOCOL || \
267 | (option) == CURLOPT_DNS_INTERFACE || \
268 | (option) == CURLOPT_DNS_LOCAL_IP4 || \
269 | (option) == CURLOPT_DNS_LOCAL_IP6 || \
270 | (option) == CURLOPT_DNS_SERVERS || \
271 | (option) == CURLOPT_DOH_URL || \
272 | (option) == CURLOPT_EGDSOCKET || \
273 | (option) == CURLOPT_FTPPORT || \
274 | (option) == CURLOPT_FTP_ACCOUNT || \
275 | (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
276 | (option) == CURLOPT_INTERFACE || \
277 | (option) == CURLOPT_ISSUERCERT || \
278 | (option) == CURLOPT_KEYPASSWD || \
279 | (option) == CURLOPT_KRBLEVEL || \
280 | (option) == CURLOPT_LOGIN_OPTIONS || \
281 | (option) == CURLOPT_MAIL_AUTH || \
282 | (option) == CURLOPT_MAIL_FROM || \
283 | (option) == CURLOPT_NETRC_FILE || \
284 | (option) == CURLOPT_NOPROXY || \
285 | (option) == CURLOPT_PASSWORD || \
286 | (option) == CURLOPT_PINNEDPUBLICKEY || \
287 | (option) == CURLOPT_PRE_PROXY || \
288 | (option) == CURLOPT_PROXY || \
289 | (option) == CURLOPT_PROXYPASSWORD || \
290 | (option) == CURLOPT_PROXYUSERNAME || \
291 | (option) == CURLOPT_PROXYUSERPWD || \
292 | (option) == CURLOPT_PROXY_CAINFO || \
293 | (option) == CURLOPT_PROXY_CAPATH || \
294 | (option) == CURLOPT_PROXY_CRLFILE || \
295 | (option) == CURLOPT_PROXY_KEYPASSWD || \
296 | (option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
297 | (option) == CURLOPT_PROXY_SERVICE_NAME || \
298 | (option) == CURLOPT_PROXY_SSLCERT || \
299 | (option) == CURLOPT_PROXY_SSLCERTTYPE || \
300 | (option) == CURLOPT_PROXY_SSLKEY || \
301 | (option) == CURLOPT_PROXY_SSLKEYTYPE || \
302 | (option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
303 | (option) == CURLOPT_PROXY_TLS13_CIPHERS || \
304 | (option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
305 | (option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
306 | (option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
307 | (option) == CURLOPT_RANDOM_FILE || \
308 | (option) == CURLOPT_RANGE || \
309 | (option) == CURLOPT_REFERER || \
310 | (option) == CURLOPT_REQUEST_TARGET || \
311 | (option) == CURLOPT_RTSP_SESSION_ID || \
312 | (option) == CURLOPT_RTSP_STREAM_URI || \
313 | (option) == CURLOPT_RTSP_TRANSPORT || \
314 | (option) == CURLOPT_SASL_AUTHZID || \
315 | (option) == CURLOPT_SERVICE_NAME || \
316 | (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
317 | (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
318 | (option) == CURLOPT_SSH_KNOWNHOSTS || \
319 | (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
320 | (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
321 | (option) == CURLOPT_SSLCERT || \
322 | (option) == CURLOPT_SSLCERTTYPE || \
323 | (option) == CURLOPT_SSLENGINE || \
324 | (option) == CURLOPT_SSLKEY || \
325 | (option) == CURLOPT_SSLKEYTYPE || \
326 | (option) == CURLOPT_SSL_CIPHER_LIST || \
327 | (option) == CURLOPT_TLS13_CIPHERS || \
328 | (option) == CURLOPT_TLSAUTH_PASSWORD || \
329 | (option) == CURLOPT_TLSAUTH_TYPE || \
330 | (option) == CURLOPT_TLSAUTH_USERNAME || \
331 | (option) == CURLOPT_UNIX_SOCKET_PATH || \
332 | (option) == CURLOPT_URL || \
333 | (option) == CURLOPT_USERAGENT || \
334 | (option) == CURLOPT_USERNAME || \
335 | (option) == CURLOPT_USERPWD || \
336 | (option) == CURLOPT_XOAUTH2_BEARER || \
337 | 0)
338 |
339 | /* evaluates to true if option takes a curl_write_callback argument */
340 | #define curlcheck_write_cb_option(option) \
341 | ((option) == CURLOPT_HEADERFUNCTION || \
342 | (option) == CURLOPT_WRITEFUNCTION)
343 |
344 | /* evaluates to true if option takes a curl_conv_callback argument */
345 | #define curlcheck_conv_cb_option(option) \
346 | ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
347 | (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
348 | (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
349 |
350 | /* evaluates to true if option takes a data argument to pass to a callback */
351 | #define curlcheck_cb_data_option(option) \
352 | ((option) == CURLOPT_CHUNK_DATA || \
353 | (option) == CURLOPT_CLOSESOCKETDATA || \
354 | (option) == CURLOPT_DEBUGDATA || \
355 | (option) == CURLOPT_FNMATCH_DATA || \
356 | (option) == CURLOPT_HEADERDATA || \
357 | (option) == CURLOPT_INTERLEAVEDATA || \
358 | (option) == CURLOPT_IOCTLDATA || \
359 | (option) == CURLOPT_OPENSOCKETDATA || \
360 | (option) == CURLOPT_PRIVATE || \
361 | (option) == CURLOPT_PROGRESSDATA || \
362 | (option) == CURLOPT_READDATA || \
363 | (option) == CURLOPT_SEEKDATA || \
364 | (option) == CURLOPT_SOCKOPTDATA || \
365 | (option) == CURLOPT_SSH_KEYDATA || \
366 | (option) == CURLOPT_SSL_CTX_DATA || \
367 | (option) == CURLOPT_WRITEDATA || \
368 | (option) == CURLOPT_RESOLVER_START_DATA || \
369 | (option) == CURLOPT_TRAILERDATA || \
370 | 0)
371 |
372 | /* evaluates to true if option takes a POST data argument (void* or char*) */
373 | #define curlcheck_postfields_option(option) \
374 | ((option) == CURLOPT_POSTFIELDS || \
375 | (option) == CURLOPT_COPYPOSTFIELDS || \
376 | 0)
377 |
378 | /* evaluates to true if option takes a struct curl_slist * argument */
379 | #define curlcheck_slist_option(option) \
380 | ((option) == CURLOPT_HTTP200ALIASES || \
381 | (option) == CURLOPT_HTTPHEADER || \
382 | (option) == CURLOPT_MAIL_RCPT || \
383 | (option) == CURLOPT_POSTQUOTE || \
384 | (option) == CURLOPT_PREQUOTE || \
385 | (option) == CURLOPT_PROXYHEADER || \
386 | (option) == CURLOPT_QUOTE || \
387 | (option) == CURLOPT_RESOLVE || \
388 | (option) == CURLOPT_TELNETOPTIONS || \
389 | (option) == CURLOPT_CONNECT_TO || \
390 | 0)
391 |
392 | /* groups of curl_easy_getinfo infos that take the same type of argument */
393 |
394 | /* evaluates to true if info expects a pointer to char * argument */
395 | #define curlcheck_string_info(info) \
396 | (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
397 |
398 | /* evaluates to true if info expects a pointer to long argument */
399 | #define curlcheck_long_info(info) \
400 | (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
401 |
402 | /* evaluates to true if info expects a pointer to double argument */
403 | #define curlcheck_double_info(info) \
404 | (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
405 |
406 | /* true if info expects a pointer to struct curl_slist * argument */
407 | #define curlcheck_slist_info(info) \
408 | (((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
409 |
410 | /* true if info expects a pointer to struct curl_tlssessioninfo * argument */
411 | #define curlcheck_tlssessioninfo_info(info) \
412 | (((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
413 |
414 | /* true if info expects a pointer to struct curl_certinfo * argument */
415 | #define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
416 |
417 | /* true if info expects a pointer to struct curl_socket_t argument */
418 | #define curlcheck_socket_info(info) \
419 | (CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
420 |
421 | /* true if info expects a pointer to curl_off_t argument */
422 | #define curlcheck_off_t_info(info) \
423 | (CURLINFO_OFF_T < (info))
424 |
425 |
426 | /* typecheck helpers -- check whether given expression has requested type*/
427 |
428 | /* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros,
429 | * otherwise define a new macro. Search for __builtin_types_compatible_p
430 | * in the GCC manual.
431 | * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
432 | * the actual expression passed to the curl_easy_setopt macro. This
433 | * means that you can only apply the sizeof and __typeof__ operators, no
434 | * == or whatsoever.
435 | */
436 |
437 | /* XXX: should evaluate to true if expr is a pointer */
438 | #define curlcheck_any_ptr(expr) \
439 | (sizeof(expr) == sizeof(void *))
440 |
441 | /* evaluates to true if expr is NULL */
442 | /* XXX: must not evaluate expr, so this check is not accurate */
443 | #define curlcheck_NULL(expr) \
444 | (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
445 |
446 | /* evaluates to true if expr is type*, const type* or NULL */
447 | #define curlcheck_ptr(expr, type) \
448 | (curlcheck_NULL(expr) || \
449 | __builtin_types_compatible_p(__typeof__(expr), type *) || \
450 | __builtin_types_compatible_p(__typeof__(expr), const type *))
451 |
452 | /* evaluates to true if expr is one of type[], type*, NULL or const type* */
453 | #define curlcheck_arr(expr, type) \
454 | (curlcheck_ptr((expr), type) || \
455 | __builtin_types_compatible_p(__typeof__(expr), type []))
456 |
457 | /* evaluates to true if expr is a string */
458 | #define curlcheck_string(expr) \
459 | (curlcheck_arr((expr), char) || \
460 | curlcheck_arr((expr), signed char) || \
461 | curlcheck_arr((expr), unsigned char))
462 |
463 | /* evaluates to true if expr is a long (no matter the signedness)
464 | * XXX: for now, int is also accepted (and therefore short and char, which
465 | * are promoted to int when passed to a variadic function) */
466 | #define curlcheck_long(expr) \
467 | (__builtin_types_compatible_p(__typeof__(expr), long) || \
468 | __builtin_types_compatible_p(__typeof__(expr), signed long) || \
469 | __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
470 | __builtin_types_compatible_p(__typeof__(expr), int) || \
471 | __builtin_types_compatible_p(__typeof__(expr), signed int) || \
472 | __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
473 | __builtin_types_compatible_p(__typeof__(expr), short) || \
474 | __builtin_types_compatible_p(__typeof__(expr), signed short) || \
475 | __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
476 | __builtin_types_compatible_p(__typeof__(expr), char) || \
477 | __builtin_types_compatible_p(__typeof__(expr), signed char) || \
478 | __builtin_types_compatible_p(__typeof__(expr), unsigned char))
479 |
480 | /* evaluates to true if expr is of type curl_off_t */
481 | #define curlcheck_off_t(expr) \
482 | (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
483 |
484 | /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
485 | /* XXX: also check size of an char[] array? */
486 | #define curlcheck_error_buffer(expr) \
487 | (curlcheck_NULL(expr) || \
488 | __builtin_types_compatible_p(__typeof__(expr), char *) || \
489 | __builtin_types_compatible_p(__typeof__(expr), char[]))
490 |
491 | /* evaluates to true if expr is of type (const) void* or (const) FILE* */
492 | #if 0
493 | #define curlcheck_cb_data(expr) \
494 | (curlcheck_ptr((expr), void) || \
495 | curlcheck_ptr((expr), FILE))
496 | #else /* be less strict */
497 | #define curlcheck_cb_data(expr) \
498 | curlcheck_any_ptr(expr)
499 | #endif
500 |
501 | /* evaluates to true if expr is of type FILE* */
502 | #define curlcheck_FILE(expr) \
503 | (curlcheck_NULL(expr) || \
504 | (__builtin_types_compatible_p(__typeof__(expr), FILE *)))
505 |
506 | /* evaluates to true if expr can be passed as POST data (void* or char*) */
507 | #define curlcheck_postfields(expr) \
508 | (curlcheck_ptr((expr), void) || \
509 | curlcheck_arr((expr), char) || \
510 | curlcheck_arr((expr), unsigned char))
511 |
512 | /* helper: __builtin_types_compatible_p distinguishes between functions and
513 | * function pointers, hide it */
514 | #define curlcheck_cb_compatible(func, type) \
515 | (__builtin_types_compatible_p(__typeof__(func), type) || \
516 | __builtin_types_compatible_p(__typeof__(func) *, type))
517 |
518 | /* evaluates to true if expr is of type curl_resolver_start_callback */
519 | #define curlcheck_resolver_start_callback(expr) \
520 | (curlcheck_NULL(expr) || \
521 | curlcheck_cb_compatible((expr), curl_resolver_start_callback))
522 |
523 | /* evaluates to true if expr is of type curl_read_callback or "similar" */
524 | #define curlcheck_read_cb(expr) \
525 | (curlcheck_NULL(expr) || \
526 | curlcheck_cb_compatible((expr), __typeof__(fread) *) || \
527 | curlcheck_cb_compatible((expr), curl_read_callback) || \
528 | curlcheck_cb_compatible((expr), _curl_read_callback1) || \
529 | curlcheck_cb_compatible((expr), _curl_read_callback2) || \
530 | curlcheck_cb_compatible((expr), _curl_read_callback3) || \
531 | curlcheck_cb_compatible((expr), _curl_read_callback4) || \
532 | curlcheck_cb_compatible((expr), _curl_read_callback5) || \
533 | curlcheck_cb_compatible((expr), _curl_read_callback6))
534 | typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
535 | typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
536 | typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
537 | typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *);
538 | typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
539 | typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
540 |
541 | /* evaluates to true if expr is of type curl_write_callback or "similar" */
542 | #define curlcheck_write_cb(expr) \
543 | (curlcheck_read_cb(expr) || \
544 | curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \
545 | curlcheck_cb_compatible((expr), curl_write_callback) || \
546 | curlcheck_cb_compatible((expr), _curl_write_callback1) || \
547 | curlcheck_cb_compatible((expr), _curl_write_callback2) || \
548 | curlcheck_cb_compatible((expr), _curl_write_callback3) || \
549 | curlcheck_cb_compatible((expr), _curl_write_callback4) || \
550 | curlcheck_cb_compatible((expr), _curl_write_callback5) || \
551 | curlcheck_cb_compatible((expr), _curl_write_callback6))
552 | typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
553 | typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
554 | const void *);
555 | typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *);
556 | typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *);
557 | typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
558 | const void *);
559 | typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
560 |
561 | /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
562 | #define curlcheck_ioctl_cb(expr) \
563 | (curlcheck_NULL(expr) || \
564 | curlcheck_cb_compatible((expr), curl_ioctl_callback) || \
565 | curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \
566 | curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \
567 | curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \
568 | curlcheck_cb_compatible((expr), _curl_ioctl_callback4))
569 | typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
570 | typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
571 | typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
572 | typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
573 |
574 | /* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
575 | #define curlcheck_sockopt_cb(expr) \
576 | (curlcheck_NULL(expr) || \
577 | curlcheck_cb_compatible((expr), curl_sockopt_callback) || \
578 | curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \
579 | curlcheck_cb_compatible((expr), _curl_sockopt_callback2))
580 | typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
581 | typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
582 | curlsocktype);
583 |
584 | /* evaluates to true if expr is of type curl_opensocket_callback or
585 | "similar" */
586 | #define curlcheck_opensocket_cb(expr) \
587 | (curlcheck_NULL(expr) || \
588 | curlcheck_cb_compatible((expr), curl_opensocket_callback) || \
589 | curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \
590 | curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \
591 | curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \
592 | curlcheck_cb_compatible((expr), _curl_opensocket_callback4))
593 | typedef curl_socket_t (*_curl_opensocket_callback1)
594 | (void *, curlsocktype, struct curl_sockaddr *);
595 | typedef curl_socket_t (*_curl_opensocket_callback2)
596 | (void *, curlsocktype, const struct curl_sockaddr *);
597 | typedef curl_socket_t (*_curl_opensocket_callback3)
598 | (const void *, curlsocktype, struct curl_sockaddr *);
599 | typedef curl_socket_t (*_curl_opensocket_callback4)
600 | (const void *, curlsocktype, const struct curl_sockaddr *);
601 |
602 | /* evaluates to true if expr is of type curl_progress_callback or "similar" */
603 | #define curlcheck_progress_cb(expr) \
604 | (curlcheck_NULL(expr) || \
605 | curlcheck_cb_compatible((expr), curl_progress_callback) || \
606 | curlcheck_cb_compatible((expr), _curl_progress_callback1) || \
607 | curlcheck_cb_compatible((expr), _curl_progress_callback2))
608 | typedef int (*_curl_progress_callback1)(void *,
609 | double, double, double, double);
610 | typedef int (*_curl_progress_callback2)(const void *,
611 | double, double, double, double);
612 |
613 | /* evaluates to true if expr is of type curl_debug_callback or "similar" */
614 | #define curlcheck_debug_cb(expr) \
615 | (curlcheck_NULL(expr) || \
616 | curlcheck_cb_compatible((expr), curl_debug_callback) || \
617 | curlcheck_cb_compatible((expr), _curl_debug_callback1) || \
618 | curlcheck_cb_compatible((expr), _curl_debug_callback2) || \
619 | curlcheck_cb_compatible((expr), _curl_debug_callback3) || \
620 | curlcheck_cb_compatible((expr), _curl_debug_callback4) || \
621 | curlcheck_cb_compatible((expr), _curl_debug_callback5) || \
622 | curlcheck_cb_compatible((expr), _curl_debug_callback6) || \
623 | curlcheck_cb_compatible((expr), _curl_debug_callback7) || \
624 | curlcheck_cb_compatible((expr), _curl_debug_callback8))
625 | typedef int (*_curl_debug_callback1) (CURL *,
626 | curl_infotype, char *, size_t, void *);
627 | typedef int (*_curl_debug_callback2) (CURL *,
628 | curl_infotype, char *, size_t, const void *);
629 | typedef int (*_curl_debug_callback3) (CURL *,
630 | curl_infotype, const char *, size_t, void *);
631 | typedef int (*_curl_debug_callback4) (CURL *,
632 | curl_infotype, const char *, size_t, const void *);
633 | typedef int (*_curl_debug_callback5) (CURL *,
634 | curl_infotype, unsigned char *, size_t, void *);
635 | typedef int (*_curl_debug_callback6) (CURL *,
636 | curl_infotype, unsigned char *, size_t, const void *);
637 | typedef int (*_curl_debug_callback7) (CURL *,
638 | curl_infotype, const unsigned char *, size_t, void *);
639 | typedef int (*_curl_debug_callback8) (CURL *,
640 | curl_infotype, const unsigned char *, size_t, const void *);
641 |
642 | /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
643 | /* this is getting even messier... */
644 | #define curlcheck_ssl_ctx_cb(expr) \
645 | (curlcheck_NULL(expr) || \
646 | curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \
647 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \
648 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \
649 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \
650 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \
651 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \
652 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \
653 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \
654 | curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8))
655 | typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
656 | typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
657 | typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
658 | typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
659 | const void *);
660 | #ifdef HEADER_SSL_H
661 | /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
662 | * this will of course break if we're included before OpenSSL headers...
663 | */
664 | typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
665 | typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
666 | typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
667 | typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
668 | const void *);
669 | #else
670 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
671 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
672 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
673 | typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
674 | #endif
675 |
676 | /* evaluates to true if expr is of type curl_conv_callback or "similar" */
677 | #define curlcheck_conv_cb(expr) \
678 | (curlcheck_NULL(expr) || \
679 | curlcheck_cb_compatible((expr), curl_conv_callback) || \
680 | curlcheck_cb_compatible((expr), _curl_conv_callback1) || \
681 | curlcheck_cb_compatible((expr), _curl_conv_callback2) || \
682 | curlcheck_cb_compatible((expr), _curl_conv_callback3) || \
683 | curlcheck_cb_compatible((expr), _curl_conv_callback4))
684 | typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
685 | typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
686 | typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
687 | typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
688 |
689 | /* evaluates to true if expr is of type curl_seek_callback or "similar" */
690 | #define curlcheck_seek_cb(expr) \
691 | (curlcheck_NULL(expr) || \
692 | curlcheck_cb_compatible((expr), curl_seek_callback) || \
693 | curlcheck_cb_compatible((expr), _curl_seek_callback1) || \
694 | curlcheck_cb_compatible((expr), _curl_seek_callback2))
695 | typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
696 | typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
697 |
698 |
699 | #endif /* CURLINC_TYPECHECK_GCC_H */
700 |
--------------------------------------------------------------------------------