Annotation of libwww/Library/src/HTAccess.html, revision 1.1
1.1 ! timbl 1: <PRE>
! 2: /* Access Manager HTAccess.h
! 3: ** ==============
! 4: **
! 5: ** This module keeps a list of valid protocol (naming scheme) specifiers
! 6: ** with associated access code. It allows documents to be loaded given
! 7: ** various combinations of parameters.
! 8: **
! 9: ** New access protocols may be registered at any time.
! 10: **
! 11: */
! 12:
! 13: #ifndef HTACCESS_H
! 14: #define HTACCESS_H
! 15:
! 16: /* Definition uses:
! 17: */
! 18: #include "HTUtils.h"
! 19: #include "tcp.h"
! 20: #include "HTAnchor.h"
! 21: #include "HTFormat.h"
! 22:
! 23: #ifdef SHORT_NAMES
! 24: #define HTClientHost HTClHost
! 25: #endif
! 26:
! 27: /* Return codes from load routines:
! 28: **
! 29: ** These codes may be returned by the protocol modules,
! 30: ** and by the HTLoad routines.
! 31: ** In general, positive codes are OK and negative ones are bad.
! 32: */
! 33:
! 34: #define HT_NO_DATA -9999 /* return code: OK but no data was loaded */
! 35: /* Typically, other app started or forked */
! 36:
! 37: /* Default Addresses */
! 38: /* ================= */
! 39:
! 40: #define LOGICAL_DEFAULT "WWW_HOME" /* Defined to be the home page */
! 41:
! 42:
! 43: #ifndef LOCAL_DEFAULT
! 44: #define LOCAL_DEFAULT "file:/usr/local/lib/WWW/default.html"
! 45: #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
! 46: #define REMOTE_ADDRESS "http://info.cern.ch/remote.html" /* can't be file */
! 47: #endif
! 48:
! 49: /* If run from telnet daemon and no -l specified, use this file:
! 50: */
! 51: #ifndef DEFAULT_LOGFILE
! 52: #define DEFAULT_LOGFILE "/usr/adm/www-log/www-log"
! 53: #endif
! 54:
! 55: /* If the home page isn't found, use this file:
! 56: */
! 57: #ifndef LAST_RESORT
! 58: #define LAST_RESORT "http://info.cern.ch:80/default.html"
! 59: #endif
! 60:
! 61:
! 62: /* Flags which may be set to control this module
! 63: */
! 64: extern int HTDiag; /* Flag: load source as plain text */
! 65: extern char * HTClientHost; /* Name or number of telnetting host */
! 66: extern FILE * logfile; /* File to output one-liners to */
! 67: extern HTStream* HTOutputStream; /* For non-interactive, set this */
! 68: extern HTFormat HTOutputFormat; /* To convert on load, set this */
! 69:
! 70:
! 71: /* Load a document
! 72: ** ---------------
! 73: **
! 74: ** On Entry,
! 75: ** anchor is the node_anchor for the document
! 76: ** full_address The address of the document to be accessed.
! 77: ** filter if YES, treat stdin as HTML
! 78: **
! 79: ** On Exit,
! 80: ** returns YES Success in opening document
! 81: ** NO Failure
! 82: **
! 83: */
! 84:
! 85: #ifdef NOT_USED
! 86: extern BOOL HTLoadDocument PARAMS((HTParentAnchor * anchor,
! 87: CONST char * full_address,
! 88: BOOL filter,
! 89: HTStream* sink));
! 90: #endif
! 91:
! 92:
! 93: /* Load a document from relative name
! 94: ** ---------------
! 95: **
! 96: ** On Entry,
! 97: ** relative_name The relative address of the file to be accessed.
! 98: ** here The anchor of the object being searched
! 99: **
! 100: ** On Exit,
! 101: ** returns YES Success in opening file
! 102: ** NO Failure
! 103: **
! 104: **
! 105: */
! 106:
! 107: extern BOOL HTLoadRelative PARAMS((
! 108: CONST char * relative_name,
! 109: HTParentAnchor * here));
! 110:
! 111:
! 112: /* Load a document from absolute name
! 113: ** ---------------
! 114: **
! 115: ** On Entry,
! 116: ** addr The absolute address of the document to be accessed.
! 117: ** filter if YES, treat document as HTML
! 118: **
! 119: ** On Exit,
! 120: ** returns YES Success in opening document
! 121: ** NO Failure
! 122: **
! 123: ** Note: This is equivalent to HTLoadDocument
! 124: */
! 125:
! 126: extern BOOL HTLoadAbsolute PARAMS((CONST char * addr));
! 127:
! 128:
! 129: /* Load a document from absolute name to a stream
! 130: ** ---------------
! 131: **
! 132: ** On Entry,
! 133: ** addr The absolute address of the document to be accessed.
! 134: ** filter if YES, treat document as HTML
! 135: **
! 136: ** On Exit,
! 137: ** returns YES Success in opening document
! 138: ** NO Failure
! 139: **
! 140: ** Note: This is equivalent to HTLoadDocument
! 141: */
! 142:
! 143: extern BOOL HTLoadToStream PARAMS((CONST char * addr, BOOL filter,
! 144: HTStream * sink));
! 145:
! 146:
! 147: /* Load if necessary, and select an anchor
! 148: ** --------------------------------------
! 149: **
! 150: ** On Entry,
! 151: ** destination The child or parenet anchor to be loaded.
! 152: **
! 153: ** On Exit,
! 154: ** returns YES Success
! 155: ** NO Failure
! 156: **
! 157: */
! 158:
! 159: extern BOOL HTLoadAnchor PARAMS((HTAnchor * destination));
! 160:
! 161:
! 162: /* Make a stream for Saving object back
! 163: ** ------------------------------------
! 164: **
! 165: ** On Entry,
! 166: ** anchor is valid anchor which has previously beeing loaded
! 167: ** On exit,
! 168: ** returnes 0 if error else a stream to save the object to.
! 169: **
! 170: */
! 171: extern HTStream * HTSaveStream PARAMS((HTParentAnchor * anchor));
! 172:
! 173:
! 174: /* Search
! 175: ** ------
! 176: ** Performs a search on word given by the user. Adds the search words to
! 177: ** the end of the current address and attempts to open the new address.
! 178: **
! 179: ** On Entry,
! 180: ** *keywords space-separated keyword list or similar search list
! 181: ** here The anchor of the object being searched
! 182: */
! 183:
! 184: extern BOOL HTSearch PARAMS((CONST char * keywords, HTParentAnchor* here));
! 185:
! 186:
! 187: /* Search Given Indexname
! 188: ** ------
! 189: ** Performs a keyword search on word given by the user. Adds the keyword to
! 190: ** the end of the current address and attempts to open the new address.
! 191: **
! 192: ** On Entry,
! 193: ** *keywords space-separated keyword list or similar search list
! 194: ** *addres is name of object search is to be done on.
! 195: */
! 196:
! 197: extern BOOL HTSearchAbsolute PARAMS((
! 198: CONST char * keywords,
! 199: CONST char * indexname));
! 200:
! 201:
! 202: /* Register an access method
! 203: ** -------------------------
! 204: */
! 205:
! 206: typedef struct _HTProtocol {
! 207: char * name;
! 208:
! 209: int (*load)PARAMS((
! 210: CONST char * full_address,
! 211: HTParentAnchor * anchor,
! 212: HTFormat format_out,
! 213: HTStream* sink));
! 214:
! 215: HTStream* (*saveStream)PARAMS((HTParentAnchor * anchor));
! 216:
! 217: } HTProtocol;
! 218:
! 219: extern BOOL HTRegisterProtocol PARAMS((HTProtocol * protocol));
! 220:
! 221:
! 222: /* Generate the anchor for the home page
! 223: ** -------------------------------------
! 224: **
! 225: ** As it involves file access, this should only be done once
! 226: ** when the program first runs.
! 227: ** This is a default algorithm -- browser don't HAVE to use this.
! 228: **
! 229: */
! 230: extern HTParentAnchor * HTHomeAnchor NOPARAMS;
! 231:
! 232: #endif /* HTACCESS_H */
! 233: </PRE>
Webmaster