Annotation of libwww/Library/src/HTHome.html, revision 2.15
2.1 frystyk 1: <HTML>
2: <HEAD>
2.11 frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 16-Jul-1996 -->
2.13 frystyk 4: <TITLE>W3C Sample Code Library libwww Home Page Management</TITLE>
2.1 frystyk 5: </HEAD>
6: <BODY>
2.7 frystyk 7: <H1>
2.10 frystyk 8: Home Page Management
2.7 frystyk 9: </H1>
2.1 frystyk 10: <PRE>
11: /*
12: ** (c) COPYRIGHT MIT 1995.
13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
2.7 frystyk 16: <P>
17: This module provides some "<I>make life easier</I>" functions in order to
18: get the application going. The functionality of this module was originally
19: in <A HREF="HTAccess.html">HTAccess</A>, but now it has been moved here as
20: a part of the <A HREF="WWWApp.html">application interface</A> where the
21: application <EM>may</EM> use it if desired.
22: <P>
23: This module is implemented by <A HREF="HTHome.c">HTHome.c</A>, and it is
2.14 frystyk 24: a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.7 frystyk 25: Library</A>.
2.1 frystyk 26: <PRE>
27: #ifndef HTHOME_H
28: #define HTHOME_H
2.3 frystyk 29: #include "WWWLib.h"
2.1 frystyk 30: </PRE>
2.7 frystyk 31: <P>
32: The <I>home page </I>is special in that this is is the first page to visit
33: when a client application starts up. Note that a home page is a generic
34: URL and hence can be any resouce - not only resources on the local file system.
2.10 frystyk 35: <H2>
2.15 ! frystyk 36: <A NAME="Personal">Personal Home Page</A>
2.10 frystyk 37: </H2>
2.7 frystyk 38: <PRE>#define LOGICAL_DEFAULT "WWW_HOME" /* Defined to be the home page */
2.1 frystyk 39:
40: #ifndef PERSONAL_DEFAULT
2.7 frystyk 41: #define PERSONAL_DEFAULT "WWW/default.html" /* in home directory */
2.1 frystyk 42: #endif
43:
44: /* If the home page isn't found, use this file: */
45: #ifndef LAST_RESORT
2.7 frystyk 46: #define LAST_RESORT "http://www.w3.org/"
2.1 frystyk 47: #endif
2.7 frystyk 48: </PRE>
2.10 frystyk 49: <H2>
2.15 ! frystyk 50: <A NAME="Remote">Home Page for Remote Access</A>
2.10 frystyk 51: </H2>
2.7 frystyk 52: <P>
53: Some Web applications can also be run remotely - for example as a telnet
54: login shell. The Line Mode Browser is an example of such an application. In
55: that case, the home page is often more generic than a personal home page.
56: <PRE>
2.1 frystyk 57: /* If one telnets to an access point it will look in this file for home page */
58: #ifndef REMOTE_POINTER
2.7 frystyk 59: #define REMOTE_POINTER "/etc/www-remote.url" /* can't be file */
2.1 frystyk 60: #endif
61:
62: /* and if that fails it will use this. */
63: #ifndef REMOTE_ADDRESS
2.7 frystyk 64: #define REMOTE_ADDRESS "http://www.w3.org/" /* can't be file */
2.1 frystyk 65: #endif
66:
67: #ifndef LOCAL_DEFAULT_FILE
2.7 frystyk 68: #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
2.1 frystyk 69: #endif
70: </PRE>
2.10 frystyk 71: <H2>
2.15 ! frystyk 72: <A NAME="HomeAnchor">Get an Anchor for the Home Page</A>
2.10 frystyk 73: </H2>
2.7 frystyk 74: <P>
75: Getting an anchor for the <I>home page</I> involves looking for the (environment)
76: variables described in the section above. As this is something that almost
77: all client applications must do then we provide some simple methods that
78: do the work for you.
2.9 frystyk 79: <PRE>
80: extern HTParentAnchor * HTHomeAnchor (void);
2.7 frystyk 81: </PRE>
2.10 frystyk 82: <H2>
2.11 frystyk 83: <A NAME="temp">Create a New Anchor for Temporary Local Files</A>
84: </H2>
85: <P>
86: When the user starts writing a new document, the client application should
87: create a new anchor which can contain the document while it is created. This
88: can also be the location for backups and for security "auto-save" functionality.
89: This functions creates a new anchor with a URL pointing to the temporary
90: location defined by this user profile and returns that anchor.
91: <PRE>
92: extern HTParentAnchor * HTTmpAnchor (HTUserProfile * up);
93: </PRE>
94: <H2>
2.7 frystyk 95: Get The Current Directory in URL form
2.10 frystyk 96: </H2>
2.7 frystyk 97: <P>
98: Creates a local file URL that can be used as a relative name when calling
99: expanding other URLs relative to the current location in the local file system
100: tree where the application is running. The code for this routine originates
101: from the Line Mode Browser and was moved here by <EM>howcome@w3.org</EM>
102: in order for all clients to take advantage.
2.9 frystyk 103: <PRE>
104: #define HTFindRelatedName HTGetCurrentDirectoryURL
2.7 frystyk 105: extern char * HTGetCurrentDirectoryURL (void);
106: </PRE>
107: <H2>
2.12 frystyk 108: <A NAME="Trace">Handle Library Trace Messages</A>
2.8 frystyk 109: </H2>
110: <P>
111: Standard interface to libwww <A HREF="HTUtils.html#Debug">TRACE messages</A>.
112: Pass this function a string of characters and it will set up the appropriate
2.15 ! frystyk 113: TRACE flags. The following characters are used as follows:
! 114: <DL COMPACT>
! 115: <DT>
! 116: <B>f</B>
! 117: <DD>
! 118: Show <A HREF="WWWUtil.html">BASIC UTILITIES </A>Trace Messages
! 119: <DT>
! 120: <B>l</B>
! 121: <DD>
! 122: Show <A HREF="WWWApp.html">APPLICATION LEVEL</A> Trace Messages
! 123: <DT>
! 124: <B>c</B>
! 125: <DD>
! 126: Show <A HREF="WWWCache.html]">CACHE</A> Trace Messages
! 127: <DT>
! 128: <B>g</B>
! 129: <DD>
! 130: Show <A HREF="WWWHTML.html">SGML</A> Trace Messages
! 131: <DT>
! 132: <B>b</B>
! 133: <DD>
! 134: Show <A HREF="HTBind.html">BIND</A> Trace Messages
! 135: <DT>
! 136: <B>t</B>
! 137: <DD>
! 138: Show <A HREF="HTEvent.html">THREAD</A> Trace Messages
! 139: <DT>
! 140: <B>s</B>
! 141: <DD>
! 142: Show <A HREF="WWWStream.html">STREAM</A> Trace Messages
! 143: <DT>
! 144: <B>p</B>
! 145: <DD>
! 146: Show <A HREF="HTProt.html">PROTOCOL</A> Trace Messages
! 147: <DT>
! 148: <B>m</B>
! 149: <DD>
! 150: Show <A HREF="HTMemory.html">MEMORY</A> Trace Messages
! 151: <DT>
! 152: <B>q</B>
! 153: <DD>
! 154: Show <A HREF="WWWSQL.html">SQL</A> Trace Messages
! 155: <DT>
! 156: <B>u</B>
! 157: <DD>
! 158: Show <A HREF="HTParse.html">URI</A> Trace Messages
! 159: <DT>
! 160: <B>h</B>
! 161: <DD>
! 162: Show <A HREF="HTAAUtil.html">AUTH</A> Trace Messages
! 163: <DT>
! 164: <B>a</B>
! 165: <DD>
! 166: Show <A HREF="HTAnchor.html">ANCHOR</A> Trace Messages
! 167: <DT>
! 168: <B>i</B>
! 169: <DD>
! 170: Show <A HREF="../../PICS-client/">PICS</A> Trace Messages
! 171: <DT>
! 172: <B>o</B>
! 173: <DD>
! 174: Show <A HREF="WWWCore.html">CORE</A> Trace Messages
! 175: <DT>
! 176: <B>x</B>
! 177: <DD>
! 178: Show <A HREF="WWWMux.html">MUX</A> Trace Messages
! 179: </DL>
! 180: <P>
! 181: The string must be null terminated, an example is "<TT>sop</TT>".
2.9 frystyk 182: <PRE>
183: extern int HTSetTraceMessageMask (const char * shortnames);
2.8 frystyk 184: </PRE>
2.1 frystyk 185: <PRE>
186: #endif /* HTHOME_H */
187: </PRE>
2.7 frystyk 188: <P>
189: <HR>
2.5 frystyk 190: <ADDRESS>
2.15 ! frystyk 191: @(#) $Id: HTHome.html,v 2.14 1998/05/14 02:10:33 frystyk Exp $
2.5 frystyk 192: </ADDRESS>
2.7 frystyk 193: </BODY></HTML>
Webmaster