summaryrefslogtreecommitdiff
path: root/ext/ftp
diff options
context:
space:
mode:
authorStefan Esser <sesser@php.net>2002-10-03 09:10:24 +0000
committerStefan Esser <sesser@php.net>2002-10-03 09:10:24 +0000
commit8827f8eca9ed8fbad3254f4640862f1577651733 (patch)
tree5b1d732210781d9dc0e5791632b2b159bed2ec07 /ext/ftp
parentaadb0c910b22d2b9f4a505f57e7b52b1ab918d15 (diff)
downloadphp-git-8827f8eca9ed8fbad3254f4640862f1577651733.tar.gz
renamed ftp_async_* into ftp_nb_*
Diffstat (limited to 'ext/ftp')
-rw-r--r--ext/ftp/ftp.c36
-rw-r--r--ext/ftp/ftp.h18
-rw-r--r--ext/ftp/php_ftp.c52
-rw-r--r--ext/ftp/php_ftp.h10
4 files changed, 58 insertions, 58 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 923cbf2f59..50678ce66c 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -138,7 +138,7 @@ ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
/* 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_reinit(ftpbuf_t *ftp)
ftp_gc(ftp);
- ftp->async = 0;
+ ftp->nb = 0;
if (!ftp_putcmd(ftp, "REIN", NULL))
return 0;
@@ -1381,10 +1381,10 @@ bail:
}
/* }}} */
-/* {{{ 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_async_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t
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 @@ bail:
}
/* }}} */
-/* {{{ 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 @@ ftp_async_continue_read(ftpbuf_t *ftp)
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_async_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t t
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 @@ bail:
/* }}} */
-/* {{{ 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 @@ ftp_async_continue_write(ftpbuf_t *ftp)
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;
}
/* }}} */
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index 40cab76a1e..f4c816a3d3 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -68,9 +68,9 @@ typedef struct ftpbuf
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 @@ int ftp_site(ftpbuf_t *ftp, const char *cmd);
/* 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
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index b7d00e57b9..55fcdb0b59 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -71,11 +71,11 @@ function_entry php_ftp_functions[] = {
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 @@ PHP_FUNCTION(ftp_fget)
}
/* }}} */
-/* {{{ 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 @@ PHP_FUNCTION(ftp_async_fget)
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 @@ PHP_FUNCTION(ftp_get)
}
/* }}} */
-/* {{{ 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 @@ PHP_FUNCTION(ftp_async_get)
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 @@ PHP_FUNCTION(ftp_async_get)
}
/* }}} */
-/* {{{ 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 @@ PHP_FUNCTION(ftp_async_continue)
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 @@ PHP_FUNCTION(ftp_fput)
}
/* }}} */
-/* {{{ 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 @@ PHP_FUNCTION(ftp_async_fput)
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 @@ PHP_FUNCTION(ftp_put)
/* }}} */
-/* {{{ 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 @@ PHP_FUNCTION(ftp_async_put)
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);
diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h
index f22697779c..e0f7bd7871 100644
--- a/ext/ftp/php_ftp.h
+++ b/ext/ftp/php_ftp.h
@@ -58,11 +58,11 @@ PHP_FUNCTION(ftp_site);
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