summaryrefslogtreecommitdiffstats
path: root/usr.bin/ncftp/open.h
blob: 7be8ccbbe1d5ac85811ef202562d265392c827ee (plain)
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
45
46
47
48
49
50
/* open.h */

#ifndef _open_h_
#define _open_h_ 1

/* Variables for Open() that can be changed from the command line. */
typedef struct OpenOptions {
	int				openmode;
	int				ignore_rc;
	unsigned int	port;
	int				redial_delay;
	int				max_dials;
	int				ftpcat;
	Hostname		hostname;
	longstring		cdpath;
	longstring		colonmodepath;
} OpenOptions;

typedef struct RemoteSiteInfo {
	int				hasSIZE;
	int				hasMDTM;
} RemoteSiteInfo;

/* Open modes. */
#define openImplicitAnon 1
#define openImplicitUser 4
#define openExplicitAnon 3
#define openExplicitUser 2

#define ISUSEROPEN(a) ((a==openImplicitUser)||(a==openExplicitUser))
#define ISANONOPEN(a) (!ISUSEROPEN(a))
#define ISEXPLICITOPEN(a) ((a==openExplicitAnon)||(a==openExplicitUser))
#define ISIMPLICITOPEN(a) (!ISEXPLICITOPEN(a))

/* ftpcat modes. */
#define NO_FTPCAT	0
#define FTPCAT		1
#define FTPMORE		2

/* Protos: */
void InitOpenOptions(OpenOptions *openopt);
int GetOpenOptions(int argc, char **argv, OpenOptions *openopt);
int CheckForColonMode(OpenOptions *openopt, int *login_verbosity);
int HookupToRemote(OpenOptions *openopt);
void CheckRemoteSystemType(int);
void ColonMode(OpenOptions *openopt);
int Open(OpenOptions *openopt);
int cmdOpen(int argc, char **argv);

#endif	/* _open_h_ */
OpenPOWER on IntegriCloud