Annotation of libwww/Library/src/HTNDir.html, revision 2.9

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.8       frystyk    22: a part of the <A HREF="http://www.w3.org/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"
2.9     ! vbancrof   28: 
        !            29: #ifdef __cplusplus
        !            30: extern "C" { 
        !            31: #endif 
2.1       frystyk    32: </PRE>
2.6       frystyk    33: <H2>
                     34:   What Should the Listings Look Like?
                     35: </H2>
                     36: <P>
                     37: You can set how the listings are to be sorted using the following flags.
2.1       frystyk    38: <PRE>
                     39: typedef enum _HTNewsDirKey {
2.2       frystyk    40:     HT_NDK_NONE                = 0,                    /* Unsorted */
                     41:     HT_NDK_INDEX       = 1,                    /* Sort by Message Number */
                     42:     HT_NDK_DATE        = 2,                    /* Sort by date */
                     43:     HT_NDK_SUBJECT     = 3,                    /* Sort by Subject */
                     44:     HT_NDK_FROM                = 4,                    /* Sort by Sender */
2.6       frystyk    45:     HT_NDK_GROUP       = 5,                    /* Sort group listing */
                     46:     HT_NDK_REFTHREAD    = 6  /* Sort messages by date and thread Added by MP */
2.1       frystyk    47: } HTNewsDirKey;
                     48: </PRE>
2.6       frystyk    49: <H2>
                     50:   The News Listing Object
                     51: </H2>
                     52: <P>
                     53: The news listing object handles the generation of a news listing. It is a
                     54: bit like a stream in that it accept data, but it must be formatted in a special
                     55: way which makes the normal stream architecture inadequate.
                     56: <H3>
                     57:   Create a News Listing Object
                     58: </H3>
                     59: <P>
                     60: Creates a structured stream object and sets up the initial HTML stuff Returns
                     61: the dir object if OK, else NULL
2.1       frystyk    62: <PRE>
                     63: typedef struct _HTNewsDir HTNewsDir;
2.3       frystyk    64: extern HTNewsDir * HTNewsDir_new (HTRequest * request, const char * title,
2.6       frystyk    65:                                  HTNewsDirKey key, BOOL cache);
2.1       frystyk    66: </PRE>
2.6       frystyk    67: <H3>
                     68:   Add a Line to the List
                     69: </H3>
                     70: <P>
                     71: This function accepts a news line. Everything except dir and nama can can
                     72: be 0 or NULL. Returns YES if OK, else NO
                     73: <PRE>
                     74: typedef struct _HTNewsNode HTNewsNode;
                     75: extern HTNewsNode * HTNewsDir_addElement (HTNewsDir * dir, int index,
                     76:                                           char * subject,
                     77:                                          char * from, time_t date,
                     78:                                           char * name,
                     79:                                          int refs, HTList * refNames);
                     80: extern HTNewsNode * HTNewsDir_addGroupElement (HTNewsDir * dir, char * group,
                     81:                                                BOOL tmplate);
                     82: </PRE>
                     83: <H3>
                     84:   Check Whether Group Belongs to the Group Set
                     85: </H3>
                     86: <P>
                     87: Returns TRUE if group belongs to set, e.g. group "soc.rec.jokes" belongs
                     88: to the set "soc.rec.*". Added by MP
                     89: <PRE>extern BOOL HTNewsDir_belongsToSet (HTNewsDir* dir, char* group);
                     90: </PRE>
                     91: <H3>
                     92:   Free a News Listing Object
                     93: </H3>
                     94: <P>
                     95: If we are sorting then do the sorting and put out the list, else just append
                     96: the end of the list.
2.1       frystyk    97: <PRE>
                     98: extern BOOL HTNewsDir_free (HTNewsDir * dir);
                     99: </PRE>
                    100: <PRE>
2.9     ! vbancrof  101: #ifdef __cplusplus
        !           102: }
        !           103: #endif
        !           104: 
2.1       frystyk   105: #endif /* HTNDIR */
                    106: </PRE>
2.6       frystyk   107: <P>
                    108:   <HR>
2.5       frystyk   109: <ADDRESS>
2.9     ! vbancrof  110:   @(#) $Id: HTNDir.html,v 2.8 1998/05/14 02:10:50 frystyk Exp $
2.5       frystyk   111: </ADDRESS>
2.6       frystyk   112: </BODY></HTML>

Webmaster