1 /* 2 3 4 5 W3C Sample Code Library libwww Local File Access 6 7 8 ! 9 Local File Access 10 ! 11 */ 12 13 /* 14 ** (c) COPYRIGHT MIT 1995. 15 ** Please first read the full copyright statement in the file COPYRIGH. 16 */ 17 18 /* 19 20 These are routines for local file access used by WWW browsers and servers. 21 22 This module is implemented by HTFile.c, and it is 23 a part of the W3C Sample Code 24 Library. 25 */ 26 27 #ifndef HTFILE_H 28 #define HTFILE_H 29 30 #include "HTProt.h" 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 extern HTProtCallback HTLoadFile; 37 38 /* 39 . 40 Directory Access 41 . 42 43 You can define the directory access for file URLs by using the following 44 function. 45 */ 46 47 typedef enum _HTDirAccess { 48 HT_DIR_FORBID, /* Altogether forbidden */ 49 HT_DIR_SELECTIVE, /* Only if "selfile" exists */ 50 HT_DIR_OK /* Directory reading always OK */ 51 } HTDirAccess; 52 53 #define DEFAULT_DIR_FILE ".www_browsable" /* If exists, can browse */ 54 55 extern HTDirAccess HTFile_dirAccess (void); 56 extern BOOL HTFile_setDirAccess (HTDirAccess mode); 57 58 /* 59 . 60 Readme Files 61 . 62 63 You can specify the module to look for a README file and to put into a directory 64 listing. These are the possibilities: 65 */ 66 67 typedef enum _HTDirReadme { 68 HT_DIR_README_NONE, 69 HT_DIR_README_TOP, 70 HT_DIR_README_BOTTOM 71 } HTDirReadme; 72 73 #define DEFAULT_README "README" 74 75 extern HTDirReadme HTFile_dirReadme (void); 76 extern BOOL HTFile_setDirReadme (HTDirReadme mode); 77 78 /* 79 . 80 Should we do Automatic File Suffix Binding? 81 . 82 83 By default, libwww uses the file suffix bindings 84 to figure out the media type, natural language, charset, content encoding, 85 etc and assign the values to the anchor of the local file. 86 87 However, in some situations, the application can either already have done 88 this or isn't interested in using the libwww bindings. You can control whether 89 libwww should do thi or not using the following methods: 90 */ 91 92 extern BOOL HTFile_doFileSuffixBinding (BOOL mode); 93 extern BOOL HTFile_fileSuffixBinding (void); 94 95 /* 96 Calculate the required buffer size (in bytes) for directory 97 entries read from the given directory handle, as per security advisory 98 from Ben Hutchings. 99 Return -1 if this this cannot be done. 100 */ 101 102 extern size_t HTFile_dirent_buf_size(DIR * dirp); 103 104 /* 105 106 */ 107 108 #ifdef __cplusplus 109 } 110 #endif 111 112 #endif /* HTFILE_H */ 113 114 /* 115 116 117 118 @(#) $Id$ 119 120 */ 121