⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htlink.h

📁 www工具包
💻 H
字号:
/*    					W3C Sample Code Library libwww Link Class!  The Link Class!*//***	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.*//*A Link represents the link between anchor objects.By keeping the link as a object and not as part of the anchor we are capableof handling link semantics in a much more organized way. For example, wecan then search for link types among all the link objects that we have created.Anchor objects are bound together using Linkobjects. Each anchor can be the source or destination of zero, one, or morelinks from and to other anchors.This module is implemented by HTLink.c, and it isa part of the  W3C Sample CodeLibrary.*/#ifndef HTLINK_H#define HTLINK_Htypedef struct _HTLink	HTLink;#include "WWWUtil.h"#include "HTMethod.h"#include "HTAnchor.h"/*.  Creation and Deletion Methods.These are the methods for crating and deleting new link objects(  Create a new Link Object)*/typedef HTAtom * 	HTLinkType;typedef enum _HTLinkResult {    HT_LINK_INVALID = -1,    HT_LINK_NONE = 0,    HT_LINK_ERROR,    HT_LINK_OK} HTLinkResult;struct _HTLink {    HTAnchor *		dest;		   /* The anchor to which this leads */    HTLinkType		type;		           /* Semantics of this link */    HTMethod		method;		   /* Method for this link, e.g. PUT */    HTLinkResult	result;    /* Result of any attempt to get this link */};HTLink * HTLink_new (void);/*(  Delete a Link Object)A link can be removed as any other object*/BOOL HTLink_delete (HTLink * link);/*(  Remove All Link Information from an Anchor)This is normally a part of deleting anchor objects.*/extern BOOL HTLink_removeAll (HTAnchor * me);/*.  Handle Link Between Anchors.As mentioned, link objects are the ones that bind anchor objects togetherin a Web like structure(  Add a Link between two Anchors)This method creates a new link between two anchorobjects.*/extern BOOL HTLink_add (HTAnchor *	source,			     HTAnchor * destination, 			     HTLinkType	type,			     HTMethod	method);/*(  Remove All Links Between two Anchors)Removes link information from one anchor to another.*/extern BOOL HTLink_remove (HTAnchor * source, HTAnchor * destination);/*(  Find a Link)Find the anchor object between a destination and a source ancher. Returnlink object if any, else NULL*/extern HTLink * HTLink_find (HTAnchor * source, HTAnchor * destination);/*.  Link Information.This is the set of methods for accessing the information carried by a linkobject(  Link Destination)The link destination is the destination anchor pointed to by the link.*/extern BOOL HTLink_setDestination (HTLink * link, HTAnchor * dest);extern HTAnchor * HTLink_destination (HTLink * link);/*(  Link Types and Semantic Links)Each link has a sematic representation associated with it. This means thatthe application can distinguish between pages based on the semantics of thelink. This is very similar to the LINK tag in HTML pages whichindicates the meaning if this pages to other pages.*/extern BOOL HTLink_setType (HTLink * link, HTLinkType type);extern HTLinkType HTLink_type (HTLink * link);/*(  Link Method)The link method is the HTTP method we have performed between the two links.For example, it can be a POST operation, or a PUT operation where the operationon the first anchor created a new anchor.*/extern BOOL HTLink_setMethod (HTLink * link, HTMethod method);extern HTMethod HTLink_method (HTLink * link);/*(  Link Result)When a link has been used for posting an object from a source to a destinationlink, the result of the operation is stored as part of the link information.This means that we can keep track of which operations we have performed ona link and hence the application can ask the user whether he or she wantsto do a re-post, for example.*/extern BOOL HTLink_setResult (HTLink * link, HTLinkResult result);extern HTLinkResult HTLink_result (HTLink * link);/**/#endif /* HTLINK_H *//*    @(#) $Id: HTLink.html,v 2.3 1998/05/14 02:10:38 frystyk Exp $*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -