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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245
|
/* Curb - Libcurl(3) bindings for Ruby.
* Copyright (c)2006 Ross Bamford.
* Licensed under the Ruby License. See LICENSE for details.
*
* $Id: curb.c 35 2006-12-23 15:22:19Z roscopeco $
*/
#include "curb.h"
#include "curb_upload.h"
VALUE mCurl;
/* ================== VER QUERY FUNCS ==============*/
/*
* call-seq:
* Curl.ipv6? => true or false
*
* Returns true if the installed libcurl supports IPv6.
*/
static VALUE ruby_curl_ipv6_q(VALUE mod) {
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_IPV6) ? Qtrue : Qfalse);
}
/*
* call-seq:
* Curl.kerberos4? => true or false
*
* Returns true if the installed libcurl supports Kerberos4 authentication
* with FTP connections.
*/
static VALUE ruby_curl_kerberos4_q(VALUE mod) {
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_KERBEROS4) ? Qtrue : Qfalse);
}
/*
* call-seq:
* Curl.ssl? => true or false
*
* Returns true if the installed libcurl supports SSL connections.
* For libcurl versions < 7.10, always returns false.
*/
static VALUE ruby_curl_ssl_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_SSL
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_SSL) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.libz? => true or false
*
* Returns true if the installed libcurl supports HTTP deflate
* using libz. For libcurl versions < 7.10, always returns false.
*/
static VALUE ruby_curl_libz_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_LIBZ
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_LIBZ) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.ntlm? => true or false
*
* Returns true if the installed libcurl supports HTTP NTLM.
* For libcurl versions < 7.10.6, always returns false.
*/
static VALUE ruby_curl_ntlm_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_NTLM
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_NTLM) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.gssnegotiate? => true or false
*
* Returns true if the installed libcurl supports HTTP GSS-Negotiate.
* For libcurl versions < 7.10.6, always returns false.
*/
static VALUE ruby_curl_gssnegotiate_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_GSSNEGOTIATE
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_GSSNEGOTIATE) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.debug? => true or false
*
* Returns true if the installed libcurl was built with extra debug
* capabilities built-in. For libcurl versions < 7.10.6, always returns
* false.
*/
static VALUE ruby_curl_debug_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_DEBUG
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_DEBUG) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.asyncdns? => true or false
*
* Returns true if the installed libcurl was built with support for
* asynchronous name lookups, which allows more exact timeouts (even
* on Windows) and less blocking when using the multi interface.
* For libcurl versions < 7.10.7, always returns false.
*/
static VALUE ruby_curl_asyncdns_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_ASYNCHDNS
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_ASYNCHDNS) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.spnego? => true or false
*
* Returns true if the installed libcurl was built with support for SPNEGO
* authentication (Simple and Protected GSS-API Negotiation Mechanism, defined
* in RFC 2478). For libcurl versions < 7.10.8, always returns false.
*/
static VALUE ruby_curl_spnego_q(VALUE mod) {
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
#ifdef HAVE_CURL_VERSION_SPNEGO
if (ver->features & CURL_VERSION_SPNEGO) return Qtrue;
#endif
#ifdef HAVE_CURL_VERSION_GSSNEGOTIATE
if (ver->features & CURL_VERSION_GSSNEGOTIATE) return Qtrue;
#endif
return Qfalse;
}
/*
* call-seq:
* Curl.largefile? => true or false
*
* Returns true if the installed libcurl was built with support for large
* files. For libcurl versions < 7.11.1, always returns false.
*/
static VALUE ruby_curl_largefile_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_LARGEFILE
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_LARGEFILE) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.idn? => true or false
*
* Returns true if the installed libcurl was built with support for IDNA,
* domain names with international letters. For libcurl versions < 7.12.0,
* always returns false.
*/
static VALUE ruby_curl_idn_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_IDN
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_IDN) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.sspi? => true or false
*
* Returns true if the installed libcurl was built with support for SSPI.
* This is only available on Windows and makes libcurl use Windows-provided
* functions for NTLM authentication. It also allows libcurl to use the current
* user and the current user's password without the app having to pass them on.
* For libcurl versions < 7.13.2, always returns false.
*/
static VALUE ruby_curl_sspi_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_SSPI
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_SSPI) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.conv? => true or false
*
* Returns true if the installed libcurl was built with support for character
* conversions. For libcurl versions < 7.15.4, always returns false.
*/
static VALUE ruby_curl_conv_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_CONV
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_CONV) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
/*
* call-seq:
* Curl.http2? => true or false
*
* Returns true if the installed libcurl was built with support for HTTP2.
* For libcurl versions < 7.33.0, always returns false.
*/
static VALUE ruby_curl_http2_q(VALUE mod) {
#ifdef HAVE_CURL_VERSION_HTTP2
curl_version_info_data *ver = curl_version_info(CURLVERSION_NOW);
return((ver->features & CURL_VERSION_HTTP2) ? Qtrue : Qfalse);
#else
return Qfalse;
#endif
}
static void finalize_curb_core(VALUE data) {
curl_global_cleanup();
}
void Init_curb_core() {
curl_version_info_data *ver;
VALUE curlver, curllongver, curlvernum;
curl_global_init(CURL_GLOBAL_ALL);
rb_set_end_proc(finalize_curb_core, Qnil);
ver = curl_version_info(CURLVERSION_NOW);
mCurl = rb_define_module("Curl");
curlver = rb_str_new2(ver->version);
curllongver = rb_str_new2(curl_version());
curlvernum = LONG2NUM(LIBCURL_VERSION_NUM);
rb_define_const(mCurl, "CURB_VERSION", rb_str_new2(CURB_VERSION));
rb_define_const(mCurl, "VERSION", curlver);
rb_define_const(mCurl, "CURL_VERSION", curlver);
rb_define_const(mCurl, "VERNUM", curlvernum);
rb_define_const(mCurl, "CURL_VERNUM", curlvernum);
rb_define_const(mCurl, "LONG_VERSION", curllongver);
rb_define_const(mCurl, "CURL_LONG_VERSION", curllongver);
/* Passed to on_debug handler to indicate that the data is informational text. */
rb_define_const(mCurl, "CURLINFO_TEXT", LONG2NUM(CURLINFO_TEXT));
/* Passed to on_debug handler to indicate that the data is header (or header-like) data received from the peer. */
rb_define_const(mCurl, "CURLINFO_HEADER_IN", LONG2NUM(CURLINFO_HEADER_IN));
/* Passed to on_debug handler to indicate that the data is header (or header-like) data sent to the peer. */
rb_define_const(mCurl, "CURLINFO_HEADER_OUT", LONG2NUM(CURLINFO_HEADER_OUT));
/* Passed to on_debug handler to indicate that the data is protocol data received from the peer. */
rb_define_const(mCurl, "CURLINFO_DATA_IN", LONG2NUM(CURLINFO_DATA_IN));
/* Passed to on_debug handler to indicate that the data is protocol data sent to the peer. */
rb_define_const(mCurl, "CURLINFO_DATA_OUT", LONG2NUM(CURLINFO_DATA_OUT));
#ifdef HAVE_CURLFTPMETHOD_MULTICWD
rb_define_const(mCurl, "CURL_MULTICWD", LONG2NUM(CURLFTPMETHOD_MULTICWD));
#endif
#ifdef HAVE_CURLFTPMETHOD_NOCWD
rb_define_const(mCurl, "CURL_NOCWD", LONG2NUM(CURLFTPMETHOD_NOCWD));
#endif
#ifdef HAVE_CURLFTPMETHOD_SINGLECWD
rb_define_const(mCurl, "CURL_SINGLECWD", LONG2NUM(CURLFTPMETHOD_SINGLECWD));
#endif
/* When passed to Curl::Easy#proxy_type , indicates that the proxy is an HTTP proxy. (libcurl >= 7.10) */
#ifdef HAVE_CURLPROXY_HTTP
rb_define_const(mCurl, "CURLPROXY_HTTP", LONG2NUM(CURLPROXY_HTTP));
#else
rb_define_const(mCurl, "CURLPROXY_HTTP", LONG2NUM(-1));
#endif
#ifdef CURL_VERSION_SSL
rb_define_const(mCurl, "CURL_SSLVERSION_DEFAULT", LONG2NUM(CURL_SSLVERSION_DEFAULT));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_DEFAULT", LONG2NUM(CURL_SSLVERSION_MAX_DEFAULT));
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1", LONG2NUM(CURL_SSLVERSION_TLSv1));
rb_define_const(mCurl, "CURL_SSLVERSION_SSLv2", LONG2NUM(CURL_SSLVERSION_SSLv2));
rb_define_const(mCurl, "CURL_SSLVERSION_SSLv3", LONG2NUM(CURL_SSLVERSION_SSLv3));
#if HAVE_CURL_SSLVERSION_TLSV1_0
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_0", LONG2NUM(CURL_SSLVERSION_TLSv1_0));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_0", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_0));
#endif
#if HAVE_CURL_SSLVERSION_TLSV1_1
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_1", LONG2NUM(CURL_SSLVERSION_TLSv1_1));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_1", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_1));
#endif
#if HAVE_CURL_SSLVERSION_TLSV1_2
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_2", LONG2NUM(CURL_SSLVERSION_TLSv1_2));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_2", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_2));
#endif
#if HAVE_CURL_SSLVERSION_TLSV1_3
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_3", LONG2NUM(CURL_SSLVERSION_TLSv1_3));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_3", LONG2NUM(CURL_SSLVERSION_MAX_TLSv1_3));
#endif
rb_define_const(mCurl, "CURL_USESSL_CONTROL", LONG2NUM(CURB_FTPSSL_CONTROL));
rb_define_const(mCurl, "CURL_USESSL_NONE", LONG2NUM(CURB_FTPSSL_NONE));
rb_define_const(mCurl, "CURL_USESSL_TRY", LONG2NUM(CURB_FTPSSL_TRY));
rb_define_const(mCurl, "CURL_USESSL_ALL", LONG2NUM(CURB_FTPSSL_ALL));
#else
rb_define_const(mCurl, "CURL_SSLVERSION_DEFAULT", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_SSLv2", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_SSLv3", LONG2NUM(-1));
#if HAVE_CURL_SSLVERSION_TLSv1_0
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_0", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_0", LONG2NUM(-1));
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_1
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_1", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_1", LONG2NUM(-1));
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_2
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_2", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_2", LONG2NUM(-1));
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_3
rb_define_const(mCurl, "CURL_SSLVERSION_TLSv1_3", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_SSLVERSION_MAX_TLSv1_3", LONG2NUM(-1));
#endif
rb_define_const(mCurl, "CURL_USESSL_CONTROL", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_USESSL_NONE", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_USESSL_TRY", LONG2NUM(-1));
rb_define_const(mCurl, "CURL_USESSL_ALL", LONG2NUM(-1));
#endif
/* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS4 proxy. (libcurl >= 7.15.2) */
#ifdef HAVE_CURLPROXY_SOCKS4
rb_define_const(mCurl, "CURLPROXY_SOCKS4", LONG2NUM(CURLPROXY_SOCKS4));
#else
rb_define_const(mCurl, "CURLPROXY_SOCKS4", LONG2NUM(-2));
#endif
/* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS4A proxy. (libcurl >= 7.18.0) */
#ifdef HAVE_CURLPROXY_SOCKS4A
rb_define_const(mCurl, "CURLPROXY_SOCKS4A", LONG2NUM(CURLPROXY_SOCKS4A));
#else
rb_define_const(mCurl, "CURLPROXY_SOCKS4A", LONG2NUM(-2));
#endif
/* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS5 proxy. (libcurl >= 7.10) */
#ifdef HAVE_CURLPROXY_SOCKS5
rb_define_const(mCurl, "CURLPROXY_SOCKS5", LONG2NUM(CURLPROXY_SOCKS5));
#else
rb_define_const(mCurl, "CURLPROXY_SOCKS5", LONG2NUM(-2));
#endif
/* When passed to Curl::Easy#proxy_type , indicates that the proxy is a SOCKS5 proxy (and that the proxy should resolve the hostname). (libcurl >= 7.17.2) */
#ifdef HAVE_CURLPROXY_SOCKS5_HOSTNAME
rb_define_const(mCurl, "CURLPROXY_SOCKS5_HOSTNAME", LONG2NUM(CURLPROXY_SOCKS5_HOSTNAME));
#else
rb_define_const(mCurl, "CURLPROXY_SOCKS5_HOSTNAME", LONG2NUM(-2));
#endif
/* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use Basic authentication. */
#ifdef HAVE_CURLAUTH_BASIC
rb_define_const(mCurl, "CURLAUTH_BASIC", LONG2NUM(CURLAUTH_BASIC));
#else
rb_define_const(mCurl, "CURLAUTH_BASIC", LONG2NUM(0));
#endif
/* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use Digest authentication. */
#ifdef HAVE_CURLAUTH_DIGEST
rb_define_const(mCurl, "CURLAUTH_DIGEST", LONG2NUM(CURLAUTH_DIGEST));
#else
rb_define_const(mCurl, "CURLAUTH_DIGEST", LONG2NUM(0));
#endif
/* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use GSS Negotiate authentication. Requires a suitable GSS-API library. */
#ifdef HAVE_CURLAUTH_GSSNEGOTIATE
rb_define_const(mCurl, "CURLAUTH_GSSNEGOTIATE", LONG2NUM(CURLAUTH_GSSNEGOTIATE));
#else
rb_define_const(mCurl, "CURLAUTH_GSSNEGOTIATE", LONG2NUM(0));
#endif
/* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, directs libcurl to use HTTP NTLM authentication. Requires MS Windows or OpenSSL support. */
#ifdef HAVE_CURLAUTH_NTLM
rb_define_const(mCurl, "CURLAUTH_NTLM", LONG2NUM(CURLAUTH_NTLM));
#else
rb_define_const(mCurl, "CURLAUTH_NTLM", LONG2NUM(0));
#endif
/* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, allows libcurl to select any suitable authentication method except basic. */
#ifdef HAVE_CURLAUTH_ANYSAFE
rb_define_const(mCurl, "CURLAUTH_ANYSAFE", LONG2NUM(CURLAUTH_ANYSAFE));
#else
rb_define_const(mCurl, "CURLAUTH_ANYSAFE", LONG2NUM(0));
#endif
/* When passed to Curl::Easy#http_auth_types or Curl::Easy#proxy_auth_types, allows libcurl to select any suitable authentication method. */
#ifdef HAVE_CURLAUTH_ANY
rb_define_const(mCurl, "CURLAUTH_ANY", LONG2NUM(CURLAUTH_ANY));
#else
rb_define_const(mCurl, "CURLAUTH_ANY", LONG2NUM(0));
#endif
CURB_DEFINE(CURLOPT_VERBOSE);
CURB_DEFINE(CURLOPT_HEADER);
CURB_DEFINE(CURLOPT_NOPROGRESS);
CURB_DEFINE(CURLOPT_NOSIGNAL);
#if HAVE_CURLOPT_PATH_AS_IS
CURB_DEFINE(CURLOPT_PATH_AS_IS);
#endif
CURB_DEFINE(CURLOPT_WRITEFUNCTION);
CURB_DEFINE(CURLOPT_WRITEDATA);
CURB_DEFINE(CURLOPT_READFUNCTION);
CURB_DEFINE(CURLOPT_READDATA);
CURB_DEFINE(CURLOPT_IOCTLFUNCTION);
CURB_DEFINE(CURLOPT_IOCTLDATA);
#if HAVE_CURLOPT_SEEKFUNCTION
CURB_DEFINE(CURLOPT_SEEKFUNCTION);
#endif
#if HAVE_CURLOPT_SEEKDATA
CURB_DEFINE(CURLOPT_SEEKDATA);
#endif
#if HAVE_CURLOPT_SOCKOPTFUNCTION
CURB_DEFINE(CURLOPT_SOCKOPTFUNCTION);
#endif
#if HAVE_CURLOPT_SOCKOPTDATA
CURB_DEFINE(CURLOPT_SOCKOPTDATA);
#endif
#if HAVE_CURLOPT_OPENSOCKETFUNCTION
CURB_DEFINE(CURLOPT_OPENSOCKETFUNCTION);
#endif
#if HAVE_CURLOPT_OPENSOCKETDATA
CURB_DEFINE(CURLOPT_OPENSOCKETDATA);
#endif
CURB_DEFINE(CURLOPT_PROGRESSFUNCTION);
CURB_DEFINE(CURLOPT_PROGRESSDATA);
CURB_DEFINE(CURLOPT_HEADERFUNCTION);
CURB_DEFINE(CURLOPT_WRITEHEADER);
CURB_DEFINE(CURLOPT_DEBUGFUNCTION);
CURB_DEFINE(CURLOPT_DEBUGDATA);
CURB_DEFINE(CURLOPT_SSL_CTX_FUNCTION);
CURB_DEFINE(CURLOPT_SSL_CTX_DATA);
CURB_DEFINE(CURLOPT_CONV_TO_NETWORK_FUNCTION);
CURB_DEFINE(CURLOPT_CONV_FROM_NETWORK_FUNCTION);
CURB_DEFINE(CURLOPT_CONV_FROM_UTF8_FUNCTION);
#if HAVE_CURLOPT_INTERLEAVEFUNCTION
CURB_DEFINE(CURLOPT_INTERLEAVEFUNCTION);
#endif
#if HAVE_CURLOPT_INTERLEAVEDATA
CURB_DEFINE(CURLOPT_INTERLEAVEDATA);
#endif
#if HAVE_CURLOPT_CHUNK_BGN_FUNCTION
CURB_DEFINE(CURLOPT_CHUNK_BGN_FUNCTION);
#endif
#if HAVE_CURLOPT_CHUNK_END_FUNCTION
CURB_DEFINE(CURLOPT_CHUNK_END_FUNCTION);
#endif
#if HAVE_CURLOPT_CHUNK_DATA
CURB_DEFINE(CURLOPT_CHUNK_DATA);
#endif
#if HAVE_CURLOPT_FNMATCH_FUNCTION
CURB_DEFINE(CURLOPT_FNMATCH_FUNCTION);
#endif
#if HAVE_CURLOPT_FNMATCH_DATA
CURB_DEFINE(CURLOPT_FNMATCH_DATA);
#endif
#if HAVE_CURLOPT_ERRORBUFFER
CURB_DEFINE(CURLOPT_ERRORBUFFER);
#endif
#if HAVE_CURLOPT_STDERR
CURB_DEFINE(CURLOPT_STDERR);
#endif
#if HAVE_CURLOPT_FAILONERROR
CURB_DEFINE(CURLOPT_FAILONERROR);
#endif
CURB_DEFINE(CURLOPT_URL);
#if HAVE_CURLOPT_PROTOCOLS
CURB_DEFINE(CURLOPT_PROTOCOLS);
#endif
#if HAVE_CURLOPT_REDIR_PROTOCOLS
CURB_DEFINE(CURLOPT_REDIR_PROTOCOLS);
#endif
CURB_DEFINE(CURLOPT_PROXY);
CURB_DEFINE(CURLOPT_PROXYPORT);
#if HAVE_CURLOPT_PROXYTYPE
CURB_DEFINE(CURLOPT_PROXYTYPE);
#endif
#if HAVE_CURLOPT_NOPROXY
CURB_DEFINE(CURLOPT_NOPROXY);
#endif
CURB_DEFINE(CURLOPT_HTTPPROXYTUNNEL);
#if HAVE_CURLOPT_SOCKS5_GSSAPI_SERVICE
CURB_DEFINE(CURLOPT_SOCKS5_GSSAPI_SERVICE);
#endif
#if HAVE_CURLOPT_SOCKS5_GSSAPI_NEC
CURB_DEFINE(CURLOPT_SOCKS5_GSSAPI_NEC);
#endif
CURB_DEFINE(CURLOPT_INTERFACE);
#if HAVE_CURLOPT_LOCALPORT
CURB_DEFINE(CURLOPT_LOCALPORT);
#endif
CURB_DEFINE(CURLOPT_DNS_CACHE_TIMEOUT);
CURB_DEFINE(CURLOPT_DNS_USE_GLOBAL_CACHE);
CURB_DEFINE(CURLOPT_BUFFERSIZE);
CURB_DEFINE(CURLOPT_PORT);
CURB_DEFINE(CURLOPT_TCP_NODELAY);
#if HAVE_CURLOPT_ADDRESS_SCOPE
CURB_DEFINE(CURLOPT_ADDRESS_SCOPE);
#endif
CURB_DEFINE(CURLOPT_NETRC);
CURB_DEFINE(CURL_NETRC_OPTIONAL);
CURB_DEFINE(CURL_NETRC_IGNORED);
CURB_DEFINE(CURL_NETRC_REQUIRED);
#if HAVE_CURLOPT_NETRC_FILE
CURB_DEFINE(CURLOPT_NETRC_FILE);
#endif
CURB_DEFINE(CURLOPT_USERPWD);
CURB_DEFINE(CURLOPT_PROXYUSERPWD);
#if HAVE_CURLOPT_USERNAME
CURB_DEFINE(CURLOPT_USERNAME);
#endif
#if HAVE_CURLOPT_PASSWORD
CURB_DEFINE(CURLOPT_PASSWORD);
#endif
#if HAVE_CURLOPT_PROXYUSERNAME
CURB_DEFINE(CURLOPT_PASSWORD);
#endif
#if HAVE_CURLOPT_PROXYPASSWORD
CURB_DEFINE(CURLOPT_PASSWORD);
#endif
#if HAVE_CURLOPT_HTTPAUTH
CURB_DEFINE(CURLOPT_HTTPAUTH);
#endif
#if HAVE_CURLAUTH_DIGEST_IE
CURB_DEFINE(CURLAUTH_DIGEST_IE);
#endif
#if HAVE_CURLAUTH_ONLY
CURB_DEFINE(CURLAUTH_ONLY);
#endif
#if HAVE_CURLOPT_TLSAUTH_TYPE
CURB_DEFINE(CURLOPT_TLSAUTH_TYPE);
#endif
#if HAVE_CURLOPT_TLSAUTH_SRP
CURB_DEFINE(CURLOPT_TLSAUTH_SRP);
#endif
#if HAVE_CURLOPT_TLSAUTH_USERNAME
CURB_DEFINE(CURLOPT_TLSAUTH_USERNAME);
#endif
#if HAVE_CURLOPT_TLSAUTH_PASSWORD
CURB_DEFINE(CURLOPT_TLSAUTH_PASSWORD);
#endif
#if HAVE_CURLOPT_PROXYAUTH
CURB_DEFINE(CURLOPT_PROXYAUTH);
#endif
#if HAVE_CURLOPT_AUTOREFERER
CURB_DEFINE(CURLOPT_AUTOREFERER);
#endif
#if HAVE_CURLOPT_ENCODING
CURB_DEFINE(CURLOPT_ENCODING);
#endif
#if HAVE_CURLOPT_FOLLOWLOCATION
CURB_DEFINE(CURLOPT_FOLLOWLOCATION);
#endif
#if HAVE_CURLOPT_UNRESTRICTED_AUTH
CURB_DEFINE(CURLOPT_UNRESTRICTED_AUTH);
#endif
#if HAVE_CURLOPT_MAXREDIRS
CURB_DEFINE(CURLOPT_MAXREDIRS);
#endif
#if HAVE_CURLOPT_POSTREDIR
CURB_DEFINE(CURLOPT_POSTREDIR);
#endif
#if HAVE_CURLOPT_PUT
CURB_DEFINE(CURLOPT_PUT);
#endif
#if HAVE_CURLOPT_POST
CURB_DEFINE(CURLOPT_POST);
#endif
CURB_DEFINE(CURLOPT_POSTFIELDS);
CURB_DEFINE(CURLOPT_POSTFIELDSIZE);
#if HAVE_CURLOPT_POSTFIELDSIZE_LARGE
CURB_DEFINE(CURLOPT_POSTFIELDSIZE_LARGE);
#endif
#if HAVE_CURLOPT_COPYPOSTFIELDS
CURB_DEFINE(CURLOPT_COPYPOSTFIELDS);
#endif
#if HAVE_CURLOPT_HTTPPOST
CURB_DEFINE(CURLOPT_HTTPPOST);
#endif
CURB_DEFINE(CURLOPT_REFERER);
CURB_DEFINE(CURLOPT_USERAGENT);
CURB_DEFINE(CURLOPT_HTTPHEADER);
#if HAVE_CURLOPT_PROXYHEADER
CURB_DEFINE(CURLOPT_PROXYHEADER);
#endif
#if HAVE_CURLOPT_REQUEST_TARGET
/* Allows overriding the Request-URI target used in the request line.
* Useful for absolute-form requests or special targets like "*". */
CURB_DEFINE(CURLOPT_REQUEST_TARGET);
#endif
#if HAVE_CURLOPT_HTTP200ALIASES
CURB_DEFINE(CURLOPT_HTTP200ALIASES);
#endif
CURB_DEFINE(CURLOPT_COOKIE);
CURB_DEFINE(CURLOPT_COOKIEFILE);
CURB_DEFINE(CURLOPT_COOKIEJAR);
#if HAVE_CURLOPT_COOKIESESSION
CURB_DEFINE(CURLOPT_COOKIESESSION);
#endif
#if HAVE_CURLOPT_COOKIELIST
CURB_DEFINE(CURLOPT_COOKIELIST);
#endif
#if HAVE_CURLOPT_HTTPGET
CURB_DEFINE(CURLOPT_HTTPGET);
#endif
CURB_DEFINE(CURLOPT_HTTP_VERSION);
CURB_DEFINE(CURL_HTTP_VERSION_NONE);
CURB_DEFINE(CURL_HTTP_VERSION_1_0);
CURB_DEFINE(CURL_HTTP_VERSION_1_1);
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
CURB_DEFINE(CURL_HTTP_VERSION_2_0);
#endif
#if LIBCURL_VERSION_NUM >= 0x072f00 /* 7.47.0 */
CURB_DEFINE(CURL_HTTP_VERSION_2TLS);
#endif
#if HAVE_CURLOPT_IGNORE_CONTENT_LENGTH
CURB_DEFINE(CURLOPT_IGNORE_CONTENT_LENGTH);
#endif
#if HAVE_CURLOPT_HTTP_CONTENT_DECODING
CURB_DEFINE(CURLOPT_HTTP_CONTENT_DECODING);
#endif
#if HAVE_CURLOPT_HTTP_TRANSFER_DECODING
CURB_DEFINE(CURLOPT_HTTP_TRANSFER_DECODING);
#endif
#if HAVE_CURLOPT_MAIL_FROM
CURB_DEFINE(CURLOPT_MAIL_FROM);
#endif
#if HAVE_CURLOPT_MAIL_RCPT
CURB_DEFINE(CURLOPT_MAIL_RCPT);
#endif
#if HAVE_CURLOPT_TFTP_BLKSIZE
CURB_DEFINE(CURLOPT_TFTP_BLKSIZE);
#endif
#if HAVE_CURLOPT_FTPPORT
CURB_DEFINE(CURLOPT_FTPPORT);
#endif
#if HAVE_CURLOPT_QUOTE
CURB_DEFINE(CURLOPT_QUOTE);
#endif
#if HAVE_CURLOPT_POSTQUOTE
CURB_DEFINE(CURLOPT_POSTQUOTE);
#endif
#if HAVE_CURLOPT_PREQUOTE
CURB_DEFINE(CURLOPT_PREQUOTE);
#endif
#if HAVE_CURLOPT_DIRLISTONLY
CURB_DEFINE(CURLOPT_DIRLISTONLY);
#endif
#if HAVE_CURLOPT_APPEND
CURB_DEFINE(CURLOPT_APPEND);
#endif
#if HAVE_CURLOPT_FTP_USE_EPRT
CURB_DEFINE(CURLOPT_FTP_USE_EPRT);
#endif
#if HAVE_CURLOPT_FTP_USE_EPSV
CURB_DEFINE(CURLOPT_FTP_USE_EPSV);
#endif
#if HAVE_CURLOPT_FTP_USE_PRET
CURB_DEFINE(CURLOPT_FTP_USE_PRET);
#endif
#if HAVE_CURLOPT_FTP_CREATE_MISSING_DIRS
CURB_DEFINE(CURLOPT_FTP_CREATE_MISSING_DIRS);
#endif
#if HAVE_CURLOPT_FTP_RESPONSE_TIMEOUT
CURB_DEFINE(CURLOPT_FTP_RESPONSE_TIMEOUT);
#endif
#if HAVE_CURLOPT_FTP_ALTERNATIVE_TO_USER
CURB_DEFINE(CURLOPT_FTP_ALTERNATIVE_TO_USER);
#endif
#if HAVE_CURLOPT_FTP_SKIP_PASV_IP
CURB_DEFINE(CURLOPT_FTP_SKIP_PASV_IP);
#endif
#if HAVE_CURLOPT_FTPSSLAUTH
CURB_DEFINE(CURLOPT_FTPSSLAUTH);
#endif
#if HAVE_CURLFTPAUTH_DEFAULT
CURB_DEFINE(CURLFTPAUTH_DEFAULT);
#endif
#if HAVE_CURLFTPAUTH_SSL
CURB_DEFINE(CURLFTPAUTH_SSL);
#endif
#if HAVE_CURLFTPAUTH_TLS
CURB_DEFINE(CURLFTPAUTH_TLS);
#endif
#if HAVE_CURLOPT_FTP_SSL_CCC
CURB_DEFINE(CURLOPT_FTP_SSL_CCC);
#endif
#if HAVE_CURLFTPSSL_CCC_NONE
CURB_DEFINE(CURLFTPSSL_CCC_NONE);
#endif
#if HAVE_CURLFTPSSL_CCC_PASSIVE
CURB_DEFINE(CURLFTPSSL_CCC_PASSIVE);
#endif
#if HAVE_CURLFTPSSL_CCC_ACTIVE
CURB_DEFINE(CURLFTPSSL_CCC_ACTIVE);
#endif
#if HAVE_CURLOPT_FTP_ACCOUNT
CURB_DEFINE(CURLOPT_FTP_ACCOUNT);
#endif
#if HAVE_CURLOPT_FTP_FILEMETHOD
CURB_DEFINE(CURLOPT_FTP_FILEMETHOD);
#endif
#if HAVE_CURLFTPMETHOD_MULTICWD
CURB_DEFINE(CURLFTPMETHOD_MULTICWD);
#endif
#if HAVE_CURLFTPMETHOD_NOCWD
CURB_DEFINE(CURLFTPMETHOD_NOCWD);
#endif
#if HAVE_CURLFTPMETHOD_SINGLECWD
CURB_DEFINE(CURLFTPMETHOD_SINGLECWD);
#endif
#if HAVE_CURLOPT_RTSP_REQUEST
CURB_DEFINE(CURLOPT_RTSP_REQUEST);
#endif
#if HAVE_CURL_RTSPREQ_OPTIONS
CURB_DEFINE(CURL_RTSPREQ_OPTIONS);
#endif
#if HAVE_CURL_RTSPREQ_DESCRIBE
CURB_DEFINE(CURL_RTSPREQ_DESCRIBE);
#endif
#if HAVE_CURL_RTSPREQ_ANNOUNCE
CURB_DEFINE(CURL_RTSPREQ_ANNOUNCE);
#endif
#if HAVE_CURL_RTSPREQ_SETUP
CURB_DEFINE(CURL_RTSPREQ_SETUP);
#endif
#if HAVE_CURL_RTSPREQ_PLAY
CURB_DEFINE(CURL_RTSPREQ_PLAY);
#endif
#if HAVE_CURL_RTSPREQ_PAUSE
CURB_DEFINE(CURL_RTSPREQ_PAUSE);
#endif
#if HAVE_CURL_RTSPREQ_TEARDOWN
CURB_DEFINE(CURL_RTSPREQ_TEARDOWN);
#endif
#if HAVE_CURL_RTSPREQ_GET_PARAMETER
CURB_DEFINE(CURL_RTSPREQ_GET_PARAMETER);
#endif
#if HAVE_CURL_RTSPREQ_SET_PARAMETER
CURB_DEFINE(CURL_RTSPREQ_SET_PARAMETER);
#endif
#if HAVE_CURL_RTSPREQ_RECORD
CURB_DEFINE(CURL_RTSPREQ_RECORD);
#endif
#if HAVE_CURL_RTSPREQ_RECEIVE
CURB_DEFINE(CURL_RTSPREQ_RECEIVE);
#endif
#if HAVE_CURLOPT_RTSP_SESSION_ID
CURB_DEFINE(CURLOPT_RTSP_SESSION_ID);
#endif
#if HAVE_CURLOPT_RTSP_STREAM_URI
CURB_DEFINE(CURLOPT_RTSP_STREAM_URI);
#endif
#if HAVE_CURLOPT_RTSP_TRANSPORT
CURB_DEFINE(CURLOPT_RTSP_TRANSPORT);
#endif
#if HAVE_CURLOPT_RTSP_HEADER
CURB_DEFINE(CURLOPT_RTSP_HEADER);
#endif
#if HAVE_CURLOPT_RTSP_CLIENT_CSEQ
CURB_DEFINE(CURLOPT_RTSP_CLIENT_CSEQ);
#endif
#if HAVE_CURLOPT_RTSP_SERVER_CSEQ
CURB_DEFINE(CURLOPT_RTSP_SERVER_CSEQ);
#endif
CURB_DEFINE(CURLOPT_TRANSFERTEXT);
#if HAVE_CURLOPT_PROXY_TRANSFER_MODE
CURB_DEFINE(CURLOPT_PROXY_TRANSFER_MODE);
#endif
#if HAVE_CURLOPT_CRLF
CURB_DEFINE(CURLOPT_CRLF);
#endif
#if HAVE_CURLOPT_RANGE
CURB_DEFINE(CURLOPT_RANGE);
#endif
#if HAVE_CURLOPT_RESUME_FROM
CURB_DEFINE(CURLOPT_RESUME_FROM);
#endif
#if HAVE_CURLOPT_RESUME_FROM_LARGE
CURB_DEFINE(CURLOPT_RESUME_FROM_LARGE);
#endif
#if HAVE_CURLOPT_CUSTOMREQUEST
CURB_DEFINE(CURLOPT_CUSTOMREQUEST);
#endif
#if HAVE_CURLOPT_FILETIME
CURB_DEFINE(CURLOPT_FILETIME);
#endif
#if HAVE_CURLOPT_NOBODY
CURB_DEFINE(CURLOPT_NOBODY);
#endif
#if HAVE_CURLOPT_INFILESIZE
CURB_DEFINE(CURLOPT_INFILESIZE);
#endif
#if HAVE_CURLOPT_INFILESIZE_LARGE
CURB_DEFINE(CURLOPT_INFILESIZE_LARGE);
#endif
#if HAVE_CURLOPT_UPLOAD
CURB_DEFINE(CURLOPT_UPLOAD);
#endif
#if HAVE_CURLOPT_MAXFILESIZE
CURB_DEFINE(CURLOPT_MAXFILESIZE);
#endif
#if HAVE_CURLOPT_MAXFILESIZE_LARGE
CURB_DEFINE(CURLOPT_MAXFILESIZE_LARGE);
#endif
#if HAVE_CURLOPT_TIMECONDITION
CURB_DEFINE(CURLOPT_TIMECONDITION);
#endif
#if HAVE_CURLOPT_TIMEVALUE
CURB_DEFINE(CURLOPT_TIMEVALUE);
#endif
#if HAVE_CURLOPT_TIMEOUT
CURB_DEFINE(CURLOPT_TIMEOUT);
#endif
#if HAVE_CURLOPT_TIMEOUT_MS
CURB_DEFINE(CURLOPT_TIMEOUT_MS);
#endif
#if HAVE_CURLOPT_LOW_SPEED_LIMIT
CURB_DEFINE(CURLOPT_LOW_SPEED_LIMIT);
#endif
#if HAVE_CURLOPT_LOW_SPEED_TIME
CURB_DEFINE(CURLOPT_LOW_SPEED_TIME);
#endif
#if HAVE_CURLOPT_MAX_SEND_SPEED_LARGE
CURB_DEFINE(CURLOPT_MAX_SEND_SPEED_LARGE);
#endif
#if HAVE_CURLOPT_MAX_RECV_SPEED_LARGE
CURB_DEFINE(CURLOPT_MAX_RECV_SPEED_LARGE);
#endif
#if HAVE_CURLOPT_MAXCONNECTS
CURB_DEFINE(CURLOPT_MAXCONNECTS);
#endif
#if HAVE_CURLOPT_CLOSEPOLICY
CURB_DEFINE(CURLOPT_CLOSEPOLICY);
#endif
#if HAVE_CURLOPT_FRESH_CONNECT
CURB_DEFINE(CURLOPT_FRESH_CONNECT);
#endif
#if HAVE_CURLOPT_FORBID_REUSE
CURB_DEFINE(CURLOPT_FORBID_REUSE);
#endif
#if HAVE_CURLOPT_CONNECTTIMEOUT
CURB_DEFINE(CURLOPT_CONNECTTIMEOUT);
#endif
#if HAVE_CURLOPT_CONNECTTIMEOUT_MS
CURB_DEFINE(CURLOPT_CONNECTTIMEOUT_MS);
#endif
#if HAVE_CURLOPT_IPRESOLVE
CURB_DEFINE(CURLOPT_IPRESOLVE);
#endif
#if HAVE_CURL_IPRESOLVE_WHATEVER
CURB_DEFINE(CURL_IPRESOLVE_WHATEVER);
#endif
#if HAVE_CURL_IPRESOLVE_V4
CURB_DEFINE(CURL_IPRESOLVE_V4);
#endif
#if HAVE_CURL_IPRESOLVE_V6
CURB_DEFINE(CURL_IPRESOLVE_V6);
#endif
#if HAVE_CURLOPT_CONNECT_ONLY
CURB_DEFINE(CURLOPT_CONNECT_ONLY);
#endif
#if HAVE_CURLOPT_USE_SSL
CURB_DEFINE(CURLOPT_USE_SSL);
#endif
#if HAVE_CURLUSESSL_NONE
CURB_DEFINE(CURLUSESSL_NONE);
#endif
#if HAVE_CURLUSESSL_TRY
CURB_DEFINE(CURLUSESSL_TRY);
#endif
#if HAVE_CURLUSESSL_CONTROL
CURB_DEFINE(CURLUSESSL_CONTROL);
#endif
#if HAVE_CURLUSESSL_ALL
CURB_DEFINE(CURLUSESSL_ALL);
#endif
#if HAVE_CURLOPT_RESOLVE
CURB_DEFINE(CURLOPT_RESOLVE);
#endif
#if HAVE_CURLOPT_SSLCERT
CURB_DEFINE(CURLOPT_SSLCERT);
#endif
#if HAVE_CURLOPT_SSLCERTTYPE
CURB_DEFINE(CURLOPT_SSLCERTTYPE);
#endif
#if HAVE_CURLOPT_SSLKEY
CURB_DEFINE(CURLOPT_SSLKEY);
#endif
#if HAVE_CURLOPT_SSLKEYTYPE
CURB_DEFINE(CURLOPT_SSLKEYTYPE);
#endif
#if HAVE_CURLOPT_KEYPASSWD
CURB_DEFINE(CURLOPT_KEYPASSWD);
#endif
#if HAVE_CURLOPT_SSLENGINE
CURB_DEFINE(CURLOPT_SSLENGINE);
#endif
#if HAVE_CURLOPT_SSLENGINE_DEFAULT
CURB_DEFINE(CURLOPT_SSLENGINE_DEFAULT);
#endif
#if HAVE_CURLOPT_SSLVERSION
CURB_DEFINE(CURLOPT_SSLVERSION);
#endif
#if HAVE_CURL_SSLVERSION_TLSv1
CURB_DEFINE(CURL_SSLVERSION_TLSv1);
#endif
#if HAVE_CURL_SSLVERSION_SSLv2
CURB_DEFINE(CURL_SSLVERSION_SSLv2);
#endif
#if HAVE_CURL_SSLVERSION_SSLv3
CURB_DEFINE(CURL_SSLVERSION_SSLv3);
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_0
CURB_DEFINE(CURL_SSLVERSION_TLSv1_0);
CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_0);
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_1
CURB_DEFINE(CURL_SSLVERSION_TLSv1_1);
CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_1);
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_2
CURB_DEFINE(CURL_SSLVERSION_TLSv1_2);
CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_2);
#endif
#if HAVE_CURL_SSLVERSION_TLSv1_3
CURB_DEFINE(CURL_SSLVERSION_TLSv1_3);
CURB_DEFINE(CURL_SSLVERSION_MAX_TLSv1_3);
#endif
#if HAVE_CURLOPT_SSL_VERIFYPEER
CURB_DEFINE(CURLOPT_SSL_VERIFYPEER);
#endif
#if HAVE_CURLOPT_CAINFO
CURB_DEFINE(CURLOPT_CAINFO);
#endif
#if HAVE_CURLOPT_ISSUERCERT
CURB_DEFINE(CURLOPT_ISSUERCERT);
#endif
#if HAVE_CURLOPT_CAPATH
CURB_DEFINE(CURLOPT_CAPATH);
#endif
#if HAVE_CURLOPT_CRLFILE
CURB_DEFINE(CURLOPT_CRLFILE);
#endif
#if HAVE_CURLOPT_SSL_VERIFYHOST
CURB_DEFINE(CURLOPT_SSL_VERIFYHOST);
#endif
#if HAVE_CURLOPT_CERTINFO
CURB_DEFINE(CURLOPT_CERTINFO);
#endif
#if HAVE_CURLOPT_RANDOM_FILE
CURB_DEFINE(CURLOPT_RANDOM_FILE);
#endif
#if HAVE_CURLOPT_EGDSOCKET
CURB_DEFINE(CURLOPT_EGDSOCKET);
#endif
#if HAVE_CURLOPT_SSL_CIPHER_LIST
CURB_DEFINE(CURLOPT_SSL_CIPHER_LIST);
#endif
#if HAVE_CURLOPT_SSL_SESSIONID_CACHE
CURB_DEFINE(CURLOPT_SSL_SESSIONID_CACHE);
#endif
#if HAVE_CURLOPT_KRBLEVEL
CURB_DEFINE(CURLOPT_KRBLEVEL);
#endif
#if HAVE_CURLOPT_SSH_AUTH_TYPES
CURB_DEFINE(CURLOPT_SSH_AUTH_TYPES);
#endif
#if HAVE_CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
CURB_DEFINE(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5);
#endif
#if HAVE_CURLOPT_SSH_PUBLIC_KEYFILE
CURB_DEFINE(CURLOPT_SSH_PUBLIC_KEYFILE);
#endif
#if HAVE_CURLOPT_SSH_PRIVATE_KEYFILE
CURB_DEFINE(CURLOPT_SSH_PRIVATE_KEYFILE);
#endif
#if HAVE_CURLOPT_SSH_KNOWNHOSTS
CURB_DEFINE(CURLOPT_SSH_KNOWNHOSTS);
#endif
#if HAVE_CURLOPT_SSH_KEYFUNCTION
CURB_DEFINE(CURLOPT_SSH_KEYFUNCTION);
#endif
#if HAVE_CURLKHSTAT_FINE_ADD_TO_FILE
CURB_DEFINE(CURLKHSTAT_FINE_ADD_TO_FILE);
#endif
#if HAVE_CURLKHSTAT_FINE
CURB_DEFINE(CURLKHSTAT_FINE);
#endif
#if HAVE_CURLKHSTAT_REJECT
CURB_DEFINE(CURLKHSTAT_REJECT);
#endif
#if HAVE_CURLKHSTAT_DEFER
CURB_DEFINE(CURLKHSTAT_DEFER);
#endif
#if HAVE_CURLOPT_SSH_KEYDATA
CURB_DEFINE(CURLOPT_SSH_KEYDATA);
#endif
#if HAVE_CURLOPT_PRIVATE
CURB_DEFINE(CURLOPT_PRIVATE);
#endif
#if HAVE_CURLOPT_SHARE
CURB_DEFINE(CURLOPT_SHARE);
#endif
#if HAVE_CURLOPT_NEW_FILE_PERMS
CURB_DEFINE(CURLOPT_NEW_FILE_PERMS);
#endif
#if HAVE_CURLOPT_NEW_DIRECTORY_PERMS
CURB_DEFINE(CURLOPT_NEW_DIRECTORY_PERMS);
#endif
#if HAVE_CURLOPT_TELNETOPTIONS
CURB_DEFINE(CURLOPT_TELNETOPTIONS);
#endif
#if HAVE_CURLOPT_GSSAPI_DELEGATION
CURB_DEFINE(CURLOPT_GSSAPI_DELEGATION);
#endif
#if HAVE_CURLGSSAPI_DELEGATION_FLAG
CURB_DEFINE(CURLGSSAPI_DELEGATION_FLAG);
#endif
#if HAVE_CURLGSSAPI_DELEGATION_POLICY_FLAG
CURB_DEFINE(CURLGSSAPI_DELEGATION_POLICY_FLAG);
#endif
#if HAVE_CURLOPT_UNIX_SOCKET_PATH
CURB_DEFINE(CURLOPT_UNIX_SOCKET_PATH);
#endif
#if HAVE_CURLOPT_PIPEWAIT
CURB_DEFINE(CURLOPT_PIPEWAIT);
#endif
#if HAVE_CURLOPT_TCP_KEEPALIVE
CURB_DEFINE(CURLOPT_TCP_KEEPALIVE);
CURB_DEFINE(CURLOPT_TCP_KEEPIDLE);
CURB_DEFINE(CURLOPT_TCP_KEEPINTVL);
#endif
#if HAVE_CURLOPT_HAPROXYPROTOCOL
CURB_DEFINE(CURLOPT_HAPROXYPROTOCOL);
#endif
#if HAVE_CURLOPT_PROXY_SSL_VERIFYHOST
CURB_DEFINE(CURLOPT_PROXY_SSL_VERIFYHOST);
#endif
#if HAVE_CURLPROTO_RTMPTE
CURB_DEFINE(CURLPROTO_RTMPTE);
#endif
#if HAVE_CURLPROTO_RTMPTS
CURB_DEFINE(CURLPROTO_RTMPTS);
#endif
#if HAVE_CURLPROTO_SMBS
CURB_DEFINE(CURLPROTO_SMBS);
#endif
#if HAVE_CURLPROTO_LDAP
CURB_DEFINE(CURLPROTO_LDAP);
#endif
#if HAVE_CURLPROTO_FTP
CURB_DEFINE(CURLPROTO_FTP);
#endif
#if HAVE_CURLPROTO_SMTPS
CURB_DEFINE(CURLPROTO_SMTPS);
#endif
#if HAVE_CURLPROTO_HTTP
CURB_DEFINE(CURLPROTO_HTTP);
#endif
#if HAVE_CURLPROTO_SMTP
CURB_DEFINE(CURLPROTO_SMTP);
#endif
#if HAVE_CURLPROTO_TFTP
CURB_DEFINE(CURLPROTO_TFTP);
#endif
#if HAVE_CURLPROTO_LDAPS
CURB_DEFINE(CURLPROTO_LDAPS);
#endif
#if HAVE_CURLPROTO_IMAPS
CURB_DEFINE(CURLPROTO_IMAPS);
#endif
#if HAVE_CURLPROTO_SCP
CURB_DEFINE(CURLPROTO_SCP);
#endif
#if HAVE_CURLPROTO_SFTP
CURB_DEFINE(CURLPROTO_SFTP);
#endif
#if HAVE_CURLPROTO_TELNET
CURB_DEFINE(CURLPROTO_TELNET);
#endif
#if HAVE_CURLPROTO_FILE
CURB_DEFINE(CURLPROTO_FILE);
#endif
#if HAVE_CURLPROTO_FTPS
CURB_DEFINE(CURLPROTO_FTPS);
#endif
#if HAVE_CURLPROTO_HTTPS
CURB_DEFINE(CURLPROTO_HTTPS);
#endif
#if HAVE_CURLPROTO_IMAP
CURB_DEFINE(CURLPROTO_IMAP);
#endif
#if HAVE_CURLPROTO_POP3
CURB_DEFINE(CURLPROTO_POP3);
#endif
#if HAVE_CURLPROTO_GOPHER
CURB_DEFINE(CURLPROTO_GOPHER);
#endif
#if HAVE_CURLPROTO_DICT
CURB_DEFINE(CURLPROTO_DICT);
#endif
#if HAVE_CURLPROTO_SMB
CURB_DEFINE(CURLPROTO_SMB);
#endif
#if HAVE_CURLPROTO_RTMP
CURB_DEFINE(CURLPROTO_RTMP);
#endif
#if HAVE_CURLPROTO_ALL
CURB_DEFINE(CURLPROTO_ALL);
#endif
#if HAVE_CURLPROTO_RTMPE
CURB_DEFINE(CURLPROTO_RTMPE);
#endif
#if HAVE_CURLPROTO_RTMPS
CURB_DEFINE(CURLPROTO_RTMPS);
#endif
#if HAVE_CURLPROTO_RTMPT
CURB_DEFINE(CURLPROTO_RTMPT);
#endif
#if HAVE_CURLPROTO_POP3S
CURB_DEFINE(CURLPROTO_POP3S);
#endif
#if HAVE_CURLPROTO_RTSP
CURB_DEFINE(CURLPROTO_RTSP);
#endif
#if LIBCURL_VERSION_NUM >= 0x072B00 /* 7.43.0 */
CURB_DEFINE(CURLPIPE_NOTHING);
CURB_DEFINE(CURLPIPE_HTTP1);
CURB_DEFINE(CURLPIPE_MULTIPLEX);
rb_define_const(mCurl, "PIPE_NOTHING", LONG2NUM(CURLPIPE_NOTHING));
rb_define_const(mCurl, "PIPE_HTTP1", LONG2NUM(CURLPIPE_HTTP1));
rb_define_const(mCurl, "PIPE_MULTIPLEX", LONG2NUM(CURLPIPE_MULTIPLEX));
#endif
#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */
rb_define_const(mCurl, "HTTP_2_0", LONG2NUM(CURL_HTTP_VERSION_2_0));
#endif
rb_define_const(mCurl, "HTTP_1_1", LONG2NUM(CURL_HTTP_VERSION_1_1));
rb_define_const(mCurl, "HTTP_1_0", LONG2NUM(CURL_HTTP_VERSION_1_0));
rb_define_const(mCurl, "HTTP_NONE", LONG2NUM(CURL_HTTP_VERSION_NONE));
rb_define_singleton_method(mCurl, "ipv6?", ruby_curl_ipv6_q, 0);
rb_define_singleton_method(mCurl, "kerberos4?", ruby_curl_kerberos4_q, 0);
rb_define_singleton_method(mCurl, "ssl?", ruby_curl_ssl_q, 0);
rb_define_singleton_method(mCurl, "libz?", ruby_curl_libz_q, 0);
rb_define_singleton_method(mCurl, "ntlm?", ruby_curl_ntlm_q, 0);
rb_define_singleton_method(mCurl, "gssnegotiate?", ruby_curl_gssnegotiate_q, 0);
rb_define_singleton_method(mCurl, "debug?", ruby_curl_debug_q, 0);
rb_define_singleton_method(mCurl, "asyncdns?", ruby_curl_asyncdns_q, 0);
rb_define_singleton_method(mCurl, "spnego?", ruby_curl_spnego_q, 0);
rb_define_singleton_method(mCurl, "largefile?", ruby_curl_largefile_q, 0);
rb_define_singleton_method(mCurl, "idn?", ruby_curl_idn_q, 0);
rb_define_singleton_method(mCurl, "sspi?", ruby_curl_sspi_q, 0);
rb_define_singleton_method(mCurl, "conv?", ruby_curl_conv_q, 0);
rb_define_singleton_method(mCurl, "http2?", ruby_curl_http2_q, 0);
init_curb_errors();
init_curb_easy();
init_curb_postfield();
init_curb_multi();
init_curb_upload();
}
|