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

apr_file_info.h

Go to the documentation of this file.
00001 /* ==================================================================== 00002 * The Apache Software License, Version 1.1 00003 * 00004 * Copyright (c) 2000-2003 The Apache Software Foundation. All rights 00005 * reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 00014 * 2. Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in 00016 * the documentation and/or other materials provided with the 00017 * distribution. 00018 * 00019 * 3. The end-user documentation included with the redistribution, 00020 * if any, must include the following acknowledgment: 00021 * "This product includes software developed by the 00022 * Apache Software Foundation (http://www.apache.org/)." 00023 * Alternately, this acknowledgment may appear in the software itself, 00024 * if and wherever such third-party acknowledgments normally appear. 00025 * 00026 * 4. The names "Apache" and "Apache Software Foundation" must 00027 * not be used to endorse or promote products derived from this 00028 * software without prior written permission. For written 00029 * permission, please contact apache@apache.org. 00030 * 00031 * 5. Products derived from this software may not be called "Apache", 00032 * nor may "Apache" appear in their name, without prior written 00033 * permission of the Apache Software Foundation. 00034 * 00035 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00036 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00037 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00038 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00039 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00040 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00041 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00042 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00043 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00044 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00045 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00046 * SUCH DAMAGE. 00047 * ==================================================================== 00048 * 00049 * This software consists of voluntary contributions made by many 00050 * individuals on behalf of the Apache Software Foundation. For more 00051 * information on the Apache Software Foundation, please see 00052 * <http://www.apache.org/>. 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 /* __cplusplus */ 00077 00084 /* Many applications use the type member to determine the 00085 * existance of a file or initialization of the file info, 00086 * so the APR_NOFILE value must be distinct from APR_UNKFILE. 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 /* additional permission flags for apr_file_copy and apr_file_append */ 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 /* ! APR_FILE_INFO_H */

Generated on Wed Sep 1 05:15:08 2004 for Apache Portable Runtime by doxygen 1.3.8