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

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

Webmaster