Annotation of libwww/Library/src/HTHome.html, revision 2.8
2.1 frystyk 1: <HTML>
2: <HEAD>
2.8 ! frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 2-Jul-1996 -->
2.7 frystyk 4: <TITLE>W3C Reference Library libwww Application Helper Functions</TITLE>
2.1 frystyk 5: </HEAD>
6: <BODY>
2.7 frystyk 7: <H1>
8: Application Helper Functions
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
24: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Reference
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: <H2>
32: Home Page Management
33: </H2>
34: <P>
35: The <I>home page </I>is special in that this is is the first page to visit
36: when a client application starts up. Note that a home page is a generic
37: URL and hence can be any resouce - not only resources on the local file system.
38: <H3>
39: Personal Home Page
40: </H3>
41: <PRE>#define LOGICAL_DEFAULT "WWW_HOME" /* Defined to be the home page */
2.1 frystyk 42:
43: #ifndef PERSONAL_DEFAULT
2.7 frystyk 44: #define PERSONAL_DEFAULT "WWW/default.html" /* in home directory */
2.1 frystyk 45: #endif
46:
47: /* If the home page isn't found, use this file: */
48: #ifndef LAST_RESORT
2.7 frystyk 49: #define LAST_RESORT "http://www.w3.org/"
2.1 frystyk 50: #endif
2.7 frystyk 51: </PRE>
52: <H3>
53: Home Page for Remote Access
54: </H3>
55: <P>
56: Some Web applications can also be run remotely - for example as a telnet
57: login shell. The Line Mode Browser is an example of such an application. In
58: that case, the home page is often more generic than a personal home page.
59: <PRE>
2.1 frystyk 60: /* If one telnets to an access point it will look in this file for home page */
61: #ifndef REMOTE_POINTER
2.7 frystyk 62: #define REMOTE_POINTER "/etc/www-remote.url" /* can't be file */
2.1 frystyk 63: #endif
64:
65: /* and if that fails it will use this. */
66: #ifndef REMOTE_ADDRESS
2.7 frystyk 67: #define REMOTE_ADDRESS "http://www.w3.org/" /* can't be file */
2.1 frystyk 68: #endif
69:
70: #ifndef LOCAL_DEFAULT_FILE
2.7 frystyk 71: #define LOCAL_DEFAULT_FILE "/usr/local/lib/WWW/default.html"
2.1 frystyk 72: #endif
73: </PRE>
2.7 frystyk 74: <H3>
75: Get an Anchor for the Home Page
76: </H3>
77: <P>
78: Getting an anchor for the <I>home page</I> involves looking for the (environment)
79: variables described in the section above. As this is something that almost
80: all client applications must do then we provide some simple methods that
81: do the work for you.
82: <PRE>extern HTParentAnchor * HTHomeAnchor (void);
83: </PRE>
84: <H3>
85: Get The Current Directory in URL form
86: </H3>
87: <P>
88: Creates a local file URL that can be used as a relative name when calling
89: expanding other URLs relative to the current location in the local file system
90: tree where the application is running. The code for this routine originates
91: from the Line Mode Browser and was moved here by <EM>howcome@w3.org</EM>
92: in order for all clients to take advantage.
93: <PRE>#define HTFindRelatedName HTGetCurrentDirectoryURL
94: extern char * HTGetCurrentDirectoryURL (void);
95: </PRE>
96: <H2>
2.8 ! frystyk 97: Handle Library Trace Messages
! 98: </H2>
! 99: <P>
! 100: Standard interface to libwww <A HREF="HTUtils.html#Debug">TRACE messages</A>.
! 101: Pass this function a string of characters and it will set up the appropriate
! 102: TRACE flags. The shortnames for the trace messages are not as intuitive as
! 103: they could be :-(. The string must be null terminated
! 104: <PRE>extern int HTSetTraceMessageMask (const char * shortnames);
! 105: </PRE>
! 106: <H2>
2.7 frystyk 107: Net Manager Callback Functions
108: </H2>
109: <P>
110: These two functions are examples of callback functions from the
111: <A HREF="HTNet.html">Net Manager</A> which are called <EM>before</EM> and
112: <EM>after</EM> a request respectively. They do a lot of the stuff an application
113: often has to do anyway.
114: <H3>
115: BEFORE Request Callback
116: </H3>
117: <P>
118: This function uses all the functionaly that the app part of the Library gives
119: for URL translations <I>BEFORE</I> a request is isseued. It checks for
120: <B>cache</B>, <B>proxy</B>, and <B>gateway</B> (in that order)
121: <PRE>extern HTNetCallback HTLoadStart;
122: </PRE>
123: <H3>
124: AFTER Request Callback
125: </H3>
126: <P>
127: This function uses all the functionaly that the app part of the Library gives
128: for handling <I>AFTER</I> a request.
129: <PRE>extern HTNetCallback HTLoadTerminate;
2.1 frystyk 130: </PRE>
131: <PRE>
132: #endif /* HTHOME_H */
133: </PRE>
2.7 frystyk 134: <P>
135: <HR>
2.5 frystyk 136: <ADDRESS>
2.8 ! frystyk 137: @(#) $Id: HTHome.html,v 2.7 1996/06/28 16:31:07 frystyk Exp $
2.5 frystyk 138: </ADDRESS>
2.7 frystyk 139: </BODY></HTML>
Webmaster