Annotation of libwww/Library/src/HTNDir.html, revision 2.7
2.1 frystyk 1: <HTML>
2: <HEAD>
2.6 frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
2.7 ! frystyk 4: <TITLE>W3C Sample Code Library libwww News/NNTP Browsing</TITLE>
2.1 frystyk 5: </HEAD>
6: <BODY>
2.6 frystyk 7: <H1>
8: Generic News/NNTP Browsing
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.6 frystyk 16: <P>
17: This news browser generates listings for NNTP reponses. This module contains
18: the protocol independent code and it produces the HTML object. It is only
19: included if the <A HREF="HTNews.html">NNTP</A>.
20: <P>
21: This module is implemented by <A HREF="HTNDir.c">HTNDir.c</A>, and it is
2.7 ! frystyk 22: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C Sample Code
2.6 frystyk 23: Library</A>.
2.1 frystyk 24: <PRE>
25: #ifndef HTNDIR_H
26: #define HTNDIR_H
27: #include "HTReq.h"
28: </PRE>
2.6 frystyk 29: <H2>
30: What Should the Listings Look Like?
31: </H2>
32: <P>
33: You can set how the listings are to be sorted using the following flags.
2.1 frystyk 34: <PRE>
35: typedef enum _HTNewsDirKey {
2.2 frystyk 36: HT_NDK_NONE = 0, /* Unsorted */
37: HT_NDK_INDEX = 1, /* Sort by Message Number */
38: HT_NDK_DATE = 2, /* Sort by date */
39: HT_NDK_SUBJECT = 3, /* Sort by Subject */
40: HT_NDK_FROM = 4, /* Sort by Sender */
2.6 frystyk 41: HT_NDK_GROUP = 5, /* Sort group listing */
42: HT_NDK_REFTHREAD = 6 /* Sort messages by date and thread Added by MP */
2.1 frystyk 43: } HTNewsDirKey;
44: </PRE>
2.6 frystyk 45: <H2>
46: The News Listing Object
47: </H2>
48: <P>
49: The news listing object handles the generation of a news listing. It is a
50: bit like a stream in that it accept data, but it must be formatted in a special
51: way which makes the normal stream architecture inadequate.
52: <H3>
53: Create a News Listing Object
54: </H3>
55: <P>
56: Creates a structured stream object and sets up the initial HTML stuff Returns
57: the dir object if OK, else NULL
2.1 frystyk 58: <PRE>
59: typedef struct _HTNewsDir HTNewsDir;
2.3 frystyk 60: extern HTNewsDir * HTNewsDir_new (HTRequest * request, const char * title,
2.6 frystyk 61: HTNewsDirKey key, BOOL cache);
2.1 frystyk 62: </PRE>
2.6 frystyk 63: <H3>
64: Add a Line to the List
65: </H3>
66: <P>
67: This function accepts a news line. Everything except dir and nama can can
68: be 0 or NULL. Returns YES if OK, else NO
69: <PRE>
70: typedef struct _HTNewsNode HTNewsNode;
71: extern HTNewsNode * HTNewsDir_addElement (HTNewsDir * dir, int index,
72: char * subject,
73: char * from, time_t date,
74: char * name,
75: int refs, HTList * refNames);
76: extern HTNewsNode * HTNewsDir_addGroupElement (HTNewsDir * dir, char * group,
77: BOOL tmplate);
78: </PRE>
79: <H3>
80: Check Whether Group Belongs to the Group Set
81: </H3>
82: <P>
83: Returns TRUE if group belongs to set, e.g. group "soc.rec.jokes" belongs
84: to the set "soc.rec.*". Added by MP
85: <PRE>extern BOOL HTNewsDir_belongsToSet (HTNewsDir* dir, char* group);
86: </PRE>
87: <H3>
88: Free a News Listing Object
89: </H3>
90: <P>
91: If we are sorting then do the sorting and put out the list, else just append
92: the end of the list.
2.1 frystyk 93: <PRE>
94: extern BOOL HTNewsDir_free (HTNewsDir * dir);
95: </PRE>
96: <PRE>
97: #endif /* HTNDIR */
98: </PRE>
2.6 frystyk 99: <P>
100: <HR>
2.5 frystyk 101: <ADDRESS>
2.7 ! frystyk 102: @(#) $Id: HTNDir.html,v 2.6 1996/08/12 16:43:28 frystyk Exp $
2.5 frystyk 103: </ADDRESS>
2.6 frystyk 104: </BODY></HTML>
Webmaster