Annotation of libwww/Library/src/HTUTree.html, revision 2.2

2.1       frystyk     1: <HTML>
                      2: <HEAD>
                      3: <!-- Changed by: Henrik Frystyk Nielsen,  7-Jul-1996 -->
2.2     ! frystyk     4:   <TITLE>W3C Sample Code Library libwww URL Tress</TITLE>
2.1       frystyk     5: </HEAD>
                      6: <BODY>
                      7: <H1>
                      8:   URL Trees
                      9: </H1>
                     10: <PRE>
                     11: /*
                     12: **     (c) COPYRIGHT MIT 1995.
                     13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
                     16: <P>
                     17: A <I>URL tree</I> is a hierarchical container class that is well suited for
                     18: storing information about a URL hierarchy. The <I>root</I> of a URL tree
                     19: is the <I>hostname</I> part of the URL, for example
                     20: <CODE>www.w3.org:8000</CODE>.&nbsp;Client application can use URL trees to
                     21: store what they know about remote servers, for example the access authentication,
                     22: PICS labels and PEP modules required to access a specific URL from a remote
                     23: server. However, URL trees can also be used on server side to contain information
                     24: about the server tree, for example what parts of the tree is protected etc.
                     25: <P>
                     26: There are three components of the URL tree which all can be searched for
                     27: using the methods declared in this module.
                     28: <UL>
                     29:   <LI>
                     30:     The Tree itself
                     31:   <LI>
                     32:     A URL Node which represents a hierarchy level in a URL
                     33:   <LI>
                     34:     A URL Template which can span multiple nodes and are very similar to the
                     35:     realms known from for example Basic Access Authentication in HTTP.
                     36: </UL>
                     37: <P>
                     38: Typically, a URL tree will be empty when the application starts and as time
                     39: goes by and we get to know more about the remote servers that we have access,
                     40: the URL trees will contain more and more information. A nice feature about
                     41: URL trees is that the application can interpolate information based on realms
                     42: and templates. This gives the application a good chance of guessing what
                     43: information (for example a set of credentials) should be appended to a new
                     44: request.
                     45: <P>
                     46: We do not currently distinguish between multiple access mechanisms, for example
                     47: <B>HTTP</B> and <B>FTP</B>, however, URL trees are mostly used within the
                     48: HTTP domain.
                     49: <P>
                     50: <I>URL Trees</I> are often used by <A HREF="HTFilter.html">filters</A> which
                     51: stores information about remote services, Each filter can have its own URL
                     52: tree&nbsp;<I>or</I> a URL tree can be shared among multiple filters.
                     53: <P>
                     54: This module is implemented by <A HREF="HTUTree.c">HTUTree.c</A>, and it is
2.2     ! frystyk    55: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Sample Code
2.1       frystyk    56: Library</A>.
                     57: <PRE>
                     58: #ifndef HTUTREE_H
                     59: #define HTUTREE_H
                     60: #include "HTReq.h"
                     61: </PRE>
                     62: <H2>
                     63:   URL Trees
                     64: </H2>
                     65: <P>
                     66: The three parts of a URL tree are called
                     67: <PRE>
                     68: typedef struct _HTUTree     HTUTree;
                     69: typedef struct _HTURealm     HTURealm;
                     70: typedef struct _HTUTemplate HTUTemplate;
                     71: </PRE>
                     72: <H3>
                     73:   Create a URL Tree
                     74: </H3>
                     75: <P>
                     76: Create a new authentication base Returns new object or NULL if error
                     77: <PRE>
                     78: 
                     79: typedef int HTUTree_gc         (void * context);
                     80: 
                     81: extern HTUTree * HTUTree_new (const char *             root,
                     82:                              const char *              host,
                     83:                              int                       port,
                     84:                              HTUTree_gc *              gc);
                     85: </PRE>
                     86: <H3>
                     87:   Delete a URL Tree
                     88: </H3>
                     89: <P>
                     90: Delete a complete server tree and everything within it.
                     91: <PRE>
                     92: extern BOOL HTUTree_delete (const char *       root,
                     93:                            const char *        host,
                     94:                            int                 port);
                     95: </PRE>
                     96: <H3>
                     97:   Delete ALL URL Trees
                     98: </H3>
                     99: <P>
                    100: Delete all information bases
                    101: <PRE>
                    102: extern BOOL HTUTree_deleteAll (void);
                    103: </PRE>
                    104: <H3>
                    105:   Find a URL Tree
                    106: </H3>
                    107: <P>
                    108: Find a authentication base. Return NULL if not found
                    109: <PRE>
                    110: extern HTUTree * HTUTree_find (const char *    root,
                    111:                               const char *     host,
                    112:                               int              port);
                    113: </PRE>
                    114: 
                    115: <H2>
                    116:   URL Nodes
                    117: </H2>
                    118: 
                    119: <PRE>
                    120: extern void * HTUTree_findNode (HTUTree * tree, 
                    121:                                 const char * realm, const char * path); 
                    122: </PRE>
                    123: 
                    124: <PRE>
                    125: extern BOOL HTUTree_addNode (HTUTree * tree, 
                    126:                              const char * realm, const char * path, 
                    127:                              void * context);
                    128: </PRE>
                    129: 
                    130: 
                    131: <PRE>
                    132: extern BOOL HTUTree_replaceNode (HTUTree * tree, 
                    133:                                  const char * realm, const char * path, 
                    134:                                  void * context);
                    135: </PRE>
                    136: 
                    137: <PRE>
                    138: extern BOOL HTUTree_deleteNode (HTUTree * tree, 
                    139:                                 const char * realm, const char * path);
                    140: </PRE>
                    141: 
                    142: 
                    143: <PRE>
                    144: #endif /* HTUTREE_H */
                    145: </PRE>
                    146: <P>
                    147:   <HR>
                    148: <ADDRESS>
2.2     ! frystyk   149:   @(#) $Id: HTUTree.html,v 2.1 1996/07/08 19:11:07 frystyk Exp $
2.1       frystyk   150: </ADDRESS>
                    151: </BODY></HTML>

Webmaster