File:  [Public] / libwww / Library / src / HTAncMan.html
Revision 2.1: download - view: text, annotated - select for diffs
Thu Dec 7 00:06:18 1995 UTC (28 years, 5 months ago) by frystyk
Branches: MAIN
CVS tags: v4/0D, v4/0C, v4/0B, HEAD
next version

<HTML>
<HEAD>
<TITLE>Anchor Object</TITLE>
<!-- Changed by: Henrik Frystyk Nielsen,  6-Dec-1995 -->
</HEAD>
<BODY>

<H1>The Anchor and Link Objects</H1>

<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>

This module is the private part of the anchor object. It has the
functions declarations that are private to the Library and that
shouldn't be used by applications. See also the public part of the
declarition in the <A HREF="HTAnchor.html">HTAnchorModule</A>.<P>

<PRE>
#ifndef HTANCMAN_H
#define HTANCMAN_H

#include "HTAnchor.h"
#include "HTList.h"
#include "HTAtom.h"
#include "HTMethod.h"
</PRE>

<H2>The Link Object</H2>

Link Objects bind together anchor objects

<PRE>
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 */
};
</PRE>

<H2>The Anchor Object</H2>

We have a set of Anchor objects which of course should be sub classes
- but - hey - this is C - what do you expect!

<A NAME="Generic"><H3>Generic Anchor type</H3></A>

This is the super class of anchors. We often use this as an argument
to the functions that both accept parent anchors and child anchors. We
separate the first link from the others to avoid too many small
mallocs involved by a list creation. Most anchors only point to one
place.

<PRE>
struct _HTAnchor {
  HTLink	mainLink;	/* Main (or default) destination of this */
  HTList *	links;  	/* List of extra links from this, if any */
  HTParentAnchor * parent;	/* Parent of this anchor (self for adults) */
};
</PRE>

<A NAME="parent"><H3>Anchor for a Parent Object</H3></A>

These anchors points to the whole contents of a graphic object
(document). The parent anchor of a parent anchor is itself. The parent
anchor now contains all meta information about the object. This is
largely the entity headers in the HTTP specification.

<PRE>
struct _HTParentAnchor {
  /* Common part from the generic anchor structure */
  HTLink	mainLink;	/* Main (or default) destination of this */
  HTList *	links;  	/* List of extra links from this, if any */
  HTParentAnchor * parent;	/* Parent of this anchor (self) */

  /* ParentAnchor-specific information */
  HTList *	children;	/* Subanchors of this, if any */
  HTList *	sources;	/* List of anchors pointing to this, if any */
  void *	document;	/* The document within this is an anchor */
  char *	physical;	/* Physical address */
  BOOL		cacheHit;	/* Yes, if cached object found */
  char * 	address;	/* Absolute address of this node */
  BOOL		isIndex;	/* Acceptance of a keyword search */

  /* Entity header fields */
  BOOL		header_parsed;	/* Are we done parsing? */

  char *	title;
  int		methods;	/* Allowed methods (bit-flag) */

  HTEncoding	content_encoding;
  HTLanguage	content_language;	/* @@@ SHOULD BE LIST @@@ */
  long int	content_length;
  HTCte		cte;		/* Content-Transfer-Encoding */
  HTFormat	content_type;
  HTCharset	charset;	/* Parameter to content-type */
  HTLevel	level;		/* Parameter to content-type `text/html' */

  time_t	date;		/* When was the request issued */  
  time_t	expires;	/* When does the copy expire */
  time_t	last_modified;

  char *	derived_from;	/* Opaque string */
  char *	version;	/* Opaque string */

  /* List of unknown headers coming in from the network. Use the field in the
     request structure for sending test headers. */
  HTList *	extra_headers;
};
</PRE>

<A NAME="child"><H3>Anchor for a Child Object</H3></A>

A child anchor is a anchor object that points to a subpart of a
graphic object (document)

<PRE>
struct _HTChildAnchor {
  /* Common part from the generic anchor structure */
  HTLink	mainLink;	/* Main (or default) destination of this */
  HTList *	links;  	/* List of extra links from this, if any */
  HTParentAnchor * parent;	/* Parent of this anchor */

  /* ChildAnchor-specific information */
  char * 	tag;		/* Address of this anchor relative to parent */
};
</PRE>

<PRE>
#endif /* HTANCMAN_H */
</PRE>
</BODY>
</HTML>

Webmaster