add uv_pipe_pending_instances api (windows only)

This commit is contained in:
Shuhei Tanuma 2012-06-02 15:29:31 +09:00
parent e0a43a1ca8
commit 789ce066a5
2 changed files with 23 additions and 4 deletions

View File

@ -21,10 +21,6 @@
* UV_EXTERN void uv_tty_reset_mode(void);
* UV_EXTERN int uv_tty_get_winsize(uv_tty_t*, int* width, int* height);
* UV_EXTERN uv_handle_type uv_guess_handle(uv_file file);
* UV_EXTERN int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc);
* UV_EXTERN void uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle,const char* name, uv_connect_cb cb);
* UV_EXTERN void uv_pipe_pending_instances(uv_pipe_t* handle, int count);
* UV_EXTERN int uv_prepare_init(uv_loop_t*, uv_prepare_t* prepare);
* UV_EXTERN int uv_prepare_start(uv_prepare_t* prepare, uv_prepare_cb cb);

View File

@ -857,6 +857,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_uv_pipe_connect, 0, 0, 3)
ZEND_ARG_INFO(0, callback)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_uv_pipe_pending_instances, 0, 0, 2)
ZEND_ARG_INFO(0, handle)
ZEND_ARG_INFO(0, count)
ZEND_END_ARG_INFO()
/* PHP Functions */
/* {{{ */
@ -1941,6 +1946,23 @@ PHP_FUNCTION(uv_pipe_connect)
}
/* }}} */
/* {{{ */
PHP_FUNCTION(uv_pipe_pending_instances)
{
php_uv_t *uv;
zval *handle;
long count;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"zl",&handle, &count) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(uv, php_uv_t *, &handle, -1, PHP_UV_RESOURCE_NAME, uv_resource_handle);
uv_pipe_pending_instances(&uv->uv.pipe, count);
}
/* }}} */
static zend_function_entry uv_functions[] = {
/* general */
@ -1994,6 +2016,7 @@ static zend_function_entry uv_functions[] = {
PHP_FE(uv_pipe_bind, arginfo_uv_pipe_bind)
PHP_FE(uv_pipe_open, arginfo_uv_pipe_open)
PHP_FE(uv_pipe_connect, arginfo_uv_pipe_connect)
PHP_FE(uv_pipe_pending_instances, arginfo_uv_pipe_pending_instances)
/* for debug */
PHP_FE(uv_loop_refcount, arginfo_uv_loop_refcount)
/* c-ares */