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