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
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.
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"
27 /* We have an implementation of mkstemp but it's not very multi-threading
28 * friendly & is part of the POSIX emulation rather than native so don't
33 #define APR_FILE_BUFSIZE 4096
46 enum { BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
48 /* Stuff for buffered mode */
50 int bufpos; // Read/Write position in buffer
51 unsigned long dataRead; // amount of valid data read into buffer
52 int direction; // buffer being used for 0 = read, 1 = write
53 unsigned long filePtr; // position in file of handle
54 apr_thread_mutex_t *mutex;// mutex semaphore, must be owned to access the above fields
65 apr_status_t apr_file_cleanup(void *);
66 apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date,
69 /* see win32/fileio.h for description of these */
70 extern const char c_is_fnchar[256];
72 #define IS_FNCHAR(c) c_is_fnchar[(unsigned char)c]
74 apr_status_t filepath_root_test(char *path, apr_pool_t *p);
75 apr_status_t filepath_drive_get(char **rootpath, char drive,
76 apr_int32_t flags, apr_pool_t *p);
77 apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t *p);
79 #endif /* ! FILE_IO_H */