sesser Thu Oct 3 05:10:24 2002 EDT
Modified files:
/php4/ext/ftp ftp.c ftp.h php_ftp.c php_ftp.h
Log:
renamed ftp_async_* into ftp_nb_*
Index: php4/ext/ftp/ftp.c
diff -u php4/ext/ftp/ftp.c:1.63 php4/ext/ftp/ftp.c:1.64
--- php4/ext/ftp/ftp.c:1.63 Mon Sep 23 10:50:21 2002
+++ php4/ext/ftp/ftp.c Thu Oct 3 05:10:23 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.c,v 1.63 2002/09/23 14:50:21 wez Exp $ */
+/* $Id: ftp.c,v 1.64 2002/10/03 09:10:23 sesser Exp $ */
#include "php.h"
@@ -138,7 +138,7 @@
/* Default Settings */
ftp->timeout_sec = timeout_sec;
- ftp->async = 0;
+ ftp->nb = 0;
size = sizeof(ftp->localaddr);
memset(&ftp->localaddr, 0, size);
@@ -250,7 +250,7 @@
ftp_gc(ftp);
- ftp->async = 0;
+ ftp->nb = 0;
if (!ftp_putcmd(ftp, "REIN", NULL))
return 0;
@@ -1381,10 +1381,10 @@
}
/* }}} */
-/* {{{ ftp_async_get
+/* {{{ ftp_nb_get
*/
int
-ftp_async_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
int resumepos)
+ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
+int resumepos)
{
databuf_t *data = NULL;
char arg[11];
@@ -1425,9 +1425,9 @@
ftp->data = data;
ftp->stream = outstream;
ftp->lastch = 0;
- ftp->async = 1;
+ ftp->nb = 1;
- return (ftp_async_continue_read(ftp));
+ return (ftp_nb_continue_read(ftp));
bail:
data_close(data);
@@ -1435,10 +1435,10 @@
}
/* }}} */
-/* {{{ ftp_aget
+/* {{{ ftp_nb_continue_read
*/
int
-ftp_async_continue_read(ftpbuf_t *ftp)
+ftp_nb_continue_read(ftpbuf_t *ftp)
{
databuf_t *data = NULL;
char *ptr;
@@ -1489,19 +1489,19 @@
goto bail;
}
- ftp->async = 0;
+ ftp->nb = 0;
return PHP_FTP_FINISHED;
bail:
- ftp->async = 0;
+ ftp->nb = 0;
data_close(data);
return PHP_FTP_FAILED;
}
/* }}} */
-/* {{{ ftp_async_put
+/* {{{ ftp_nb_put
*/
int
-ftp_async_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type,
int startpos)
+ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int
+startpos)
{
databuf_t *data = NULL;
char arg[11];
@@ -1537,9 +1537,9 @@
ftp->data = data;
ftp->stream = instream;
ftp->lastch = 0;
- ftp->async = 1;
+ ftp->nb = 1;
- return (ftp_async_continue_write(ftp));
+ return (ftp_nb_continue_write(ftp));
bail:
data_close(data);
@@ -1549,10 +1549,10 @@
/* }}} */
-/* {{{ ftp_async_continue_write
+/* {{{ ftp_nb_continue_write
*/
int
-ftp_async_continue_write(ftpbuf_t *ftp)
+ftp_nb_continue_write(ftpbuf_t *ftp)
{
int size;
char *ptr;
@@ -1594,11 +1594,11 @@
if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250))
goto bail;
- ftp->async = 0;
+ ftp->nb = 0;
return PHP_FTP_FINISHED;
bail:
data_close(ftp->data);
- ftp->async = 0;
+ ftp->nb = 0;
return PHP_FTP_FAILED;
}
/* }}} */
Index: php4/ext/ftp/ftp.h
diff -u php4/ext/ftp/ftp.h:1.27 php4/ext/ftp/ftp.h:1.28
--- php4/ext/ftp/ftp.h:1.27 Sun Aug 25 18:17:55 2002
+++ php4/ext/ftp/ftp.h Thu Oct 3 05:10:24 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.h,v 1.27 2002/08/25 22:17:55 sebastian Exp $ */
+/* $Id: ftp.h,v 1.28 2002/10/03 09:10:24 sesser Exp $ */
#ifndef FTP_H
#define FTP_H
@@ -68,9 +68,9 @@
long timeout_sec; /* User configureable timeout (seconds) */
int autoseek; /* User configureable autoseek flag */
- int async; /* asyncronous transfer in progress */
- databuf_t *data; /* Data connection for asyncrounous transfers
*/
- php_stream *stream; /* output stream for asyncrounous transfers */
+ int nb; /* "nonblocking" transfer in
+progress */
+ databuf_t *data; /* Data connection for "nonblocking" transfers
+*/
+ php_stream *stream; /* output stream for "nonblocking" transfers
+*/
int lastch; /* last char of previous call
*/
int direction; /* recv = 0 / send = 1 */
int closestream;/* close or not close stream */
@@ -170,21 +170,21 @@
/* retrieves part of a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_async_get(ftpbuf_t *ftp, php_stream *outstream, const char *path,
+int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path,
ftptype_t type, int resumepos);
/* stores the data from a file, socket, or process as a file on the remote server
* returns true on success, false on error
*/
-int ftp_async_put(ftpbuf_t *ftp, const char *path, php_stream *instream,
ftptype_t type, int startpos);
+int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream,
+ftptype_t type, int startpos);
-/* continues a previous async_(f)get command
+/* continues a previous nb_(f)get command
*/
-int ftp_async_continue_read(ftpbuf_t *ftp);
+int ftp_nb_continue_read(ftpbuf_t *ftp);
-/* continues a previous async_(f)put command
+/* continues a previous nb_(f)put command
*/
-int ftp_async_continue_write(ftpbuf_t *ftp);
+int ftp_nb_continue_write(ftpbuf_t *ftp);
#endif
Index: php4/ext/ftp/php_ftp.c
diff -u php4/ext/ftp/php_ftp.c:1.72 php4/ext/ftp/php_ftp.c:1.73
--- php4/ext/ftp/php_ftp.c:1.72 Wed Sep 25 11:46:43 2002
+++ php4/ext/ftp/php_ftp.c Thu Oct 3 05:10:24 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.c,v 1.72 2002/09/25 15:46:43 wez Exp $ */
+/* $Id: php_ftp.c,v 1.73 2002/10/03 09:10:24 sesser Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -71,11 +71,11 @@
PHP_FE(ftp_close, NULL)
PHP_FE(ftp_set_option, NULL)
PHP_FE(ftp_get_option, NULL)
- PHP_FE(ftp_async_fget, NULL)
- PHP_FE(ftp_async_get, NULL)
- PHP_FE(ftp_async_continue, NULL)
- PHP_FE(ftp_async_put, NULL)
- PHP_FE(ftp_async_fput, NULL)
+ PHP_FE(ftp_nb_fget, NULL)
+ PHP_FE(ftp_nb_get, NULL)
+ PHP_FE(ftp_nb_continue, NULL)
+ PHP_FE(ftp_nb_put, NULL)
+ PHP_FE(ftp_nb_fput, NULL)
PHP_FALIAS(ftp_quit, ftp_close, NULL)
{NULL, NULL, NULL}
};
@@ -460,9 +460,9 @@
}
/* }}} */
-/* {{{ proto bool ftp_async_fget(resource stream, resource fp, string remote_file,
int mode[, int resumepos])
+/* {{{ proto bool ftp_nb_fget(resource stream, resource fp, string remote_file, int
+mode[, int resumepos])
Retrieves a file from the FTP server asynchronly and writes it to an open file */
-PHP_FUNCTION(ftp_async_fget)
+PHP_FUNCTION(ftp_nb_fget)
{
zval *z_ftp, *z_file;
ftpbuf_t *ftp;
@@ -498,7 +498,7 @@
ftp->direction = 0; /* recv */
ftp->closestream = 0; /* do not close */
- if ((ret = ftp_async_get(ftp, stream, file, xtype, resumepos)) ==
PHP_FTP_FAILED) {
+ if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos)) == PHP_FTP_FAILED)
+{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(ret);
}
@@ -585,9 +585,9 @@
}
/* }}} */
-/* {{{ proto int ftp_async_get(resource stream, string local_file, string
remote_file, int mode[, int resume_pos])
- Retrieves a file from the FTP server asynchronly and writes it to a local file */
-PHP_FUNCTION(ftp_async_get)
+/* {{{ proto int ftp_nb_get(resource stream, string local_file, string remote_file,
+int mode[, int resume_pos])
+ Retrieves a file from the FTP server nbhronly and writes it to a local file */
+PHP_FUNCTION(ftp_nb_get)
{
zval *z_ftp;
ftpbuf_t *ftp;
@@ -635,7 +635,7 @@
ftp->direction = 0; /* recv */
ftp->closestream = 1; /* do close */
- if ((ret = ftp_async_get(ftp, outstream, remote, xtype, resumepos)) ==
PHP_FTP_FAILED) {
+ if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos)) ==
+PHP_FTP_FAILED) {
php_stream_close(outstream);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(PHP_FTP_FAILED);
@@ -649,9 +649,9 @@
}
/* }}} */
-/* {{{ proto int ftp_async_continue(resource stream)
- Continues retrieving/sending a file asyncronously */
-PHP_FUNCTION(ftp_async_continue)
+/* {{{ proto int ftp_nb_continue(resource stream)
+ Continues retrieving/sending a file nbronously */
+PHP_FUNCTION(ftp_nb_continue)
{
zval *z_ftp;
ftpbuf_t *ftp;
@@ -663,15 +663,15 @@
ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf);
- if (!ftp->async) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "no asyncronous transfer
to continue.");
+ if (!ftp->nb) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "no nbronous transfer to
+continue.");
RETURN_LONG(PHP_FTP_FAILED);
}
if (ftp->direction) {
- ret=ftp_async_continue_write(ftp);
+ ret=ftp_nb_continue_write(ftp);
} else {
- ret=ftp_async_continue_read(ftp);
+ ret=ftp_nb_continue_read(ftp);
}
if (ret != PHP_FTP_MOREDATA && ftp->closestream) {
@@ -732,9 +732,9 @@
}
/* }}} */
-/* {{{ proto bool ftp_async_fput(resource stream, string remote_file, resource fp,
int mode[, int startpos])
- Stores a file from an open file to the FTP server asyncronly */
-PHP_FUNCTION(ftp_async_fput)
+/* {{{ proto bool ftp_nb_fput(resource stream, string remote_file, resource fp, int
+mode[, int startpos])
+ Stores a file from an open file to the FTP server nbronly */
+PHP_FUNCTION(ftp_nb_fput)
{
zval *z_ftp, *z_file;
ftpbuf_t *ftp;
@@ -773,7 +773,7 @@
ftp->direction = 1; /* send */
ftp->closestream = 0; /* do not close */
- if (((ret = ftp_async_put(ftp, remote, stream, xtype, startpos)) ==
PHP_FTP_FAILED)) {
+ if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos)) ==
+PHP_FTP_FAILED)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_LONG(ret);
}
@@ -837,9 +837,9 @@
/* }}} */
-/* {{{ proto bool ftp_async_put(resource stream, string remote_file, string
local_file, int mode[, int startpos])
+/* {{{ proto bool ftp_nb_put(resource stream, string remote_file, string local_file,
+int mode[, int startpos])
Stores a file on the FTP server */
-PHP_FUNCTION(ftp_async_put)
+PHP_FUNCTION(ftp_nb_put)
{
zval *z_ftp;
ftpbuf_t *ftp;
@@ -883,7 +883,7 @@
ftp->direction = 1; /* send */
ftp->closestream = 1; /* do close */
- ret = ftp_async_put(ftp, remote, instream, xtype, startpos);
+ ret = ftp_nb_put(ftp, remote, instream, xtype, startpos);
if (ret != PHP_FTP_MOREDATA) {
php_stream_close(instream);
Index: php4/ext/ftp/php_ftp.h
diff -u php4/ext/ftp/php_ftp.h:1.19 php4/ext/ftp/php_ftp.h:1.20
--- php4/ext/ftp/php_ftp.h:1.19 Fri Jul 26 18:00:25 2002
+++ php4/ext/ftp/php_ftp.h Thu Oct 3 05:10:24 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_ftp.h,v 1.19 2002/07/26 22:00:25 sesser Exp $ */
+/* $Id: php_ftp.h,v 1.20 2002/10/03 09:10:24 sesser Exp $ */
#ifndef _INCLUDED_FTP_H
#define _INCLUDED_FTP_H
@@ -58,11 +58,11 @@
PHP_FUNCTION(ftp_close);
PHP_FUNCTION(ftp_set_option);
PHP_FUNCTION(ftp_get_option);
-PHP_FUNCTION(ftp_async_get);
-PHP_FUNCTION(ftp_async_fget);
-PHP_FUNCTION(ftp_async_put);
-PHP_FUNCTION(ftp_async_fput);
-PHP_FUNCTION(ftp_async_continue);
+PHP_FUNCTION(ftp_nb_get);
+PHP_FUNCTION(ftp_nb_fget);
+PHP_FUNCTION(ftp_nb_put);
+PHP_FUNCTION(ftp_nb_fput);
+PHP_FUNCTION(ftp_nb_continue);
#define phpext_ftp_ptr php_ftp_module_ptr
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php