Annotation of libwww/Library/src/HTDescpt.html, revision 2.13
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:
31: </PRE>
32:
33: <H2>Description File</H2>
34:
35: This module gets descriptions from the file defined by global variable
2.2 frystyk 36: <CODE>HTDescriptionFile</CODE> in the same directory as the directoy
37: to be listed. The default value is <CODE>.www_descript</CODE>:
38:
2.1 frystyk 39: <PRE>
40: extern char * HTDescriptionFile;
41: </PRE>
42:
43: In the description file lines starting with a word starting with 'D'
44: are taken to be descriptions (this looks funny now, but this is to
45: make it easy to extend these description files to contain also other
2.2 frystyk 46: information. An example of the format of the description file is:
47:
2.1 frystyk 48: <PRE>
2.3 frystyk 49: /*
2.4 frystyk 50: ** DESCRIBE welcome.html Our welcome page
51: ** DESCRIBE map*.gif Map as a GIF image
52: ** DESCRIBE map*.ps Map as a PostScript image
2.3 frystyk 53: */
2.1 frystyk 54: </PRE>
55:
56: <H2>HTML Titles</H2>
57:
58: If description is not specified for a file that is of type
59: <CODE>text/html</CODE>, this module uses the HTML TITLE as the
60: description. This feature can be turned off by setting the
61: <CODE>HTPeekTitles</CODE> variable to false.
2.2 frystyk 62:
2.1 frystyk 63: <PRE>
64: extern BOOL HTPeekTitles;
65: </PRE>
66:
67: <H2>Read Description File</H2>
68:
69: The description file for a directory is read in only once by
70: <CODE>HTReadDescriptions()</CODE>, and the result returned by it is
71: given as an argument when finding out a description for a single file.
2.2 frystyk 72:
2.1 frystyk 73: <PRE>
2.9 frystyk 74: extern HTList * HTReadDescriptions (char * dirname);
2.1 frystyk 75: </PRE>
76:
77: <H2>Get Description For a File</H2>
78:
79: Once description file has been read and the list of descriptions is
80: returned by <CODE>HTReadDescriptions()</CODE>, the function
81: <CODE>HTGetDescription()</CODE> can be used to get a description for a
82: given file:
2.2 frystyk 83:
2.1 frystyk 84: <PRE>
2.9 frystyk 85: extern char * HTGetDescription (HTList * descriptions,
2.1 frystyk 86: char * dirname,
87: char * filename,
2.9 frystyk 88: HTFormat format);
2.1 frystyk 89: </PRE>
2.2 frystyk 90:
2.1 frystyk 91: Directory name has to be present because this function may then take a
92: peek at the file itself (to get the HTML TITLE, for example).
93: If <CODE>format</CODE> is <CODE>WWW_HTML</CODE> and description is not
94: found, this module may be configured to use the HTML TITLE as the
95: description. <P>
96:
97: <STRONG>No string returned by this function should be freed!</STRONG>
98:
99:
100: <H2>Freeing Descriptions</H2>
101:
102: Once descriptions have been gotten, the description list returned by
103: <CODE>HTReadDescriptions()</CODE> must be freed by
104: <CODE>HTFreeDescriptions()</CODE>:
105: <PRE>
2.9 frystyk 106: extern void HTFreeDescriptions (HTList * descriptions);
2.1 frystyk 107: </PRE>
108:
109: <PRE>
110: #endif /* !HTDESCRIPT_H */
111: </PRE>
2.11 frystyk 112:
113: <HR>
114: <ADDRESS>
2.13 ! frystyk 115: @(#) $Id: HTDescpt.html,v 2.12 1997/02/16 18:42:07 frystyk Exp $
2.11 frystyk 116: </ADDRESS>
2.1 frystyk 117: </BODY>
118: </HTML>
Webmaster