Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_file_info.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 APR_FILE_INFO_H
18 #define APR_FILE_INFO_H
19 
25 #include "apr.h"
26 #include "apr_user.h"
27 #include "apr_pools.h"
28 #include "apr_tables.h"
29 #include "apr_time.h"
30 #include "apr_errno.h"
31 
32 #if APR_HAVE_SYS_UIO_H
33 #include <sys/uio.h>
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif /* __cplusplus */
39 
46 /* Many applications use the type member to determine the
47  * existance of a file or initialization of the file info,
48  * so the APR_NOFILE value must be distinct from APR_UNKFILE.
49  */
50 
62 typedef enum {
63  APR_NOFILE = 0,
71  APR_UNKFILE = 127
73 
79 #define APR_FPROT_USETID 0x8000
80 #define APR_FPROT_UREAD 0x0400
81 #define APR_FPROT_UWRITE 0x0200
82 #define APR_FPROT_UEXECUTE 0x0100
84 #define APR_FPROT_GSETID 0x4000
85 #define APR_FPROT_GREAD 0x0040
86 #define APR_FPROT_GWRITE 0x0020
87 #define APR_FPROT_GEXECUTE 0x0010
89 #define APR_FPROT_WSTICKY 0x2000
90 #define APR_FPROT_WREAD 0x0004
91 #define APR_FPROT_WWRITE 0x0002
92 #define APR_FPROT_WEXECUTE 0x0001
94 #define APR_FPROT_OS_DEFAULT 0x0FFF
96 /* additional permission flags for apr_file_copy and apr_file_append */
97 #define APR_FPROT_FILE_SOURCE_PERMS 0x1000
99 /* backcompat */
100 #define APR_USETID APR_FPROT_USETID
101 #define APR_UREAD APR_FPROT_UREAD
102 #define APR_UWRITE APR_FPROT_UWRITE
103 #define APR_UEXECUTE APR_FPROT_UEXECUTE
104 #define APR_GSETID APR_FPROT_GSETID
105 #define APR_GREAD APR_FPROT_GREAD
106 #define APR_GWRITE APR_FPROT_GWRITE
107 #define APR_GEXECUTE APR_FPROT_GEXECUTE
108 #define APR_WSTICKY APR_FPROT_WSTICKY
109 #define APR_WREAD APR_FPROT_WREAD
110 #define APR_WWRITE APR_FPROT_WWRITE
111 #define APR_WEXECUTE APR_FPROT_WEXECUTE
112 #define APR_OS_DEFAULT APR_FPROT_OS_DEFAULT
113 #define APR_FILE_SOURCE_PERMS APR_FPROT_FILE_SOURCE_PERMS
121 typedef struct apr_dir_t apr_dir_t;
122 
126 #if (defined WIN32) || (defined NETWARE)
127 
130 typedef apr_uint32_t apr_dev_t;
131 #else
132 
135 typedef dev_t apr_dev_t;
136 #endif
137 
143 typedef struct apr_finfo_t apr_finfo_t;
144 
145 #define APR_FINFO_LINK 0x00000001
146 #define APR_FINFO_MTIME 0x00000010
147 #define APR_FINFO_CTIME 0x00000020
148 #define APR_FINFO_ATIME 0x00000040
149 #define APR_FINFO_SIZE 0x00000100
150 #define APR_FINFO_CSIZE 0x00000200
151 #define APR_FINFO_DEV 0x00001000
152 #define APR_FINFO_INODE 0x00002000
153 #define APR_FINFO_NLINK 0x00004000
154 #define APR_FINFO_TYPE 0x00008000
155 #define APR_FINFO_USER 0x00010000
156 #define APR_FINFO_GROUP 0x00020000
157 #define APR_FINFO_UPROT 0x00100000
158 #define APR_FINFO_GPROT 0x00200000
159 #define APR_FINFO_WPROT 0x00400000
160 #define APR_FINFO_ICASE 0x01000000
161 #define APR_FINFO_NAME 0x02000000
163 #define APR_FINFO_MIN 0x00008170
164 #define APR_FINFO_IDENT 0x00003000
165 #define APR_FINFO_OWNER 0x00030000
166 #define APR_FINFO_PROT 0x00700000
167 #define APR_FINFO_NORM 0x0073b170
168 #define APR_FINFO_DIRENT 0x02000000
174 struct apr_finfo_t {
175 
181  apr_fileperms_t protection;
194  apr_dev_t device;
208  const char *fname;
210  const char *name;
213 };
214 
230  apr_int32_t wanted, apr_pool_t *pool);
231 
245  const char *dirname,
246  apr_pool_t *pool);
247 
253 
268  apr_dir_t *thedir);
269 
287 #define APR_FILEPATH_NOTABOVEROOT 0x01
288 
290 #define APR_FILEPATH_SECUREROOTTEST 0x02
291 
295 #define APR_FILEPATH_SECUREROOT 0x03
296 
298 #define APR_FILEPATH_NOTRELATIVE 0x04
299 
301 #define APR_FILEPATH_NOTABSOLUTE 0x08
302 
305 #define APR_FILEPATH_NATIVE 0x10
306 
311 #define APR_FILEPATH_TRUENAME 0x20
312 
336 APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
337  const char **filepath,
339  apr_pool_t *p);
340 
355  const char *rootpath,
356  const char *addpath,
357  apr_int32_t flags,
358  apr_pool_t *p);
359 
370  const char *liststr,
371  apr_pool_t *p);
372 
383  apr_array_header_t *pathelts,
384  apr_pool_t *p);
385 
394  apr_pool_t *p);
395 
401 APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
402 
404 #define APR_FILEPATH_ENCODING_UNKNOWN 0
405 
407 #define APR_FILEPATH_ENCODING_LOCALE 1
408 
410 #define APR_FILEPATH_ENCODING_UTF8 2
411 
424 #ifdef __cplusplus
425 }
426 #endif
427 
428 #endif /* ! APR_FILE_INFO_H */
apr_status_t apr_filepath_set(const char *path, apr_pool_t *p)
apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *pool)
Definition: apr_file_info.h:68
const char * fname
Definition: apr_file_info.h:208
char * fname
Definition: apr_arch_file_io.h:110
apr_int32_t valid
Definition: apr_file_info.h:179
Definition: apr_arch_file_io.h:107
Definition: apr_tables.h:62
apr_status_t apr_filepath_list_merge(char **liststr, apr_array_header_t *pathelts, apr_pool_t *p)
apr_off_t size
Definition: apr_file_info.h:198
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
apr_finfo_t * finfo
Definition: apr_arch_file_io.h:170
apr_int32_t nlink
Definition: apr_file_info.h:196
uid_t apr_uid_t
Definition: apr_user.h:45
apr_off_t csize
Definition: apr_file_info.h:200
Definition: apr_arch_file_io.h:135
struct apr_file_t * filehand
Definition: apr_file_info.h:212
apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir)
Definition: apr_file_info.h:71
Definition: apr_file_info.h:63
apr_time_t atime
Definition: apr_file_info.h:202
APR User ID Services.
apr_status_t apr_filepath_root(const char **rootpath, const char **filepath, apr_int32_t flags, apr_pool_t *p)
apr_int64_t apr_time_t
Definition: apr_time.h:45
APR memory allocation.
apr_status_t apr_filepath_get(char **path, apr_int32_t flags, apr_pool_t *p)
apr_time_t mtime
Definition: apr_file_info.h:204
apr_fileperms_t protection
Definition: apr_file_info.h:181
apr_int32_t apr_fileperms_t
Definition: apr_file_info.h:125
apr_status_t apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p)
apr_status_t apr_filepath_encoding(int *style, apr_pool_t *p)
APR Table library.
APR Error Codes.
Definition: apr_file_info.h:65
unsigned int apr_uint32_t
Definition: apr.h:334
APR Platform Definitions.
dev_t apr_dev_t
Definition: apr_file_info.h:135
apr_time_t ctime
Definition: apr_file_info.h:206
const char * name
Definition: apr_file_info.h:210
apr_pool_t * p
Definition: apr_file_info.h:64
apr_dev_t device
Definition: apr_file_info.h:194
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_file_info.h:66
apr_uid_t user
Definition: apr_file_info.h:188
apr_status_t apr_dir_rewind(apr_dir_t *thedir)
Definition: apr_file_info.h:67
ino_t apr_ino_t
Definition: apr.h:379
gid_t apr_gid_t
Definition: apr_user.h:54
Definition: apr_file_info.h:70
apr_filetype_e filetype
Definition: apr_file_info.h:186
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
apr_status_t apr_filepath_list_split(apr_array_header_t **pathelts, const char *liststr, apr_pool_t *p)
APR Time Library.
apr_gid_t group
Definition: apr_file_info.h:190
apr_status_t apr_dir_close(apr_dir_t *thedir)
apr_ino_t inode
Definition: apr_file_info.h:192
apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool)
apr_filetype_e
Definition: apr_file_info.h:62
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1346
off_t apr_off_t
Definition: apr.h:377
Definition: apr_file_info.h:174
apr_pool_t * pool
Definition: apr_file_info.h:176
Definition: apr_file_info.h:69
int apr_int32_t
Definition: apr.h:333