00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef FILE_IO_H
00018 #define FILE_IO_H
00019
00020 #include "apr.h"
00021 #include "apr_private.h"
00022 #include "apr_general.h"
00023 #include "apr_tables.h"
00024 #include "apr_file_io.h"
00025 #include "apr_file_info.h"
00026 #include "apr_errno.h"
00027 #include "apr_lib.h"
00028 #include "apr_poll.h"
00029
00030
00031 #if APR_HAVE_FCNTL_H
00032 #include <fcntl.h>
00033 #endif
00034 #if APR_HAVE_SYS_TYPES_H
00035 #include <sys/types.h>
00036 #endif
00037 #if APR_HAVE_ERRNO_H
00038 #include <errno.h>
00039 #endif
00040 #if APR_HAVE_STRING_H
00041 #include <string.h>
00042 #endif
00043 #if APR_HAVE_STRINGS_H
00044 #include <strings.h>
00045 #endif
00046 #if APR_HAVE_DIRENT_H
00047 #include <dirent.h>
00048 #endif
00049 #ifdef HAVE_SYS_STAT_H
00050 #include <sys/stat.h>
00051 #endif
00052 #if APR_HAVE_UNISTD_H
00053 #include <unistd.h>
00054 #endif
00055 #if APR_HAVE_STDIO_H
00056 #include <stdio.h>
00057 #endif
00058 #if APR_HAVE_STDLIB_H
00059 #include <stdlib.h>
00060 #endif
00061 #if APR_HAVE_SYS_UIO_H
00062 #include <sys/uio.h>
00063 #endif
00064 #if APR_HAVE_SYS_TIME_H
00065 #include <sys/time.h>
00066 #endif
00067
00068 #include <fsio.h>
00069
00070
00071
00072 #define APR_FILE_BUFSIZE 4096
00073
00074 #if APR_HAS_LARGE_FILES
00075 #define lseek(f,o,w) lseek64(f,o,w)
00076 #define ftruncate(f,l) ftruncate64(f,l)
00077 #endif
00078
00079 typedef struct stat struct_stat;
00080
00081 struct apr_file_t {
00082 apr_pool_t *pool;
00083 int filedes;
00084 char *fname;
00085 apr_int32_t flags;
00086 int eof_hit;
00087 int is_pipe;
00088 apr_interval_time_t timeout;
00089 int buffered;
00090 enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
00091 int ungetchar;
00092
00093
00094 apr_pollset_t *pollset;
00095
00096
00097 char *buffer;
00098 int bufpos;
00099 apr_off_t dataRead;
00100 int direction;
00101 apr_off_t filePtr;
00102 #if APR_HAS_THREADS
00103 struct apr_thread_mutex_t *thlock;
00104 #endif
00105 };
00106
00107 struct apr_dir_t {
00108 apr_pool_t *pool;
00109 char *dirname;
00110 DIR *dirstruct;
00111 struct dirent *entry;
00112 };
00113
00114 typedef struct apr_stat_entry_t apr_stat_entry_t;
00115
00116 struct apr_stat_entry_t {
00117 struct stat info;
00118 char *casedName;
00119 apr_time_t expire;
00120 NXPathCtx_t pathCtx;
00121 };
00122
00123 #define MAX_SERVER_NAME 64
00124 #define MAX_VOLUME_NAME 64
00125 #define MAX_PATH_NAME 256
00126 #define MAX_FILE_NAME 256
00127
00128 #define DRIVE_ONLY 1
00129
00130
00131
00132
00133
00134 apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
00135
00136
00137
00138
00139
00140
00141 apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p);
00142
00143
00144
00145
00146 apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p);
00147
00148 apr_status_t apr_unix_file_cleanup(void *);
00149
00150 #endif
00151