-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathphp_swoole_api.h
More file actions
64 lines (53 loc) · 2.18 KB
/
php_swoole_api.h
File metadata and controls
64 lines (53 loc) · 2.18 KB
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
/*
+----------------------------------------------------------------------+
| Swoole |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the Apache license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.apache.org/licenses/LICENSE-2.0.html |
| If you did not receive a copy of the Apache2.0 license and are unable|
| to obtain it through the world-wide-web, please send a note to |
| license@swoole.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Tianfeng Han <rango@swoole.com> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_SWOOLE_API_H
#define PHP_SWOOLE_API_H
#ifdef __cplusplus
extern "C" {
#endif
#include "php.h"
#include "php_network.h"
int php_async_socket_connect_to_host(const char *host,
unsigned short port,
int socktype,
int asynchronous,
struct timeval *timeout,
zend_string **error_string,
int *error_code,
const char *bindto,
unsigned short bindport,
long sockopts);
int php_async_socket_poll(php_socket_t fd, int events, int timeout);
#if PHP_VERSION_ID < 80300
static inline const char *zend_zval_value_name(const zval *arg) {
ZVAL_DEREF(arg);
if (Z_ISUNDEF_P(arg)) {
return "null";
}
if (Z_TYPE_P(arg) == IS_OBJECT) {
return ZSTR_VAL(Z_OBJCE_P(arg)->name);
} else if (Z_TYPE_P(arg) == IS_FALSE) {
return "false";
} else if (Z_TYPE_P(arg) == IS_TRUE) {
return "true";
}
return zend_get_type_by_const(Z_TYPE_P(arg));
}
#endif
#ifdef __cplusplus
}
#endif
#endif /* PHP_SWOOLE_API_H */