Annotation of libwww/Library/src/HTHome.html, revision 2.19

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 &nbsp;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.&nbsp;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.
2.18      kahan      91: Andy Levine: I additionally found that calling HTTmpAnchor repeatedly without
                     92: freeing the newly allocated anchor will cause the anchor hash table to
                     93: continue to grow.
2.11      frystyk    94: <PRE>
                     95: extern HTParentAnchor * HTTmpAnchor (HTUserProfile * up);
                     96: </PRE>
                     97: <H2>
2.7       frystyk    98:   Get The Current Directory in URL form
2.10      frystyk    99: </H2>
2.7       frystyk   100: <P>
                    101: Creates a local file URL that can be used as a relative name when calling
                    102: expanding other URLs relative to the current location in the local file system
                    103: tree where the application is running. The code for this routine originates
                    104: from the Line Mode Browser and was moved here by <EM>howcome@w3.org</EM>
                    105: in order for all clients to take advantage.
2.9       frystyk   106: <PRE>
                    107: #define HTFindRelatedName      HTGetCurrentDirectoryURL
2.7       frystyk   108: extern char *  HTGetCurrentDirectoryURL (void);
                    109: </PRE>
                    110: <H2>
2.16      frystyk   111:   <A NAME="FormInput">Handle HTML Form Input fields</A>
                    112: </H2>
                    113: <P>
                    114: Takes a string of the form "<CODE>a=b</CODE>" containing HTML form data,
                    115: escapes it accordingly and puts it into the association list so that it readily
                    116: can be passed to any of the HTAccess function that handles HTML form data.
                    117: The string should not be encoded in any way - this function encodes it according
                    118: to the HTML form encoding rules.
                    119: <P>
                    120: Examples are "foo=bar", "baz=foo and bar", "a= b ", " a = b ", "toto=", "four
                    121: = two + two", "six three + three", and "a=b=c"
                    122: <PRE>
                    123: extern BOOL HTParseFormInput (HTAssocList * list, const char * str);
                    124: </PRE>
                    125: <H2>
2.12      frystyk   126:   <A NAME="Trace">Handle Library Trace Messages</A>
2.8       frystyk   127: </H2>
                    128: <P>
                    129: Standard interface to libwww <A HREF="HTUtils.html#Debug">TRACE messages</A>.
2.19    ! kahan     130: Pass this function a string of characters.  It will set up the appropriate
2.15      frystyk   131: TRACE flags. The following characters are used as follows:
                    132: <DL COMPACT>
                    133:   <DT>
                    134:     <B>f</B>
                    135:   <DD>
                    136:     Show <A HREF="WWWUtil.html">BASIC UTILITIES </A>Trace Messages
                    137:   <DT>
                    138:     <B>l</B>
                    139:   <DD>
                    140:     Show <A HREF="WWWApp.html">APPLICATION LEVEL</A> Trace Messages
                    141:   <DT>
                    142:     <B>c</B>
                    143:   <DD>
                    144:     Show <A HREF="WWWCache.html]">CACHE</A> Trace Messages
                    145:   <DT>
                    146:     <B>g</B>
                    147:   <DD>
                    148:     Show <A HREF="WWWHTML.html">SGML</A> Trace Messages
                    149:   <DT>
                    150:     <B>b</B>
                    151:   <DD>
                    152:     Show <A HREF="HTBind.html">BIND</A> Trace Messages
                    153:   <DT>
                    154:     <B>t</B>
                    155:   <DD>
                    156:     Show <A HREF="HTEvent.html">THREAD</A> Trace Messages
                    157:   <DT>
                    158:     <B>s</B>
                    159:   <DD>
                    160:     Show <A HREF="WWWStream.html">STREAM</A> Trace Messages
                    161:   <DT>
                    162:     <B>p</B>
                    163:   <DD>
                    164:     Show <A HREF="HTProt.html">PROTOCOL</A> Trace Messages
                    165:   <DT>
                    166:     <B>m</B>
                    167:   <DD>
                    168:     Show <A HREF="HTMemory.html">MEMORY</A> Trace Messages
                    169:   <DT>
                    170:     <B>q</B>
                    171:   <DD>
                    172:     Show <A HREF="WWWSQL.html">SQL</A> Trace Messages
                    173:   <DT>
                    174:     <B>u</B>
                    175:   <DD>
                    176:     Show <A HREF="HTParse.html">URI</A> Trace Messages
                    177:   <DT>
                    178:     <B>h</B>
                    179:   <DD>
                    180:     Show <A HREF="HTAAUtil.html">AUTH</A> Trace Messages
                    181:   <DT>
                    182:     <B>a</B>
                    183:   <DD>
                    184:     Show <A HREF="HTAnchor.html">ANCHOR</A> Trace Messages
                    185:   <DT>
                    186:     <B>i</B>
                    187:   <DD>
                    188:     Show <A HREF="../../PICS-client/">PICS</A> Trace Messages
                    189:   <DT>
                    190:     <B>o</B>
                    191:   <DD>
                    192:     Show <A HREF="WWWCore.html">CORE</A> Trace Messages
                    193:   <DT>
                    194:     <B>x</B>
                    195:   <DD>
2.17      frystyk   196:     Show <A HREF="WWWMux.html">MUX</A> Trace Messages
                    197:   <DT>
                    198:     <B>*</B>
2.16      frystyk   199:   <DD>
                    200:     Show <EM>ALL</EM> Trace Messages
2.15      frystyk   201: </DL>
                    202: <P>
                    203: The string must be null terminated, an example is "<TT>sop</TT>".
2.9       frystyk   204: <PRE>
                    205: extern int HTSetTraceMessageMask (const char * shortnames);
2.8       frystyk   206: </PRE>
2.1       frystyk   207: <PRE>
                    208: #endif /* HTHOME_H */
                    209: </PRE>
2.7       frystyk   210: <P>
                    211:   <HR>
2.5       frystyk   212: <ADDRESS>
2.19    ! kahan     213:   @(#) $Id: HTHome.html,v 2.18 2000/06/16 12:38:44 kahan Exp $
2.5       frystyk   214: </ADDRESS>
2.7       frystyk   215: </BODY></HTML>

Webmaster