00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef APR_FILE_INFO_H
00017 #define APR_FILE_INFO_H
00018
00024 #include "apr.h"
00025 #include "apr_user.h"
00026 #include "apr_pools.h"
00027 #include "apr_tables.h"
00028 #include "apr_time.h"
00029 #include "apr_errno.h"
00030
00031 #if APR_HAVE_SYS_UIO_H
00032 #include <sys/uio.h>
00033 #endif
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00045
00046
00047
00048
00049
00061 typedef enum {
00062 APR_NOFILE = 0,
00063 APR_REG,
00064 APR_DIR,
00065 APR_CHR,
00066 APR_BLK,
00067 APR_PIPE,
00068 APR_LNK,
00069 APR_SOCK,
00070 APR_UNKFILE = 127
00071 } apr_filetype_e;
00072
00078 #define APR_UREAD 0x0400
00079 #define APR_UWRITE 0x0200
00080 #define APR_UEXECUTE 0x0100
00082 #define APR_GREAD 0x0040
00083 #define APR_GWRITE 0x0020
00084 #define APR_GEXECUTE 0x0010
00086 #define APR_WREAD 0x0004
00087 #define APR_WWRITE 0x0002
00088 #define APR_WEXECUTE 0x0001
00090 #define APR_OS_DEFAULT 0x0FFF
00092
00093 #define APR_FILE_SOURCE_PERMS 0x1000
00101 typedef struct apr_dir_t apr_dir_t;
00102
00105 typedef apr_int32_t apr_fileperms_t;
00106 #if (defined WIN32) || (defined NETWARE)
00107
00110 typedef apr_uint64_t apr_ino_t;
00114 typedef apr_uint32_t apr_dev_t;
00115 #else
00116
00117 typedef ino_t apr_ino_t;
00121 typedef dev_t apr_dev_t;
00122 #endif
00123
00129 typedef struct apr_finfo_t apr_finfo_t;
00130
00131 #define APR_FINFO_LINK 0x00000001
00132 #define APR_FINFO_MTIME 0x00000010
00133 #define APR_FINFO_CTIME 0x00000020
00134 #define APR_FINFO_ATIME 0x00000040
00135 #define APR_FINFO_SIZE 0x00000100
00136 #define APR_FINFO_CSIZE 0x00000200
00137 #define APR_FINFO_DEV 0x00001000
00138 #define APR_FINFO_INODE 0x00002000
00139 #define APR_FINFO_NLINK 0x00004000
00140 #define APR_FINFO_TYPE 0x00008000
00141 #define APR_FINFO_USER 0x00010000
00142 #define APR_FINFO_GROUP 0x00020000
00143 #define APR_FINFO_UPROT 0x00100000
00144 #define APR_FINFO_GPROT 0x00200000
00145 #define APR_FINFO_WPROT 0x00400000
00146 #define APR_FINFO_ICASE 0x01000000
00147 #define APR_FINFO_NAME 0x02000000
00149 #define APR_FINFO_MIN 0x00008170
00150 #define APR_FINFO_IDENT 0x00003000
00151 #define APR_FINFO_OWNER 0x00030000
00152 #define APR_FINFO_PROT 0x00700000
00153 #define APR_FINFO_NORM 0x0073b170
00154 #define APR_FINFO_DIRENT 0x02000000
00160 struct apr_finfo_t {
00161
00162 apr_pool_t *pool;
00165 apr_int32_t valid;
00167 apr_fileperms_t protection;
00172 apr_filetype_e filetype;
00174 apr_uid_t user;
00176 apr_gid_t group;
00178 apr_ino_t inode;
00180 apr_dev_t device;
00182 apr_int32_t nlink;
00184 apr_off_t size;
00186 apr_off_t csize;
00188 apr_time_t atime;
00190 apr_time_t mtime;
00192 apr_time_t ctime;
00194 const char *fname;
00196 const char *name;
00198 struct apr_file_t *filehand;
00199 };
00200
00210 APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
00211 apr_int32_t wanted, apr_pool_t *cont);
00212
00225 APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
00226 apr_int32_t wanted, apr_pool_t *cont);
00239 APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir,
00240 const char *dirname,
00241 apr_pool_t *cont);
00242
00247 APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
00248
00256 APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
00257 apr_dir_t *thedir);
00258
00263 APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
00272 #define APR_FILEPATH_NOTABOVEROOT 0x01
00273
00275 #define APR_FILEPATH_SECUREROOTTEST 0x02
00276
00280 #define APR_FILEPATH_SECUREROOT 0x03
00281
00283 #define APR_FILEPATH_NOTRELATIVE 0x04
00284
00286 #define APR_FILEPATH_NOTABSOLUTE 0x08
00287
00290 #define APR_FILEPATH_NATIVE 0x10
00291
00296 #define APR_FILEPATH_TRUENAME 0x20
00297
00321 APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
00322 const char **filepath,
00323 apr_int32_t flags,
00324 apr_pool_t *p);
00325
00339 APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
00340 const char *rootpath,
00341 const char *addpath,
00342 apr_int32_t flags,
00343 apr_pool_t *p);
00344
00354 APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
00355 const char *liststr,
00356 apr_pool_t *p);
00357
00367 APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
00368 apr_array_header_t *pathelts,
00369 apr_pool_t *p);
00370
00378 APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags,
00379 apr_pool_t *p);
00380
00386 APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
00387
00389 #define APR_FILEPATH_ENCODING_UNKNOWN 0
00390
00392 #define APR_FILEPATH_ENCODING_LOCALE 1
00393
00395 #define APR_FILEPATH_ENCODING_UTF8 2
00396
00404 APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p);
00409 #ifdef __cplusplus
00410 }
00411 #endif
00412
00413 #endif