/* {{{ ftp_open
*/
ftpbuf_t*
-ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC)
+ftp_open(const char *host, short port, php_int_t timeout_sec TSRMLS_DC)
{
ftpbuf_t *ftp;
socklen_t size;
{
#if HAVE_OPENSSL_EXT
SSL_CTX *ctx = NULL;
- long ssl_ctx_options = SSL_OP_ALL;
+ php_int_t ssl_ctx_options = SSL_OP_ALL;
#endif
if (ftp == NULL) {
return 0;
/* {{{ ftp_alloc
*/
int
-ftp_alloc(ftpbuf_t *ftp, const long size, zend_string **response)
+ftp_alloc(ftpbuf_t *ftp, const php_int_t size, zend_string **response)
{
char buffer[64];
/* {{{ ftp_get
*/
int
-ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC)
+ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, php_int_t resumepos TSRMLS_DC)
{
databuf_t *data = NULL;
size_t rcvd;
/* {{{ ftp_put
*/
int
-ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC)
+ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, php_int_t startpos TSRMLS_DC)
{
databuf_t *data = NULL;
- long size;
+ php_int_t size;
char *ptr;
int ch;
char arg[11];
/* {{{ ftp_size
*/
-long
+php_int_t
ftp_size(ftpbuf_t *ftp, const char *path)
{
if (ftp == NULL) {
int
my_send(ftpbuf_t *ftp, php_socket_t s, void *buf, size_t len)
{
- long size, sent;
+ php_int_t size, sent;
int n;
size = len;
#if HAVE_OPENSSL_EXT
SSL_CTX *ctx;
- long ssl_ctx_options = SSL_OP_ALL;
+ php_int_t ssl_ctx_options = SSL_OP_ALL;
#endif
if (data->fd != -1) {
/* {{{ ftp_nb_get
*/
int
-ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC)
+ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, php_int_t resumepos TSRMLS_DC)
{
databuf_t *data = NULL;
char arg[11];
/* {{{ ftp_nb_put
*/
int
-ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC)
+ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, php_int_t startpos TSRMLS_DC)
{
databuf_t *data = NULL;
char arg[11];
ftptype_t type; /* current transfer type */
int pasv; /* 0=off; 1=pasv; 2=ready */
php_sockaddr_storage pasvaddr; /* passive mode address */
- long timeout_sec; /* User configureable timeout (seconds) */
+ php_int_t timeout_sec; /* User configureable timeout (seconds) */
int autoseek; /* User configureable autoseek flag */
int nb; /* "nonblocking" transfer in progress */
/* open a FTP connection, returns ftpbuf (NULL on error)
* port is the ftp port in network byte order, or 0 for the default
*/
-ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC);
+ftpbuf_t* ftp_open(const char *host, short port, php_int_t timeout_sec TSRMLS_DC);
/* quits from the ftp session (it still needs to be closed)
* return true on success, false on error
* however some servers will not accept STOR or APPE until ALLO is confirmed.
* If response is passed, it is estrdup()ed from ftp->inbuf and must be freed
* or assigned to a zval returned to the user */
-int ftp_alloc(ftpbuf_t *ftp, const long size, zend_string **response);
+int ftp_alloc(ftpbuf_t *ftp, const php_int_t size, zend_string **response);
/* returns a NULL-terminated array of filenames in the given path
* or NULL on error. the return array must be freed (but don't
/* retrieves a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC);
+int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, php_int_t resumepos TSRMLS_DC);
/* 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_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC);
+int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, php_int_t startpos TSRMLS_DC);
/* returns the size of the given file, or -1 on error */
-long ftp_size(ftpbuf_t *ftp, const char *path);
+php_int_t ftp_size(ftpbuf_t *ftp, const char *path);
/* returns the last modified time of the given file, or -1 on error */
time_t ftp_mdtm(ftpbuf_t *ftp, const char *path);
/* retrieves part of a file and saves its contents to outfp
* returns true on success, false on error
*/
-int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC);
+int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, php_int_t resumepos TSRMLS_DC);
/* 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_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, long startpos TSRMLS_DC);
+int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, php_int_t startpos TSRMLS_DC);
/* continues a previous nb_(f)get command
*/
ftpbuf_t *ftp;
char *host;
int host_len;
- long port = 0;
- long timeout_sec = FTP_DEFAULT_TIMEOUT;
+ php_int_t port = 0;
+ php_int_t timeout_sec = FTP_DEFAULT_TIMEOUT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ii", &host, &host_len, &port, &timeout_sec) == FAILURE) {
return;
}
ftpbuf_t *ftp;
char *host;
int host_len;
- long port = 0;
- long timeout_sec = FTP_DEFAULT_TIMEOUT;
+ php_int_t port = 0;
+ php_int_t timeout_sec = FTP_DEFAULT_TIMEOUT;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ii", &host, &host_len, &port, &timeout_sec) == FAILURE) {
return;
}
ftpbuf_t *ftp;
char *filename;
int filename_len;
- long mode;
+ php_int_t mode;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlp", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rip", &z_ftp, &mode, &filename, &filename_len) == FAILURE) {
RETURN_FALSE;
}
{
zval *z_ftp, *zresponse = NULL;
ftpbuf_t *ftp;
- long size, ret;
+ php_int_t size, ret;
zend_string *response = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &z_ftp, &size, &zresponse) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri|z/", &z_ftp, &size, &zresponse) == FAILURE) {
RETURN_FALSE;
}
php_stream *stream;
char *file;
int file_len;
- long mode, resumepos=0;
+ php_int_t mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsi|i", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
php_stream *stream;
char *file;
int file_len;
- long mode, resumepos=0, ret;
+ php_int_t mode, resumepos=0, ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsi|i", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
php_stream *outstream;
char *local, *remote;
int local_len, remote_len;
- long mode, resumepos=0;
+ php_int_t mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppi|i", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
php_stream *outstream;
char *local, *remote;
int local_len, remote_len, ret;
- long mode, resumepos=0;
+ php_int_t mode, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssi|i", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
{
zval *z_ftp;
ftpbuf_t *ftp;
- long ret;
+ php_int_t ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) {
return;
ftpbuf_t *ftp;
ftptype_t xtype;
int remote_len;
- long mode, startpos=0;
+ php_int_t mode, startpos=0;
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsri|i", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
ftpbuf_t *ftp;
ftptype_t xtype;
int remote_len, ret;
- long mode, startpos=0;
+ php_int_t mode, startpos=0;
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsri|i", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
ftpbuf_t *ftp;
ftptype_t xtype;
char *remote, *local;
- long remote_len, local_len;
- long mode, startpos=0;
+ php_int_t remote_len, local_len;
+ php_int_t mode, startpos=0;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppi|i", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
ftptype_t xtype;
char *remote, *local;
int remote_len, local_len;
- long mode, startpos=0, ret;
+ php_int_t mode, startpos=0, ret;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rppi|i", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
PHP_FUNCTION(ftp_set_option)
{
zval *z_ftp, *z_value;
- long option;
+ php_int_t option;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_ftp, &option, &z_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riz", &z_ftp, &option, &z_value) == FAILURE) {
return;
}
PHP_FUNCTION(ftp_get_option)
{
zval *z_ftp;
- long option;
+ php_int_t option;
ftpbuf_t *ftp;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_ftp, &option) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ri", &z_ftp, &option) == FAILURE) {
return;
}