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

浏览器

开发平台:

Unix_Linux

  1. /*                                                                         Directory Browsing
  2.                                     DIRECTORY BROWSING
  3.                                              
  4.  */
  5. /*
  6. **      (c) COPYRIGHT MIT 1995.
  7. **      Please first read the full copyright statement in the file COPYRIGH.
  8. */
  9. /*
  10.    The directory manager generates directory listings for FTP and HTTP requests. This
  11.    module contains the protocol independent code and it produces the HTML object. It is
  12.    only included if either the FTP or the File module is included.
  13.    
  14.    This module is implemented by HTDir.c, and it is a part of the  W3C Reference Library.
  15.    
  16.  */
  17. #ifndef HTDIR_H
  18. #define HTDIR_H
  19. #include "HTReq.h"
  20. #include "HTIcons.h"
  21. /*
  22. What Should the Listings Look Like?
  23.    If the HT_DS_DES is set then the Descriptionfield is added as the last column in the
  24.    listing.  File descriptions are queried from the HTDescript module. Make a full mask by
  25.    adding/oring the following flags:
  26.    
  27.  */
  28. typedef enum _HTDirShow {
  29.     HT_DS_SIZE  = 0x1,                  /* Show file size using K, M and G? */
  30.     HT_DS_DATE  = 0x2,                  /* Show last modified date? */
  31.     HT_DS_HID   = 0x4,                  /* Show hidden files? */
  32.     HT_DS_DES   = 0x8,                  /* Show descriptions? */
  33.     HT_DS_ICON  = 0x10,                 /* Show icons? */
  34.     HT_DS_HOTI  = 0x20                  /* Are Icons hot or cold? */
  35. } HTDirShow;
  36. typedef enum _HTDirKey {
  37.     HT_DK_NONE  = 0,                    /* No sorting */
  38.     HT_DK_CSEN  = 1,                    /* Case sensitive */
  39.     HT_DK_CINS  = 2                     /* Case insensitive */
  40. } HTDirKey;
  41. /*
  42.   LENGTH OF FILENAMES AND DESCRIPTIONS
  43.   
  44.    The module automatically ajusts the width of the directory listing as a function of the
  45.    file name. The width can flows dynamically between an upper and a lower limit.  The
  46.    maximum length of this field is specified by
  47.    
  48.  */
  49. extern BOOL HTDir_setWidth (int minfile, int maxfile);
  50. /*
  51. The Directory Object
  52.    The directory object handles the generation of a directory listing. It is a bit like a
  53.    stream in that it accept data, but it must be formatted in a special way which makes
  54.    the normal stream architecture inadequate.
  55.    
  56.   WIDTH OF FILE NAMES
  57.   
  58.    The module automatically ajusts the width of the directory listing as a function of the
  59.    file name. The width can flows dynamically between an upper and a lower limit.
  60.    
  61.  */
  62. extern BOOL HTDir_setWidth (int minfile, int maxfile);
  63. /*
  64.   CREATE A DIRECTORY OBJECT
  65.   
  66.    Creates a structured stream object and sets up the initial HTML stuff Returns the dir
  67.    object if OK, else NULL
  68.    
  69.  */
  70. typedef struct _HTDir HTDir;
  71. extern HTDir * HTDir_new (HTRequest * request, HTDirShow show, HTDirKey key);
  72. /*
  73.   ADD A LINE TO THE LIST
  74.   
  75.    This function accepts a directory line. "data" and "size", and "description" can all be
  76.    NULL. Returns YES if OK, else NO
  77.    
  78.  */
  79. extern BOOL HTDir_addElement    (HTDir *dir, char *name, char *date,
  80.                                  char *size, HTFileMode mode);
  81. /*
  82.   FREE A DIRECTORY OBEJCT
  83.   
  84.    If we are sorting then do the sorting and put out the list, else just append the end of
  85.    the list.
  86.    
  87.  */
  88. extern BOOL HTDir_free (HTDir * dir);
  89. /*
  90.  */
  91. #endif /* HTDIR */
  92. /*
  93.    End of declaration */