update
[midnight-commander.git] / vfs / ftpfs.h
blob9fa3eeffb8b16f6546a5a27b032eda38e37ddd68
1 /* ftpfs.h */
3 #if !defined(__FTPFS_H)
4 #define __FTPFS_H
6 struct direntry
8 char *name;
9 int count;
10 char *linkname;
11 char *local_filename, *remote_filename;
12 int local_is_temp:1;
13 int freshly_created:1;
14 struct stat local_stat;
15 struct stat s;
16 struct stat *l_stat;
17 struct connection *bucket;
19 int data_sock; /* For linear_ operations */
20 int linear_state;
21 #define LS_NONLIN 0 /* Not using linear access at all */
22 #define LS_LINEAR_CLOSED 1 /* Using linear access, but not open, yet */
23 #define LS_LINEAR_OPEN 2 /* Using linear access, open */
26 struct dir
28 int count;
29 struct timeval timestamp;
30 char *remote_path;
31 struct linklist *file_list;
32 int symlink_status;
35 /* valid values for dir->symlink_status */
36 #define FTPFS_NO_SYMLINKS 0
37 #define FTPFS_UNRESOLVED_SYMLINKS 1
38 #define FTPFS_RESOLVED_SYMLINKS 2
39 #define FTPFS_RESOLVING_SYMLINKS 3
41 struct connection {
42 char *host;
43 char *user;
44 char *current_directory;
45 char *home;
46 char *updir;
47 char *password;
48 int port;
49 int sock;
50 struct linklist *dcache;
51 ino_t __inode_counter;
52 int lock;
53 int failed_on_login; /* used to pass the failure reason to upper levels */
54 int use_proxy; /* use a proxy server */
55 int result_pending;
56 int use_source_route;
57 int use_passive_connection;
58 int remote_is_amiga; /* No leading slash allowed for AmiTCP (Amiga) */
59 int isbinary;
60 int cwd_defered; /* current_directory was changed but CWD command hasn't
61 been sent yet */
62 int strict_rfc959_list_cmd; /* ftp server doesn't understand
63 "LIST -la <path>"; use "CWD <path>"/
64 "LIST" instead */
67 #define qhost(b) (b)->host
68 #define quser(b) (b)->user
69 #define qcdir(b) (b)->current_directory
70 #define qport(b) (b)->port
71 #define qsock(b) (b)->sock
72 #define qlock(b) (b)->lock
73 #define qdcache(b) (b)->dcache
74 #define qhome(b) (b)->home
75 #define qupdir(b) (b)->updir
76 #define qproxy(b) (b)->use_proxy
78 /* Increased since now we may use C-r to reread the contents */
79 #define FTPFS_DIRECTORY_TIMEOUT 30 * 60
81 #define DO_RESOLVE_SYMLINK 1
82 #define DO_OPEN 2
83 #define DO_FREE_RESOURCE 4
85 extern char *ftpfs_anonymous_passwd;
86 extern char *ftpfs_proxy_host;
87 extern int ftpfs_directory_timeout;
88 extern int ftpfs_always_use_proxy;
90 void ftpfs_init_passwd ();
91 #endif