Implement an ftpVerbose() hook.

Submitted by: jmz
This commit is contained in:
Jordan K. Hubbard 1996-07-04 00:55:21 +00:00
parent 41aa7251bb
commit 89689cf8c9
3 changed files with 22 additions and 2 deletions

View File

@ -36,6 +36,7 @@
.Nm ftpPut ,
.Nm ftpBinary ,
.Nm ftpPassive ,
.Nm ftpVerbose ,
.Nm ftpGetURL ,
.Nm ftpPutURL
.Nd FTPIO User library
@ -61,6 +62,8 @@
.Fn ftpBinary "FILE *stream"
.Ft int
.Fn ftpPassive "FILE *stream, int status"
.Ft void
.Fn ftpVerbose "FILE *stream, int status"
.Ft FILE *
.Fn ftpGetURL "char *url, char *user, char *passwd"
.Ft FILE *
@ -144,6 +147,12 @@ sets passive mode (for firewalls) for the current server connection named by
to boolean value
.Fa status .
.Pp
.Fn ftpVerbose
sets the verbosity mode for the current server connection named by
.Fa stream
to boolean value
.Fa status .
.Pp
.Fn ftpGetURL
attempts to retreive the file named by the supplied
.Fa URL

View File

@ -14,7 +14,7 @@
* Turned inside out. Now returns xfers as new file ids, not as a special
* `state' of FTP_t
*
* $Id: ftpio.c,v 1.6 1996/06/17 23:16:04 jkh Exp $
* $Id: ftpio.c,v 1.7 1996/06/22 21:43:54 jkh Exp $
*
*/
@ -139,6 +139,12 @@ ftpBinary(FILE *fp)
ftp->is_binary = TRUE;
return SUCCESS;
}
void
ftpVerbose(FILE *fp, int status)
{
FTP_t ftp = fcookie(fp);
ftp->is_verbose = status;
}
int
ftpChdir(FILE *fp, char *dir)
@ -360,6 +366,7 @@ ftp_new(void)
ftp->con_state = init;
ftp->is_binary = FALSE;
ftp->is_passive = FALSE;
ftp->is_verbose = FALSE;
ftp->errno = 0;
return ftp;
}
@ -448,6 +455,8 @@ get_a_line(FTP_t ftp)
if (!i)
continue;
buf[i] = '\0';
if (ftp->is_verbose == TRUE)
printf("%s\n",buf+4);
return buf;
}
i++;

View File

@ -20,7 +20,7 @@
* Turned inside out. Now returns xfers as new file ids, not as a special
* `state' of FTP_t
*
* $Id: ftpio.h,v 1.3 1996/06/22 21:43:56 jkh Exp $
* $Id: ftpio.h,v 1.4 1996/06/26 20:31:11 gpalmer Exp $
*/
/* Internal housekeeping data structure for FTP sessions */
@ -33,6 +33,7 @@ typedef struct {
int errno;
int is_binary;
int is_passive;
int is_verbose;
} *FTP_t;
/* Exported routines - deal only with FILE* type */
@ -45,6 +46,7 @@ extern FILE *ftpPut(FILE *fp, char *file);
extern int ftpAscii(FILE *fp);
extern int ftpBinary(FILE *fp);
extern int ftpPassive(FILE *fp, int status);
extern void ftpVerbose(FILE *fp, int status);
extern FILE *ftpGetURL(char *url, char *user, char *passwd);
extern FILE *ftpPutURL(char *url, char *user, char *passwd);
extern time_t ftpGetModtime(FILE *fp, char *s);