Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_arch_file_io.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 #ifndef FILE_IO_H
18 #define FILE_IO_H
19 
20 #include "apr_private.h"
21 #include "apr_general.h"
22 #include "apr_thread_mutex.h"
23 #include "apr_file_io.h"
24 #include "apr_file_info.h"
25 #include "apr_errno.h"
26 #include "apr_poll.h"
27 
28 /* We have an implementation of mkstemp but it's not very multi-threading
29  * friendly & is part of the POSIX emulation rather than native so don't
30  * use it.
31  */
32 #undef HAVE_MKSTEMP
33 
34 #define APR_FILE_DEFAULT_BUFSIZE 4096
35 #define APR_FILE_BUFSIZE APR_FILE_DEFAULT_BUFSIZE
36 
37 struct apr_file_t {
39  HFILE filedes;
40  char * fname;
41  int isopen;
42  int buffered;
43  int eof_hit;
45  int timeout;
46  int pipe;
47  HEV pipeSem;
49 
50  /* Stuff for buffered mode */
51  char *buffer;
52  apr_size_t bufsize; /* The size of the buffer */
53  apr_size_t bufpos; /* Read/Write position in buffer */
54  unsigned long dataRead; /* amount of valid data read into buffer */
55  int direction; /* buffer being used for 0 = read, 1 = write */
56  unsigned long filePtr; /* position in file of handle */
57  apr_thread_mutex_t *mutex; /* mutex semaphore, must be owned to access
58  the above fields */
59  int ungetchar;
60 };
61 
62 struct apr_dir_t {
64  char *dirname;
65  ULONG handle;
66  FILEFINDBUF3 entry;
68 };
69 
71 apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date,
72  FTIME os2time);
73 apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time,
74  apr_time_t aprtime);
75 
76 /* see win32/fileio.h for description of these */
77 extern const char c_is_fnchar[256];
78 
79 #define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c]
80 
82 apr_status_t filepath_drive_get(char **rootpath, char drive,
84 apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
85 
86 #endif /* ! FILE_IO_H */
87 
int pipe
Definition: apr_arch_file_io.h:46
size_t apr_size_t
Definition: apr.h:375
char * fname
Definition: apr_arch_file_io.h:110
Definition: apr_arch_thread_mutex.h:28
int timeout
Definition: apr_arch_file_io.h:45
Definition: apr_arch_file_io.h:107
HFILE filedes
Definition: apr_arch_file_io.h:39
unsigned long dataRead
Definition: apr_arch_file_io.h:54
HEV pipeSem
Definition: apr_arch_file_io.h:47
enum apr_file_t::@17 blocking
apr_status_t filepath_drive_get(char **rootpath, char drive, apr_int32_t flags, apr_pool_t *p)
APR File Information.
char * dirname
Definition: apr_arch_file_io.h:137
apr_pool_t * pool
Definition: apr_arch_file_io.h:136
FILEFINDBUF3 entry
Definition: apr_arch_file_io.h:66
apr_pool_t * pool
Definition: apr_arch_file_io.h:108
Definition: apr_arch_file_io.h:116
Definition: apr_arch_file_io.h:135
APR File I/O Handling.
APR Thread Mutex Routines.
apr_status_t apr_file_cleanup(void *)
APR Miscellaneous library routines.
APR Poll interface.
int ungetchar
Definition: apr_arch_file_io.h:117
int buffered
Definition: apr_arch_file_io.h:115
unsigned long filePtr
Definition: apr_arch_file_io.h:56
apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time, apr_time_t aprtime)
apr_int64_t apr_time_t
Definition: apr_time.h:45
int eof_hit
Definition: apr_arch_file_io.h:112
apr_status_t filepath_root_test(char *path, apr_pool_t *p)
int direction
Definition: apr_arch_file_io.h:127
apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p)
APR Error Codes.
char * buffer
Definition: apr_arch_file_io.h:123
int isopen
Definition: apr_arch_file_io.h:41
Definition: apr_arch_file_io.h:116
ULONG handle
Definition: apr_arch_file_io.h:65
apr_pool_t * p
int validentry
Definition: apr_arch_file_io.h:67
apr_size_t bufsize
Definition: apr_arch_file_io.h:125
apr_thread_mutex_t * mutex
Definition: apr_arch_file_io.h:57
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date, FTIME os2time)
int apr_status_t
Definition: apr_errno.h:44
apr_int32_t flags
Definition: apr_arch_file_io.h:111
Definition: apr_arch_file_io.h:116
const char c_is_fnchar[256]
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1346
apr_size_t bufpos
Definition: apr_arch_file_io.h:124
int apr_int32_t
Definition: apr.h:333