Annotation of libwww/Library/src/HTLib.html, revision 2.6
2.1 frystyk 1: <HTML>
2: <HEAD>
2.6 ! frystyk 3: <TITLE>W3C Sample Code Library libwww Initialization</TITLE>
2.1 frystyk 4: </HEAD>
5: <BODY>
6: <H1>
2.6 ! frystyk 7: Libwww Initialization
2.1 frystyk 8: </H1>
9: <PRE>
10: /*
11: ** (c) COPYRIGHT MIT 1995.
12: ** Please first read the full copyright statement in the file COPYRIGH.
13: */
14: </PRE>
15: <P>
16: This module contains some generic functions for getting the name and version
17: of libwww. It also contains some global configuration options like if you
18: can access the local file system, for example.
19: <P>
2.6 ! frystyk 20: This module is implemented by <A HREF="HTLib.c">HTLib.c</A>, and it is a
! 21: part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code Library</A>.
2.1 frystyk 22: <PRE>
23: #ifndef HTLIB_H
24: #define HTLIB_H
25:
2.6 ! frystyk 26: #include "<A HREF="HTUser.html">HTUser.h</A>"
2.1 frystyk 27: </PRE>
2.6 ! frystyk 28: <H2>
! 29: Initializing and Terminating libwww
! 30: </H2>
! 31: <P>
! 32: These two functions initiates memory and settings for the libwww core and
! 33: cleans up memory kept by libwww core when exiting the application. They
! 34: MUST be used as libwww otherwise is in a undefined state.
2.1 frystyk 35: <PRE>extern BOOL HTLibInit (const char * AppName, const char * AppVersion);
36: extern BOOL HTLibTerminate (void);
37: </PRE>
2.6 ! frystyk 38: <H2>
! 39: Libwww Name and Version
! 40: </H2>
2.1 frystyk 41: <P>
42: You can get the generic name of the Library and the version by using the
43: following functions:
44: <PRE>extern const char * HTLib_name (void);
45: extern const char * HTLib_version (void);
46: </PRE>
2.6 ! frystyk 47: <H2>
! 48: Is libwww Initalized?
! 49: </H2>
2.2 frystyk 50: <P>
51: Returns YES or NO
52: <PRE>extern BOOL HTLib_isInitialized (void);
53: </PRE>
2.6 ! frystyk 54: <H2>
! 55: Application Name and Version
! 56: </H2>
! 57: <P>
! 58: Returns the name of the application name and the version number. The name
! 59: and version SHOULD be short and to the point. They MUST NOT be used for
! 60: advertising or other non-essential information. Although any token character
! 61: MAY appear in a product-version, this token SHOULD only be used for a version
! 62: identifier.
2.2 frystyk 63: <H3>
2.6 ! frystyk 64: Set or get the application name
2.1 frystyk 65: </H3>
66: <P>
2.6 ! frystyk 67: The name can not contain any spaces as it is used as part of the user agent
! 68: field. For the same reason, the string MUST be in US-ASCII. For example,
! 69: "<B>SmartApp</B>"
2.1 frystyk 70: <PRE>
71: extern const char * HTLib_appName (void);
2.6 ! frystyk 72: extern BOOL HTLib_setAppName (const char * name);
! 73: </PRE>
! 74: <H3>
! 75: Set or get the application version
! 76: </H3>
! 77: <P>
! 78: The version token can not contain any spaces as it is used as part of the
! 79: user agent field. For the same reason, the string MUST be in US-ASCII. For
! 80: example, "<B>1.0</B>".
! 81: <PRE>
2.1 frystyk 82: extern const char * HTLib_appVersion (void);
2.6 ! frystyk 83: extern BOOL HTLib_setAppVersion (const char * version);
2.1 frystyk 84: </PRE>
2.6 ! frystyk 85: <H2>
2.3 frystyk 86: <A NAME="Secure">Accessing the Local File System</A>
2.6 ! frystyk 87: </H2>
2.1 frystyk 88: <P>
2.6 ! frystyk 89: Libwww does normally use the local file system for dumping unknown data objects,
! 90: file cache etc. In some situations this is not desired and we can therefore
! 91: turn it off. This mode also prevents you from being able to access other
! 92: resources where you have to login telnet, for example.
2.1 frystyk 93: <PRE>extern BOOL HTLib_secure (void);
94: extern void HTLib_setSecure (BOOL mode);
95: </PRE>
2.6 ! frystyk 96: <H2>
2.1 frystyk 97: Default User Profile
2.6 ! frystyk 98: </H2>
2.1 frystyk 99: <P>
100: The default <A HREF="HTUser.html">user profile</A> is automatically created
101: by the libwww in order to get information about the <I>hostname</I>, default
102: <I>email -address </I>etc. All <A HREF="HTReq.html">request objects</A> will
103: be created with this default user profile. The application may assign individual
104: user profiles to every request object or may set the default user profile.
105: <PRE>extern HTUserProfile * HTLib_userProfile (void);
106: extern BOOL HTLib_setUserProfile (HTUserProfile * up);
107: </PRE>
108: <PRE>
109: #endif /* HTLIB_H */
110: </PRE>
111: <P>
112: <HR>
113: <ADDRESS>
2.6 ! frystyk 114: @(#) $Id: HTLib.html,v 2.5 1998/05/14 02:10:38 frystyk Exp $
2.1 frystyk 115: </ADDRESS>
116: </BODY></HTML>
Webmaster