Annotation of libwww/Library/src/HTDescpt.html, revision 2.14

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.12      frystyk     3: <TITLE>W3C Sample Code Library libwww File descriptions</TITLE>
2.11      frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
2.1       frystyk     5: </HEAD>
                      6: <BODY>
                      7: 
                      8: <H1>File Descriptions</H1>
                      9: 
                     10: <PRE>
                     11: /*
2.5       frystyk    12: **     (c) COPYRIGHT MIT 1995.
2.1       frystyk    13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
                     16: 
2.8       frystyk    17: Descriptions appearing in <A HREF="HTDir.html">directory listings</A>
                     18: are produced by this module. This may be overridden by another module
                     19: for those who which descriptions to come from somewhere else. It's
                     20: only HTTP directory listings that contain a description field (if
                     21: enabled by the <A HREF="HTDir.html">Directory browsing module</A>.<P>
2.1       frystyk    22: 
2.8       frystyk    23: This module is implemented by <A HREF="HTDescpt.c">HTDescpt.c</A>, and
2.13      frystyk    24: it is a part of the <A HREF="http://www.w3.org/Library/"> W3C
2.12      frystyk    25: Sample Code Library</A>.
2.1       frystyk    26: 
                     27: <PRE>
                     28: #ifndef HTDESCRIPT_H
                     29: #define HTDESCRIPT_H
                     30: 
2.14    ! vbancrof   31: #ifdef __cplusplus
        !            32: extern "C" { 
        !            33: #endif 
2.1       frystyk    34: </PRE>
                     35: 
                     36: <H2>Description File</H2>
                     37: 
                     38: This module gets descriptions from the file defined by global variable
2.2       frystyk    39: <CODE>HTDescriptionFile</CODE> in the same directory as the directoy
                     40: to be listed. The default value is <CODE>.www_descript</CODE>:
                     41: 
2.1       frystyk    42: <PRE>
                     43: extern char * HTDescriptionFile;
                     44: </PRE>
                     45: 
                     46: In the description file lines starting with a word starting with 'D'
                     47: are taken to be descriptions (this looks funny now, but this is to
                     48: make it easy to extend these description files to contain also other
2.2       frystyk    49: information. An example of the format of the description file is:
                     50: 
2.1       frystyk    51: <PRE>
2.3       frystyk    52: /*
2.4       frystyk    53: **     DESCRIBE  welcome.html  Our welcome page
                     54: **     DESCRIBE  map*.gif      Map as a GIF image
                     55: **     DESCRIBE  map*.ps       Map as a PostScript image
2.3       frystyk    56: */
2.1       frystyk    57: </PRE>
                     58: 
                     59: <H2>HTML Titles</H2>
                     60: 
                     61: If description is not specified for a file that is of type
                     62: <CODE>text/html</CODE>, this module uses the HTML TITLE as the
                     63: description.  This feature can be turned off by setting the
                     64: <CODE>HTPeekTitles</CODE> variable to false.
2.2       frystyk    65: 
2.1       frystyk    66: <PRE>
                     67: extern BOOL HTPeekTitles;
                     68: </PRE>
                     69: 
                     70: <H2>Read Description File</H2>
                     71: 
                     72: The description file for a directory is read in only once by
                     73: <CODE>HTReadDescriptions()</CODE>, and the result returned by it is
                     74: given as an argument when finding out a description for a single file.
2.2       frystyk    75: 
2.1       frystyk    76: <PRE>
2.9       frystyk    77: extern HTList * HTReadDescriptions (char * dirname);
2.1       frystyk    78: </PRE>
                     79: 
                     80: <H2>Get Description For a File</H2>
                     81: 
                     82: Once description file has been read and the list of descriptions is
                     83: returned by <CODE>HTReadDescriptions()</CODE>, the function
                     84: <CODE>HTGetDescription()</CODE> can be used to get a description for a
                     85: given file:
2.2       frystyk    86: 
2.1       frystyk    87: <PRE>
2.9       frystyk    88: extern char * HTGetDescription (HTList *       descriptions,
2.1       frystyk    89:                                       char *   dirname,
                     90:                                       char *   filename,
2.9       frystyk    91:                                       HTFormat format);
2.1       frystyk    92: </PRE>
2.2       frystyk    93: 
2.1       frystyk    94: Directory name has to be present because this function may then take a
                     95: peek at the file itself (to get the HTML TITLE, for example).
                     96: If <CODE>format</CODE> is <CODE>WWW_HTML</CODE> and description is not
                     97: found, this module may be configured to use the HTML TITLE as the
                     98: description. <P>
                     99: 
                    100: <STRONG>No string returned by this function should be freed!</STRONG>
                    101: 
                    102: 
                    103: <H2>Freeing Descriptions</H2>
                    104: 
                    105: Once descriptions have been gotten, the description list returned by
                    106: <CODE>HTReadDescriptions()</CODE> must be freed by
                    107: <CODE>HTFreeDescriptions()</CODE>:
                    108: <PRE>
2.9       frystyk   109: extern void HTFreeDescriptions (HTList * descriptions);
2.1       frystyk   110: </PRE>
                    111: 
                    112: <PRE>
2.14    ! vbancrof  113: #ifdef __cplusplus
        !           114: }
        !           115: #endif
        !           116: 
2.1       frystyk   117: #endif /* !HTDESCRIPT_H */
                    118: </PRE>
2.11      frystyk   119: 
                    120: <HR>
                    121: <ADDRESS>
2.14    ! vbancrof  122: @(#) $Id: HTDescpt.html,v 2.13 1998/05/14 02:10:22 frystyk Exp $
2.11      frystyk   123: </ADDRESS>
2.1       frystyk   124: </BODY>
                    125: </HTML>

Webmaster