Annotation of libwww/Library/src/HTAccess.html, revision 2.34

2.9       timbl       1: <HTML>
                      2: <HEAD>
2.6       timbl       3: <TITLE>HTAccess:  Access manager  for libwww</TITLE>
2.19      timbl       4: <NEXTID N="z11">
2.9       timbl       5: </HEAD>
2.5       timbl       6: <BODY>
2.33      frystyk     7: <H1>Access Manager</H1>
                      8: This module keeps a list of valid
2.5       timbl       9: protocol (naming scheme) specifiers
                     10: with associated access code.  It
                     11: allows documents to be loaded given
                     12: various combinations of parameters.
                     13: New access protocols may be registered
                     14: at any time.<P>
2.33      frystyk    15: 
                     16: <B>Note:</B> HTRequest defined and request parameter added to almost all calls
2.9       timbl      17: 18 Nov 1993.<P>
2.33      frystyk    18: 
                     19: This document is a part of the <A NAME="z0" HREF="Overview.html">
                     20: libwww library</A>. The code is implemented in <A NAME="z8" HREF="HTAccess.c">
                     21: HTAcces.c</A>
                     22: 
                     23: <PRE>
                     24: #ifndef HTACCESS_H
1.1       timbl      25: #define HTACCESS_H
                     26: 
2.33      frystyk    27: /* Definition uses: */
                     28: #include "tcp.h"
2.16      luotonen   29: #include "HTList.h"
1.1       timbl      30: 
                     31: #ifdef SHORT_NAMES
2.8       timbl      32: #define HTClientHost           HTClHost
                     33: #define HTSearchAbsolute       HTSeAbso
                     34: #define HTOutputStream         HTOuStre
                     35: #define HTOutputFormat         HTOuForm
1.1       timbl      36: #endif
2.33      frystyk    37: </PRE>
1.1       timbl      38: 
2.33      frystyk    39: <H2>Methods</H2>
                     40: 
                     41: Thesse are the valid methods, see <A HREF="http://info.cern.ch/hypertext/WWW/Protocols/HTTP/Methods.html">HTTP Methods</A>
                     42: 
                     43: <PRE>
2.16      luotonen   44: typedef enum {
                     45:        METHOD_INVALID  = 0,
                     46:        METHOD_GET      = 1,
                     47:        METHOD_HEAD,
                     48:        METHOD_POST,
                     49:        METHOD_PUT,
                     50:        METHOD_DELETE,
                     51:        METHOD_CHECKOUT,
                     52:        METHOD_CHECKIN,
                     53:        METHOD_SHOWMETHOD,
                     54:        METHOD_LINK,
                     55:        METHOD_UNLINK,
                     56:        MAX_METHODS
                     57: } HTMethod;
2.33      frystyk    58: </PRE>
                     59: 
                     60: <H3>Get Method Enumeration</H3>
2.16      luotonen   61: 
2.33      frystyk    62: Gives the enumeration value of the method as a function of the (char *) name.
2.16      luotonen   63: 
2.33      frystyk    64: <PRE>
                     65: PUBLIC HTMethod HTMethod_enum PARAMS((char * name));
2.16      luotonen   66: </PRE>
                     67: 
2.33      frystyk    68: <H3>Get Method String</H3>
2.16      luotonen   69: 
2.33      frystyk    70: The reverse of <I>HTMethod_enum()</I>
2.16      luotonen   71: 
2.33      frystyk    72: <PRE>
2.16      luotonen   73: PUBLIC char * HTMethod_name PARAMS((HTMethod method));
2.33      frystyk    74: </PRE>
                     75: 
                     76: <H3>Valid Methods</H3>
2.16      luotonen   77: 
2.33      frystyk    78: This functions searches the list of valid methods for a given anchor, see
                     79: <A HREF="HTAnchor.html">HTAnchor module</A> If the method is found it returns
                     80: YES else NO.
2.16      luotonen   81: 
2.33      frystyk    82: <PRE>
2.16      luotonen   83: PUBLIC BOOL HTMethod_inList PARAMS((HTMethod   method,
                     84:                                    HTList *    list));
                     85: </PRE>
2.33      frystyk    86: 
2.16      luotonen   87: <H2>Match Template Against Filename</H2>
                     88: <PRE>
                     89: /* PUBLIC                                              HTAA_templateMatch()
                     90: **             STRING COMPARISON FUNCTION FOR FILE NAMES
                     91: **                WITH ONE WILDCARD * IN THE TEMPLATE
                     92: ** NOTE:
                     93: **     This is essentially the same code as in HTRules.c, but it
                     94: **     cannot be used because it is embedded in between other code.
                     95: **     (In fact, HTRules.c should use this routine, but then this
                     96: **      routine would have to be more sophisticated... why is life
                     97: **      sometimes so hard...)
                     98: **
                     99: ** ON ENTRY:
                    100: **     template        is a template string to match the file name
                    101: **                     agaist, may contain a single wildcard
                    102: **                     character * which matches zero or more
                    103: **                     arbitrary characters.
                    104: **     filename        is the filename (or pathname) to be matched
                    105: **                     agaist the template.
                    106: **
                    107: ** ON EXIT:
                    108: **     returns         YES, if filename matches the template.
                    109: **                     NO, otherwise.
                    110: */
                    111: PUBLIC BOOL HTAA_templateMatch PARAMS((CONST char * template, 
                    112:                                       CONST char * filename));
                    113: 
                    114: 
2.19      timbl     115: </PRE>The following have to be defined
2.10      timbl     116: in advance of the other include files
                    117: because of circular references.
2.33      frystyk   118: <PRE>
                    119: typedef struct _HTRequest HTRequest;
2.10      timbl     120: 
2.14      luotonen  121: /*
                    122: ** Callback to call when username and password
                    123: ** have been prompted.
                    124: */
                    125: typedef int (*HTRetryCallbackType) PARAMS((HTRequest * req));
                    126: 
                    127: 
2.10      timbl     128: #include "HTAnchor.h"
                    129: #include <A
                    130: NAME="z3" HREF="HTFormat.html">"HTFormat.h"</A>
2.15      luotonen  131: #include "HTAAUtil.h"          /* HTAAScheme, HTAAFailReason */
2.14      luotonen  132: #include "HTAABrow.h"          /* HTAASetup */
2.33      frystyk   133: </PRE>
2.10      timbl     134: 
2.33      frystyk   135: <H2>Default Addresses</H2>
2.10      timbl     136: 
2.33      frystyk   137: These control the home page selection. To mess with these for normal browses
2.6       timbl     138: is asking for user confusion.
2.33      frystyk   139: <PRE>
                    140: #define LOGICAL_DEFAULT "WWW_HOME"           /* Defined to be the home page */
1.1       timbl     141: 
2.6       timbl     142: #ifndef PERSONAL_DEFAULT
2.33      frystyk   143: #define PERSONAL_DEFAULT "WWW/default.html"            /* in home directory */
2.6       timbl     144: #endif
2.33      frystyk   145: 
2.6       timbl     146: #ifndef LOCAL_DEFAULT_FILE
1.1       timbl     147: #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
2.6       timbl     148: #endif
2.33      frystyk   149: 
                    150: /* If one telnets to an access point it will look in this file for home page */
2.7       timbl     151: #ifndef REMOTE_POINTER
2.33      frystyk   152: #define REMOTE_POINTER  "/etc/www-remote.url"              /* can't be file */
2.7       timbl     153: #endif
2.33      frystyk   154: 
2.7       timbl     155: /* and if that fails it will use this. */
2.6       timbl     156: #ifndef REMOTE_ADDRESS
2.33      frystyk   157: #define REMOTE_ADDRESS  "http://info.cern.ch/remote.html"   /* can't be file */
1.1       timbl     158: #endif
                    159: 
2.33      frystyk   160: /* If run from telnet daemon and no -l specified, use this file: */
1.1       timbl     161: #ifndef DEFAULT_LOGFILE
                    162: #define DEFAULT_LOGFILE        "/usr/adm/www-log/www-log"
                    163: #endif
                    164: 
2.33      frystyk   165: /* If the home page isn't found, use this file: */
1.1       timbl     166: #ifndef LAST_RESORT
2.6       timbl     167: #define LAST_RESORT    "http://info.cern.ch/default.html"
1.1       timbl     168: #endif
                    169: 
2.33      frystyk   170: /* This is the default cache directory: */
2.23      frystyk   171: #ifndef CACHE_HOME_DIR
                    172: #define CACHE_HOME_DIR         "/tmp/"
                    173: #endif
                    174: 
2.33      frystyk   175: /* The default directory for "save locally" and "save and execute" files: */
2.23      frystyk   176: #ifndef SAVE_LOCALLY_HOME_DIR
                    177: #define SAVE_LOCALLY_HOME_DIR  "/tmp/"
                    178: #endif
2.33      frystyk   179: </PRE>
2.10      timbl     180: 
2.34    ! frystyk   181: <H2><A NAME="HTNetInfo">Protocol Specific Information</A></H2>
        !           182: 
        !           183: This structure contains information about socket number, input buffer for
        !           184: reading from the network etc. The structure is used through out the protocol
        !           185: modules and is the refenrence point for introducing multi threaded execution
        !           186: into the library. 
        !           187: 
        !           188: <PRE>
        !           189: typedef struct _HTNetInfo {
        !           190:     int                        sockfd;
        !           191:     HTInputSocket *    isoc;
        !           192:     struct _HTRequest *        request;
        !           193: } HTNetInfo;
        !           194: </PRE>
        !           195: 
2.9       timbl     196: <H2><A
                    197: NAME="z1">The Request structure</A></H2>When a request is handled, all kinds
                    198: of things about it need to be passed
                    199: along.  These are all put into a
2.31      frystyk   200: HTRequest structure. <P>
                    201: 
                    202: <NOTE>Note 1:</NOTE> There is also a <A NAME="z4" HREF="HTFormat.html#z17">global list of converters</A> <P>
2.33      frystyk   203: <NOTE>Note 2:</NOTE> If you reuse the request structure for more than one
                    204: request then make sure that the request is re-initialized, so that no `old'
                    205: data is reused, see <A HREF="#z100">functions to manipulate HTRequest
                    206: Structure</A>. The library handles its own internal information from request
                    207: to request but the information set by the caller is untouched.
2.31      frystyk   208: 
2.10      timbl     209: <PRE>struct _HTRequest {
2.19      timbl     210: 
                    211: </PRE>The elements of the request structure
                    212: are as follows.
                    213: <H3>Set by the caller of HTaccess:</H3>
                    214: <H4>Conditions of the request itself:</H4>
                    215: <PRE>  HTMethod        method;
                    216: 
                    217: </PRE>An atom for the name of the operation
                    218: using HTTP <A
                    219: NAME="z7" HREF="../../Protocols/HTTP/Methods.html">method names</A> .
                    220: <PRE>  HTList *        conversions ;
2.20      frystyk   221: </PRE>NULL, or a list of conversions which
2.19      timbl     222: the format manager can do in order
                    223: to fulfill the request.  This is
                    224: set by the caller of HTAccess. Typically
                    225: points to a list set up an initialisation
                    226: time for example by HTInit.
                    227: <PRE>  HTList *        encodings;      /* allowed content-encodings      */
                    228: 
                    229: </PRE>The list of encodings acceptablein
                    230: the output stream.
                    231: <PRE>  HTList *        languages;      /* accepted content-languages     */
                    232: 
                    233: </PRE>The list of (human) language values
                    234: acceptable in the response
                    235: <PRE>  BOOL (*<A
2.20      frystyk   236: NAME="z9"> callback</A> ) PARAMS((
2.9       timbl     237:                                struct _HTRequest* request,
                    238:                                void *param));
2.19      timbl     239: 
                    240: </PRE>A function to be called back in the
                    241: event that a file has been saved
                    242: to disk by HTSaveAndCallBack for
                    243: example.
                    244: <PRE>  void *          context;        /* caller data -- HTAccess unaware */
                    245: 
                    246: </PRE>An arbitrary pointer passed to HTAccess
                    247: and passed back as a parameter to
                    248: the <A
2.20      frystyk   249: NAME="z10" HREF="#z9">callback</A> .
2.19      timbl     250: <PRE>  HTStream*       output_stream; 
                    251: 
                    252: </PRE>NULL in the case of display to the
                    253: user, or if a specific output stream
                    254: is required, the stream.
                    255: <PRE>  HTAtom *        output_format;
                    256: 
                    257: </PRE>The output format required, or a
                    258: generic format such as www/present
                    259: (present to user). 
                    260: <H4>Information about the requester</H4>
                    261: <PRE>  char *          from;
                    262: 
2.33      frystyk   263: </PRE>Email format address of person responible for request
                    264: 
                    265: <H4>The URI from which this request was obtained</H4>
                    266: <PRE>  HTParentAnchor *parentAnchor;
                    267: </PRE>
                    268: If this parameter is set then a `Referer: &lt;parent address&gt; is generated
                    269: in the request to the server, see <A HREF="http://info.cern.ch/hypertext/WWW/Protocols/HTTP/HTRQ_Headers.html#z14">Referer field in a HTTP Request</A>
                    270: 
2.19      timbl     271: <H3>Set by HTAccess</H3>None of the bits below may be looked
                    272: at by a client application except
                    273: in the callback routine, when the
                    274: anchor may be picked out.
                    275: <PRE>  HTParentAnchor* anchor;
                    276: 
                    277: </PRE>The anchor for the object in question.
2.20      frystyk   278: Set immediately by HTAcesss.  Used
2.19      timbl     279: by the protocol and parsing modules.
                    280: Valid thoughout the access.
                    281: <PRE>  HTChildAnchor * childAnchor;    /* For element within the object  */
                    282: 
2.31      frystyk   283: </PRE>The anchor for the sub object if
2.19      timbl     284: any.  The object builder should ensure
                    285: that htis is selected, highlighted,
                    286: etc when the object is loaded. NOTE:
                    287: Set by HTAccess.
                    288: <PRE>  void *          using_cache;
                    289: 
                    290: </PRE>pointer to cache element if cache
                    291: hit
2.25      luotonen  292: <H3>Error Diagnostics</H3>
                    293: <PRE>
2.30      frystyk   294:        BOOL            error_block;    /* YES if stream has been used    */
2.29      luotonen  295:        HTList *        error_stack;    /* List of errors                 */
2.25      luotonen  296: 
2.34    ! frystyk   297: </PRE>
        !           298: <H3>Library Side</H3>
        !           299: <PRE>
        !           300:        HTNetInfo *     net_info;       /* Information about socket etc. */
2.25      luotonen  301: </PRE>
2.21      luotonen  302: <H3>Server Side</H3>
                    303: <PRE>
                    304:        HTAtom *        content_type;   /* Content-Type:                  */
2.18      luotonen  305:        HTAtom *        content_language;/* Language                      */
                    306:        HTAtom *        content_encoding;/* Encoding                      */
2.16      luotonen  307:        int             content_length; /* Content-Length:                */
2.21      luotonen  308:        HTInputSocket * isoc;           /* InputSocket object for reading */
2.14      luotonen  309:        char *          authorization;  /* Authorization: field           */
                    310:        HTAAScheme      scheme;         /* Authentication scheme used     */
2.19      timbl     311: </PRE>
2.21      luotonen  312: <H3>Client Side</H3>
2.19      timbl     313: <PRE>
2.14      luotonen  314:        HTList *        valid_schemes;  /* Valid auth.schemes             */
                    315:        HTAssocList **  scheme_specifics;/* Scheme-specific parameters    */
                    316:        char *          prot_template;  /* WWW-Protection-Template: field */
                    317:        HTAASetup *     setup;          /* Doc protection info            */
                    318:        HTAARealm *     realm;          /* Password realm                 */
                    319:        char *          dialog_msg;     /* Authentication prompt (client) */
                    320:        HTRetryCallbackType
                    321:                        retry_callback; /* Called when password entered   */
2.10      timbl     322: };
2.9       timbl     323: 
2.31      frystyk   324: </PRE>
                    325: 
                    326: <H2><A NAME="z100">Functions to Manipulate a HTRequest Structure</A></H2>
                    327: 
                    328: Just to make things easier especially for clients, here are some functions to
                    329: manipulate the request structure:
                    330: 
                    331: <H3>Create blank request</H3>This request has defaults in -- in
2.9       timbl     332: most cases it will need some information
                    333: added before being passed to HTAccess,
                    334: but it will work as is for a simple
                    335: request.
2.14      luotonen  336: <PRE>
                    337: PUBLIC HTRequest * HTRequest_new NOPARAMS;
2.31      frystyk   338: </PRE>
2.14      luotonen  339: 
2.31      frystyk   340: <H3>Delete request structure</H3>Frees also conversion list hanging
2.19      timbl     341: from req->conversions.
2.14      luotonen  342: <PRE>
                    343: PUBLIC void HTRequest_delete PARAMS((HTRequest * req));
2.31      frystyk   344: </PRE>
1.1       timbl     345: 
2.31      frystyk   346: <H3>Clear a request structure</H3>
                    347: Clears a request structure so that it can be reused. The only thing that differs from using free/new is that the list of conversions is kept.
                    348: <PRE>
                    349: extern void HTRequest_clear PARAMS((HTRequest * req));
                    350: </PRE>
2.9       timbl     351: 
2.5       timbl     352: <H2>Flags which may be set to control
                    353: this module</H2>
2.22      frystyk   354: <PRE>
2.23      frystyk   355: extern char * HTSaveLocallyDir;                /* Dir home for "save locally" files */
                    356: extern char * HTCacheDir;              /* Cache dir, default NULL: no cache */
1.1       timbl     357: extern char * HTClientHost;            /* Name or number of telnetting host */
2.27      frystyk   358: extern FILE * HTlogfile;               /* File to output one-liners to */
2.7       timbl     359: extern BOOL HTSecure;                  /* Disable security holes? */
2.28      luotonen  360: extern char * HTImServer;              /* If I'm cern_httpd */
2.21      luotonen  361: extern BOOL HTImProxy;                 /* If I'm cern_httpd as a proxy */
2.23      frystyk   362: extern BOOL HTForceReload;             /* Force reload from cache or net */
1.1       timbl     363: 
2.5       timbl     364: </PRE>
                    365: <H2>Load a document from relative name</H2>
                    366: <H3>On Entry,</H3>
                    367: <DL>
                    368: <DT>relative_name
2.6       timbl     369: <DD> The relative address
2.5       timbl     370: of the file to be accessed.
                    371: <DT>here
2.6       timbl     372: <DD> The anchor of the object being
2.5       timbl     373: searched
2.9       timbl     374: <DT>request->anchor
                    375: <DD> not filled in yet
2.5       timbl     376: </DL>
                    377: 
                    378: <H3>On Exit,</H3>
                    379: <DL>
                    380: <DT>returns    YES
2.6       timbl     381: <DD> Success in opening
2.5       timbl     382: file
                    383: <DT>NO
2.6       timbl     384: <DD> Failure 
2.5       timbl     385: </DL>
1.1       timbl     386: 
2.5       timbl     387: <PRE>extern  BOOL HTLoadRelative PARAMS((
1.1       timbl     388:                CONST char *            relative_name,
2.9       timbl     389:                HTParentAnchor *        here,
                    390:                HTRequest *             request));
1.1       timbl     391: 
                    392: 
2.5       timbl     393: </PRE>
                    394: <H2>Load a document from absolute name</H2>
                    395: <H3>On Entry,</H3>
                    396: <DL>
                    397: <DT>addr
2.6       timbl     398: <DD> The absolute address of the
                    399: document to be accessed.
2.5       timbl     400: <DT>filter
2.6       timbl     401: <DD> if YES, treat document as
                    402: HTML
2.9       timbl     403: <DT>request->anchor
                    404: <DD> not filled in yet
2.5       timbl     405: </DL>
1.1       timbl     406: 
2.5       timbl     407: <PRE>
                    408: </PRE>
                    409: <H3>On Exit,</H3>
                    410: <PRE>
                    411: </PRE>
                    412: <DL>
                    413: <DT>returns YES
2.6       timbl     414: <DD> Success in opening document
2.5       timbl     415: <DT>NO
2.6       timbl     416: <DD> Failure 
2.5       timbl     417: </DL>
1.1       timbl     418: 
2.9       timbl     419: <PRE>extern BOOL HTLoadAbsolute PARAMS((CONST char * addr,
                    420:                HTRequest *             request));
1.1       timbl     421: 
                    422: 
2.5       timbl     423: </PRE>
                    424: <H2>Load a document from absolute name
                    425: to a stream</H2>
                    426: <H3>On Entry,</H3>
                    427: <DL>
                    428: <DT>addr
2.6       timbl     429: <DD> The absolute address of the
                    430: document to be accessed.
2.5       timbl     431: <DT>filter
2.6       timbl     432: <DD> if YES, treat document as
                    433: HTML
2.9       timbl     434: <DT>request->anchor
                    435: <DD> not filled in yet
2.5       timbl     436: </DL>
                    437: 
                    438: <H3>On Exit,</H3>
                    439: <DL>
                    440: <DT>returns YES
2.6       timbl     441: <DD> Success in opening document
2.5       timbl     442: <DT>NO
2.6       timbl     443: <DD> Failure 
2.5       timbl     444: </DL>
                    445: Note: This is equivalent to HTLoadDocument
2.9       timbl     446: <PRE>extern BOOL HTLoadToStream PARAMS((
                    447:                CONST char *            addr,
                    448:                BOOL                    filter,
                    449:                HTRequest *             request));
1.1       timbl     450: 
                    451: 
2.5       timbl     452: </PRE>
                    453: <H2>Load if necessary, and select an
2.9       timbl     454: anchor</H2>The anchor parameter may be a child
                    455: anchor. The anchor in the request
2.33      frystyk   456: is set to the parent anchor. The recursive function keeps the error stack in 
                    457: the request structure so that no information is lost having more than one
                    458: call. 
2.5       timbl     459: <H3>On Entry,</H3>
                    460: <DL>
2.9       timbl     461: <DT>anchor
                    462: <DD> may be a child or parenet
                    463: anchor or 0 in which case there is
                    464: no effect.
                    465: <DT>request->anchor      
                    466: <DD>    Not set
                    467: yet.
2.5       timbl     468: </DL>
                    469: 
                    470: <H3>On Exit,</H3>
                    471: <PRE>
                    472: </PRE>
                    473: <DL>
                    474: <DT>returns YES
2.6       timbl     475: <DD> Success
2.5       timbl     476: <DT>returns NO
2.6       timbl     477: <DD> Failure 
2.9       timbl     478: <DT>request->anchor
                    479: <DD> The parenet anchor.
2.5       timbl     480: </DL>
                    481: 
2.33      frystyk   482: <PRE>
                    483: extern BOOL HTLoadAnchor PARAMS((HTAnchor  * a,
                    484:                                 HTRequest *            request));
                    485: extern BOOL HTLoadAnchorRecursive PARAMS((HTAnchor  * a,
                    486:                                          HTRequest *           request));
2.5       timbl     487: </PRE>
2.24      luotonen  488: 
                    489: <H2>Load a Document</H2>
                    490: This is an internal routine, which has an address AND a matching
                    491: anchor.  (The public routines are called with one OR the other.)
2.33      frystyk   492: This is recursively called from file load module to try ftp (though this
                    493: will be obsolete in the next major release).
2.24      luotonen  494: 
                    495: <H3>On entry,</H3>
2.33      frystyk   496: <DL> 
                    497: <DT> request->
                    498: <DD>
2.24      luotonen  499: <DL>
                    500:        <DT> anchor             <DD> a parent anchor with fully qualified
                    501:                                     hypertext reference as its address set
                    502:        <DT> output_format      <DD> valid
                    503:        <DT> output_stream      <DD> valid on NULL
                    504: </DL>
2.33      frystyk   505: <DT> keep_error_stack 
                    506: <DD> If this is set to YES then the error (or info) stack is not cleared from
                    507: the previous call. 
                    508: </DL> 
2.24      luotonen  509: <H3>On exit,</H3>
                    510: returns
                    511: <DL>
                    512:        <DT> <0         <DD> Error has occured.
                    513:        <DT> HT_LOADED  <DD> Success
                    514:        <DT> HT_NO_DATA <DD> Success, but no document loaded.
                    515:                                        (telnet sesssion started etc)
                    516: </DL>
                    517: 
                    518: <PRE>
2.33      frystyk   519: PUBLIC int HTLoad PARAMS((HTRequest * request, BOOL keep_error_stack));
2.24      luotonen  520: </PRE>
                    521: 
                    522: 
2.20      frystyk   523: <H2>Bind an anchor to a request structure
                    524: without loading</H2>The anchor parameter may be a child
                    525: anchor. The anchor in the request
                    526: is set to the parent anchor. This
                    527: is useful in non-interactive mode
                    528: if no home-anchor is known. Actually
                    529: the same as HTLoadAnchor(), but without
                    530: loading
                    531: <H3>On Entry,</H3>
                    532: <DL>
                    533: <DT>anchor
                    534: <DD> may be a child or parenet
                    535: anchor or 0 in which case there is
                    536: no effect.
                    537: <DT>request->anchor      
                    538: <DD> Not set yet.
                    539: </DL>
                    540: 
                    541: <H3>On Exit,</H3>
                    542: <PRE>
                    543: </PRE>returns YES       Success<P>
                    544: returns NO      Failure <P>
                    545: request->anchor         The parenet anchor.
                    546: <PRE>
                    547: extern BOOL HTBindAnchor PARAMS((HTAnchor *anchor, HTRequest *request));
                    548: 
                    549: 
                    550: </PRE>
2.5       timbl     551: <H2>Make a stream for Saving object back</H2>
                    552: <H3>On Entry,</H3>
                    553: <DL>
2.9       timbl     554: <DT>request->anchor
                    555: <DD> is valid anchor which
                    556: has previously beeing loaded
2.5       timbl     557: </DL>
                    558: 
                    559: <H3>On exit,</H3>
                    560: <DL>
                    561: <DT>returns
2.6       timbl     562: <DD> 0 if error else a stream
                    563: to save the object to.
2.5       timbl     564: </DL>
                    565: 
                    566: <PRE>
                    567: 
2.13      timbl     568: extern HTStream * HTSaveStream PARAMS((HTRequest * request));
1.1       timbl     569: 
                    570: 
2.5       timbl     571: </PRE>
                    572: <H2>Search</H2>Performs a search on word given by
                    573: the user. Adds the search words to
                    574: the end of the current address and
                    575: attempts to open the new address.
                    576: <H3>On Entry,</H3>
                    577: <DL>
                    578: <DT>*keywords
2.6       timbl     579: <DD> space-separated keyword
2.5       timbl     580: list or similar search list
                    581: <DT>here
2.6       timbl     582: <DD> The anchor of the object being
2.5       timbl     583: searched
                    584: </DL>
1.1       timbl     585: 
2.9       timbl     586: <PRE>extern BOOL HTSearch PARAMS((
                    587:                CONST char *            keywords,
                    588:                HTParentAnchor*         here,
                    589:                HTRequest *             request));
1.1       timbl     590: 
                    591: 
2.5       timbl     592: </PRE>
                    593: <H2>Search Given Indexname</H2>Performs a keyword search on word
                    594: given by the user. Adds the keyword
                    595: to  the end of the current address
                    596: and attempts to open the new address.
                    597: <H3>On Entry,</H3>
                    598: <DL>
                    599: <DT>*keywords
2.6       timbl     600: <DD> space-separated keyword
2.5       timbl     601: list or similar search list
                    602: <DT>*indexname
2.6       timbl     603: <DD> is name of object search
2.5       timbl     604: is to be done on.
                    605: </DL>
1.1       timbl     606: 
2.5       timbl     607: <PRE>extern BOOL HTSearchAbsolute PARAMS((
2.9       timbl     608:        CONST char *            keywords,
                    609:        CONST char *            indexname,
                    610:        HTRequest *             request));
1.1       timbl     611: 
                    612: 
2.5       timbl     613: </PRE>
2.9       timbl     614: <H2>Register an access method</H2>An access method is defined by an
                    615: HTProtocol structure which point
                    616: to the routines for performing the
                    617: various logical operations on an
                    618: object: in HTTP terms,  GET, PUT,
                    619: and POST.<P>
                    620: Each of these routine takes as a
                    621: parameter a <A
                    622: NAME="z2" HREF="#z1">request structure</A> containing
                    623: details ofthe request.  When the
                    624: protocol class routine is called,
                    625: the anchor elemnt in the request
                    626: is already valid (made valid by HTAccess).
                    627: <PRE>typedef struct _HTProtocol {
1.1       timbl     628:        char * name;
                    629:        
2.11      timbl     630:        int (*load)PARAMS((HTRequest *  request));
1.1       timbl     631:                
2.11      timbl     632:        HTStream* (*saveStream)PARAMS((HTRequest *      request));
                    633: 
2.9       timbl     634:        HTStream* (*postStream)PARAMS((
                    635:                                HTRequest *     request,
                    636:                                HTParentAnchor* postTo));
1.1       timbl     637: 
                    638: } HTProtocol;
                    639: 
                    640: extern BOOL HTRegisterProtocol PARAMS((HTProtocol * protocol));
                    641: 
                    642: 
2.5       timbl     643: </PRE>
                    644: <H2>Generate the anchor for the home
                    645: page</H2>
                    646: <PRE>
                    647: </PRE>As it involves file access, this
                    648: should only be done once when the
                    649: program first runs. This is a default
                    650: algorithm -- browser don't HAVE to
                    651: use this.
2.25      luotonen  652: <PRE>
2.33      frystyk   653: extern HTParentAnchor * HTHomeAnchor NOPARAMS;
2.25      luotonen  654: </PRE>
                    655: 
                    656: <PRE>
1.1       timbl     657: #endif /* HTACCESS_H */
2.25      luotonen  658: </PRE>
                    659: end of HTAccess
                    660: </BODY>
2.9       timbl     661: </HTML>

Webmaster