1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
21
#include "apr_private.h"
22
#include "apr_general.h"
23
#include "apr_tables.h"
24
#include "apr_file_io.h"
25
#include "apr_file_info.h"
26
#include "apr_errno.h"
30
/* System headers the file I/O library needs */
34
#if APR_HAVE_SYS_TYPES_H
35
#include <sys/types.h>
43
#if APR_HAVE_STRINGS_H
49
#ifdef HAVE_SYS_STAT_H
61
#if APR_HAVE_SYS_UIO_H
64
#if APR_HAVE_SYS_TIME_H
70
/* End System headers */
72
#define APR_FILE_BUFSIZE 4096
74
#if APR_HAS_LARGE_FILES
75
#define lseek(f,o,w) lseek64(f,o,w)
76
#define ftruncate(f,l) ftruncate64(f,l)
79
typedef struct stat struct_stat;
88
apr_interval_time_t timeout;
90
enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
91
int ungetchar; /* Last char provided by an unget op. (-1 = no char)*/
93
/* if there is a timeout set, then this pollset is used */
94
apr_pollset_t *pollset;
96
/* Stuff for buffered mode */
98
int bufpos; /* Read/Write position in buffer */
99
apr_off_t dataRead; /* amount of valid data read into buffer */
100
int direction; /* buffer being used for 0 = read, 1 = write */
101
apr_off_t filePtr; /* position in file of handle */
103
struct apr_thread_mutex_t *thlock;
111
struct dirent *entry;
114
typedef struct apr_stat_entry_t apr_stat_entry_t;
116
struct apr_stat_entry_t {
123
#define MAX_SERVER_NAME 64
124
#define MAX_VOLUME_NAME 64
125
#define MAX_PATH_NAME 256
126
#define MAX_FILE_NAME 256
130
/* If the user passes d: vs. D: (or //mach/share vs. //MACH/SHARE),
131
* we need to fold the case to canonical form. This function is
134
apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
136
/* This function check to see of the given path includes a drive/volume
137
* specifier. If the _only_ parameter is set to DRIVE_ONLY then it
138
* check to see of the path only contains a drive/volume specifier and
141
apr_status_t filepath_has_drive(const char *rootpath, int only, apr_pool_t *p);
143
/* This function compares the drive/volume specifiers for each given path.
144
* It returns zero if they match or non-zero if not.
146
apr_status_t filepath_compare_drive(const char *path1, const char *path2, apr_pool_t *p);
148
apr_status_t apr_unix_file_cleanup(void *);
150
#endif /* ! FILE_IO_H */