]> granicus.if.org Git - php/commitdiff
Removed select(), fd_set(), etc. (wasn't present in the first place, and
authorSterling Hughes <sterling@php.net>
Wed, 15 Aug 2001 05:21:43 +0000 (05:21 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 15 Aug 2001 05:21:43 +0000 (05:21 +0000)
 these are implemented in the sockwasn't present in the first place, and
 these are implemented in the sockets extension))

ext/standard/file.c

index 39cd424574f35714b99c00a828cbf607791b4d89..03841aae36e412e428490facffa531d38d8e0594 100644 (file)
@@ -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) {