diff options
author | Sterling Hughes <sterling@php.net> | 2001-08-15 05:21:43 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2001-08-15 05:21:43 +0000 |
commit | 8300abe36780f90baca3afb755a0f1031cf1a8e6 (patch) | |
tree | ce500c731fdf5c3a396e3162affad1385fc70739 /ext/standard/file.c | |
parent | 5917e310974d350cc116cc56dc17eb89c26f0f1d (diff) | |
download | php-git-8300abe36780f90baca3afb755a0f1031cf1a8e6.tar.gz |
Removed select(), fd_set(), etc. (wasn't present in the first place, and
these are implemented in the sockwasn't present in the first place, and
these are implemented in the sockets extension))
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r-- | ext/standard/file.c | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 39cd424574..03841aae36 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2232,117 +2232,6 @@ PHP_FUNCTION(realpath) #endif -#if 0 - -static fd_set readfd; -static int max_fd; -/* {{{ PHP_FUNCTION(fd_set) - */ -PHP_FUNCTION(fd_set) -{ - pval **arg; - void *what; - int type, fd; - - if(ARG_COUNT(ht) <= 0) { - php_error(E_WARNING, "fd_set: Must be passed at least one value" ); - return_value->type = IS_NULL; - return; - } - else if(ARG_COUNT(ht) == 1) { - if(zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - /* XXX: add stream support --Wez. */ - what = zend_fetch_resource(arg TSRMLS_CC,-1, "select", &type, 3, le_fopen, le_socket, le_popen); - ZEND_VERIFY_RESOURCE(what); - if(type == le_socket) { - fd = *(int *)what; - } else { - fd = fileno((FILE *)what); - } - max_fd = fd; - FD_ZERO(&readfd); - FD_SET(max_fd, &readfd); - } - else { - pval ***args = (pval ***) emalloc(sizeof(pval **) * ARG_COUNT(ht)); - int i; - if(zend_get_parameters_array_ex(ARG_COUNT(ht), args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - FD_ZERO(&readfd); - for(i = 0; i < ARG_COUNT(ht); i++) { - /* XXX: add stream support --Wez. */ - what = zend_fetch_resource(*args TSRMLS_CC,-1, "select", &type, 3, le_fopen, le_socket, le_popen); - ZEND_VERIFY_RESOURCE(what); - if(type == le_socket) { - fd = *(int *)what; - } else { - fd = fileno((FILE *)what); - } - FD_SET(fd, &readfd); - if(fd > max_fd) max_fd = fd; - } - efree(args); - } - RETURN_LONG(1); -} -/* }}} */ - -/* {{{ PHP_FUNCTION(select) - */ -PHP_FUNCTION(select) -{ - pval **timeout; - struct timeval tv; - - if(ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &timeout) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(timeout); - - tv.tv_sec = (*timeout)->value.lval / 1000000; - tv.tv_usec = (*timeout)->value.lval % 1000000; - /* XXX: add stream support --Wez. */ - - RETURN_LONG(select(max_fd + 1, &readfd, NULL, NULL, ((*timeout)->value.lval <= 0) ? NULL : &tv)); -} -/* }}} */ - -/* {{{ PHP_FUNCTION(fd_isset) - */ -PHP_FUNCTION(fd_isset) -{ - pval **fdarg; - void *what; - int type, fd; - - if(ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &fdarg) == FAILURE) { - WRONG_PARAM_COUNT; - } - /* XXX: add stream support --Wez. */ - - what = zend_fetch_resource(fdarg TSRMLS_CC,-1, "select", &type, 3, le_fopen, le_socket, le_popen); - ZEND_VERIFY_RESOURCE(what); - - if(type == le_socket) { - fd = *(int *)what; - } else { - fd = fileno((FILE *)what); - } - - if(FD_ISSET(fd, &readfd)) { - RETURN_TRUE; - } - RETURN_FALSE; -} -/* }}} */ - -#endif - /* {{{ php_fread_all Function reads all data from file or socket and puts it into the buffer */ size_t php_fread_all(char **buf, int socket, FILE *fp, int issock) { |