#include <sys/stat.h>
-#if !defined(WIN32)
+#ifndef _WIN32
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/time.h>
off_t restart_point = 0;
SOCKET cin, cout;
-int dataconn(char *mode);
+int dataconn(const char *mode);
-int command(char *fmt, ...);
+int command(const char *fmt, ...);
char *hostname;
return ((char *)0);
}
-int login(char *host)
+int login(const char *host)
{
char tmp[80];
- char *user, *pass, *acct;
+ char *puser, *ppass, *pacct;
+ const char *user, *pass, *acct;
int n, aflag = 0;
user = pass = acct = 0;
- if (ruserpass(host, &user, &pass, &acct) < 0) {
+ if (ruserpass(host, &puser, &ppass, &pacct) < 0) {
code = -1;
return(0);
}
+ user = puser;
+ pass = ppass;
+ acct = pacct;
while (user == NULL) {
- char *myname = "none"; // This needs to become the usename env
+ const char *myname = "none"; // This needs to become the usename env
if (myname)
printf("Name (%s:%s): ", host, myname);
return (1);
}
-void
+static void
cmdabort(int sig)
{
extern jmp_buf ptabort;
}
/*VARARGS1*/
-int command(char *fmt, ...)
+int command(const char *fmt, ...)
{
va_list ap;
int r;
}
}
-int
+static int
empty(mask, sec)
struct fd_set *mask;
int sec;
jmp_buf sendabort;
+#if 0
void abortsend()
{
(void) fflush(stdout);
longjmp(sendabort, 1);
}
+#endif
#define HASHBYTES 1024
-void sendrequest(char *cmd, char *local, char *remote, int printnames)
+void sendrequest(const char *cmd, const char *local, const char *remote, int printnames)
{
FILE *fin;
int dout = 0;
int (*closefunc)(), _pclose(), fclose();
sig_t (*oldintr)(), (*oldintp)();
- void abortsend();
char buf[BUFSIZ], *bufp;
long bytes = 0, hashbytes = HASHBYTES;
register int c, d;
struct stat st;
struct timeval start, stop;
- char *mode;
+ const char *mode;
if (verbose && printnames) {
if (local && *local != '-')
jmp_buf recvabort;
-
+#if 0
void abortrecv()
{
(void) fflush(stdout);
longjmp(recvabort, 1);
}
+#endif
-void recvrequest(char *cmd, char *local, char *remote, char *mode,
+void recvrequest(const char *cmd, const char *local, const char *remote, const char *mode,
int printnames)
{
- FILE *fout;
+ FILE *fout = stdout;
int din = 0;
int (*closefunc)(), _pclose(), fclose();
void (*oldintr)(int), (*oldintp)(int);
- void abortrecv();
int oldverbose = 0, oldtype = 0, is_retr, tcrflag, nfnd, bare_lfs = 0;
- char *gunique(), msg;
+ char msg;
// static char *buf; // Szurgot: Shouldn't this go SOMEWHERE?
char buf[1024];
static int bufsize = 1024;
return (1);
}
-int dataconn(char *mode)
+int dataconn(const char *mode)
{
struct sockaddr_in from;
int s, fromlen = sizeof (from);
}
void ptransfer(direction, bytes, t0, t1)
- char *direction;
+ const char *direction;
long bytes;
struct timeval *t0, *t1;
{
s = td.tv_sec + (td.tv_usec / 1000000.);
#define nz(x) ((x) == 0 ? 1 : (x))
bs = bytes / nz(s);
- printf("%ld bytes %s in %.2g seconds (%.2g Kbytes/s)\n",
+ printf("%ld bytes %s in %.1f seconds (%.0f Kbytes/s)\n",
bytes, direction, s, bs / 1024.);
(void) fflush(stdout);
}
jmp_buf ptabort;
int ptabflg;
+#if 0
void
abortpt()
{
abrtflag = 0;
longjmp(ptabort, 1);
}
+#endif
void proxtrans(cmd, local, remote)
- char *cmd, *local, *remote;
+ const char *cmd, *local, *remote;
{
// void (*oldintr)(int);
- //void abortpt(int);
int tmptype, oldtype = 0, secndflag = 0, nfnd;
extern jmp_buf ptabort;
- char *cmd2;
+ const char *cmd2;
// struct
fd_set mask;
}
}
+#if 0
char *
gunique(local)
char *local;
}
return(new);
}
+#endif
int null(void)
{