HTRequest
- The HTRequest structure contains information necessary to
handle a request issued by the application. It contains information
about the method to be used (for example "GET" and "PUT"), user
preferences (language, content type etc.) specific for this request,
where the output of the data object should go etc. The HTRequest
structure ties together the other structures used by the core modules
in order to handle the request. It is intended to live until the
request reaches a final state, either success or failure, after which
it can be discarded.
Normally, the HTRequest structure is created by the application, but
the Library is capable of creating HTRequest structures on its own
under certain circumstances. An example is when the Library creates a
"Post Web" as explained in section "Building a
POST Web, an API for PUT and POST".
HTAnchor
- Anchors represent any data objects which may be the sources or
destinations of hypertext links. The HTAnchor structure contains all
information about the object, whether it has been loaded,
metainformation like language, media type etc., and any relations to
other objects. The Library defines two anchor classes: a parent anchor
and a child anchor. The former contains information about whole data
objects and the latter contains about subparts of a data object. The
HTAnchor structure is a generic superclass of both parent anchors and
child anchors. Section "Anchor Objects"
describes anchors and their relations in more detail.
HTNetInfo
- HTNetInfo is a network interface specific structure that
contains all information required to read and write from the
network. It contains the current socket descriptor (or ANSI C file
descriptor) used for reading and writing, which input buffer to use
and where to put the data once they are read. It also contains timing
information on how long it takes to connect to a remote host and how
many times it has tried to connect. This information is used by the DNS Cache in order to optimize access on
multi homed hosts.
The HTNetInfo structure is also a key structure in the libwww thread
model where a thread is identified by this structure. The libwww
thread model is explained in "Description of
libwww Threads".
HTCache
- The HTCache structure contains metainformation about
every cached object like the amount of times it has been requested from
the cache, the content type, the size, and how long it took to obtain
the data from the network. As the cache manager is yet to be fully
specified this structure is likely to change in the near future.
HyperDoc
- The HyperDoc structure is different from the other
central data structures as it is only declared in the Library - the
definition is left to the application. It is intended to contain
information about data objects, especially hypertext objects that are
to be presented to a user. As an example of a definition, you can look
at the Line Mode Browser
where it is defined in the GridText
Module. Here it is called "_HText" structure and it contains all
information needed to present and manage a data object in a text based
environment.
The memory management of the HyperDoc object is also left to the
application along with the definition. The Library does not use any
information from the object at all - the only interaction is that the
access manager checks if a HyperDoc object exists for a given anchor
or not as a part of servicing a request. The application can use this
to maintain a set of HyperDoc objects in memory as a fast
cache. Again, the Line Mode Browser can be used as an example as it
keeps the 5 latest accessed hypertext objects in memory (regardless of
their size) in order to allow fast back track for the user. The
relation to the HTAnchor object requires that there is a link from the
HyperDoc to the corresponding anchor in order for the application to
do proper garbage collection of the HyperDoc objects.
Even though the Library does not interfere with the contents of the
HyperDoc object it does provide an API for managing the object. This
API is known as the "HText" API and it is described further in the User's Guide
HTErrorInfo
- The HTErrorInfo contains information about errors occured
in the protocol manager. Each request (in form of a HTRequest
structure) has an error stack which is a linked list of HTErrorInfo
structures. The HTErrorInfo structure contains an error number that
refers to a list of error messages, the severity of the error, any
parameters registered together with the error, and if this specific
error should be ignored by the application or not - independently of
the severity. A parameter can for example be a file name causing the
error.
HTStream
- The stream
structure is an object which accepts sequences of characters. It is a
destination of data which can be thought of much like an output stream
in C++ or an ANSI C-file stream for writing data to a disk or another
peripheral device. The broad definition makes streams very flexible
and they are used as the main method to transport data from the
application to the network and vise versa. The Library defines two
stream classes: A generic stream class and a specialized stream class
for structured data using SGML lexical tokens. The contents of the two
classes is described in detail in section "Streams Objects".
The following figure illustrates the relations between the central
data structures themselves. As before there might be other relations
between the structures, but these are the main relations.