File:  [Public] / libwww / Library / src / HTProfil.html
Revision 2.8: download - view: text, annotated - select for diffs
Wed Jul 12 10:44:41 2000 UTC (23 years, 10 months ago) by kahan
Branches: MAIN
CVS tags: repeat-requests, before_webdav, Release-5-4-0, Release-5-3-1, HEAD, Amaya-6-3, Amaya-6-1, Amaya-5-2, Amaya-4-3-2, Amaya-4-3-1, Amaya-4-3, Amaya-4-1-2, Amaya-4-1-0, Amaya-4-0-0, Amaya
typo fixes contributed by fox one

<HTML>
<HEAD>
  <!-- Changed by: Henrik Frystyk Nielsen, 15-Jul-1996 -->
  <TITLE>W3C Sample Code Library libwww Default Initialization</TITLE>
</HEAD>
<BODY>
<H1>
  Application Profiles
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
As mentioned in the <A HREF="../User/Architecture/">Library Architecture</A>,
libwww consists of a small core and a large set of hooks for adding
functionality. By itself, the core it not capable of performing any Web related
tasks like accessing a HTTP server or parsing a HTML document. All this
functionality must be registered by the application. This way, the core of
libwww is kept application independent and can be used as the basic building
block for any kind of Web application.
<P>
The Library comes with a large set of default functions, for example for
accessing HTTP and FTP servers, parsing
<A HREF="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc822.txt">RFC
822</A> headers etc. but it must all be registered by the application before
the core knows about it. You can either register the parts directly through
the many initialization functions in the Initialization Interface or you
can use these "precompiled" profiles which are set up to contain the featuers
often used by the a specific type of application, for example a client, a
server, a robot etc.
<P>
This module helps the application programmer setting up all this functionality,
but it is important to note that none of it is <I>required</I> in order to
use the Library. All the profiles declared below superseed the Library core
initialization function <CODE>HTLibInit()</CODE> which is defined in the
<A HREF="HTLib.html">HTLib module</A>.
<P>
This module is implemented by <A HREF="HTProfil.c">HTProfil.c</A>, and it
is a part of the <A HREF="http://www.w3.org/Library/">W3C Sample Code
Library</A>. You can also have a look at the other
<A HREF="WWWInit.html">Initialization modules</A>.
<PRE>
#ifndef HTPROF_H
#define HTPROF_H
#include "WWWLib.h"
#include "WWWInit.h"
</PRE>
<H2>
  <A NAME="Client">Client Application Profiles</A>
</H2>
<P>
We have a couple of different client application profiles suited to different
types of clients.
<H3>
  Traditional Client Application
</H3>
<P>
The first uses a non-blocking socket interface which enables the application
to perform multiple requests simultanously - in everyday words called
pseudo-threads. Besides that this profile contains typical filters for handling
redirection, authentication, logging, and proxy servers.
<PRE>
extern void HTProfile_newClient (
	const char * AppName,
	const char * AppVersion);
</PRE>
<H3>
  Simple HTML Client
</H3>
<P>
As above but furthermore contains the <A HREF="HTML.html">default libwww
HTML parser</A>
<PRE>
extern void HTProfile_newHTMLClient (
	const char * AppName,
	const char * AppVersion);
</PRE>
<H3>
  Client without a Persistent Cache
</H3>
<P>
This is the same as above except that it doesn't start the persistent cache.
<PRE>
extern void HTProfile_newNoCacheClient (
	const char * AppName,
	const char * AppVersion);
</PRE>
<H3>
  Simple HTML Client without Persistent Cache
</H3>
<P>
As above but furthermore contains the <A HREF="HTML.html">default libwww
HTML parser</A>
<PRE>
extern void HTProfile_newHTMLNoCacheClient (
	const char * AppName,
	const char * AppVersion);
</PRE>
<H3>
  Preemptive (Blocking) Client
</H3>
<P>
<B><IMG SRC="../../Icons/32x32/warning.gif" WIDTH="32" HEIGHT="32" ALT="Note: "
    BORDER="0">Do not use preemptive profiles if you are doing <TT>PUT</TT> or
<TT>POST</TT> requests.</B>
<P>
We also have a blocking (preemptive) version of the same client interface.
The difference is that this version uses traditional blocking sockets and
hence only one request can be performed at the same time.
<PRE>
extern void HTProfile_newPreemptiveClient (
	const char * AppName,
	const char * AppVersion);
</PRE>
<H2>
  <A NAME="Robot">Robot Application Profile</A>
</H2>
<P>
The robot profile contains much of the same functionality as the client,
but it does contain less filters. For example, robots are normally not interested
in performing automatic redirections or access authentication, and hence
this is not part of the robot profile.
<PRE>
extern void HTProfile_newRobot (
	const char * AppName,
	const char * AppVersion);
</PRE>
<P>
<B><IMG SRC="../../Icons/32x32/warning.gif" WIDTH="32" HEIGHT="32" ALT="Note: "
    BORDER="0">Do not use preemptive profiles if you are doing <TT>PUT</TT> or
<TT>POST</TT> requests.</B>
<P>
As for the client interfacem we also have a blocking (preemptive) version
of the same interface. The difference is that this version uses traditional
blocking sockets and hence only one reques can be performed at the same time.
<PRE>
extern void HTProfile_newPreemptiveRobot (
	const char * AppName,
	const char * AppVersion);
</PRE>
<H2>
  Delete a Profile
</H2>
<P>
This is a generic profile cleanup that should be used on all the profiles
above. This will clean up the memory allocated by the profile and by the
Library core itself. After calling this you can not call any Library function
again. This call also supersedes the termination function for the Library
core, <CODE>HTLibTerminate()</CODE> so that you don't have to call that after
calling this function.
<PRE>extern void HTProfile_delete (void);
</PRE>
<PRE>
#endif
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: HTProfil.html,v 2.8 2000/07/12 10:44:41 kahan Exp $
</ADDRESS>
</BODY></HTML>

Webmaster