Annotation of libwww/Library/src/HTAnchor.html, revision 2.60

2.7       timbl       1: <HTML>
                      2: <HEAD>
2.47      frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen, 16-Jul-1996 -->
2.51      frystyk     4:   <TITLE>W3C Sample Code Library libwww Anchor Class</TITLE>
2.8       timbl       5: </HEAD>
2.6       timbl       6: <BODY>
2.42      frystyk     7: <H1>
2.44      frystyk     8:   The Anchor Class
2.42      frystyk     9: </H1>
2.15      frystyk    10: <PRE>
                     11: /*
2.23      frystyk    12: **     (c) COPYRIGHT MIT 1995.
2.15      frystyk    13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.42      frystyk    16: <P>
                     17: An anchor represents a region of a hypertext document which is linked to
                     18: another anchor in the same or a different document. Another name for anchors
                     19: would be URLs as an anchor represents all we know about a URL - including
                     20: where it points to and who points to it.&nbsp;Because the anchor objects
                     21: represent the part of the Web, the application has been in touch, it is often
                     22: useful to maintain the anchors throughout the lifetime of the application.
                     23: It would actually be most useful if we had persistent anchors so that an
2.44      frystyk    24: application could build up a higher knowledge about the Web topology.
2.60    ! kahan      25: 
        !            26: <h2><a name="When">When to Escape and Unescape Addresses</a></h2>
        !            27: 
        !            28: <p>The <em>URI escape policy</em> in libwww is that <b>all</b> URIs created as
        !            29: anchors <b>must already have been escaped</b>. The reason for this is that if
        !            30: URIs are not escaped then the URI parser is not guaranteed to work as
        !            31: expected. Imagine, for example, that you have a <tt><code>":"</code></tt> in a
        !            32: host name, then you could get something like this:
        !            33: tt>http://my:host:8000/</tt> instead of <tt>http://my%3Ahost:8000/</tt>.</p>
        !            34: 
        !            35: <p>Libwww provides <a href="HTEscape.html">support for escaping and unescaping
        !            36: URIs using this set of APIs</a>.</p>
        !            37: 
2.42      frystyk    38: <P>
                     39: This module is implemented by <A HREF="HTAnchor.c">HTAnchor.c</A>, and it
2.57      frystyk    40: is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.42      frystyk    41: Library</A>.
2.15      frystyk    42: <PRE>
                     43: #ifndef HTANCHOR_H
1.1       timbl      44: #define HTANCHOR_H
2.24      frystyk    45: 
2.18      frystyk    46: </PRE>
2.42      frystyk    47: <H2>
                     48:   Types defined and used by the Anchor Object
                     49: </H2>
                     50: <P>
                     51: This is a set of videly used type definitions used through out the Library:
2.24      frystyk    52: <PRE>
2.44      frystyk    53: #include "WWWUtil.h"
2.35      frystyk    54: 
2.24      frystyk    55: typedef HTAtom * HTFormat;
                     56: typedef HTAtom * HTLevel;                     /* Used to specify HTML level */
2.40      frystyk    57: typedef HTAtom * HTEncoding;                               /* C-E and C-T-E */
2.24      frystyk    58: typedef HTAtom * HTCharset;
                     59: typedef HTAtom * HTLanguage;
2.35      frystyk    60: 
                     61: typedef struct _HTAnchor       HTAnchor;
                     62: typedef struct _HTParentAnchor HTParentAnchor;
                     63: typedef struct _HTChildAnchor  HTChildAnchor;
2.28      frystyk    64: 
2.44      frystyk    65: #include "HTLink.h"
                     66: #include "HTMethod.h"
2.49      frystyk    67: #include "HTResponse.h"
2.35      frystyk    68: </PRE>
2.42      frystyk    69: <H2>
                     70:   The Anchor Class
                     71: </H2>
                     72: <P>
                     73: We have three variants of the Anchor object - I guess some would call them
                     74: superclass and subclasses ;-) <A NAME="Generic"></A>
                     75: <H3>
2.44      frystyk    76:   <A NAME="Generic">Anchor Base Class</A>
2.42      frystyk    77: </H3>
                     78: <P>
                     79: This is the super class of anchors. We often use this as an argument to the
                     80: functions that both accept parent anchors and child anchors. We separate
                     81: the first link from the others to avoid too many small mallocs involved by
                     82: a list creation. Most anchors only point to one place. <A NAME="parent"></A>
                     83: <H3>
                     84:   <A NAME="parent">Anchor for a Parent Object</A>
                     85: </H3>
                     86: <P>
2.44      frystyk    87: These anchors points to the whole contents of any resource accesible by a
                     88: URI. The parent anchor now contains all known metainformation about that
                     89: object and in some cases the parent anchor also contains the document itself.
                     90: Often we get the metainformation about a document via the entity headers
                     91: in the HTTP specification.
2.42      frystyk    92: <H3>
                     93:   <A NAME="child">Anchor for a Child Object</A>
                     94: </H3>
                     95: <P>
2.44      frystyk    96: A child anchor is a anchor object that points to a subpart of a hypertext
                     97: document. In HTML this is represented by the <CODE>NAME</CODE> tag of the
                     98: Anchor element.
2.42      frystyk    99: <P>
                    100: After we have defined the data structures we must define the methods that
                    101: can be used on them. All anchors are kept in an internal hash table so that
                    102: they are easier to find again.
                    103: <H3>
                    104:   Find/Create a Parent Anchor
                    105: </H3>
                    106: <P>
                    107: This one is for a reference (link) which is found in a document, and might
                    108: not be already loaded. The parent anchor returned can either be created on
                    109: the spot or is already in the hash table.
2.18      frystyk   110: <PRE>
2.37      frystyk   111: extern HTAnchor * HTAnchor_findAddress         (const char * address);
2.18      frystyk   112: </PRE>
2.42      frystyk   113: <H3>
                    114:   Find/Create a Child Anchor
                    115: </H3>
                    116: <P>
                    117: This one is for a new child anchor being edited into an existing document.
                    118: The parent anchor must already exist but the child returned can either be
                    119: created on the spot or is already in the hash table. The <EM>tag</EM> is
                    120: the part that's after the '#' sign in a URI.
2.18      frystyk   121: <PRE>
2.32      frystyk   122: extern HTChildAnchor * HTAnchor_findChild      (HTParentAnchor *parent,
2.37      frystyk   123:                                                 const char *   tag);
2.7       timbl     124: </PRE>
2.42      frystyk   125: <H3>
                    126:   Find/Create a Child Anchor and Link to Another Parent
                    127: </H3>
                    128: <P>
                    129: Find a child anchor anchor with a given parent and possibly a <EM>tag</EM>,
                    130: and (if passed) link this child to the URI given in the <EM>href</EM>. As
                    131: we really want typed links to the caller should also indicate what the type
                    132: of the link is (see HTTP spec for more information). The link is
                    133: <EM>relative</EM> to the address of the parent anchor.
2.18      frystyk   134: <PRE>
2.43      eric      135: extern HTChildAnchor * HTAnchor_findChildAndLink (
                    136:                HTParentAnchor * parent,                /* May not be 0 */
2.37      frystyk   137:                const char * tag,                       /* May be "" or 0 */
                    138:                const char * href,                      /* May be "" or 0 */
2.35      frystyk   139:                HTLinkType ltype);                      /* May be 0 */
2.18      frystyk   140: </PRE>
2.42      frystyk   141: <H3>
                    142:   Delete an Anchor
                    143: </H3>
                    144: <P>
                    145: All outgoing links from parent and children are deleted, and this anchor
                    146: is removed from the sources list of all its targets. We also delete the targets.
                    147: If this anchor's source list is empty, we delete it and its children.
2.18      frystyk   148: <PRE>
2.32      frystyk   149: extern BOOL HTAnchor_delete    (HTParentAnchor *me);
2.20      frystyk   150: </PRE>
2.42      frystyk   151: <H3>
2.59      frystyk   152:   Clear all Anchors
                    153: </H3>
                    154: <P>
                    155: Deletes all the metadata associated with anchors but doesn't delete
                    156: the anchor link structure itself. This is much safer than deleting the
                    157: complete anchor structure as this represents the complete Web the
                    158: application has been in touch with. It also returns a list of all the
                    159: objects (hyperdoc) hanging of the parent anchors found while doing
                    160: it. These are not deleted by libwww.
                    161: <PRE>
                    162: extern BOOL HTAnchor_clearAll (HTList * documents);
                    163: </PRE>
                    164: <H3>
2.42      frystyk   165:   Delete all Anchors
                    166: </H3>
                    167: <P>
                    168: Deletes <EM>all</EM> anchors and return a list of all the objects (hyperdoc)
                    169: hanging of the parent anchors found while doing it. The application may keep
                    170: its own list of <CODE>HyperDoc</CODE>s, but this function returns it anyway.
                    171: It is <EM>always</EM> for the application to delete any
                    172: <CODE>HyperDoc</CODE>s. If NULL then no hyperdocs are returned. Return YES
                    173: if OK, else NO.
                    174: <P>
                    175: <B>Note:</B> This function is different from cleaning up the history list!
2.20      frystyk   176: <PRE>
2.32      frystyk   177: extern BOOL HTAnchor_deleteAll (HTList * objects);
2.18      frystyk   178: </PRE>
2.52      frystyk   179: <H3>
                    180:   Flatten all anchors into Array
                    181: </H3>
2.59      frystyk   182: <P>
2.52      frystyk   183: Flattens the anchor web structure into an array.  This is useful for
                    184: calculating statistics, sorting the parent anchors etc.<P>
                    185: 
                    186: The caller can indicate the size of the array (total number of anchors
                    187: if known - otherwise 0).<P>
                    188: 
                    189: Return an array that must be freed by the caller or NULL if no
                    190: anchors.<P>
                    191: 
                    192: <PRE>
                    193: extern HTArray * HTAnchor_getArray (int growby);
                    194: </PRE>
                    195: 
2.42      frystyk   196: <H2>
2.44      frystyk   197:   <A NAME="links">Links and Anchors</A>
2.42      frystyk   198: </H2>
                    199: <P>
2.44      frystyk   200: Anchor objects are bound together by <A HREF="HTLink.html">Link objects</A>
                    201: that carry information about what type of link and whetther we have followed
                    202: the link etc. Any anchor object can have zero, one, or many links but the
                    203: normal case is one. Therefore we treat this is a special way.
                    204: <H3>
                    205:   Handling the Main Link
                    206: </H3>
                    207: <P>
                    208: Any outgoing link can at any time be the main destination.
                    209: <PRE>
                    210: extern BOOL HTAnchor_setMainLink       (HTAnchor * anchor, HTLink * link);
                    211: extern HTLink * HTAnchor_mainLink      (HTAnchor * anchor);
                    212: 
                    213: extern HTAnchor * HTAnchor_followMainLink (HTAnchor * anchor);
                    214: </PRE>
2.42      frystyk   215: <H3>
2.44      frystyk   216:   Handling the Sub Links
2.42      frystyk   217: </H3>
2.44      frystyk   218: <PRE>
                    219: extern BOOL HTAnchor_setSubLinks       (HTAnchor * anchor, HTList * list);
                    220: extern HTList * HTAnchor_subLinks      (HTAnchor * anchor);
                    221: </PRE>
2.53      frystyk   222: 
                    223: <H3>
                    224:   Search for a Link Type
                    225: </H3>
                    226: 
                    227: Links can have relations (indicated by the "rel" or "rev" HTML link
                    228: attributes).  This function can search an anchor looking for a
                    229: specific type, for example "stylesheet".
                    230: 
                    231: <PRE>
                    232: extern HTLink * HTAnchor_findLinkType (HTAnchor * me, HTLinkType type);
                    233: </PRE>
                    234: 
2.44      frystyk   235: <H2>
                    236:   Relations Between Children and Parents
                    237: </H2>
                    238: <P>
                    239: As always, children and parents have a compliated relationship and the libwww
                    240: Anchor class is no exception.
                    241: <H3>
2.42      frystyk   242:   Who is Parent?
2.44      frystyk   243: </H3>
2.42      frystyk   244: <P>
2.18      frystyk   245: For parent anchors this returns the anchor itself
2.44      frystyk   246: <PRE>extern HTParentAnchor * HTAnchor_parent   (HTAnchor *me);
2.18      frystyk   247: </PRE>
2.44      frystyk   248: <H3>
2.42      frystyk   249:   Does it have any Anchors within it?
2.44      frystyk   250: </H3>
                    251: <P>
                    252: Does this parent anchor have any children
                    253: <PRE>extern BOOL HTAnchor_hasChildren  (HTParentAnchor *me);
                    254: </PRE>
2.56      frystyk   255: <H3>
                    256:   Is this anchor a Child?
                    257: </H3>
                    258: <PRE>
                    259: extern BOOL HTAnchor_isChild (HTAnchor * me);
                    260: </PRE>
                    261: 
                    262: <H3>
                    263:   Get the Tag/Fragment/View of this anchor
                    264: </H3>
                    265: 
                    266: If this is a child anchor then it has a tag (often also called a "fragment"), which
                    267: is essentially a specific <B>view</B> of a document. This is why I like to call it
                    268: a view instead of a fragment. The string returned (if non-NULL) must be freed by the
                    269: caller.
                    270: 
                    271: <PRE>
                    272: extern char * HTAnchor_view (HTAnchor * me);
                    273: </PRE>
                    274: 
2.44      frystyk   275: <H2>
2.45      frystyk   276:   Anchor Addresses
2.44      frystyk   277: </H2>
                    278: <P>
                    279: There are two addresses of an anchor. The URI that was passed when the anchor
                    280: was crated and the physical address that's used when the URI is going to
                    281: be requested. The two addresses may be different if the request is going
2.45      frystyk   282: through a proxy or a gateway or it may have been mapped through a rule file.
2.44      frystyk   283: <H3>
                    284:   Logical Address
                    285: </H3>
                    286: <P>
                    287: Returns the full URI of the anchor, child or parent as a malloc'd string
                    288: to be freed by the caller as when the anchor was created.
                    289: <PRE>extern char * HTAnchor_address            (HTAnchor * me);
2.18      frystyk   290: </PRE>
2.42      frystyk   291: <H3>
2.45      frystyk   292:   Expanded Logical Address
                    293: </H3>
                    294: <P>
                    295: When expanding URLs within a hypertext document, the base address is taken
                    296: as the following value if present (in that order):
                    297: <UL>
                    298:   <LI>
                    299:     <CODE>Content-Base</CODE> header
                    300:   <LI>
                    301:     <CODE>Content-Location</CODE> header
                    302:   <LI>
                    303:     Logical address
                    304: </UL>
                    305: <PRE>extern char * HTAnchor_expandedAddress  (HTAnchor * me);
                    306: </PRE>
                    307: <H3>
2.44      frystyk   308:   Physical address
2.42      frystyk   309: </H3>
                    310: <P>
2.44      frystyk   311: Contains the physical address after we haved looked for proxies etc.
                    312: <PRE>extern char * HTAnchor_physical           (HTParentAnchor * me);
                    313: extern void HTAnchor_setPhysical       (HTParentAnchor * me, char * protocol);
2.45      frystyk   314: extern void HTAnchor_clearPhysical     (HTParentAnchor * me);
2.44      frystyk   315: </PRE>
                    316: <H2>
                    317:   Entity Body Information
                    318: </H2>
                    319: <P>
2.42      frystyk   320: A parent anchor can have a data object bound to it. This data object does
                    321: can for example be a parsed version of a HTML that knows how to present itself
                    322: to the user, or it can be an unparsed data object. It's completely free for
                    323: the application to use this possibility, but a typical usage would to manage
                    324: the data object as part of a memory cache.
2.18      frystyk   325: <PRE>
2.35      frystyk   326: extern void HTAnchor_setDocument       (HTParentAnchor *me, void * doc);
                    327: extern void * HTAnchor_document                (HTParentAnchor *me);
2.18      frystyk   328: </PRE>
2.44      frystyk   329: <H2>
                    330:   Entity Header Information
                    331: </H2>
                    332: <P>
                    333: The anchor object also contains all the metainformation that we know about
                    334: the object.
2.42      frystyk   335: <H3>
2.44      frystyk   336:   Clear All header Information
2.42      frystyk   337: </H3>
2.49      frystyk   338: <PRE>
                    339: extern void HTAnchor_clearHeader       (HTParentAnchor *me);
2.42      frystyk   340: </PRE>
                    341: <H3>
2.49      frystyk   342:   Inherit Metainformation from the Response object
2.47      frystyk   343: </H3>
                    344: <P>
2.49      frystyk   345: Once we have decided to cache the object we transfer already parsed
                    346: metainformation from the <A HREF="HTResponse.html">HTResponse object </A>to
                    347: the anchor object and also the unparsed headers as we may wanna use that
                    348: information later.
2.47      frystyk   349: <PRE>
2.49      frystyk   350: extern BOOL HTAnchor_update (HTParentAnchor * me, HTResponse * response);
2.47      frystyk   351: </PRE>
                    352: <H3>
2.42      frystyk   353:   Is the Anchor searchable?
                    354: </H3>
2.44      frystyk   355: <PRE>extern void HTAnchor_clearIndex           (HTParentAnchor * me);
2.42      frystyk   356: extern void HTAnchor_setIndex          (HTParentAnchor * me);
                    357: extern BOOL HTAnchor_isIndex           (HTParentAnchor * me);
                    358: </PRE>
                    359: <H3>
2.44      frystyk   360:   Anchor Title
2.42      frystyk   361: </H3>
                    362: <P>
                    363: We keep the title in the anchor as we then can refer to it later in the history
                    364: list etc. We can also obtain the title element if it is passed as a HTTP
                    365: header in the response. Any title element found in an HTML document will
                    366: overwrite a title given in a HTTP header.
2.44      frystyk   367: <PRE>extern const char * HTAnchor_title        (HTParentAnchor *me);
2.32      frystyk   368: extern void HTAnchor_setTitle          (HTParentAnchor *me,
2.37      frystyk   369:                                         const char *   title);
2.32      frystyk   370: extern void HTAnchor_appendTitle       (HTParentAnchor *me,
2.37      frystyk   371:                                         const char *   title);
2.18      frystyk   372: </PRE>
2.42      frystyk   373: <H3>
2.54      frystyk   374:   Meta Tags within the Document
                    375: </H3>
                    376: 
                    377: <PRE>
                    378: extern HTAssocList * HTAnchor_meta (HTParentAnchor * me);
                    379: extern BOOL HTAnchor_addMeta (HTParentAnchor * me,
                    380:                              const char * name, const char * value);
                    381: </PRE>
                    382: 
                    383: <H4>
                    384:   The Robots Meta tag
                    385: </H4>
                    386: 
                    387: A special case function that looks for any robots meta tag. This tag
                    388: contains information about which links a robot can traverse and which
                    389: it shouldn't.
                    390: 
                    391: <PRE>
                    392: extern char * HTAnchor_robots (HTParentAnchor * me);
                    393: </PRE>
                    394: 
                    395: <H3>
2.44      frystyk   396:   Content Base
                    397: </H3>
                    398: <P>
2.49      frystyk   399: The <CODE>Content-Base</CODE> header may be used for resolving
                    400: relative URLs within the entity. If it there is no
                    401: <CODE>Content-Base</CODE> header then we use the Content-Location if
                    402: present and absolute.
                    403: <PRE>
                    404: extern char * HTAnchor_base    (HTParentAnchor * me);
2.44      frystyk   405: extern BOOL HTAnchor_setBase   (HTParentAnchor * me, char * base);
                    406: </PRE>
                    407: <H3>
                    408:   Content Location
                    409: </H3>
                    410: <P>
2.49      frystyk   411: Content location can either be an absolute or a relative URL. The URL may
                    412: be either absolute or relative. If it is relative then we parse it relative
                    413: to the <CODE>Content-Base</CODE> header of the request URI if any, otherwise
                    414: we use the Request URI.
                    415: <PRE>
                    416: extern char * HTAnchor_location                (HTParentAnchor * me);
2.44      frystyk   417: extern BOOL HTAnchor_setLocation       (HTParentAnchor * me, char * location);
                    418: </PRE>
                    419: <H3>
2.42      frystyk   420:   Media Types (Content-Type)
                    421: </H3>
2.18      frystyk   422: <PRE>
2.32      frystyk   423: extern HTFormat HTAnchor_format                (HTParentAnchor *me);
                    424: extern void HTAnchor_setFormat         (HTParentAnchor *me,
                    425:                                         HTFormat       form);
2.18      frystyk   426: </PRE>
2.42      frystyk   427: <H3>
2.44      frystyk   428:   Content Type Parameters
                    429: </H3>
                    430: <P>
                    431: The Anchor obejct stores all content parameters in an Association list so
                    432: here you will always be able to find them. We also have a few methods for
                    433: the special cases: <CODE>charset</CODE> and <CODE>level</CODE> as they are
                    434: often needed.
                    435: <PRE>
                    436: extern HTAssocList * HTAnchor_formatParam (HTParentAnchor * me);
                    437: 
                    438: extern BOOL HTAnchor_addFormatParam    (HTParentAnchor * me,
                    439:                                        const char * name, const char * value);
                    440: </PRE>
                    441: <H4>
2.42      frystyk   442:   Charset parameter to Content-Type
2.44      frystyk   443: </H4>
2.18      frystyk   444: <PRE>
2.32      frystyk   445: extern HTCharset HTAnchor_charset      (HTParentAnchor *me);
2.44      frystyk   446: extern BOOL HTAnchor_setCharset                (HTParentAnchor *me,
2.32      frystyk   447:                                         HTCharset      charset);
2.18      frystyk   448: </PRE>
2.44      frystyk   449: <H4>
2.42      frystyk   450:   Level parameter to Content-Type
2.44      frystyk   451: </H4>
2.21      frystyk   452: <PRE>
2.32      frystyk   453: extern HTLevel HTAnchor_level          (HTParentAnchor * me);
2.44      frystyk   454: extern BOOL HTAnchor_setLevel          (HTParentAnchor * me,
2.32      frystyk   455:                                         HTLevel        level);
2.22      frystyk   456: </PRE>
2.42      frystyk   457: <H3>
                    458:   Content Language
                    459: </H3>
2.22      frystyk   460: <PRE>
2.39      frystyk   461: extern HTList * HTAnchor_language      (HTParentAnchor * me);
                    462: extern BOOL HTAnchor_addLanguage       (HTParentAnchor *me, HTLanguage lang);
2.58      frystyk   463: extern BOOL HTAnchor_deleteLanguageAll  (HTParentAnchor * me);
2.21      frystyk   464: </PRE>
2.42      frystyk   465: <H3>
                    466:   Content Encoding
                    467: </H3>
2.18      frystyk   468: <PRE>
2.39      frystyk   469: extern HTList * HTAnchor_encoding      (HTParentAnchor * me);
                    470: extern BOOL HTAnchor_addEncoding       (HTParentAnchor * me, HTEncoding enc);
2.58      frystyk   471: extern BOOL HTAnchor_deleteEncoding     (HTParentAnchor * me, HTEncoding enc);
                    472: extern BOOL HTAnchor_deleteEncodingAll  (HTParentAnchor * me);
                    473: 
                    474: #define HTAnchor_removeEncoding(a, e)   HTAnchor_deleteEncoding((a), (e))
2.18      frystyk   475: </PRE>
2.42      frystyk   476: <H3>
                    477:   Content Transfer Encoding
                    478: </H3>
2.18      frystyk   479: <PRE>
2.55      frystyk   480: extern HTEncoding HTAnchor_contentTransferEncoding     (HTParentAnchor *me);
                    481: extern void HTAnchor_setContentTransferEncoding                (HTParentAnchor *me,
                    482:                                                         HTEncoding     cte);
2.18      frystyk   483: </PRE>
2.42      frystyk   484: <H3>
                    485:   Content Length
                    486: </H3>
2.18      frystyk   487: <PRE>
2.41      frystyk   488: extern long int HTAnchor_length        (HTParentAnchor * me);
                    489: extern void HTAnchor_setLength (HTParentAnchor * me, long int length);
                    490: extern void HTAnchor_addLength (HTParentAnchor * me, long int deltalength);
2.18      frystyk   491: </PRE>
2.42      frystyk   492: <H3>
2.44      frystyk   493:   Content MD5
                    494: </H3>
                    495: <PRE>
                    496: extern char * HTAnchor_md5     (HTParentAnchor * me);
2.49      frystyk   497: extern BOOL HTAnchor_setMd5    (HTParentAnchor * me, const char * hash);
2.44      frystyk   498: </PRE>
                    499: <H3>
2.42      frystyk   500:   Allowed methods (Allow)
                    501: </H3>
2.18      frystyk   502: <PRE>
2.49      frystyk   503: extern HTMethod HTAnchor_allow   (HTParentAnchor * me);
                    504: extern void HTAnchor_setAllow    (HTParentAnchor * me, HTMethod methodset);
                    505: extern void HTAnchor_appendAllow (HTParentAnchor * me, HTMethod methodset);
2.18      frystyk   506: </PRE>
2.42      frystyk   507: <H3>
                    508:   Version
                    509: </H3>
2.18      frystyk   510: <PRE>
2.35      frystyk   511: extern char * HTAnchor_version (HTParentAnchor * me);
2.37      frystyk   512: extern void HTAnchor_setVersion        (HTParentAnchor * me, const char * version);
2.28      frystyk   513: </PRE>
2.42      frystyk   514: <H3>
                    515:   Date
                    516: </H3>
                    517: <P>
2.28      frystyk   518: Returns the date that was registered in the RFC822 header "Date"
                    519: <PRE>
2.35      frystyk   520: extern time_t HTAnchor_date            (HTParentAnchor * me);
2.37      frystyk   521: extern void HTAnchor_setDate           (HTParentAnchor * me, const time_t date);
2.28      frystyk   522: </PRE>
2.42      frystyk   523: <H3>
                    524:   Last Modified Date
                    525: </H3>
                    526: <P>
2.28      frystyk   527: Returns the date that was registered in the RFC822 header "Last-Modified"
                    528: <PRE>
2.35      frystyk   529: extern time_t HTAnchor_lastModified    (HTParentAnchor * me);
2.37      frystyk   530: extern void HTAnchor_setLastModified   (HTParentAnchor * me, const time_t lm);
2.28      frystyk   531: </PRE>
2.42      frystyk   532: <H3>
2.44      frystyk   533:   Entity Tag
                    534: </H3>
                    535: <P>
                    536: Entity tags are used for comparing two or more entities from the same requested
                    537: resource. It is a cache validator much in the same way <I>Date</I> can be.
                    538: The difference is that we can't always trust the date and time stamp and
                    539: hence we must have something stronger.
                    540: <PRE>extern char * HTAnchor_etag       (HTParentAnchor * me);
                    541: extern void HTAnchor_setEtag   (HTParentAnchor * me, const char * etag);
                    542: extern BOOL HTAnchor_isEtagWeak        (HTParentAnchor * me);
                    543: </PRE>
                    544: <H3>
2.47      frystyk   545:   Age Header
                    546: </H3>
                    547: <P>
                    548: The <CODE>Age</CODE> response-header field conveys the sender's estimate
                    549: of the amount of time since the response (or its revalidation) was generated
                    550: at the origin server. A cached response is "fresh" if its age does not exceed
                    551: its freshness lifetime.
                    552: <PRE>
                    553: extern time_t HTAnchor_age    (HTParentAnchor * me);
                    554: extern void HTAnchor_setAge   (HTParentAnchor * me, const time_t age);
                    555: </PRE>
                    556: <H3>
2.42      frystyk   557:   Expires Date
                    558: </H3>
2.28      frystyk   559: <PRE>
2.35      frystyk   560: extern time_t HTAnchor_expires         (HTParentAnchor * me);
2.37      frystyk   561: extern void HTAnchor_setExpires                (HTParentAnchor * me, const time_t exp);
2.18      frystyk   562: </PRE>
2.42      frystyk   563: <H3>
                    564:   Derived from
                    565: </H3>
2.18      frystyk   566: <PRE>
2.35      frystyk   567: extern char * HTAnchor_derived (HTParentAnchor *me);
2.37      frystyk   568: extern void HTAnchor_setDerived        (HTParentAnchor *me, const char *derived_from);
2.18      frystyk   569: </PRE>
2.44      frystyk   570: <H2>
2.42      frystyk   571:   Status of Header Parsing
2.44      frystyk   572: </H2>
2.42      frystyk   573: <P>
2.47      frystyk   574: This is primarily for internal use. It is so that we can check whether the
                    575: header has been parsed or not.
2.49      frystyk   576: <PRE>
                    577: extern BOOL HTAnchor_headerParsed      (HTParentAnchor *me);
2.32      frystyk   578: extern void HTAnchor_setHeaderParsed   (HTParentAnchor *me);
2.7       timbl     579: </PRE>
2.49      frystyk   580: <H3>
                    581:   Original Response Headers
                    582: </H3>
                    583: <P>
                    584: The <A HREF="HTMIME.html">MIME parser</A> may add the original response headers
                    585: as (name,value) pairs.
                    586: <PRE>
                    587: extern BOOL HTAnchor_setHeader       (HTParentAnchor * me, HTAssocList * list);
                    588: extern HTAssocList * HTAnchor_header (HTParentAnchor * me);
                    589: </PRE>
2.18      frystyk   590: <PRE>
                    591: #endif /* HTANCHOR_H */
                    592: </PRE>
2.42      frystyk   593: <P>
                    594:   <HR>
2.39      frystyk   595: <ADDRESS>
2.60    ! kahan     596:   @(#) $Id: HTAnchor.html,v 2.59 1998/12/22 19:59:58 frystyk Exp $
2.39      frystyk   597: </ADDRESS>
2.42      frystyk   598: </BODY></HTML>

Webmaster