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