Annotation of libwww/Library/src/HTHome.html, revision 2.17
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.16 frystyk 108: <A NAME="FormInput">Handle HTML Form Input fields</A>
109: </H2>
110: <P>
111: Takes a string of the form "<CODE>a=b</CODE>" containing HTML form data,
112: escapes it accordingly and puts it into the association list so that it readily
113: can be passed to any of the HTAccess function that handles HTML form data.
114: The string should not be encoded in any way - this function encodes it according
115: to the HTML form encoding rules.
116: <P>
117: Examples are "foo=bar", "baz=foo and bar", "a= b ", " a = b ", "toto=", "four
118: = two + two", "six three + three", and "a=b=c"
119: <PRE>
120: extern BOOL HTParseFormInput (HTAssocList * list, const char * str);
121: </PRE>
122: <H2>
2.12 frystyk 123: <A NAME="Trace">Handle Library Trace Messages</A>
2.8 frystyk 124: </H2>
125: <P>
126: Standard interface to libwww <A HREF="HTUtils.html#Debug">TRACE messages</A>.
127: Pass this function a string of characters and it will set up the appropriate
2.15 frystyk 128: TRACE flags. The following characters are used as follows:
129: <DL COMPACT>
130: <DT>
131: <B>f</B>
132: <DD>
133: Show <A HREF="WWWUtil.html">BASIC UTILITIES </A>Trace Messages
134: <DT>
135: <B>l</B>
136: <DD>
137: Show <A HREF="WWWApp.html">APPLICATION LEVEL</A> Trace Messages
138: <DT>
139: <B>c</B>
140: <DD>
141: Show <A HREF="WWWCache.html]">CACHE</A> Trace Messages
142: <DT>
143: <B>g</B>
144: <DD>
145: Show <A HREF="WWWHTML.html">SGML</A> Trace Messages
146: <DT>
147: <B>b</B>
148: <DD>
149: Show <A HREF="HTBind.html">BIND</A> Trace Messages
150: <DT>
151: <B>t</B>
152: <DD>
153: Show <A HREF="HTEvent.html">THREAD</A> Trace Messages
154: <DT>
155: <B>s</B>
156: <DD>
157: Show <A HREF="WWWStream.html">STREAM</A> Trace Messages
158: <DT>
159: <B>p</B>
160: <DD>
161: Show <A HREF="HTProt.html">PROTOCOL</A> Trace Messages
162: <DT>
163: <B>m</B>
164: <DD>
165: Show <A HREF="HTMemory.html">MEMORY</A> Trace Messages
166: <DT>
167: <B>q</B>
168: <DD>
169: Show <A HREF="WWWSQL.html">SQL</A> Trace Messages
170: <DT>
171: <B>u</B>
172: <DD>
173: Show <A HREF="HTParse.html">URI</A> Trace Messages
174: <DT>
175: <B>h</B>
176: <DD>
177: Show <A HREF="HTAAUtil.html">AUTH</A> Trace Messages
178: <DT>
179: <B>a</B>
180: <DD>
181: Show <A HREF="HTAnchor.html">ANCHOR</A> Trace Messages
182: <DT>
183: <B>i</B>
184: <DD>
185: Show <A HREF="../../PICS-client/">PICS</A> Trace Messages
186: <DT>
187: <B>o</B>
188: <DD>
189: Show <A HREF="WWWCore.html">CORE</A> Trace Messages
190: <DT>
191: <B>x</B>
192: <DD>
2.17 ! frystyk 193: Show <A HREF="WWWMux.html">MUX</A> Trace Messages
! 194: <DT>
! 195: <B>*</B>
2.16 frystyk 196: <DD>
197: Show <EM>ALL</EM> Trace Messages
2.15 frystyk 198: </DL>
199: <P>
200: The string must be null terminated, an example is "<TT>sop</TT>".
2.9 frystyk 201: <PRE>
202: extern int HTSetTraceMessageMask (const char * shortnames);
2.8 frystyk 203: </PRE>
2.1 frystyk 204: <PRE>
205: #endif /* HTHOME_H */
206: </PRE>
2.7 frystyk 207: <P>
208: <HR>
2.5 frystyk 209: <ADDRESS>
2.16 frystyk 210: @(#) $Id: HTHome.html,v 2.15 1998/12/17 01:51:01 frystyk Exp $
2.5 frystyk 211: </ADDRESS>
2.7 frystyk 212: </BODY></HTML>
Webmaster