-
Notifications
You must be signed in to change notification settings - Fork 22
/
libpascurl.pas
3184 lines (2567 loc) · 143 KB
/
libpascurl.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(******************************************************************************)
(* libPasCURL *)
(* delphi and object pascal wrapper around cURL library *)
(* https://github.com/curl/curl *)
(* *)
(* Copyright (c) 2019 - 2020 Ivan Semenkov *)
(* https://github.com/isemenkov/libpascurl ivan@semenkov.pro *)
(* Ukraine *)
(******************************************************************************)
(* *)
(* This source is free software; you can redistribute it and/or modify it *)
(* under the terms of the GNU General Public License as published by the Free *)
(* Software Foundation; either version 3 of the License. *)
(* *)
(* This code is distributed in the hope that it will be useful, but WITHOUT *)
(* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *)
(* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *)
(* more details. *)
(* *)
(* A copy of the GNU General Public License is available on the World Wide *)
(* Web at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by *)
(* writing to the Free Software Foundation, Inc., 51 Franklin Street - Fifth *)
(* Floor, Boston, MA 02110-1335, USA. *)
(* *)
(******************************************************************************)
unit libpascurl;
{$IFDEF FPC}
{$mode objfpc}{$H+}
{$ENDIF}
interface
uses
Classes, SysUtils, Types{$IF DEFINED(LINUX) OR DEFINED(DARWIN)}, Sockets, BaseUnix{$ELSE}, WinSock
{$IFEND};
{$IFDEF FPC}
{$PACKRECORDS C}
{$ENDIF}
const
{$IFDEF FPC}
{$IFDEF WINDOWS}
CurlLib = 'libcurl.dll';
{$ENDIF}
{$IFDEF LINUX}
CurlLib = 'libcurl.so';
{$ENDIF}
{$IFDEF DARWIN}
CurlLib = 'libcurl.dylib';
{$LINKLIB libcurl}
{$ENDIF}
{$ELSE}
{$IFDEF MSWINDOWS OR defined(MSWINDOWS)}
CurlLib = 'libcurl.dll';
{$ENDIF}
{$IFDEF LINUX}
CurlLib = 'libcurl.so';
{$ENDIF}
{$IFDEF DARWIN}
CurlLib = 'libcurl.dylib';
{$ENDIF}
{$ENDIF}
CURL_SOCKET_BAD = -1;
{ specified content is a file name }
CURL_HTTPPOST_FILENAME = 1 shl 0;
{ specified content is a file name }
CURL_HTTPPOST_READFILE = 1 shl 1;
{ name is only stored pointer do not free in formfree }
CURL_HTTPPOST_PTRNAME = 1 shl 2;
{ contents is only stored pointer do not free in formfree }
CURL_HTTPPOST_PTRCONTENTS = 1 shl 3;
{ upload file from buffer }
CURL_HTTPPOST_BUFFER = 1 shl 4;
{ upload file from pointer contents }
CURL_HTTPPOST_PTRBUFFER = 1 shl 5;
{ upload file contents by using the regular read callback to get the data and
pass the given pointer as custom pointer }
CURL_HTTPPOST_CALLBACK = 1 shl 6;
{ use size in 'contentlen', added in 7.46.0 }
CURL_HTTPPOST_LARGE = 1 shl 7;
{ This is a return code for the progress callback that, when returned, will
signal libcurl to continue executing the default progress function }
CURL_PROGRESSFUNC_CONTINUE = $10000001;
{ The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. }
CURL_MAX_READ_SIZE = 524288;
{ Tests have proven that 20K is a very bad buffer size for uploads on
Windows, while 16K for some odd reason performed a lot better.
We do the ifndef check to allow this value to easier be changed at build
time for those who feel adventurous. The practical minimum is about
400 bytes since libcurl uses a buffer of this size as a scratch area
(unrelated to network send operations). }
CURL_MAX_WRITE_SIZE = 16384;
{ The only reason to have a max limit for this is to avoid the risk of a bad
server feeding libcurl with a never-ending header that will cause reallocs
infinitely }
CURL_MAX_HTTP_HEADER = (100 * 1024);
{ This is a magic return code for the write callback that, when returned,
will signal libcurl to pause receiving on the current transfer. }
CURL_WRITEFUNC_PAUSE = $10000001;
CURLFINFOFLAG_KNOWN_FILENAME = 1 shl 0;
CURLFINFOFLAG_KNOWN_FILETYPE = 1 shl 1;
CURLFINFOFLAG_KNOWN_TIME = 1 shl 2;
CURLFINFOFLAG_KNOWN_PERM = 1 shl 3;
CURLFINFOFLAG_KNOWN_UID = 1 shl 4;
CURLFINFOFLAG_KNOWN_GID = 1 shl 5;
CURLFINFOFLAG_KNOWN_SIZE = 1 shl 6;
CURLFINFOFLAG_KNOWN_HLINKCOUNT = 1 shl 7;
{ return codes for CURLOPT_CHUNK_BGN_FUNCTION }
CURL_CHUNK_BGN_FUNC_OK = 0;
CURL_CHUNK_BGN_FUNC_FAIL { tell the lib to end the task } = 1;
CURL_CHUNK_BGN_FUNC_SKIP { skip this chunk over } = 2;
{ return codes for CURLOPT_CHUNK_END_FUNCTION }
CURL_CHUNK_END_FUNC_OK = 0;
CURL_CHUNK_END_FUNC_FAIL { tell the lib to end the task } = 1;
{ return codes for FNMATCHFUNCTION }
CURL_FNMATCHFUNC_MATCH { string corresponds to the pattern } = 0;
CURL_FNMATCHFUNC_NOMATCH { pattern doesn't match the string } = 1;
CURL_FNMATCHFUNC_FAIL { an error occurred } = 2;
{ These are the return codes for the seek callbacks }
CURL_SEEKFUNC_OK = 0;
CURL_SEEKFUNC_FAIL { fail the entire transfer } = 1;
CURL_SEEKFUNC_CANTSEEK { tell libcurl seeking can't } = 2;
{ be done, so libcurl might try other means }
{ instead }
{ This is a return code for the read callback that, when returned, will
signal libcurl to immediately abort the current transfer. }
CURL_READFUNC_ABORT = $10000000;
{ This is a return code for the read callback that, when returned, will
signal libcurl to pause sending data on the current transfer. }
CURL_READFUNC_PAUSE = $10000001;
{ Return code for when the trailing headers' callback has terminated
without any errors }
CURL_TRAILERFUNC_OK = 0;
{ Return code for when was an error in the trailing header's list and we
want to abort the request }
CURL_TRAILERFUNC_ABORT = 1;
{ The return code from the sockopt_callback can signal information back
to libcurl: }
CURL_SOCKOPT_OK = 0;
CURL_SOCKOPT_ERROR { causes libcurl to abort and } = 1;
{ return CURLE_ABORTED_BY_CALLBACK }
CURL_SOCKOPT_ALREADY_CONNECTED = 2;
{ This was the error code 50 in 7.7.3 and a few earlier versions, this
is no longer used by libcurl but is instead #defined here only to not
make programs break }
CURLE_ALREADY_COMPLETE = 99999;
{ Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
CURLAUTH_NONE - No HTTP authentication
CURLAUTH_BASIC - HTTP Basic authentication (default)
CURLAUTH_DIGEST - HTTP Digest authentication
CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication
CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
CURLAUTH_NTLM - HTTP NTLM authentication
CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
CURLAUTH_BEARER - HTTP Bearer token authentication
CURLAUTH_ONLY - Use together with a single other type to force no
authentication or just that single type
CURLAUTH_ANY - All fine types set
CURLAUTH_ANYSAFE - All fine types except Basic }
CURLAUTH_NONE = Cardinal(0);
CURLAUTH_BASIC = Cardinal(1 shl 0);
CURLAUTH_DIGEST = Cardinal(1 shl 1);
CURLAUTH_NEGOTIATE = Cardinal(1 shl 2);
CURLAUTH_GSSAPI = CURLAUTH_NEGOTIATE;
CURLAUTH_NTLM = Cardinal(1 shl 3);
CURLAUTH_DIGEST_IE = Cardinal(1 shl 4);
CURLAUTH_NTLM_WB = Cardinal(1 shl 5);
CURLAUTH_BEARER = Cardinal(1 shl 6);
CURLAUTH_ONLY = Cardinal(1 shl 31);
CURLAUTH_ANY = (Not CURLAUTH_DIGEST_IE);
CURLAUTH_ANYSAFE = (Not (CURLAUTH_BASIC or CURLAUTH_DIGEST_IE));
CURLSSH_AUTH_ANY { all types supported by the server } = (Not 0);
CURLSSH_AUTH_NONE { none allowed, silly but complete } = 0;
CURLSSH_AUTH_PUBLICKEY { public/private key files } = 1 shl 0;
CURLSSH_AUTH_PASSWORD { password } = 1 shl 1;
CURLSSH_AUTH_HOST { host key files } = 1 shl 2;
CURLSSH_AUTH_KEYBOARD { keyboard interactive } = 1 shl 3;
CURLSSH_AUTH_AGENT { agent (ssh-agent, pageant...) } = 1 shl 4;
CURLSSH_AUTH_GSSAPI { gssapi (kerberos, ...) } = 1 shl 5;
CURLSSH_AUTH_DEFAULT = CURLSSH_AUTH_ANY;
CURLGSSAPI_DELEGATION_NONE { no delegation (default) } = 0;
CURLGSSAPI_DELEGATION_POLICY_FLAG { if permitted by policy } = 1 shl 0;
CURLGSSAPI_DELEGATION_FLAG { delegate always } = 1 shl 1;
CURL_ERROR_SIZE = 256;
{ Definition of bits for the CURLOPT_SSL_OPTIONS argument: }
{ - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
name of improving interoperability with older servers. Some SSL libraries
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. }
CURLSSLOPT_ALLOW_BEAST = 1 shl 0;
{ - NO_REVOKE tells libcurl to disable certificate revocation checks for
those SSL backends where such behavior is present. }
CURLSSLOPT_NO_REVOKE = 1 shl 1;
{ - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
if possible. The OpenSSL backend has this ability. }
CURLSSLOPT_NO_PARTIALCHAIN = 1 shl 2;
{ - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
checks and ignore missing revocation list for those SSL backends where such
behavior is present. }
CURLSSLOPT_REVOKE_BEST_EFFORT = 1 shl 3;
{ - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
operating system. Currently implemented under MS-Windows. }
CURLSSLOPT_NATIVE_CA = 1 shl 4;
{ The default connection attempt delay in milliseconds for happy eyeballs.
CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
this value, keep them in sync. }
CURL_HET_DEFAULT = Longint(200);
{ The default connection upkeep interval in milliseconds. }
CURL_UPKEEP_INTERVAL_DEFAULT = Longint(60000);
{ bitmask defines for CURLOPT_HEADEROPT }
CURLHEADER_UNIFIED = 0;
CURLHEADER_SEPARATE = 1 shl 0;
{ CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option }
CURLALTSVC_READONLYFILE = 1 shl 2;
CURLALTSVC_H1 = 1 shl 3;
CURLALTSVC_H2 = 1 shl 4;
CURLALTSVC_H3 = 1 shl 5;
{ CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options }
CURLPROTO_HTTP = 1 shl 0;
CURLPROTO_HTTPS = 1 shl 1;
CURLPROTO_FTP = 1 shl 2;
CURLPROTO_FTPS = 1 shl 3;
CURLPROTO_SCP = 1 shl 4;
CURLPROTO_SFTP = 1 shl 5;
CURLPROTO_TELNET = 1 shl 6;
CURLPROTO_LDAP = 1 shl 7;
CURLPROTO_LDAPS = 1 shl 8;
CURLPROTO_DICT = 1 shl 9;
CURLPROTO_FILE = 1 shl 10;
CURLPROTO_TFTP = 1 shl 11;
CURLPROTO_IMAP = 1 shl 12;
CURLPROTO_IMAPS = 1 shl 13;
CURLPROTO_POP3 = 1 shl 14;
CURLPROTO_POP3S = 1 shl 15;
CURLPROTO_SMTP = 1 shl 16;
CURLPROTO_SMTPS = 1 shl 17;
CURLPROTO_RTSP = 1 shl 18;
CURLPROTO_RTMP = 1 shl 19;
CURLPROTO_RTMPT = 1 shl 20;
CURLPROTO_RTMPE = 1 shl 21;
CURLPROTO_RTMPTE = 1 shl 22;
CURLPROTO_RTMPS = 1 shl 23;
CURLPROTO_RTMPTS = 1 shl 24;
CURLPROTO_GOPHER = 1 shl 25;
CURLPROTO_SMB = 1 shl 26;
CURLPROTO_SMBS = 1 shl 27;
CURLPROTO_MQTT = 1 shl 28;
CURLPROTO_ALL { enable everything } = (Not 0);
{ long may be 32 or 64 bits, but we should never depend on anything else
but 32 }
CURLOPTTYPE_LONG = 0;
{ 'long' argument with a set of values/bitmask }
CURLOPTTYPE_VALUES = CURLOPTTYPE_LONG;
CURLOPTTYPE_OBJECTPOINT = 10000;
{ 'char *' argument to a string with a trailing zero }
CURLOPTTYPE_STRINGPOINT = CURLOPTTYPE_OBJECTPOINT;
{ 'struct curl_slist *' argument }
CURLOPTTYPE_SLISTPOINT = CURLOPTTYPE_OBJECTPOINT;
{ 'void *' argument passed untouched to callback }
CURLOPTTYPE_CBPOINT = CURLOPTTYPE_OBJECTPOINT;
CURLOPTTYPE_FUNCTIONPOINT = 20000;
CURLOPTTYPE_OFF_T = 30000;
CURLOPTTYPE_BLOB = 40000;
{ Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
name resolves addresses using more than one IP protocol version, this
option might be handy to force libcurl to use a specific IP version. }
CURL_IPRESOLVE_WHATEVER { default, resolves addresses to all } = 0;
{ IP versions that your system allows }
CURL_IPRESOLVE_V4 { resolve to IPv4 addresses } = 1;
CURL_IPRESOLVE_V6 { resolve to IPv6 addresses } = 2;
{ symbols to use with CURLOPT_POSTREDIR.
CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
can be bitwise ORed so that CURL_REDIR_POST_301 or CURL_REDIR_POST_302
or CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL }
CURL_REDIR_GET_ALL = 0;
CURL_REDIR_POST_301 = 1;
CURL_REDIR_POST_302 = 2;
CURL_REDIR_POST_303 = 4;
CURL_REDIR_POST_ALL = CURL_REDIR_POST_301 or CURL_REDIR_POST_302 or
CURL_REDIR_POST_303;
CURL_ZERO_TERMINATED = Cardinal(-1);
CURLINFO_STRING = $100000;
CURLINFO_LONG = $200000;
CURLINFO_DOUBLE = $300000;
CURLINFO_SLIST = $400000;
CURLINFO_PTR { same as SLIST } = $400000;
CURLINFO_SOCKET = $500000;
CURLINFO_OFF_T = $600000;
CURLINFO_MASK = $0fffff;
CURLINFO_TYPEMASK = $f00000;
CURL_GLOBAL_SSL { no purpose since since 7.57.0 } = 1 shl 0;
CURL_GLOBAL_WIN32 = 1 shl 1;
CURL_GLOBAL_ALL = CURL_GLOBAL_SSL or CURL_GLOBAL_WIN32;
CURL_GLOBAL_NOTHING = 0;
CURL_GLOBAL_DEFAULT = CURL_GLOBAL_ALL;
CURL_GLOBAL_ACK_EINTR = 1 shl 2;
CURL_VERSION_IPV6 { IPv6-enabled } = 1 shl 0;
CURL_VERSION_KERBEROS4 { Kerberos V4 auth is supported } = 1 shl 1;
{ (deprecated) }
CURL_VERSION_SSL { SSL options are present } = 1 shl 2;
CURL_VERSION_LIBZ { libz features are present } = 1 shl 3;
CURL_VERSION_NTLM { NTLM auth is supported } = 1 shl 4;
CURL_VERSION_GSSNEGOTIATE { Negotiate auth is supported } = 1 shl 5;
{ (deprecated) }
CURL_VERSION_DEBUG { Built with debug capabilities } = 1 shl 6;
CURL_VERSION_ASYNCHDNS { Asynchronous DNS resolves } = 1 shl 7;
CURL_VERSION_SPNEGO { SPNEGO auth is supported } = 1 shl 8;
CURL_VERSION_LARGEFILE { Supports files larger than 2GB } = 1 shl 9;
CURL_VERSION_IDN { Internationized Domain Names are } = 1 shl 10;
{ supported }
CURL_VERSION_SSPI { Built against Windows SSPI } = 1 shl 11;
CURL_VERSION_CONV { Character conversions supported } = 1 shl 12;
CURL_VERSION_CURLDEBUG { Debug memory tracking supported } = 1 shl 13;
CURL_VERSION_TLSAUTH_SRP{ TLS-SRP auth is supported } = 1 shl 14;
CURL_VERSION_NTLM_WB { NTLM delegation to winbind helper } = 1 shl 15;
{ is supported }
CURL_VERSION_HTTP2 { HTTP2 support built-in } = 1 shl 16;
CURL_VERSION_GSSAPI { Built against a GSS-API library } = 1 shl 17;
CURL_VERSION_KERBEROS5 { Kerberos V5 auth is supported } = 1 shl 18;
CURL_VERSION_UNIX_SOCKETS { Unix domain sockets support } = 1 shl 19;
CURL_VERSION_PSL { Mozilla's Public Suffix List, } = 1 shl 20;
{ used for cookie domain verification }
CURL_VERSION_HTTPS_PROXY{ HTTPS-proxy support built-in } = 1 shl 21;
CURL_VERSION_MULTI_SSL { Multiple SSL backends available } = 1 shl 22;
CURL_VERSION_BROTLI { Brotli features are present. } = 1 shl 23;
CURL_VERSION_ALTSVC { Alt-Svc handling built-in } = 1 shl 24;
CURL_VERSION_HTTP3 { HTTP3 support built-in } = 1 shl 25;
CURL_VERSION_ZSTD { zstd features are present } = 1 shl 26;
CURL_VERSION_UNICODE { Unicode support on Windows } = 1 shl 27;
CURL_VERSION_HSTS { HSTS is supported } = 1 shl 28;
CURLPAUSE_RECV = 1 shl 0;
CURLPAUSE_RECV_CONT = 0;
CURLPAUSE_SEND = 1 shl 2;
CURLPAUSE_SEND_CONT = 0;
CURLPAUSE_ALL = CURLPAUSE_RECV or CURLPAUSE_SEND;
CURLPAUSE_CONT = CURLPAUSE_RECV_CONT or CURLPAUSE_SEND_CONT;
{ bitmask bits for CURLMOPT_PIPELINING }
CURLPIPE_NOTHING = Longint(0);
CURLPIPE_HTTP1 = Longint(1);
CURLPIPE_MULTIPLEX = Longint(2);
{ Based on poll(2) structure and values.
We don't use pollfd and POLL* constants explicitly
to cover platforms without poll(). }
CURL_WAIT_POLLIN = $0001;
CURL_WAIT_POLLPRI = $0002;
CURL_WAIT_POLLOUT = $0004;
CURL_POLL_NONE = 0;
CURL_POLL_IN = 1;
CURL_POLL_OUT = 2;
CURL_POLL_INOUT = 3;
CURL_POLL_REMOVE = 4;
CURL_SOCKET_TIMEOUT = CURL_SOCKET_BAD;
CURL_CSELECT_IN = $01;
CURL_CSELECT_OUT = $02;
CURL_CSELECT_ERR = $04;
CURL_PUSH_OK = 0;
CURL_PUSH_DENY = 1;
CURL_PUSH_ERROROUT { added in 7.72.0 } = 2;
CURLU_DEFAULT_PORT { return default port number } = 1 shl 0;
CURLU_NO_DEFAULT_PORT { act as if no port number was set, } = 1 shl 1;
{ if the port number matches the default }
{ for the scheme }
CURLU_DEFAULT_SCHEME { return default scheme if missing } = 1 shl 2;
CURLU_NON_SUPPORT_SCHEME{ allow non-supported scheme } = 1 shl 3;
CURLU_PATH_AS_IS { leave dot sequences } = 1 shl 4;
CURLU_DISALLOW_USER { no user+password allowed } = 1 shl 5;
CURLU_URLDECODE { URL decode on get } = 1 shl 6;
CURLU_URLENCODE { URL encode on set } = 1 shl 7;
CURLU_APPENDQUERY { append a form style part } = 1 shl 8;
CURLU_GUESS_SCHEME { legacy curl-style guessing } = 1 shl 9;
CURLU_NO_AUTHORITY { Allow empty authority when the scheme } = 1 shl 10;
{ is unknown. }
{ CURLHSTS_* are bits for the CURLOPT_HSTS option }
CURLHSTS_ENABLE = 1 shl 0;
CURLHSTS_READONLYFILE = 1 shl 1;
type
CURL = type Pointer;
CURLSH = type Pointer;
CURLM = type Pointer;
curl_socket_t = type Integer;
curl_off_t = type Longint;
curl_hstsentry = record
name : PChar;
namelen : Cardinal;
includeSubDomains : Byte; { unsigned int includeSubDomains:1; }
expire : array [0 .. 17] of Char; { YYYYMMDD HH:MM:SS [null-terminated] }
end;
curl_index = record
index : Cardinal; { the provided entry's "index" or count }
total : Cardinal; { total number of entries to save }
end;
CURLSTScode = (
CURLSTS_OK,
CURLSTS_DONE,
CURLSTS_FAIL
);
curl_hstsread_callback = function (easy : CURL; e : curl_hstsentry; userp :
Pointer) : CURLSTScode of object;
curl_hstswrite_callback = function (easy : CURL; e : curl_hstsentry; i :
curl_index; userp : Pointer) : CURLSTScode of object;
{ enum for the different supported SSL backends }
curl_sslbackend = (
CURLSSLBACKEND_NONE = 0,
CURLSSLBACKEND_OPENSSL = 1,
{ aliases for library clones and renames }
CURLSSLBACKEND_LIBRESSL = CURLSSLBACKEND_OPENSSL{%H-},
CURLSSLBACKEND_BORINGSSL = CURLSSLBACKEND_OPENSSL{%H-},
{ end aliases }
CURLSSLBACKEND_GNUTLS = 2,
CURLSSLBACKEND_NSS = 3,
CURLSSLBACKEND_OBSOLETE4 { Was QSOSSL. } = 4,
CURLSSLBACKEND_GSKIT = 5,
CURLSSLBACKEND_POLARSSL = 6,
CURLSSLBACKEND_WOLFSSL = 7,
{ deprecated names: }
CURLSSLBACKEND_CYASSL = CURLSSLBACKEND_WOLFSSL{%H-},
{ end deprecated }
CURLSSLBACKEND_SCHANNEL = 8,
CURLSSLBACKEND_SECURETRANSPORT = 9,
{ deprecated names: }
CURLSSLBACKEND_DARWINSSL = CURLSSLBACKEND_SECURETRANSPORT{%H-},
{ end deprecated }
CURLSSLBACKEND_AXTLS { never used since 7.63.0 } = 10,
CURLSSLBACKEND_MBEDTLS = 11,
CURLSSLBACKEND_MESALINK = 12,
CURLSSLBACKEND_BEARSSL = 13
);
{ linked-list structure for the CURLOPT_QUOTE option (and other) }
pcurl_slist = ^curl_slist;
ppcurl_slist = ^pcurl_slist;
curl_slist = record
data : PChar;
next : pcurl_slist;
end;
pcurl_httppost = ^curl_httppost;
ppcurl_httppost = ^pcurl_httppost;
curl_httppost = record
next : ^curl_httppost; { next entry in the list }
name : PChar; { pointer to allocated name }
namelength : Longint; { length of name length }
contents : PChar; { pointer to allocated data contents }
contentslength : Longint; { length of contents field, see also
CURL_HTTPPOST_LARGE }
buffer : PChar; { pointer to allocated buffer contents }
bufferLength : Longint; { length of buffer field }
contenttype : PChar; { Content-Type }
contentheader : ^curl_slist;{ list of extra headers for this form }
more : ^curl_httppost; { if one field name has more than one
file, this link should link to following
files }
flags : Longint; { as defined below }
showfilename : PChar; { The file name to show. If not set, the
actual file name will be used (if this
is a file part) }
userp : Pointer; { custom pointer used for
HTTPPOST_CALLBACK posts }
contentlen : curl_off_t; { alternative length of contents
field. Used if CURL_HTTPPOST_LARGE is
set. Added in 7.46.0 }
end;
{ This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered
deprecated but was the only choice up until 7.31.0 }
curl_progress_callback = function (clientp : Pointer; dltotal : Double;
dlnow : Double; ultotal : Double; ulnow : Double) : Integer of object;
{ This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in
7.32.0, it avoids floating point and provides more detailed information. }
curl_xferinfo_callback = function (clientp : Pointer; dltotal : curl_off_t;
dlnow : curl_off_t; ultotal : curl_off_t; ulnow : curl_off_t) : Integer
of object;
curl_write_callback = function (buffer : PChar; size : LongWord; nitems :
LongWord; outstream : Pointer) : LongWord of object;
{ This callback will be called when a new resolver request is made }
curl_resolver_start_callback = function (resolver_state : Pointer; reserved :
Pointer; userdata : Pointer) : Integer of object;
{ enumeration of file types }
curlfiletype = (
CURLFILETYPE_FILE = 0,
CURLFILETYPE_DIRECTORY,
CURLFILETYPE_SYMLINK,
CURLFILETYPE_DEVICE_BLOCK,
CURLFILETYPE_DEVICE_CHAR,
CURLFILETYPE_NAMEDPIPE,
CURLFILETYPE_SOCKET,
CURLFILETYPE_DOOR, { is possible only on Sun Solaris now }
CURLFILETYPE_UNKNOWN { should never occur }
);
{ Information about a single file, used when doing FTP wildcard matching }
curl_fileinfo = record
filename : PChar;
filetype : curlfiletype;
time : Int64; { always zero! }
perm : Cardinal;
uid : Integer;
gid : Integer;
size : curl_off_t;
hardlinks : Longint;
strings : record
{ If some of these fields is not NULL, it is a pointer to b_data. }
time : PChar;
perm : PChar;
user : PChar;
group : PChar;
target : PChar; { pointer to the target filename of a symlink }
end;
flags : Cardinal;
{ used internally }
b_data : PChar;
b_size : LongWord;
b_used : LongWord;
end;
{ if splitting of data transfer is enabled, this callback is called before
download of an individual chunk started. Note that parameter "remains" works
only for FTP wildcard downloading (for now), otherwise is not used }
curl_chunk_bgn_callback = function (const transfer_info : Pointer;
ptr : Pointer; remains : Integer) : Longint of object;
{ If splitting of data transfer is enabled this callback is called after
download of an individual chunk finished.
Note! After this callback was set then it have to be called FOR ALL chunks.
Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
This is the reason why we don't need "transfer_info" parameter in this
callback and we are not interested in "remains" parameter too. }
curl_chunk_end_callback = function (ptr : Pointer) : Longint of object;
{ callback type for wildcard downloading pattern matching. If the
string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. }
curl_fnmatch_callback = function (ptr : Pointer; const pattern : PChar;
const str : PChar) : Integer of object;
curl_seek_callback = function (instream : Pointer; offset : curl_off_t;
origin : Integer) : Integer of object;
curl_read_callback = function (buffer : PChar; size : LongWord;
nitems : LongWord; instream : Pointer) : LongWord of object;
curl_trailer_callback = function (list : ppcurl_slist; userdata : Pointer) :
Integer of object;
curlsocktype = (
CURLSOCKTYPE_IPCXN, { socket created for a specific IP connection }
CURLSOCKTYPE_ACCEPT, { socket created by accept() call }
CURLSOCKTYPE_LAST { never use }
);
curl_sockopt_callback = function (clientp : Pointer; curlfd : curl_socket_t;
purpose : curlsocktype) : Integer of object;
pcurl_sockaddr = ^curl_sockaddr;
curl_sockaddr = record
family : Integer;
socktype : Integer;
protocol : Integer;
addrlen : Cardinal; { addrlen was a socklen_t type before 7.18.0 }
{ but it turned really ugly and painful on the }
{ systems that lack this type }
addr : {$IFDEF FPC}sockaddr
{$ELSE IFDEF DCC32 OR IFDEF DCC64}Pointer{$ENDIF};
end;
curl_opensocket_callback = function (clientp : Pointer;
purpose : curlsocktype; address : pcurl_sockaddr) : curl_socket_t of object;
curl_closesocket_callback = function (clientp : Pointer;
item : curl_socket_t) : Integer of object;
curlioerr = (
CURLEIOE_OK, { I/O operation successful }
CURLIOE_UNKNOWNCMD, { command was unknown to callback }
CURLIOE_FAILRESTART, { failed to restart the read }
CURLIOE_LAST { never use }
);
curliocmd = (
CURLIOCMD_NOP, { no operation }
CURLIOCMD_RESTARTREAD, { restart the read stream from start }
CURLIOCMD_LAST { never use }
);
curl_ioctrl_callback = function (handle : CURL; cmd : Integer;
clientp : Pointer) : curlioerr of object;
{ The following typedef's are signatures of malloc, free, realloc, strdup and
calloc respectively. Function pointers of these types can be passed to the
curl_global_init_mem() function to set user defined memory management
callback routines. }
curl_malloc_callback = function (size : Cardinal) : Pointer of object;
curl_free_callback = procedure (ptr : Pointer) of object;
curl_realloc_callback = function (ptr : Pointer; size : Cardinal) : Pointer of
object;
curl_strdup_callback = function (const str : PChar) : PChar of object;
curl_calloc_callback = function (nmemb : Cardinal; size : Cardinal) : Pointer
of object;
{ the kind of data that is passed to information_callback }
curl_infotype = (
CURLINFO_TEXT = 0,
CURLINFO_HEADER_IN, { 1 }
CURLINFO_HEADER_OUT, { 2 }
CURLINFO_DATA_IN, { 3 }
CURLINFO_DATA_OUT, { 4 }
CURLINFO_SSL_DATA_IN, { 5 }
CURLINFO_SSL_DATA_OUT, { 6 }
CURLINFO_END
);
curl_debug_callback = function (
handle : CURL; { the handle/transfer this concerns }
type_ : curl_infotype; { what kind of data }
data : PChar; { points to the data }
size: Cardinal; { size of the data pointed to }
userptr : Pointer) { whatever the user please }
: Integer of object;
(* All possible error codes from all sorts of curl functions. Future versions
may return other values, stay prepared.
Always add new return codes last. Never *EVER* remove any. The return
codes must remain the same! *)
CURLcode = (
CURLE_OK = 0,
CURLE_UNSUPPORTED_PROTOCOL, { 1 }
CURLE_FAILED_INIT, { 2 }
CURLE_URL_MALFORMAT, { 3 }
CURLE_NOT_BUILT_IN, { 4 - [was obsoleted in August 2007 for
7.17.0, reused in April 2011 for 7.21.5] }
CURLE_COULDNT_RESOLVE_PROXY,{ 5 }
CURLE_COULDNT_RESOLVE_HOST, { 6 }
CURLE_COULDNT_CONNECT, { 7 }
CURLE_WEIRD_SERVER_REPLY, { 8 }
CURLE_REMOTE_ACCESS_DENIED, { 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. }
CURLE_FTP_ACCEPT_FAILED, { 10 - [was obsoleted in April 2006 for
7.15.4, reused in Dec 2011 for 7.24.0] }
CURLE_FTP_WEIRD_PASS_REPLY, { 11 }
CURLE_FTP_ACCEPT_TIMEOUT, { 12 - timeout occurred accepting server
[was obsoleted in August 2007 for 7.17.0,
reused in Dec 2011 for 7.24.0] }
CURLE_FTP_WEIRD_PASV_REPLY, { 13 }
CURLE_FTP_WEIRD_227_FORMAT, { 14 }
CURLE_FTP_CANT_GET_HOST, { 15 }
CURLE_HTTP2, { 16 - A problem in the http2 framing layer.
[was obsoleted in August 2007 for 7.17.0,
reused in July 2014 for 7.38.0] }
CURLE_FTP_COULDNT_SET_TYPE, { 17 }
CURLE_PARTIAL_FILE, { 18 }
CURLE_FTP_COULDNT_RETR_FILE,{ 19 }
CURLE_OBSOLETE20, { 20 - NOT USED }
CURLE_QUOTE_ERROR, { 21 - quote command failure }
CURLE_HTTP_RETURNED_ERROR, { 22 }
CURLE_WRITE_ERROR, { 23 }
CURLE_OBSOLETE24, { 24 - NOT USED }
CURLE_UPLOAD_FAILED, { 25 - failed upload "command" }
CURLE_READ_ERROR, { 26 - couldn't open/read from file }
CURLE_OUT_OF_MEMORY, { 27 }
{ Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
instead of a memory allocation error if CURL_DOES_CONVERSIONS
is defined }
CURLE_OPERATION_TIMEDOUT, { 28 - the timeout time was reached }
CURLE_OBSOLETE29, { 29 - NOT USED }
CURLE_FTP_PORT_FAILED, { 30 - FTP PORT operation failed }
CURLE_FTP_COULDNT_USE_REST, { 31 - the REST command failed }
CURLE_OBSOLETE32, { 32 - NOT USED }
CURLE_RANGE_ERROR, { 33 - RANGE "command" didn't work }
CURLE_HTTP_POST_ERROR, { 34 }
CURLE_SSL_CONNECT_ERROR, { 35 - wrong when connecting with SSL }
CURLE_BAD_DOWNLOAD_RESUME, { 36 - couldn't resume download }
CURLE_FILE_COULDNT_READ_FILE,{ 37 }
CURLE_LDAP_CANNOT_BIND, { 38 }
CURLE_LDAP_SEARCH_FAILED, { 39 }
CURLE_OBSOLETE40, { 40 - NOT USED }
CURLE_FUNCTION_NOT_FOUND, { 41 - NOT USED starting with 7.53.0 }
CURLE_ABORTED_BY_CALLBACK, { 42 }
CURLE_BAD_FUNCTION_ARGUMENT,{ 43 }
CURLE_OBSOLETE44, { 44 - NOT USED }
CURLE_INTERFACE_FAILED, { 45 - CURLOPT_INTERFACE failed }
CURLE_OBSOLETE46, { 46 - NOT USED }
CURLE_TOO_MANY_REDIRECTS, { 47 - catch endless re-direct loops }
CURLE_UNKNOWN_OPTION, { 48 - User specified an unknown option }
CURLE_TELNET_OPTION_SYNTAX, { 49 - Malformed telnet option }
CURLE_OBSOLETE50, { 50 - NOT USED }
CURLE_OBSOLETE51, { 51 - NOT USED }
CURLE_GOT_NOTHING, { 52 - when this is a specific error }
CURLE_SSL_ENGINE_NOTFOUND, { 53 - SSL crypto engine not found }
CURLE_SSL_ENGINE_SETFAILED, { 54 - can not set SSL crypto engine as
default }
CURLE_SEND_ERROR, { 55 - failed sending network data }
CURLE_RECV_ERROR, { 56 - failure in receiving network data }
CURLE_OBSOLETE57, { 57 - NOT IN USE }
CURLE_SSL_CERTPROBLEM, { 58 - problem with the local certificate }
CURLE_SSL_CIPHER, { 59 - couldn't use specified cipher }
CURLE_SSL_CACERT, { 60 - problem with the CA cert (path?) }
CURLE_PEER_FAILED_VERIFICATION = CURLE_SSL_CACERT{%H-},
CURLE_BAD_CONTENT_ENCODING, { 61 - Unrecognized/bad encoding }
CURLE_LDAP_INVALID_URL, { 62 - Invalid LDAP URL }
CURLE_FILESIZE_EXCEEDED, { 63 - Maximum file size exceeded }
CURLE_USE_SSL_FAILED, { 64 - Requested FTP SSL level failed }
CURLE_SEND_FAIL_REWIND, { 65 - Sending the data requires a rewind
that failed }
CURLE_SSL_ENGINE_INITFAILED,{ 66 - failed to initialise ENGINE }
CURLE_LOGIN_DENIED, { 67 - user, password or similar was not
accepted and we failed to login }
CURLE_TFTP_NOTFOUND, { 68 - file not found on server }
CURLE_TFTP_PERM, { 69 - permission problem on server }
CURLE_REMOTE_DISK_FULL, { 70 - out of disk space on server }
CURLE_TFTP_ILLEGAL, { 71 - Illegal TFTP operation }
CURLE_TFTP_UNKNOWNID, { 72 - Unknown transfer ID }
CURLE_REMOTE_FILE_EXISTS, { 73 - File already exists }
CURLE_TFTP_NOSUCHUSER, { 74 - No such user }
CURLE_CONV_FAILED, { 75 - conversion failed }
CURLE_CONV_REQD, { 76 - caller must register conversion
callbacks using curl_easy_setopt options
CURLOPT_CONV_FROM_NETWORK_FUNCTION,
CURLOPT_CONV_TO_NETWORK_FUNCTION, and
CURLOPT_CONV_FROM_UTF8_FUNCTION }
CURLE_SSL_CACERT_BADFILE, { 77 - could not load CACERT file, missing
or wrong format }
CURLE_REMOTE_FILE_NOT_FOUND,{ 78 - remote file not found }
CURLE_SSH, { 79 - error from the SSH layer, somewhat
generic so the error message will be of
interest when this has happened }
CURLE_SSL_SHUTDOWN_FAILED, { 80 - Failed to shut down the SSL
connection }
CURLE_AGAIN, { 81 - socket is not ready for send/recv,
wait till it's ready and try again (Added
in 7.18.2) }
CURLE_SSL_CRL_BADFILE, { 82 - could not load CRL file, missing or
wrong format (Added in 7.19.0) }
CURLE_SSL_ISSUER_ERROR, { 83 - Issuer check failed. (Added in
7.19.0) }
CURLE_FTP_PRET_FAILED, { 84 - a PRET command failed }
CURLE_RTSP_CSEQ_ERROR, { 85 - mismatch of RTSP CSeq numbers }
CURLE_RTSP_SESSION_ERROR, { 86 - mismatch of RTSP Session Ids }
CURLE_FTP_BAD_FILE_LIST, { 87 - unable to parse FTP file list }
CURLE_CHUNK_FAILED, { 88 - chunk callback reported error }
CURLE_NO_CONNECTION_AVAILABLE,{ 89 - No connection available, the
session will be queued }
CURLE_SSL_PINNEDPUBKEYNOTMATCH,{ 90 - specified pinned public key did not
match }
CURLE_SSL_INVALIDCERTSTATUS,{ 91 - invalid certificate status }
CURLE_HTTP2_STREAM, { 92 - stream error in HTTP/2 framing layer }
CURLE_RECURSIVE_API_CALL, { 93 - an api function was called from
inside a callback }
CURLE_AUTH_ERROR, { 94 - an authentication function returned an
error }
CURLE_HTTP3, { 95 - An HTTP/3 layer problem }
CURLE_QUIC_CONNECT_ERROR, { 96 - QUIC connection error }
CURLE_PROXY, { 97 - proxy handshake error }
CURL_LAST { never use! }
);
{ Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was
return for the transfers. }
CURLproxycode = (
CURLPX_OK,
CURLPX_BAD_ADDRESS_TYPE,
CURLPX_BAD_VERSION,
CURLPX_CLOSED,
CURLPX_GSSAPI,
CURLPX_GSSAPI_PERMSG,
CURLPX_GSSAPI_PROTECTION,
CURLPX_IDENTD,
CURLPX_IDENTD_DIFFER,
CURLPX_LONG_HOSTNAME,
CURLPX_LONG_PASSWD,
CURLPX_LONG_USER,
CURLPX_NO_AUTH,
CURLPX_RECV_ADDRESS,
CURLPX_RECV_AUTH,
CURLPX_RECV_CONNECT,
CURLPX_RECV_REQACK,
CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
CURLPX_REPLY_CONNECTION_REFUSED,
CURLPX_REPLY_GENERAL_SERVER_FAILURE,
CURLPX_REPLY_HOST_UNREACHABLE,
CURLPX_REPLY_NETWORK_UNREACHABLE,
CURLPX_REPLY_NOT_ALLOWED,
CURLPX_REPLY_TTL_EXPIRED,
CURLPX_REPLY_UNASSIGNED,
CURLPX_REQUEST_FAILED,
CURLPX_RESOLVE_HOST,
CURLPX_SEND_AUTH,
CURLPX_SEND_CONNECT,
CURLPX_SEND_REQUEST,
CURLPX_UNKNOWN_FAIL,
CURLPX_UNKNOWN_MODE,
CURLPX_USER_REJECTED,
CURLPX_LAST { never use }
);
curl_conv_callback = function (buffer : PChar; length : Cardinal) : CURLcode
of object;
curl_ssl_ctx_callback = function (curl : CURL; { easy handle }
ssl_ctx : Pointer; { actually an OpenSSL SSL_CTX or an mbedTLS
mbedtls_ssl_config } userptr : Pointer) : CURLcode of object;
curl_proxytype = (
CURLPROXY_HTTP { added in 7.10, new in 7.19.4 } = 0,
{ default is to use CONNECT HTTP/1.1 }
CURLPROXY_HTTP_1_0 { added in 7.19.4, force to use } = 1,
{ CONNECT HTTP/1.0 }
CURLPROXY_HTTPS { added in 7.52.0 } = 2,
CURLPROXY_SOCKS4 { support added in 7.15.2, enum } = 4,
{ existed already in 7.10 }
CURLPROXY_SOCKS5 { added in 7.10 } = 5,
CURLPROXY_SOCKS4A { added in 7.18.0 } = 6,
CURLPROXY_SOCKS5_HOSTNAME { Use the SOCKS5 protocol but } = 7
{ pass along the host name rather }
{ than the IP address. added in 7.18.0 }
);
curl_khtype = (
CURLKHTYPE_UNKNOWN,
CURLKHTYPE_RSA1,
CURLKHTYPE_RSA,
CURLKHTYPE_DSS,
CURLKHTYPE_ECDSA,
CURLKHTYPE_ED25519
);
pcurl_khkey = ^curl_khkey;
curl_khkey = record
key : PChar; { points to a zero-terminated string encoded }
{ with base64 if len is zero, otherwise to the }
{ "raw" data }
len : Cardinal;
keytype : curl_khtype;
end;
{ this is the set of return values expected from the curl_sshkeycallback
callback }
curl_khstat = (
CURLKHSTAT_FINE_ADD_TO_FILE,
CURLKHSTAT_FINE,
CURLKHSTAT_REJECT, { reject the connection, return an error }
CURLKHSTAT_DEFER, { do not accept it, but we can't answer right }
{ now so this causes a CURLE_DEFER error but }
{ otherwise the connection will be left intact }
{ etc }
CURLKHSTAT_FINE_REPLACE, { accept and replace the wrong key }
CURLKHSTAT_LAST { not for use, only a marker for last-in-list }
);
{ this is the set of status codes pass in to the callback }
curl_khmatch = (
CURLKHMATCH_OK, { match }
CURLKHMATCH_MISMATCH, { host found, key mismatch! }
CURLKHMATCH_MISSING, { no matching host/key found }
CURLKHMATCH_LAST { not for use, only a marker for last-in-list }
);
curl_sshkeycallback = function (
easy : CURL; { easy handle }
knownkey : pcurl_khkey; { known }
foundkey : pcurl_khkey; { found }
keys : curl_khmatch; { libcurl's view on the keys }
clientp : Pointer { custom pointer passed from app }
) : Integer of object;
{ parameter for the CURLOPT_USE_SSL option }
curl_usessl = (
CURLUSESSL_NONE, { do not attempt to use SSL }
CURLUSESSL_TRY, { try using SSL, proceed anyway otherwise }
CURLUSESSL_CONTROL, { SSL for the control connection or fail }
CURLUSESSL_ALL, { SSL for all communication or fail }
CURLUSESSL_LAST { not an option, never use }
);
{ parameter for the CURLOPT_FTP_SSL_CCC option }
curl_ftpccc = (
CURLFTPSSL_CCC_NONE, { do not send CCC }
CURLFTPSSL_CCC_PASSIVE, { Let the server initiate the shutdown }
CURLFTPSSL_CCC_ACTIVE, { Initiate the shutdown }
CURLFTPSSL_CCC_LAST { not an option, never use }
);
{ parameter for the CURLOPT_FTPSSLAUTH option }
curl_ftpauth = (
CURLFTPAUTH_DEFAULT, { let libcurl decide }
CURLFTPAUTH_SSL, { use "AUTH SSL" }
CURLFTPAUTH_TLS, { use "AUTH TLS" }
CURLFTPAUTH_LAST { not an option, never use }
);
{ parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option }
curl_ftpcreatedir = (
CURLFTP_CREATE_DIR_NONE, { do NOT create missing dirs! }
CURLFTP_CREATE_DIR, { (FTP/SFTP) if CWD fails, try MKD and then CWD
again if MKD succeeded, for SFTP this does
similar magic }
CURLFTP_CREATE_DIR_RETRY, { (FTP only) if CWD fails, try MKD and then CWD
again even if MKD failed! }
CURLFTP_CREATE_DIR_LAST { not an option, never use }
);
{ parameter for the CURLOPT_FTP_FILEMETHOD option }
curl_ftpmethod = (
CURLFTPMETHOD_DEFAULT, { let libcurl pick }
CURLFTPMETHOD_MULTICWD, { single CWD operation for each path part }
CURLFTPMETHOD_NOCWD, { no CWD at all }
CURLFTPMETHOD_SINGLECWD, { one CWD to full dir, then work on file }
CURLFTPMETHOD_LAST { not an option, never use }
);
CURLoption = (
{ This is the FILE * or void * the regular output should be written to. }
CURLOPT_WRITEDATA = CURLOPTTYPE_CBPOINT + 1,
{ The full URL to get/put }
CURLOPT_URL = CURLOPTTYPE_STRINGPOINT + 2,
{ Port number to connect to, if other than default. }
CURLOPT_PORT = CURLOPTTYPE_LONG + 3{%H-},
{ Name of proxy to use. }
CURLOPT_PROXY = CURLOPTTYPE_STRINGPOINT + 4,
{ "user:password;options" to use when fetching. }
CURLOPT_USERPWD = CURLOPTTYPE_STRINGPOINT + 5,
{ "user:password" to use with proxy. }
CURLOPT_PROXYUSERPWD = CURLOPTTYPE_STRINGPOINT + 6,
{ Range to get, specified as an ASCII string. }
CURLOPT_RANGE = CURLOPTTYPE_STRINGPOINT + 7,
{ not used }