Annotation of libwww/Library/src/HTDescpt.html, revision 2.2
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 ! 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.1 frystyk 53: </PRE>
54:
55: <H2>HTML Titles</H2>
56:
57: If description is not specified for a file that is of type
58: <CODE>text/html</CODE>, this module uses the HTML TITLE as the
59: description. This feature can be turned off by setting the
60: <CODE>HTPeekTitles</CODE> variable to false.
2.2 ! frystyk 61:
2.1 frystyk 62: <PRE>
63: extern BOOL HTPeekTitles;
64: </PRE>
65:
66: <H2>Read Description File</H2>
67:
68: The description file for a directory is read in only once by
69: <CODE>HTReadDescriptions()</CODE>, and the result returned by it is
70: given as an argument when finding out a description for a single file.
2.2 ! frystyk 71:
2.1 frystyk 72: <PRE>
73: extern HTList * HTReadDescriptions PARAMS((char * dirname));
74: </PRE>
75:
76: <H2>Get Description For a File</H2>
77:
78: Once description file has been read and the list of descriptions is
79: returned by <CODE>HTReadDescriptions()</CODE>, the function
80: <CODE>HTGetDescription()</CODE> can be used to get a description for a
81: given file:
2.2 ! frystyk 82:
2.1 frystyk 83: <PRE>
84: extern char * HTGetDescription PARAMS((HTList * descriptions,
85: char * dirname,
86: char * filename,
87: HTFormat format));
88: </PRE>
2.2 ! frystyk 89:
2.1 frystyk 90: Directory name has to be present because this function may then take a
91: peek at the file itself (to get the HTML TITLE, for example).
92: If <CODE>format</CODE> is <CODE>WWW_HTML</CODE> and description is not
93: found, this module may be configured to use the HTML TITLE as the
94: description. <P>
95:
96: <STRONG>No string returned by this function should be freed!</STRONG>
97:
98:
99: <H2>Freeing Descriptions</H2>
100:
101: Once descriptions have been gotten, the description list returned by
102: <CODE>HTReadDescriptions()</CODE> must be freed by
103: <CODE>HTFreeDescriptions()</CODE>:
104: <PRE>
105: extern void HTFreeDescriptions PARAMS((HTList * descriptions));
106: </PRE>
107:
108: <PRE>
109: #endif /* !HTDESCRIPT_H */
110: </PRE>
111: End of <CODE>HTDescpt.h</CODE>.
112: </BODY>
113: </HTML>
Webmaster