Annotation of libwww/Library/src/HTAccess.html, revision 2.64
2.9 timbl 1: <HTML>
2: <HEAD>
2.45 frystyk 3: <TITLE>Access manager for libwww</TITLE>
2.64 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 19-Sep-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
42: application. It is highly recommended that they are used!
43:
44: <PRE>
2.63 frystyk 45: extern BOOL HTLibInit (void);
46: extern BOOL HTLibTerminate (void);
2.52 frystyk 47: </PRE>
48:
2.64 ! frystyk 49: <H2>Client Get Started Help</H2>
! 50:
! 51: Two small functions that make life easier for client apps
! 52:
! 53: <H3>Generate the Anchor for the Home Page</H3>
! 54:
! 55: As it involves file access, this should only be done once when the
! 56: program first runs. This is a default algorithm using the
! 57: <CODE>WWW_HOME</CODE> environment variable.
! 58:
! 59: <PRE>
! 60: extern HTParentAnchor * HTHomeAnchor (void);
! 61: </PRE>
! 62:
! 63: <H3>Find Related Name</H3>
! 64:
! 65: Creates a local file URI that can be used as a relative name when
! 66: calling HTParse() to expand a relative file name to an absolute
! 67: one. The code for this routine originates from the Line Mode Browser
! 68: and was moved here by <EM>howcome@w3.org</EM> in order for all clients
! 69: to take advantage.<P>
! 70:
! 71: <PRE>
! 72: extern char * HTFindRelatedName (void);
! 73: </PRE>
! 74:
2.52 frystyk 75: <A NAME="Addresses"><H2>Default WWW Addresses</H2></A>
76:
77: These control the home page selection. To mess with these for normal browses
78: is asking for user confusion.
79: <PRE>
80: #define LOGICAL_DEFAULT "WWW_HOME" /* Defined to be the home page */
81:
82: #ifndef PERSONAL_DEFAULT
83: #define PERSONAL_DEFAULT "WWW/default.html" /* in home directory */
84: #endif
85:
86: /* If the home page isn't found, use this file: */
87: #ifndef LAST_RESORT
88: #define LAST_RESORT "http://www.w3.org/"
89: #endif
90:
91: /* If one telnets to an access point it will look in this file for home page */
92: #ifndef REMOTE_POINTER
93: #define REMOTE_POINTER "/etc/www-remote.url" /* can't be file */
94: #endif
95:
96: /* and if that fails it will use this. */
97: #ifndef REMOTE_ADDRESS
98: #define REMOTE_ADDRESS "http://www.w3.org/" /* can't be file */
99: #endif
100:
101: #ifndef LOCAL_DEFAULT_FILE
102: #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
103: #endif
104: </PRE>
105:
2.64 ! frystyk 106: <A NAME="LoadDoc"><H2>Functions for Requesting an Object</H2></A>
2.33 frystyk 107:
2.64 ! frystyk 108: <H3>Request a document from absolute name</H3>
2.33 frystyk 109:
2.64 ! frystyk 110: Request a document referencd by an absolute URL. Returns YES if
! 111: request accepted, else NO
2.33 frystyk 112:
2.64 ! frystyk 113: <PRE>
! 114: extern BOOL HTLoadAbsolute (CONST char * url, HTRequest* request);
! 115: </PRE>
2.51 frystyk 116:
2.64 ! frystyk 117: <H3>Request a document from absolute name to stream</H3>
2.51 frystyk 118:
2.64 ! frystyk 119: Request a document referencd by an absolute URL and sending the data
! 120: down a stream. This is _excactly_ the same as HTLoadAbsolute as the
! 121: ourputstream is specified using the function.
! 122: HTRequest_setOutputStream(). 'filter' is ignored! Returns YES if
! 123: request accepted, else NO
2.34 frystyk 124:
125: <PRE>
2.64 ! frystyk 126: extern BOOL HTLoadToStream (CONST char * url, BOOL filter, HTRequest *request);
2.34 frystyk 127: </PRE>
128:
2.64 ! frystyk 129: <H3>Request a document from relative name</H3>
2.39 frystyk 130:
2.64 ! frystyk 131: Request a document referenced by a relative URL. The relative URL is
! 132: made absolute by resolving it relative to the address of the 'base'
! 133: anchor. Returns YES if request accepted, else NO
2.19 timbl 134:
2.39 frystyk 135: <PRE>
2.64 ! frystyk 136: extern BOOL HTLoadRelative (CONST char * relative,
! 137: HTParentAnchor * base,
! 138: HTRequest * request);
2.39 frystyk 139: </PRE>
140:
2.64 ! frystyk 141: <H3>Request an anchor</H3>
2.46 frystyk 142:
2.64 ! frystyk 143: Request the document referenced by the anchor Returns YES if request
! 144: accepted, else NO
2.39 frystyk 145:
146: <PRE>
2.64 ! frystyk 147: extern BOOL HTLoadAnchor (HTAnchor * anchor, HTRequest * request);
2.39 frystyk 148: </PRE>
149:
2.64 ! frystyk 150: <H3>Request an anchor</H3>
2.52 frystyk 151:
2.64 ! frystyk 152: Same as HTLoadAnchor but any information in the Error Stack in the
! 153: request object is kept, so that any error messages in one This
! 154: function is almost identical to HTLoadAnchor, but it doesn't clear the
! 155: error stack so that the information in there is kept. Returns YES if
! 156: request accepted, else NO
2.51 frystyk 157:
158: <PRE>
2.64 ! frystyk 159: extern BOOL HTLoadAnchorRecursive (HTAnchor * anchor, HTRequest * request);
2.46 frystyk 160: </PRE>
161:
2.64 ! frystyk 162: <H3>Search an Anchor</H3>
2.52 frystyk 163:
164: Performs a keyword search on word given by the user. Adds the keyword
165: to the end of the current address and attempts to open the new
2.64 ! frystyk 166: address. The list of keywords must be a space-separated list and
! 167: spaces will be converted to '+' before the request is issued. Search
! 168: can also be performed by HTLoadAbsolute() etc. Returns YES if request
! 169: accepted, else NO
2.46 frystyk 170:
171: <PRE>
2.64 ! frystyk 172: extern BOOL HTSearch (CONST char * keywords,
! 173: HTParentAnchor * base,
! 174: HTRequest * request);
2.46 frystyk 175: </PRE>
176:
2.64 ! frystyk 177: <H3>Search a document from absolute name</H3>
2.52 frystyk 178:
2.64 ! frystyk 179: Request a document referencd by an absolute URL appended with the
! 180: keywords given. The URL can NOT contain any fragment identifier! The
! 181: list of keywords must be a space-separated list and spaces will be
! 182: converted to '+' before the request is issued. Returns YES if request
! 183: accepted, else NO
2.39 frystyk 184:
185: <PRE>
2.64 ! frystyk 186: extern BOOL HTSearchAbsolute (CONST char * keywords,
! 187: CONST char * url,
! 188: HTRequest * request);
2.39 frystyk 189: </PRE>
190:
2.64 ! frystyk 191: <H3>Copy an anchor</H3>
2.45 frystyk 192:
2.64 ! frystyk 193: Fetch the URL (possibly local file URL) and send it using either PUT
! 194: or POST to the remote destination using HTTP. The caller can decide the
! 195: exact method used and which HTTP header fields to transmit by setting
! 196: the user fields in the request structure.
! 197: Returns YES if request accepted, else NO
2.39 frystyk 198:
2.47 frystyk 199: <PRE>
2.64 ! frystyk 200: extern BOOL HTCopyAnchor (HTAnchor * src_anchor, HTRequest * main_req);
2.47 frystyk 201: </PRE>
202:
2.52 frystyk 203: <H3>Upload an Anchor</H3>
2.39 frystyk 204:
2.64 ! frystyk 205: Send the contents (in hyperdoc) of the source anchor using either PUT
! 206: or POST to the remote destination using HTTP. The caller can decide
! 207: the exact method used and which HTTP header fields to transmit by
! 208: setting the user fields in the request structure. Returns YES if
! 209: request accepted, else NO
2.43 frystyk 210:
211: <PRE>
2.64 ! frystyk 212: extern BOOL HTUploadAnchor (HTAnchor * src_anchor,
! 213: HTParentAnchor * dest_anchor,
! 214: HTRequest * dest_req);
2.46 frystyk 215: </PRE>
216:
2.25 luotonen 217: <PRE>
2.63 frystyk 218: #endif /* HTACCESS_H */
2.38 howcome 219: </PRE>
220:
2.52 frystyk 221: End of Declaration
2.25 luotonen 222: </BODY>
2.9 timbl 223: </HTML>
Webmaster