File: urldisk.h

package info (click to toggle)
fdclone 3.01b-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 4,772 kB
  • ctags: 8,674
  • sloc: ansic: 100,552; makefile: 4,497; sh: 1,480; sed: 224
file content (198 lines) | stat: -rw-r--r-- 6,606 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*
 *	urldisk.h
 *
 *	definitions & function prototype declarations for "urldisk.c"
 */

#include "dirent.h"
#include "stream.h"
#include "namelist.h"
#include "url.h"
#include "auth.h"

#define	URLNOFILE		16
#define	URLMAXCMDLINE		255
#define	URLENDTIMEOUT		2
#define	FTPANONUSER		"anonymous"
#define	FTPANONPASS		"@"
#define	lazyproxy(uh)		(urlhostlist[uh].prototype == TYPE_HTTP \
				&& urlhostlist[uh].type == TYPE_FTP \
				&& urlhostlist[uh].http \
				&& !((urlhostlist[uh].http) -> server) \
				&& (urlhostlist[uh].http) -> version < 101)

typedef struct _httpstat_t {
	char cwd[MAXPATHLEN];
	int version;
	off_t clength;
	time_t mtim;
	char *server;
	url_t location;
	char *digest;
	int charset;
	int chunk;
	int flags;
} httpstat_t;

#define	HFL_CLENGTH		000001
#define	HFL_MTIME		000002
#define	HFL_LOCATION		000004
#define	HFL_DISCONNECT		000010
#define	HFL_AUTHED		000020
#define	HFL_PROXYAUTHED		000040
#define	HFL_CHUNKED		000100
#define	HFL_OTHERHOST		000200
#define	HFL_BODYLESS		000400

typedef struct _urldev_t {
	XFILE *fp;
	urlhost_t host;
	urlhost_t proxy;
	int type;
	int prototype;
#ifdef	DEP_HTTPPATH
	httpstat_t *http;
	char *redirect;
#endif
	int nlink;
	int options;
	int flags;
} urldev_t;

#define	UOP_NOPASV		000001
#define	UOP_NOPORT		000002
#define	UOP_NOMDTM		000004
#define	UOP_NOFEAT		000010
#define	UOP_FULLSTAT		000020
#define	UOP_NOLISTOPT		000040
#define	UOP_USENLST		000100
#define	UOP_NOSIZE		000200
#define	UFL_LOCKED		000001
#define	UFL_INTRED		000002
#define	UFL_CLOSED		000004
#define	UFL_PROXIED		000010
#define	UFL_RETRYPASV		000100
#define	UFL_RETRYPORT		000200
#define	UFL_FIXLISTOPT		000400

typedef struct _urlstat_t {
	namelist *list;
	int max;
	int uh;
	int nlink;
	char *path;
	int flags;
} urlstat_t;

#define	UFL_FULLLIST		000001

#define	UGP_SCHEME		000001
#define	UGP_USER		000002
#define	UGP_PASS		000004
#define	UGP_HOST		000010
#define	UGP_CWD			000020
#define	UGP_ANON		000100
#define	UGP_ENCODE		000200

extern VOID urlfreestatlist __P_((int));
extern int urlferror __P_((XFILE *));
extern int urlgetreply __P_((int, char **));
extern int urlcommand __P_((int, char **, int, ...));
extern int urlnewstatlist __P_((int, namelist *, int, CONST char *));
extern int urlrecvlist __P_((int *, CONST char *, int));
extern CONST char *urlsplitpath __P_((char *, ALLOC_T, CONST char *));
extern int urlrecvstatus __P_((int *, CONST char *, namelist *, int *, int));
extern int urltracelink __P_((int *, CONST char *, namelist *, int *));
extern int urlreconnect __P_((int));
extern int urlopendev __P_((CONST char *, int));
extern VOID urlclosedev __P_((int));
extern int urlgenpath __P_((int, char *, ALLOC_T, int));
extern int urlchdir __P_((int, CONST char *));
extern char *urlgetcwd __P_((int, char *, ALLOC_T));
extern DIR *urlopendir __P_((CONST char *, int, CONST char *));
extern int urlclosedir __P_((DIR *));
extern struct dirent *urlreaddir __P_((DIR *));
extern VOID urlrewinddir __P_((DIR *));
extern int urlstat __P_((CONST char *, int, CONST char *, struct stat *));
extern int urllstat __P_((CONST char *, int, CONST char *, struct stat *));
extern int urlaccess __P_((CONST char *, int, CONST char *, int));
extern int urlreadlink __P_((CONST char *, int, CONST char *, char *, int));
extern int urlchmod __P_((CONST char *, int, CONST char *, int));
extern int urlunlink __P_((CONST char *, int, CONST char *));
extern int urlrename __P_((CONST char *, int, CONST char *, CONST char *));
extern VOID urlputopenlist __P_((int, int, CONST char *, int));
extern int urldelopenlist __P_((int));
extern int urlopen __P_((CONST char *, int, CONST char *, int));
extern int urlclose __P_((int));
extern int urlfstat __P_((int, struct stat *));
extern int urlselect __P_((int));
extern int urlread __P_((int, char *, int));
extern int urlwrite __P_((int, CONST char *, int));
extern int urldup2 __P_((int, int));
extern int urlmkdir __P_((CONST char *, int, CONST char *));
extern int urlrmdir __P_((CONST char *, int, CONST char *));
extern int urlallclose __P_((VOID_A));
#ifdef	DEP_FTPPATH
extern int ftpgetreply __P_((XFILE *, char **));
extern int ftpseterrno __P_((int));
extern int vftpcommand __P_((int, char **, int, va_list));
extern int ftpquit __P_((int));
extern int ftpabort __P_((int));
extern int ftplogin __P_((int));
extern int ftprecvlist __P_((int, CONST char *, namelist **));
extern int ftprecvstatus __P_((int, CONST char *, namelist *, int, int));
extern int ftpchdir __P_((int, CONST char *));
extern char *ftpgetcwd __P_((int, char *, ALLOC_T));
extern int ftpchmod __P_((int, CONST char *, int));
extern int ftpunlink __P_((int, CONST char *));
extern int ftprename __P_((int, CONST char *, CONST char *));
extern int ftpopen __P_((int, CONST char *, int));
extern int ftpclose __P_((int, int));
extern int ftpfstat __P_((int, struct stat *));
extern int ftpread __P_((int, int, char *, int));
extern int ftpwrite __P_((int, int, CONST char *, int));
extern int ftpmkdir __P_((int, CONST char *));
extern int ftprmdir __P_((int, CONST char *));
#endif	/* DEP_FTPPATH */
#ifdef	DEP_HTTPPATH
extern VOID httpreset __P_((int, int));
extern int httpgetreply __P_((int, char **));
extern int httpseterrno __P_((int));
extern int vhttpcommand __P_((int, char **, int, va_list));
extern int httprecvlist __P_((int, CONST char *, namelist **));
extern int httprecvstatus __P_((int, CONST char *, namelist *, int, int *));
extern int httpchdir __P_((int, CONST char *));
extern char *httpgetcwd __P_((int, char *, ALLOC_T));
extern int httpchmod __P_((int, CONST char *, int));
extern int httpunlink __P_((int, CONST char *));
extern int httprename __P_((int, CONST char *, CONST char *));
extern int httpopen __P_((int, CONST char *, int));
extern int httpclose __P_((int, int));
extern int httpfstat __P_((int, struct stat *));
extern int httpread __P_((int, int, char *, int));
extern int httpwrite __P_((int, int, CONST char *, int));
extern int httpmkdir __P_((int, CONST char *));
extern int httprmdir __P_((int, CONST char *));
extern int httpreopen __P_((int, int));
extern int httprerecvlist __P_((int *, namelist **));
extern int httprerecvstatus __P_((int *, namelist *, int *));
#endif	/* DEP_HTTPPATH */

extern int urloptions;
extern int urltimeout;
extern int urlkcode;
extern urldev_t urlhostlist[];
extern int maxurlhost;
extern urlstat_t *urlstatlist;
extern int maxurlstat;
extern char *logheader;
#ifdef	DEP_FTPPATH
extern char *ftpaddress;
extern char *ftpproxy;
extern char *ftplogfile;
#endif
#ifdef	DEP_HTTPPATH
extern char *httpproxy;
extern char *httplogfile;
extern char *htmllogfile;
#endif