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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
/*
* $LynxId: HTAccess.h,v 1.21 2019/08/23 23:51:45 tom Exp $
* HTAccess: Access manager for libwww
* ACCESS MANAGER
*
* This module keeps a list of valid protocol (naming scheme) specifiers with
* associated access code. It allows documents to be loaded given various
* combinations of parameters. New access protocols may be registered at any
* time.
*
* Part of the libwww library .
*
*/
#ifndef HTACCESS_H
#define HTACCESS_H
/* Definition uses:
*/
#include <HTAnchor.h>
#include <HTFormat.h>
#ifdef __cplusplus
extern "C" {
#endif
extern char *use_this_url_instead;
extern int redirection_limit;
extern int redirection_attempts;
/* Return codes from load routines:
*
* These codes may be returned by the protocol modules,
* and by the HTLoad routines.
* In general, positive codes are OK and negative ones are bad.
*/
/*
Default Addresses
These control the home page selection. To mess with these for normal browses is asking
for user confusion.
*/
#define LOGICAL_DEFAULT "WWW_HOME" /* Defined to be the home page */
#ifndef PERSONAL_DEFAULT
#define PERSONAL_DEFAULT "WWW/default.html" /* in home directory */
#endif
#ifndef LOCAL_DEFAULT_FILE
#define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
#endif
/* If one telnets to a www access point,
it will look in this file for home page */
#ifndef REMOTE_POINTER
#define REMOTE_POINTER "/etc/www-remote.url" /* can't be file */
#endif
/* and if that fails it will use this. */
#ifndef REMOTE_ADDRESS
#define REMOTE_ADDRESS "http://www.w3.org/remote.html" /* can't be file */
#endif
/* If run from telnet daemon and no -l specified, use this file:
*/
#ifndef DEFAULT_LOGFILE
#define DEFAULT_LOGFILE "/usr/adm/www-log/www-log"
#endif
/* If the home page isn't found, use this file:
*/
#ifndef LAST_RESORT
#define LAST_RESORT "http://www.w3.org/default.html"
#endif
/*
Flags which may be set to control this module
*/
#ifdef NOT
extern int HTDiag; /* Flag: load source as plain text */
#endif /* NOT */
extern char *HTClientHost; /* Name or number of telnetting host */
extern FILE *HTlogfile; /* File to output one-liners to */
extern BOOL HTSecure; /* Disable security holes? */
extern BOOL HTPermitRedir; /* Special flag for getfile() */
extern HTStream *HTOutputStream; /* For non-interactive, set this */
extern HTFormat HTOutputFormat; /* To convert on load, set this */
/* Check for proxy override. override_proxy()
*
* Check the no_proxy environment variable to get the list
* of hosts for which proxy server is not consulted.
*
* no_proxy is a comma- or space-separated list of machine
* or domain names, with optional :port part. If no :port
* part is present, it applies to all ports on that domain.
*
* Example:
* no_proxy="cern.ch,some.domain:8001"
*
* Use "*" to override all proxy service:
* no_proxy="*"
*/
extern BOOL override_proxy(const char *addr);
/*
Load a document from relative name
ON ENTRY,
relative_name The relative address of the file to be accessed.
here The anchor of the object being searched
ON EXIT,
returns YES Success in opening file
NO Failure
*/
extern BOOL HTLoadRelative(const char *relative_name,
HTParentAnchor *here);
/*
Load a document from absolute name
ON ENTRY,
addr The absolute address of the document to be accessed.
filter_it if YES, treat document as HTML
ON EXIT,
returns YES Success in opening document
NO Failure
*/
extern BOOL HTLoadAbsolute(const DocAddress *addr);
/*
Load a document from absolute name to a stream
ON ENTRY,
addr The absolute address of the document to be accessed.
filter_it if YES, treat document as HTML
ON EXIT,
returns YES Success in opening document
NO Failure
Note: This is equivalent to HTLoadDocument
*/
extern BOOL HTLoadToStream(const char *addr, BOOL filter_it,
HTStream *sink);
/*
Load if necessary, and select an anchor
ON ENTRY,
destination The child or parent anchor to be loaded.
ON EXIT,
returns YES Success
returns NO Failure
*/
extern BOOL HTLoadAnchor(HTAnchor * destination);
/*
Make a stream for Saving object back
ON ENTRY,
anchor is valid anchor which has previously been loaded
ON EXIT,
returns 0 if error else a stream to save the object to.
*/
extern HTStream *HTSaveStream(HTParentAnchor *anchor);
/*
Search
Performs a search on word given by the user. Adds the search words to the end of the
current address and attempts to open the new address.
ON ENTRY,
*keywords space-separated keyword list or similar search list
here The anchor of the object being searched
*/
extern BOOL HTSearch(const char *keywords, HTParentAnchor *here);
/*
Search Given Indexname
Performs a keyword search on word given by the user. Adds the keyword to the end of
the current address and attempts to open the new address.
ON ENTRY,
*keywords space-separated keyword list or similar search list
*indexname is name of object search is to be done on.
*/
extern BOOL HTSearchAbsolute(const char *keywords,
char *indexname);
/*
Register an access method
*/
typedef struct _HTProtocol {
const char *name;
int (*load) (const char *full_address,
HTParentAnchor *anchor,
HTFormat format_out,
HTStream *sink);
HTStream *(*saveStream) (HTParentAnchor *anchor);
} HTProtocol;
extern BOOL HTRegisterProtocol(HTProtocol * protocol);
/*
Generate the anchor for the home page
*/
/*
As it involves file access, this should only be done once when the program first runs.
This is a default algorithm -- browser don't HAVE to use this.
*/
extern HTParentAnchor *HTHomeAnchor(void);
/*
Return Host Name
*/
extern const char *HTHostName(void);
/*
For registering protocols supported by Lynx
*/
extern void LYRegisterLynxProtocols(void);
extern void LYUCPushAssumed(HTParentAnchor *anchor);
extern int LYUCPopAssumed(void);
extern BOOL using_proxy; /* Are we using an NNTP proxy? */
#ifdef __cplusplus
}
#endif
#endif /* HTACCESS_H */
|