File: qftp.cc

package info (click to toggle)
qftp 0.98-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 216 kB
  • ctags: 235
  • sloc: cpp: 2,017; makefile: 77
file content (44 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 *  qftp
 *  Copyright (C) 1997,1998 Peter Strand
 *  Distributed under the GNU Pulic Licence
 */

#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>

#include "ftpconn.h"
#include "txtif.h"
#include "conf.h"

#include "hosts.h"

int main(int argc, char *argv[])
{
	TxtIF *txtif;
	Conf gconf;
	Hosts hosts;
	int fd;
	char tmp[200], *p;

	p = getenv("HOME");
	if (p) {
		strcat(tmp, p);
		strcat(tmp, "/.qftprc");	
		fd = open(tmp, O_RDONLY);
		hosts.Parse(fd, gconf);
		close(fd);
	}
	gconf.Parse(gconf, argc, argv, "abcefhlnqzy:u:ABCEFLNQZ");
	txtif = new TxtIF(new FtpConn, gconf, &hosts);
	if (argv[1] && argv[1][0] == '-' && argv[1][1] == 'h') {
		txtif->Khelp(-1, argv);
		exit(0);
	}
	if (gconf.Args())
		txtif->Open(argc, argv);
	txtif->go();
	return 0;
}