File:  [Public] / libwww / Library / src / HTLib.html
Revision 2.6: download - view: text, annotated - select for diffs
Thu Oct 15 20:09:34 1998 UTC (25 years, 7 months ago) by frystyk
Branches: MAIN
CVS tags: Release-5-2-8, Release-5-2-6, Release-5-2, HEAD, Before-New-Trace-Messages, Amaya_2_4, Amaya-3-2-1, Amaya-3-2
Added two new public functions to the HTLib module which allows the application to set the application name and version number used in libwww, primarily in the HTTP user-agent field. Note that there are strict limitataions on what can be put into these strings

<HTML>
<HEAD>
  <TITLE>W3C Sample Code Library libwww Initialization</TITLE>
</HEAD>
<BODY>
<H1>
  Libwww Initialization
</H1>
<PRE>
/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
</PRE>
<P>
This module contains some generic functions for getting the name and version
of libwww. It also contains some global configuration options like if you
can access the local file system, for example.
<P>
This module is implemented by <A HREF="HTLib.c">HTLib.c</A>, and it is a
part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code Library</A>.
<PRE>
#ifndef HTLIB_H
#define HTLIB_H

#include "<A HREF="HTUser.html">HTUser.h</A>"
</PRE>
<H2>
  Initializing and Terminating libwww
</H2>
<P>
These two functions initiates memory and settings for the libwww core and
cleans up memory kept by libwww core when exiting the application. They
&nbsp;MUST be used as libwww otherwise is in a undefined state.
<PRE>extern BOOL HTLibInit (const char * AppName, const char * AppVersion);
extern BOOL HTLibTerminate (void);
</PRE>
<H2>
  Libwww Name and Version
</H2>
<P>
You can get the generic name of the Library and the version by using the
following functions:
<PRE>extern const char * HTLib_name (void);
extern const char * HTLib_version (void);
</PRE>
<H2>
  Is libwww Initalized?
</H2>
<P>
Returns YES or NO
<PRE>extern BOOL HTLib_isInitialized (void);
</PRE>
<H2>
  Application Name and Version
</H2>
<P>
Returns the name of the application name and the version number. The name
and version SHOULD be short and to the point. They MUST NOT be used for
advertising or other non-essential information. Although any token character
MAY appear in a product-version, this token SHOULD only be used for a version
identifier.
<H3>
  Set or get the application name
</H3>
<P>
The name can not contain any spaces as it is used as part of the user agent
field. For the same reason, the string MUST be in US-ASCII. For example,
"<B>SmartApp</B>"
<PRE>
extern const char * HTLib_appName (void);
extern BOOL HTLib_setAppName (const char * name);
</PRE>
<H3>
  Set or get the application version
</H3>
<P>
The version token can not contain any spaces as it is used as part of the
user agent field. For the same reason, the string MUST be in US-ASCII. For
example, "<B>1.0</B>". 
<PRE>
extern const char * HTLib_appVersion (void);
extern BOOL HTLib_setAppVersion (const char * version);
</PRE>
<H2>
  <A NAME="Secure">Accessing the Local File System</A>
</H2>
<P>
Libwww does normally use the local file system for dumping unknown data objects,
file cache etc. In some situations this is not desired and we can therefore
turn it off. This mode also prevents you from being able to access other
resources where you have to login telnet, for example.
<PRE>extern BOOL HTLib_secure (void);
extern void HTLib_setSecure (BOOL mode);
</PRE>
<H2>
  Default User Profile
</H2>
<P>
The default <A HREF="HTUser.html">user profile</A> is automatically created
by the libwww in order to get information about the <I>hostname</I>, default
<I>email -address </I>etc. All <A HREF="HTReq.html">request objects</A> will
be created with this default user profile. The application may assign individual
user profiles to every request object or may set the default user profile.
<PRE>extern HTUserProfile * HTLib_userProfile (void);
extern BOOL HTLib_setUserProfile (HTUserProfile * up);
</PRE>
<PRE>
#endif /* HTLIB_H */
</PRE>
<P>
  <HR>
<ADDRESS>
  @(#) $Id: HTLib.html,v 2.6 1998/10/15 20:09:34 frystyk Exp $
</ADDRESS>
</BODY></HTML>

Webmaster