Annotation of libwww/Library/src/HTAccess.html, revision 2.65
2.9 timbl 1: <HTML>
2: <HEAD>
2.45 frystyk 3: <TITLE>Access manager for libwww</TITLE>
2.65 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 28-Oct-1995 -->
2.19 timbl 5: <NEXTID N="z11">
2.9 timbl 6: </HEAD>
2.5 timbl 7: <BODY>
2.39 frystyk 8:
2.33 frystyk 9: <H1>Access Manager</H1>
2.39 frystyk 10:
2.41 frystyk 11: <PRE>
12: /*
2.50 frystyk 13: ** (c) COPYRIGHT MIT 1995.
2.41 frystyk 14: ** Please first read the full copyright statement in the file COPYRIGH.
15: */
16: </PRE>
17:
2.64 frystyk 18: This module is the application interface module to the <A
19: HREF="HTReq.html">Request Manager</A>. You can use the Request Manager
20: directly but this module makes it easier to use by providing a lot of
21: small request functions using the Request Manager in different
22: ways. It contains help functions for accessing documents and for
2.63 frystyk 23: uploading documents to a remote server.<P>
2.39 frystyk 24:
25: This module is implemented by <A HREF="HTAccess.c">HTAccess.c</A>, and
2.64 frystyk 26: it is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C
27: Reference Library</A>. <P>
2.39 frystyk 28:
2.33 frystyk 29: <PRE>
30: #ifndef HTACCESS_H
1.1 timbl 31: #define HTACCESS_H
2.44 roeber 32:
2.64 frystyk 33: #include "HTReq.h"
34: #include "HTAnchor.h"
2.52 frystyk 35: </PRE>
36:
37: <A NAME="Library"><H2>Initializing and Terminating the Library</H2></A>
38:
2.62 frystyk 39: <IMG SRC="http://www.w3.org/pub/WWW/Icons/32x32/warning.gif">
2.52 frystyk 40: These two functions initiates memory and settings for the Library and
41: cleans up memory kept by the Library when about to exit the
2.65 ! frystyk 42: application. They <B>must</B> be used!
2.52 frystyk 43:
44: <PRE>
2.65 ! frystyk 45: extern BOOL HTLibInit (CONST char * AppName, CONST char * AppVersion);
2.63 frystyk 46: extern BOOL HTLibTerminate (void);
2.65 ! frystyk 47: </PRE>
! 48:
! 49: <H2>Application Name and Version</H2>
! 50:
! 51: Returns the name of the application and the version number that was
! 52: passed to the <CODE>HTLibInit()</CODE> function.
! 53:
! 54: <PRE>
! 55: extern CONST char * HTLib_appName (void);
! 56: extern CONST char * HTLib_appVersion (void);
2.52 frystyk 57: </PRE>
58:
2.64 frystyk 59: <H2>Client Get Started Help</H2>
60:
61: Two small functions that make life easier for client apps
62:
63: <H3>Generate the Anchor for the Home Page</H3>
64:
65: As it involves file access, this should only be done once when the
66: program first runs. This is a default algorithm using the
67: <CODE>WWW_HOME</CODE> environment variable.
68:
69: <PRE>
70: extern HTParentAnchor * HTHomeAnchor (void);
71: </PRE>
72:
73: <H3>Find Related Name</H3>
74:
75: Creates a local file URI that can be used as a relative name when
76: calling HTParse() to expand a relative file name to an absolute
77: one. The code for this routine originates from the Line Mode Browser
78: and was moved here by <EM>howcome@w3.org</EM> in order for all clients
79: to take advantage.<P>
80:
81: <PRE>
82: extern char * HTFindRelatedName (void);
83: </PRE>
84:
2.52 frystyk 85: <A NAME="Addresses"><H2>Default WWW Addresses</H2></A>
86:
87: These control the home page selection. To mess with these for normal browses
88: is asking for user confusion.
89: <PRE>
90: #define LOGICAL_DEFAULT "WWW_HOME" /* Defined to be the home page */
91:
92: #ifndef PERSONAL_DEFAULT
93: #define PERSONAL_DEFAULT "WWW/default.html" /* in home directory */
94: #endif
95:
96: /* If the home page isn't found, use this file: */
97: #ifndef LAST_RESORT
98: #define LAST_RESORT "http://www.w3.org/"
99: #endif
100:
101: /* If one telnets to an access point it will look in this file for home page */
102: #ifndef REMOTE_POINTER
103: #define REMOTE_POINTER "/etc/www-remote.url" /* can't be file */
104: #endif
105:
106: /* and if that fails it will use this. */
107: #ifndef REMOTE_ADDRESS
108: #define REMOTE_ADDRESS "http://www.w3.org/" /* can't be file */
109: #endif
110:
111: #ifndef LOCAL_DEFAULT_FILE
112: #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
113: #endif
114: </PRE>
115:
2.64 frystyk 116: <A NAME="LoadDoc"><H2>Functions for Requesting an Object</H2></A>
2.33 frystyk 117:
2.64 frystyk 118: <H3>Request a document from absolute name</H3>
2.33 frystyk 119:
2.64 frystyk 120: Request a document referencd by an absolute URL. Returns YES if
121: request accepted, else NO
2.33 frystyk 122:
2.64 frystyk 123: <PRE>
124: extern BOOL HTLoadAbsolute (CONST char * url, HTRequest* request);
125: </PRE>
2.51 frystyk 126:
2.64 frystyk 127: <H3>Request a document from absolute name to stream</H3>
2.51 frystyk 128:
2.64 frystyk 129: Request a document referencd by an absolute URL and sending the data
130: down a stream. This is _excactly_ the same as HTLoadAbsolute as the
131: ourputstream is specified using the function.
132: HTRequest_setOutputStream(). 'filter' is ignored! Returns YES if
133: request accepted, else NO
2.34 frystyk 134:
135: <PRE>
2.64 frystyk 136: extern BOOL HTLoadToStream (CONST char * url, BOOL filter, HTRequest *request);
2.34 frystyk 137: </PRE>
138:
2.64 frystyk 139: <H3>Request a document from relative name</H3>
2.39 frystyk 140:
2.64 frystyk 141: Request a document referenced by a relative URL. The relative URL is
142: made absolute by resolving it relative to the address of the 'base'
143: anchor. Returns YES if request accepted, else NO
2.19 timbl 144:
2.39 frystyk 145: <PRE>
2.64 frystyk 146: extern BOOL HTLoadRelative (CONST char * relative,
147: HTParentAnchor * base,
148: HTRequest * request);
2.39 frystyk 149: </PRE>
150:
2.64 frystyk 151: <H3>Request an anchor</H3>
2.46 frystyk 152:
2.64 frystyk 153: Request the document referenced by the anchor Returns YES if request
154: accepted, else NO
2.39 frystyk 155:
156: <PRE>
2.64 frystyk 157: extern BOOL HTLoadAnchor (HTAnchor * anchor, HTRequest * request);
2.39 frystyk 158: </PRE>
159:
2.64 frystyk 160: <H3>Request an anchor</H3>
2.52 frystyk 161:
2.64 frystyk 162: Same as HTLoadAnchor but any information in the Error Stack in the
163: request object is kept, so that any error messages in one This
164: function is almost identical to HTLoadAnchor, but it doesn't clear the
165: error stack so that the information in there is kept. Returns YES if
166: request accepted, else NO
2.51 frystyk 167:
168: <PRE>
2.64 frystyk 169: extern BOOL HTLoadAnchorRecursive (HTAnchor * anchor, HTRequest * request);
2.46 frystyk 170: </PRE>
171:
2.64 frystyk 172: <H3>Search an Anchor</H3>
2.52 frystyk 173:
174: Performs a keyword search on word given by the user. Adds the keyword
175: to the end of the current address and attempts to open the new
2.64 frystyk 176: address. The list of keywords must be a space-separated list and
177: spaces will be converted to '+' before the request is issued. Search
178: can also be performed by HTLoadAbsolute() etc. Returns YES if request
179: accepted, else NO
2.46 frystyk 180:
181: <PRE>
2.64 frystyk 182: extern BOOL HTSearch (CONST char * keywords,
183: HTParentAnchor * base,
184: HTRequest * request);
2.46 frystyk 185: </PRE>
186:
2.64 frystyk 187: <H3>Search a document from absolute name</H3>
2.52 frystyk 188:
2.64 frystyk 189: Request a document referencd by an absolute URL appended with the
190: keywords given. The URL can NOT contain any fragment identifier! The
191: list of keywords must be a space-separated list and spaces will be
192: converted to '+' before the request is issued. Returns YES if request
193: accepted, else NO
2.39 frystyk 194:
195: <PRE>
2.64 frystyk 196: extern BOOL HTSearchAbsolute (CONST char * keywords,
197: CONST char * url,
198: HTRequest * request);
2.39 frystyk 199: </PRE>
200:
2.64 frystyk 201: <H3>Copy an anchor</H3>
2.45 frystyk 202:
2.64 frystyk 203: Fetch the URL (possibly local file URL) and send it using either PUT
204: or POST to the remote destination using HTTP. The caller can decide the
205: exact method used and which HTTP header fields to transmit by setting
206: the user fields in the request structure.
207: Returns YES if request accepted, else NO
2.39 frystyk 208:
2.47 frystyk 209: <PRE>
2.64 frystyk 210: extern BOOL HTCopyAnchor (HTAnchor * src_anchor, HTRequest * main_req);
2.47 frystyk 211: </PRE>
212:
2.52 frystyk 213: <H3>Upload an Anchor</H3>
2.39 frystyk 214:
2.64 frystyk 215: Send the contents (in hyperdoc) of the source anchor using either PUT
216: or POST to the remote destination using HTTP. The caller can decide
217: the exact method used and which HTTP header fields to transmit by
218: setting the user fields in the request structure. Returns YES if
219: request accepted, else NO
2.43 frystyk 220:
221: <PRE>
2.64 frystyk 222: extern BOOL HTUploadAnchor (HTAnchor * src_anchor,
223: HTParentAnchor * dest_anchor,
224: HTRequest * dest_req);
2.46 frystyk 225: </PRE>
226:
2.25 luotonen 227: <PRE>
2.63 frystyk 228: #endif /* HTACCESS_H */
2.38 howcome 229: </PRE>
230:
2.52 frystyk 231: End of Declaration
2.25 luotonen 232: </BODY>
2.9 timbl 233: </HTML>
Webmaster