Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

apr_file_info.h

Go to the documentation of this file.
00001 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef APR_FILE_INFO_H
00018 #define APR_FILE_INFO_H
00019 
00025 #include "apr.h"
00026 #include "apr_user.h"
00027 #include "apr_pools.h"
00028 #include "apr_tables.h"
00029 #include "apr_time.h"
00030 #include "apr_errno.h"
00031 
00032 #if APR_HAVE_SYS_UIO_H
00033 #include <sys/uio.h>
00034 #endif
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif /* __cplusplus */
00039 
00046 /* Many applications use the type member to determine the
00047  * existance of a file or initialization of the file info,
00048  * so the APR_NOFILE value must be distinct from APR_UNKFILE.
00049  */
00050 
00062 typedef enum {
00063     APR_NOFILE = 0,     
00064     APR_REG,            
00065     APR_DIR,            
00066     APR_CHR,            
00067     APR_BLK,            
00068     APR_PIPE,           
00069     APR_LNK,            
00070     APR_SOCK,           
00071     APR_UNKFILE = 127   
00072 } apr_filetype_e; 
00073 
00079 #define APR_USETID      0x8000 
00080 #define APR_UREAD       0x0400 
00081 #define APR_UWRITE      0x0200 
00082 #define APR_UEXECUTE    0x0100 
00084 #define APR_GSETID      0x4000 
00085 #define APR_GREAD       0x0040 
00086 #define APR_GWRITE      0x0020 
00087 #define APR_GEXECUTE    0x0010 
00089 #define APR_WSTICKY     0x2000 
00090 #define APR_WREAD       0x0004 
00091 #define APR_WWRITE      0x0002 
00092 #define APR_WEXECUTE    0x0001 
00094 #define APR_OS_DEFAULT  0x0FFF 
00096 /* additional permission flags for apr_file_copy  and apr_file_append */
00097 #define APR_FILE_SOURCE_PERMS 0x1000 
00105 typedef struct apr_dir_t          apr_dir_t;
00106 
00109 typedef apr_int32_t               apr_fileperms_t;
00110 #if (defined WIN32) || (defined NETWARE)
00111 
00114 typedef apr_uint64_t              apr_ino_t;
00118 typedef apr_uint32_t              apr_dev_t;
00119 #else
00120 
00121 typedef ino_t                     apr_ino_t;
00125 typedef dev_t                     apr_dev_t;
00126 #endif
00127 
00133 typedef struct apr_finfo_t        apr_finfo_t;
00134 
00135 #define APR_FINFO_LINK   0x00000001 
00136 #define APR_FINFO_MTIME  0x00000010 
00137 #define APR_FINFO_CTIME  0x00000020 
00138 #define APR_FINFO_ATIME  0x00000040 
00139 #define APR_FINFO_SIZE   0x00000100 
00140 #define APR_FINFO_CSIZE  0x00000200 
00141 #define APR_FINFO_DEV    0x00001000 
00142 #define APR_FINFO_INODE  0x00002000 
00143 #define APR_FINFO_NLINK  0x00004000 
00144 #define APR_FINFO_TYPE   0x00008000 
00145 #define APR_FINFO_USER   0x00010000 
00146 #define APR_FINFO_GROUP  0x00020000 
00147 #define APR_FINFO_UPROT  0x00100000 
00148 #define APR_FINFO_GPROT  0x00200000 
00149 #define APR_FINFO_WPROT  0x00400000 
00150 #define APR_FINFO_ICASE  0x01000000 
00151 #define APR_FINFO_NAME   0x02000000 
00153 #define APR_FINFO_MIN    0x00008170 
00154 #define APR_FINFO_IDENT  0x00003000 
00155 #define APR_FINFO_OWNER  0x00030000 
00156 #define APR_FINFO_PROT   0x00700000 
00157 #define APR_FINFO_NORM   0x0073b170 
00158 #define APR_FINFO_DIRENT 0x02000000 
00164 struct apr_finfo_t {
00165 
00166     apr_pool_t *pool;
00169     apr_int32_t valid;
00171     apr_fileperms_t protection;
00176     apr_filetype_e filetype;
00178     apr_uid_t user;
00180     apr_gid_t group;
00182     apr_ino_t inode;
00184     apr_dev_t device;
00186     apr_int32_t nlink;
00188     apr_off_t size;
00190     apr_off_t csize;
00192     apr_time_t atime;
00194     apr_time_t mtime;
00196     apr_time_t ctime;
00198     const char *fname;
00200     const char *name;
00202     struct apr_file_t *filehand;
00203 };
00204 
00214 APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
00215                                    apr_int32_t wanted, apr_pool_t *cont);
00216 
00229 APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
00230                                     apr_int32_t wanted, apr_pool_t *cont);
00243 APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, 
00244                                        const char *dirname, 
00245                                        apr_pool_t *cont);
00246 
00251 APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir);
00252 
00260 APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
00261                                        apr_dir_t *thedir);
00262 
00267 APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
00276 #define APR_FILEPATH_NOTABOVEROOT   0x01
00277 
00279 #define APR_FILEPATH_SECUREROOTTEST 0x02
00280 
00284 #define APR_FILEPATH_SECUREROOT     0x03
00285 
00287 #define APR_FILEPATH_NOTRELATIVE    0x04
00288 
00290 #define APR_FILEPATH_NOTABSOLUTE    0x08
00291 
00294 #define APR_FILEPATH_NATIVE         0x10
00295 
00300 #define APR_FILEPATH_TRUENAME       0x20
00301 
00325 APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath, 
00326                                             const char **filepath, 
00327                                             apr_int32_t flags,
00328                                             apr_pool_t *p);
00329 
00343 APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath, 
00344                                              const char *rootpath,
00345                                              const char *addpath, 
00346                                              apr_int32_t flags,
00347                                              apr_pool_t *p);
00348 
00358 APR_DECLARE(apr_status_t) apr_filepath_list_split(apr_array_header_t **pathelts,
00359                                                   const char *liststr,
00360                                                   apr_pool_t *p);
00361 
00371 APR_DECLARE(apr_status_t) apr_filepath_list_merge(char **liststr,
00372                                                   apr_array_header_t *pathelts,
00373                                                   apr_pool_t *p);
00374 
00382 APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_int32_t flags,
00383                                            apr_pool_t *p);
00384 
00390 APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
00391 
00393 #define APR_FILEPATH_ENCODING_UNKNOWN  0
00394 
00396 #define APR_FILEPATH_ENCODING_LOCALE   1
00397 
00399 #define APR_FILEPATH_ENCODING_UTF8     2
00400 
00408 APR_DECLARE(apr_status_t) apr_filepath_encoding(int *style, apr_pool_t *p);
00413 #ifdef __cplusplus
00414 }
00415 #endif
00416 
00417 #endif  /* ! APR_FILE_INFO_H */

Generated on Tue Jul 26 04:31:13 2005 for Apache Portable Runtime by  doxygen 1.4.2