00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
#ifndef APR_FILE_INFO_H
00056
#define APR_FILE_INFO_H
00057
00063
#include "apr.h"
00064
#include "apr_user.h"
00065
#include "apr_pools.h"
00066
#include "apr_tables.h"
00067
#include "apr_time.h"
00068
#include "apr_errno.h"
00069
00070
#if APR_HAVE_SYS_UIO_H
00071
#include <sys/uio.h>
00072
#endif
00073
00074
#ifdef __cplusplus
00075
extern "C" {
00076
#endif
00077
00084
00085
00086
00087
00088
00100 typedef enum {
00101
APR_NOFILE = 0,
00102
APR_REG,
00103
APR_DIR,
00104
APR_CHR,
00105
APR_BLK,
00106
APR_PIPE,
00107
APR_LNK,
00108
APR_SOCK,
00109
APR_UNKFILE = 127
00110 }
apr_filetype_e;
00111
00117 #define APR_USETID 0x8000
00118 #define APR_UREAD 0x0400
00119 #define APR_UWRITE 0x0200
00120 #define APR_UEXECUTE 0x0100
00122 #define APR_GSETID 0x4000
00123 #define APR_GREAD 0x0040
00124 #define APR_GWRITE 0x0020
00125 #define APR_GEXECUTE 0x0010
00127 #define APR_WSTICKY 0x2000
00128 #define APR_WREAD 0x0004
00129 #define APR_WWRITE 0x0002
00130 #define APR_WEXECUTE 0x0001
00132 #define APR_OS_DEFAULT 0x0FFF
00134
00135 #define APR_FILE_SOURCE_PERMS 0x1000
00143 typedef struct apr_dir_t apr_dir_t;
00144
00147 typedef apr_int32_t
apr_fileperms_t;
00148
#if (defined WIN32) || (defined NETWARE)
00149
00152
typedef apr_uint64_t
apr_ino_t;
00156
typedef apr_uint32_t
apr_dev_t;
00157
#else
00158
00159 typedef ino_t
apr_ino_t;
00163 typedef dev_t
apr_dev_t;
00164
#endif
00165
00171 typedef struct apr_finfo_t apr_finfo_t;
00172
00173 #define APR_FINFO_LINK 0x00000001
00174 #define APR_FINFO_MTIME 0x00000010
00175 #define APR_FINFO_CTIME 0x00000020
00176 #define APR_FINFO_ATIME 0x00000040
00177 #define APR_FINFO_SIZE 0x00000100
00178 #define APR_FINFO_CSIZE 0x00000200
00179 #define APR_FINFO_DEV 0x00001000
00180 #define APR_FINFO_INODE 0x00002000
00181 #define APR_FINFO_NLINK 0x00004000
00182 #define APR_FINFO_TYPE 0x00008000
00183 #define APR_FINFO_USER 0x00010000
00184 #define APR_FINFO_GROUP 0x00020000
00185 #define APR_FINFO_UPROT 0x00100000
00186 #define APR_FINFO_GPROT 0x00200000
00187 #define APR_FINFO_WPROT 0x00400000
00188 #define APR_FINFO_ICASE 0x01000000
00189 #define APR_FINFO_NAME 0x02000000
00191 #define APR_FINFO_MIN 0x00008170
00192 #define APR_FINFO_IDENT 0x00003000
00193 #define APR_FINFO_OWNER 0x00030000
00194 #define APR_FINFO_PROT 0x00700000
00195 #define APR_FINFO_NORM 0x0073b170
00196 #define APR_FINFO_DIRENT 0x02000000
00202 struct apr_finfo_t {
00203
00204 apr_pool_t *pool;
00207 apr_int32_t valid;
00209 apr_fileperms_t protection;
00214 apr_filetype_e filetype;
00216 apr_uid_t user;
00218 apr_gid_t group;
00220 apr_ino_t inode;
00222 apr_dev_t device;
00224 apr_int32_t nlink;
00226 apr_off_t size;
00228 apr_off_t csize;
00230 apr_time_t atime;
00232 apr_time_t mtime;
00234 apr_time_t ctime;
00236 const char *fname;
00238 const char *name;
00240 struct apr_file_t *filehand;
00241 };
00242
00252
APR_DECLARE(
apr_status_t) apr_stat(
apr_finfo_t *finfo, const
char *fname,
00253 apr_int32_t wanted,
apr_pool_t *cont);
00254
00267 APR_DECLARE(
apr_status_t) apr_lstat(
apr_finfo_t *finfo, const
char *fname,
00268 apr_int32_t wanted,
apr_pool_t *cont);
00281 APR_DECLARE(
apr_status_t) apr_dir_open(
apr_dir_t **new_dir,
00282 const
char *dirname,
00283
apr_pool_t *cont);
00284
00289 APR_DECLARE(
apr_status_t) apr_dir_close(
apr_dir_t *thedir);
00290
00298 APR_DECLARE(
apr_status_t) apr_dir_read(
apr_finfo_t *finfo, apr_int32_t wanted,
00299
apr_dir_t *thedir);
00300
00305 APR_DECLARE(
apr_status_t) apr_dir_rewind(
apr_dir_t *thedir);
00314 #define APR_FILEPATH_NOTABOVEROOT 0x01
00315
00317 #define APR_FILEPATH_SECUREROOTTEST 0x02
00318
00322 #define APR_FILEPATH_SECUREROOT 0x03
00323
00325 #define APR_FILEPATH_NOTRELATIVE 0x04
00326
00328 #define APR_FILEPATH_NOTABSOLUTE 0x08
00329
00332 #define APR_FILEPATH_NATIVE 0x10
00333
00338 #define APR_FILEPATH_TRUENAME 0x20
00339
00363 APR_DECLARE(
apr_status_t) apr_filepath_root(const
char **rootpath,
00364 const
char **filepath,
00365 apr_int32_t flags,
00366
apr_pool_t *p);
00367
00381 APR_DECLARE(
apr_status_t) apr_filepath_merge(
char **newpath,
00382 const
char *rootpath,
00383 const
char *addpath,
00384 apr_int32_t flags,
00385
apr_pool_t *p);
00386
00396 APR_DECLARE(
apr_status_t) apr_filepath_list_split(
apr_array_header_t **pathelts,
00397 const
char *liststr,
00398
apr_pool_t *p);
00399
00409 APR_DECLARE(
apr_status_t) apr_filepath_list_merge(
char **liststr,
00410
apr_array_header_t *pathelts,
00411
apr_pool_t *p);
00412
00420 APR_DECLARE(
apr_status_t) apr_filepath_get(
char **path, apr_int32_t flags,
00421
apr_pool_t *p);
00422
00428 APR_DECLARE(
apr_status_t) apr_filepath_set(const
char *path,
apr_pool_t *p);
00429
00431 #define APR_FILEPATH_ENCODING_UNKNOWN 0
00432
00434 #define APR_FILEPATH_ENCODING_LOCALE 1
00435
00437 #define APR_FILEPATH_ENCODING_UTF8 2
00438
00446 APR_DECLARE(
apr_status_t) apr_filepath_encoding(
int *style,
apr_pool_t *p);
00451 #ifdef __cplusplus
00452 }
00453 #endif
00454
00455 #endif