📄 htanchor.h
字号:
Contains the physical address after we haved looked for proxies etc.*/extern char * HTAnchor_physical (HTParentAnchor * me);extern void HTAnchor_setPhysical (HTParentAnchor * me, char * protocol);extern void HTAnchor_clearPhysical (HTParentAnchor * me);/*. Entity Body Information.A parent anchor can have a data object bound to it. This data object doescan for example be a parsed version of a HTML that knows how to present itselfto the user, or it can be an unparsed data object. It's completely free forthe application to use this possibility, but a typical usage would to managethe data object as part of a memory cache.*/extern void HTAnchor_setDocument (HTParentAnchor *me, void * doc);extern void * HTAnchor_document (HTParentAnchor *me);/*. Entity Header Information.The anchor object also contains all the metainformation that we know aboutthe object.( Clear All header Information)*/extern void HTAnchor_clearHeader (HTParentAnchor *me);/*( Inherit Metainformation from the Response object)Once we have decided to cache the object we transfer already parsedmetainformation from the HTResponse object tothe anchor object and also the unparsed headers as we may wanna use thatinformation later.*/extern BOOL HTAnchor_update (HTParentAnchor * me, HTResponse * response);/*( Is the Anchor searchable?)*/extern void HTAnchor_clearIndex (HTParentAnchor * me);extern void HTAnchor_setIndex (HTParentAnchor * me);extern BOOL HTAnchor_isIndex (HTParentAnchor * me);/*( Anchor Title)We keep the title in the anchor as we then can refer to it later in the historylist etc. We can also obtain the title element if it is passed as a HTTPheader in the response. Any title element found in an HTML document willoverwrite a title given in a HTTP header.*/extern const char * HTAnchor_title (HTParentAnchor *me);extern void HTAnchor_setTitle (HTParentAnchor *me, const char * title);extern void HTAnchor_appendTitle (HTParentAnchor *me, const char * title);/*( Meta Tags within the Document)*/extern HTAssocList * HTAnchor_meta (HTParentAnchor * me);extern BOOL HTAnchor_addMeta (HTParentAnchor * me, const char * name, const char * value);/* The Robots Meta tagA special case function that looks for any robots meta tag. This tagcontains information about which links a robot can traverse and whichit shouldn't.*/extern char * HTAnchor_robots (HTParentAnchor * me);/*( Content Base)The Content-Base header may be used for resolvingrelative URLs within the entity. If it there is noContent-Base header then we use the Content-Location ifpresent and absolute.*/extern char * HTAnchor_base (HTParentAnchor * me);extern BOOL HTAnchor_setBase (HTParentAnchor * me, char * base);/*( Content Location)Content location can either be an absolute or a relative URL. The URL maybe either absolute or relative. If it is relative then we parse it relativeto the Content-Base header of the request URI if any, otherwisewe use the Request URI.*/extern char * HTAnchor_location (HTParentAnchor * me);extern BOOL HTAnchor_setLocation (HTParentAnchor * me, char * location);/*( Media Types (Content-Type))*/extern HTFormat HTAnchor_format (HTParentAnchor *me);extern void HTAnchor_setFormat (HTParentAnchor *me, HTFormat form);/*( Content Type Parameters)The Anchor obejct stores all content parameters in an Association list sohere you will always be able to find them. We also have a few methods forthe special cases: charset and level as they areoften needed.*/extern HTAssocList * HTAnchor_formatParam (HTParentAnchor * me);extern BOOL HTAnchor_addFormatParam (HTParentAnchor * me, const char * name, const char * value);/* Charset parameter to Content-Type*/extern HTCharset HTAnchor_charset (HTParentAnchor *me);extern BOOL HTAnchor_setCharset (HTParentAnchor *me, HTCharset charset);/* Level parameter to Content-Type*/extern HTLevel HTAnchor_level (HTParentAnchor * me);extern BOOL HTAnchor_setLevel (HTParentAnchor * me, HTLevel level);/*( Content Language)*/extern HTList * HTAnchor_language (HTParentAnchor * me);extern BOOL HTAnchor_addLanguage (HTParentAnchor *me, HTLanguage lang);extern BOOL HTAnchor_deleteLanguageAll (HTParentAnchor * me);/*( Content Encoding)*/extern HTList * HTAnchor_encoding (HTParentAnchor * me);extern BOOL HTAnchor_addEncoding (HTParentAnchor * me, HTEncoding enc);extern BOOL HTAnchor_deleteEncoding (HTParentAnchor * me, HTEncoding enc);extern BOOL HTAnchor_deleteEncodingAll (HTParentAnchor * me);#define HTAnchor_removeEncoding(a, e) HTAnchor_deleteEncoding((a), (e))/*( Content Transfer Encoding)*/extern HTEncoding HTAnchor_contentTransferEncoding (HTParentAnchor *me);extern void HTAnchor_setContentTransferEncoding (HTParentAnchor *me, HTEncoding cte);/*( Content Length)*/extern long int HTAnchor_length (HTParentAnchor * me);extern void HTAnchor_setLength (HTParentAnchor * me, long int length);extern void HTAnchor_addLength (HTParentAnchor * me, long int deltalength);/*( Content MD5)*/extern char * HTAnchor_md5 (HTParentAnchor * me);extern BOOL HTAnchor_setMd5 (HTParentAnchor * me, const char * hash);/*( Allowed methods (Allow))*/extern HTMethod HTAnchor_allow (HTParentAnchor * me);extern void HTAnchor_setAllow (HTParentAnchor * me, HTMethod methodset);extern void HTAnchor_appendAllow (HTParentAnchor * me, HTMethod methodset);/*( Version)*/extern char * HTAnchor_version (HTParentAnchor * me);extern void HTAnchor_setVersion (HTParentAnchor * me, const char * version);/*( Date)Returns the date that was registered in the RFC822 header "Date"*/extern time_t HTAnchor_date (HTParentAnchor * me);extern void HTAnchor_setDate (HTParentAnchor * me, const time_t date);/*( Last Modified Date)Returns the date that was registered in the RFC822 header "Last-Modified"*/extern time_t HTAnchor_lastModified (HTParentAnchor * me);extern void HTAnchor_setLastModified (HTParentAnchor * me, const time_t lm);/*( Entity Tag)Entity tags are used for comparing two or more entities from the same requestedresource. It is a cache validator much in the same way Date can be.The difference is that we can't always trust the date and time stamp andhence we must have something stronger.*/extern char * HTAnchor_etag (HTParentAnchor * me);extern void HTAnchor_setEtag (HTParentAnchor * me, const char * etag);extern BOOL HTAnchor_isEtagWeak (HTParentAnchor * me);/*( Age Header)The Age response-header field conveys the sender's estimateof the amount of time since the response (or its revalidation) was generatedat the origin server. A cached response is "fresh" if its age does not exceedits freshness lifetime.*/extern time_t HTAnchor_age (HTParentAnchor * me);extern void HTAnchor_setAge (HTParentAnchor * me, const time_t age);/*( Expires Date)*/extern time_t HTAnchor_expires (HTParentAnchor * me);extern void HTAnchor_setExpires (HTParentAnchor * me, const time_t exp);/*( Derived from)*/extern char * HTAnchor_derived (HTParentAnchor *me);extern void HTAnchor_setDerived (HTParentAnchor *me, const char *derived_from);/*. Status of Header Parsing.This is primarily for internal use. It is so that we can check whether theheader has been parsed or not.*/extern BOOL HTAnchor_headerParsed (HTParentAnchor *me);extern void HTAnchor_setHeaderParsed (HTParentAnchor *me);/*( Original Response Headers)The MIME parser may add the original response headersas (name,value) pairs.*/extern BOOL HTAnchor_setHeader (HTParentAnchor * me, HTAssocList * list);extern HTAssocList * HTAnchor_header (HTParentAnchor * me);/**/#endif /* HTANCHOR_H *//* @(#) $Id: HTAnchor.html,v 2.61 2000/08/04 09:14:58 kahan Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -