HTNDir.h
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:2k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. /*                                                                      Generic News Browsing
  2.                                   GENERIC NEWS BROWSING
  3.                                              
  4.  */
  5. /*
  6. **      (c) COPYRIGHT MIT 1995.
  7. **      Please first read the full copyright statement in the file COPYRIGH.
  8. */
  9. /*
  10.    This news browser generates listings for NNTP reponses. This module contains the
  11.    protocol independent code and it produces the HTML object. It is only included if the
  12.    NNTP.
  13.    
  14.    This module is implemented by HTNDir.c, and it is a part of the  W3C Reference Library.
  15.    
  16.  */
  17. #ifndef HTNDIR_H
  18. #define HTNDIR_H
  19. #include "HTReq.h"
  20. /*
  21. What Should the Listings Look Like?
  22.    You can set how the listings are to be sorted using the following flags.
  23.    
  24.  */
  25. typedef enum _HTNewsDirKey {
  26.     HT_NDK_NONE         = 0,                    /* Unsorted */
  27.     HT_NDK_INDEX        = 1,                    /* Sort by Message Number */
  28.     HT_NDK_DATE         = 2,                    /* Sort by date */
  29.     HT_NDK_SUBJECT      = 3,                    /* Sort by Subject */
  30.     HT_NDK_FROM         = 4,                    /* Sort by Sender */
  31.     HT_NDK_GROUP        = 5                     /* Sort group listing */
  32. } HTNewsDirKey;
  33. /*
  34. The News Listing Object
  35.    The news listing object handles the generation of a news listing. It is a bit like a
  36.    stream in that it accept data, but it must be formatted in a special way which makes
  37.    the normal stream architecture inadequate.
  38.    
  39.   CREATE A NEWS LISTING OBJECT
  40.   
  41.    Creates a structured stream object and sets up the initial HTML stuff Returns the dir
  42.    object if OK, else NULL
  43.    
  44.  */
  45. typedef struct _HTNewsDir HTNewsDir;
  46. extern HTNewsDir * HTNewsDir_new (HTRequest * request, CONST char * title,
  47.                                   HTNewsDirKey key);
  48. /*
  49.   ADD A LINE TO THE LIST
  50.   
  51.    This function accepts a news line. Everything except dir and nama can can be 0 or NULL.
  52.    Returns YES if OK, else NO
  53.    
  54.  */
  55. extern BOOL HTNewsDir_addElement (HTNewsDir * dir, int index, char * subject,
  56.                                   char * from, time_t date, char * name,
  57.                                   int refs);
  58. /*
  59.   FREE A NEWS LISTING OBJECT
  60.   
  61.    If we are sorting then do the sorting and put out the list, else just append the end of
  62.    the list.
  63.    
  64.  */
  65. extern BOOL HTNewsDir_free (HTNewsDir * dir);
  66. /*
  67.  */
  68. #endif /* HTNDIR */
  69. /*
  70.    End of declaration */