1 /* 2 +----------------------------------------------------------------------+ 3 | PHP Version 7 | 4 +----------------------------------------------------------------------+ 5 | Copyright (c) The PHP Group | 6 +----------------------------------------------------------------------+ 7 | This source file is subject to version 3.01 of the PHP license, | 8 | that is bundled with this package in the file LICENSE, and is | 9 | available through the world-wide-web at the following url: | 10 | http://www.php.net/license/3_01.txt | 11 | If you did not receive a copy of the PHP license and are unable to | 12 | obtain it through the world-wide-web, please send a note to | 13 | license@php.net so we can mail you a copy immediately. | 14 +----------------------------------------------------------------------+ 15 | Author: Sterling Hughes <sterling@php.net> | 16 | Wez Furlong <wez@thebrainroom.com> | 17 +----------------------------------------------------------------------+ 18 */ 19 20 /* Copied from PHP-7.4.11 */ 21 22 #ifdef SW_USE_CURL 23 24 #ifndef _PHP_CURL_H 25 #define _PHP_CURL_H 26 27 #include "php.h" 28 #include "zend_smart_str.h" 29 30 #define PHP_CURL_DEBUG 0 31 32 #ifdef PHP_WIN32 33 # define PHP_CURL_API __declspec(dllexport) 34 #elif defined(__GNUC__) && __GNUC__ >= 4 35 # define PHP_CURL_API __attribute__ ((visibility("default"))) 36 #else 37 # define PHP_CURL_API 38 #endif 39 40 #include "php_version.h" 41 #define PHP_CURL_VERSION PHP_VERSION 42 43 #include <curl/curl.h> 44 #include <curl/multi.h> 45 46 #define CURLOPT_RETURNTRANSFER 19913 47 #define CURLOPT_BINARYTRANSFER 19914 /* For Backward compatibility */ 48 #define PHP_CURL_STDOUT 0 49 #define PHP_CURL_FILE 1 50 #define PHP_CURL_USER 2 51 #define PHP_CURL_DIRECT 3 52 #define PHP_CURL_RETURN 4 53 #define PHP_CURL_IGNORE 7 54 55 #if PHP_VERSION_ID < 80000 56 #define le_curl_name "Swoole-Coroutine-cURL-Handle" 57 #define le_curl_multi_handle_name "Swoole-Coroutine-cURL-Multi-Handle" 58 #define le_curl_share_handle_name "Swoole-Coroutine-cURL-Share-Handle" 59 #endif 60 61 #if PHP_VERSION_ID >= 80000 62 PHP_CURL_API extern zend_class_entry *curl_ce; 63 PHP_CURL_API extern zend_class_entry *curl_share_ce; 64 PHP_CURL_API extern zend_class_entry *curl_multi_ce; 65 PHP_CURL_API extern zend_class_entry *swoole_coroutine_curl_handle_ce; 66 PHP_CURL_API extern zend_class_entry *swoole_coroutine_curl_multi_handle_ce; 67 #endif 68 69 PHP_CURL_API extern zend_class_entry *curl_CURLFile_class; 70 71 #else 72 #define curl_module_ptr NULL 73 #endif /* HAVE_CURL */ 74 #define phpext_curl_ptr curl_module_ptr 75 #endif 76