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_USETID 0x0800
00079 #define APR_UREAD 0x0400
00080 #define APR_UWRITE 0x0200
00081 #define APR_UEXECUTE 0x0100
00083 #define APR_GSETID 0x0080
00084 #define APR_GREAD 0x0040
00085 #define APR_GWRITE 0x0020
00086 #define APR_GEXECUTE 0x0010
00088 #define APR_WSTICKY 0x0008
00089 #define APR_WREAD 0x0004
00090 #define APR_WWRITE 0x0002
00091 #define APR_WEXECUTE 0x0001
00093 #define APR_OS_DEFAULT 0x0FFF
00095
00096 #define APR_FILE_SOURCE_PERMS 0x1000
00104 typedef struct apr_dir_t apr_dir_t;
00105
00108 typedef apr_int32_t
apr_fileperms_t;
00109
#if (defined WIN32) || (defined NETWARE)
00110
00113
typedef apr_uint64_t
apr_ino_t;
00117
typedef apr_uint32_t
apr_dev_t;
00118
#else
00119
00120 typedef ino_t
apr_ino_t;
00124 typedef dev_t
apr_dev_t;
00125
#endif
00126
00132 typedef struct apr_finfo_t apr_finfo_t;
00133
00134 #define APR_FINFO_LINK 0x00000001
00135 #define APR_FINFO_MTIME 0x00000010
00136 #define APR_FINFO_CTIME 0x00000020
00137 #define APR_FINFO_ATIME 0x00000040
00138 #define APR_FINFO_SIZE 0x00000100
00139 #define APR_FINFO_CSIZE 0x00000200
00140 #define APR_FINFO_DEV 0x00001000
00141 #define APR_FINFO_INODE 0x00002000
00142 #define APR_FINFO_NLINK 0x00004000
00143 #define APR_FINFO_TYPE 0x00008000
00144 #define APR_FINFO_USER 0x00010000
00145 #define APR_FINFO_GROUP 0x00020000
00146 #define APR_FINFO_UPROT 0x00100000
00147 #define APR_FINFO_GPROT 0x00200000
00148 #define APR_FINFO_WPROT 0x00400000
00149 #define APR_FINFO_ICASE 0x01000000
00150 #define APR_FINFO_NAME 0x02000000
00152 #define APR_FINFO_MIN 0x00008170
00153 #define APR_FINFO_IDENT 0x00003000
00154 #define APR_FINFO_OWNER 0x00030000
00155 #define APR_FINFO_PROT 0x00700000
00156 #define APR_FINFO_NORM 0x0073b170
00157 #define APR_FINFO_DIRENT 0x02000000
00163 struct apr_finfo_t {
00164
00165 apr_pool_t *pool;
00168 apr_int32_t valid;
00170 apr_fileperms_t protection;
00175 apr_filetype_e filetype;
00177 apr_uid_t user;
00179 apr_gid_t group;
00181 apr_ino_t inode;
00183 apr_dev_t device;
00185 apr_int32_t nlink;
00187 apr_off_t size;
00189 apr_off_t csize;
00191 apr_time_t atime;
00193 apr_time_t mtime;
00195 apr_time_t ctime;
00197 const char *fname;
00199 const char *name;
00201 struct apr_file_t *filehand;
00202 };
00203
00213
APR_DECLARE(apr_status_t) apr_stat(
apr_finfo_t *finfo, const
char *fname,
00214 apr_int32_t wanted, apr_pool_t *cont);
00215
00228 APR_DECLARE(apr_status_t) apr_lstat(
apr_finfo_t *finfo, const
char *fname,
00229 apr_int32_t wanted, apr_pool_t *cont);
00242 APR_DECLARE(apr_status_t) apr_dir_open(
apr_dir_t **new_dir,
00243 const
char *dirname,
00244 apr_pool_t *cont);
00245
00250 APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
00251
00259 APR_DECLARE(apr_status_t) apr_dir_read(
apr_finfo_t *finfo, apr_int32_t wanted,
00260 apr_dir_t *thedir);
00261
00266 APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
00275 #define APR_FILEPATH_NOTABOVEROOT 0x01
00276
00278 #define APR_FILEPATH_SECUREROOTTEST 0x02
00279
00283 #define APR_FILEPATH_SECUREROOT 0x03
00284
00286 #define APR_FILEPATH_NOTRELATIVE 0x04
00287
00289 #define APR_FILEPATH_NOTABSOLUTE 0x08
00290
00293 #define APR_FILEPATH_NATIVE 0x10
00294
00299 #define APR_FILEPATH_TRUENAME 0x20
00300
00324 APR_DECLARE(apr_status_t) apr_filepath_root(const
char **rootpath,
00325 const
char **filepath,
00326 apr_int32_t flags,
00327 apr_pool_t *p);
00328
00342 APR_DECLARE(apr_status_t) apr_filepath_merge(
char **newpath,
00343 const
char *rootpath,
00344 const
char *addpath,
00345 apr_int32_t flags,
00346 apr_pool_t *p);
00347
00357 APR_DECLARE(apr_status_t) apr_filepath_list_split(
apr_array_header_t **pathelts,
00358 const
char *liststr,
00359 apr_pool_t *p);
00360
00370 APR_DECLARE(apr_status_t) apr_filepath_list_merge(
char **liststr,
00371
apr_array_header_t *pathelts,
00372 apr_pool_t *p);
00373
00381 APR_DECLARE(apr_status_t) apr_filepath_get(
char **path, apr_int32_t flags,
00382 apr_pool_t *p);
00383
00389 APR_DECLARE(apr_status_t) apr_filepath_set(const
char *path, apr_pool_t *p);
00390
00392 #define APR_FILEPATH_ENCODING_UNKNOWN 0
00393
00395 #define APR_FILEPATH_ENCODING_LOCALE 1
00396
00398 #define APR_FILEPATH_ENCODING_UTF8 2
00399
00407 APR_DECLARE(apr_status_t) apr_filepath_encoding(
int *style, apr_pool_t *p);
00412 #ifdef __cplusplus
00413 }
00414 #endif
00415
00416 #endif