forked from alandipert/ncsa-mosaic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHTAccess.h
164 lines (97 loc) · 3.47 KB
/
HTAccess.h
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
/* 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 "HTUtils.h"
#include "tcp.h"
#include "HTAnchor.h"
#include "HTFormat.h"
#ifdef SHORT_NAMES
#define HTClientHost HTClHost
#define HTOutputStream HTOuStre
#define HTOutputFormat HTOuForm
#endif
/* 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.
*/
#define HT_NO_DATA -9999 /* return code: OK but no data was loaded */
/* Typically, other app started or forked */
/*
Flags which may be set to control this module
*/
extern int HTDiag; /* Flag: load source as plain text */
extern char * HTClientHost; /* Name or number of telnetting host */
extern FILE * logfile; /* File to output one-liners to */
extern HTStream* HTOutputStream; /* For non-interactive, set this */
extern HTFormat HTOutputFormat; /* To convert on load, set this */
/*
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 PARAMS((
WWW_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 if YES, treat document as HTML
*/
/*
ON EXIT,
*/
/*
returns YES Success in opening document
NO Failure
*/
extern int HTLoadAbsolute PARAMS((WWW_CONST char * addr));
/*
Load a document from absolute name to a stream
ON ENTRY,
addr The absolute address of the document to be accessed.
filter 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 PARAMS((WWW_CONST char * addr, BOOL filter,
HTStream * sink));
/*
Make a stream for Saving object back
ON ENTRY,
anchor is valid anchor which has previously beeing loaded
ON EXIT,
returns 0 if error else a stream to save the object to.
*/
extern HTStream * HTSaveStream PARAMS((HTParentAnchor * anchor));
/*
Register an access method
*/
typedef struct _HTProtocol {
char * name;
int (*load)PARAMS((
WWW_CONST char * full_address,
HTParentAnchor * anchor,
HTFormat format_out,
HTStream* sink));
HTStream* (*saveStream)PARAMS((HTParentAnchor * anchor));
} HTProtocol;
extern BOOL HTRegisterProtocol PARAMS((HTProtocol * protocol));
#endif /* HTACCESS_H */