1 /* 2 3 W3C Sample Code Library libwww Anchor Object 4 5 6 7 8 !The Anchor Class Definition! 9 10 */ 11 12 /* 13 ** (c) COPYRIGHT MIT 1995. 14 ** Please first read the full copyright statement in the file COPYRIGH. 15 */ 16 17 /* 18 19 This module is the private part of the anchor object. It has the 20 functions declarations that are private to the Library and that 21 shouldn't be used by applications. See also the public part of the 22 declarition in the HTAnchorModule. 23 24 */ 25 26 #ifndef HTANCMAN_H 27 #define HTANCMAN_H 28 29 #include "HTAnchor.h" 30 #include "HTList.h" 31 #include "HTAtom.h" 32 #include "HTMethod.h" 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 39 /* 40 41 We have a set of Anchor objects which of course should be sub classes 42 - but - hey - this is C - what do you expect! 43 44 (Generic Anchor type) 45 46 This is the super class of anchors. We often use this as an argument 47 to the functions that both accept parent anchors and child anchors. We 48 separate the first link from the others to avoid too many small 49 mallocs involved by a list creation. Most anchors only point to one 50 place. 51 52 */ 53 54 struct _HTAnchor { 55 HTLink mainLink; /* Main (or default) destination of this */ 56 HTList * links; /* List of extra links from this, if any */ 57 HTParentAnchor * parent; /* Parent of this anchor (self for adults) */ 58 }; 59 60 /* 61 62 (Anchor for a Parent Object) 63 64 These anchors points to the whole contents of a graphic object 65 (document). The parent anchor of a parent anchor is itself. The parent 66 anchor now contains all meta information about the object. This is 67 largely the entity headers in the HTTP specification. 68 69 */ 70 71 struct _HTParentAnchor { 72 /* Common part from the generic anchor structure */ 73 HTLink mainLink; /* Main (or default) destination of this */ 74 HTList * links; /* List of extra links from this, if any */ 75 HTParentAnchor * parent; /* Parent of this anchor (self) */ 76 77 /* ParentAnchor-specific information */ 78 HTList ** children; /* Hash of subanchors of this, if any */ 79 HTList * sources; /* List of anchors pointing to this, if any */ 80 void * document; /* The document within this is an anchor */ 81 char * physical; /* Physical address */ 82 char * address; /* Absolute address of this node */ 83 BOOL isIndex; /* Acceptance of a keyword search */ 84 85 HTAssocList * headers; /* Unparsed headers */ 86 BOOL header_parsed; /* Are we done parsing? */ 87 88 /* We keep a list of variants of this anchor, if any */ 89 HTList * variants; 90 91 /* Entity header fields */ 92 char * title; 93 HTMethod allow; /* Allowed methods (bit-flag) */ 94 95 HTFormat content_type; /* Content type */ 96 HTAssocList * type_parameters;/* Content type parameters (charset etc.) */ 97 98 HTAssocList * meta_tags; /* Set of metatags found in the HTML text */ 99 100 char * content_base; 101 HTList * content_encoding; 102 HTList * content_language; 103 long int content_length; 104 char * content_location; 105 char * content_md5; 106 107 HTEncoding cte; /* Content-Transfer-Encoding */ 108 109 time_t date; /* When was the request issued */ 110 time_t expires; /* When does the copy expire */ 111 time_t last_modified; /* When was this last modified */ 112 time_t age; /* Cache estimate of age */ 113 char * etag; /* entity tag */ 114 115 char * derived_from; /* Opaque string */ 116 char * version; /* Opaque string */ 117 }; 118 119 /* 120 121 (Anchor for a Child Object) 122 123 A child anchor is a anchor object that points to a subpart of a 124 graphic object (document) 125 126 */ 127 128 struct _HTChildAnchor { 129 /* Common part from the generic anchor structure */ 130 HTLink mainLink; /* Main (or default) destination of this */ 131 HTList * links; /* List of extra links from this, if any */ 132 HTParentAnchor * parent; /* Parent of this anchor */ 133 134 /* ChildAnchor-specific information */ 135 char * tag; /* Address of this anchor relative to parent */ 136 }; 137 138 /* 139 140 */ 141 142 #ifdef __cplusplus 143 } 144 #endif 145 146 #endif /* HTANCMAN_H */ 147 148 /* 149 150 151 152 @(#) $Id$ 153 154 155 */ 156 157 158 159