/usr/src/redhat/BUILD/httpd-2.2.3/srclib/apr/include/arch/unix/apr_arch_file_io.h

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 FILE_IO_H
00018 #define FILE_IO_H
00019 
00020 #include "apr.h"
00021 #include "apr_private.h"
00022 #include "apr_general.h"
00023 #include "apr_tables.h"
00024 #include "apr_file_io.h"
00025 #include "apr_file_info.h"
00026 #include "apr_errno.h"
00027 #include "apr_lib.h"
00028 #include "apr_thread_mutex.h"
00029 #ifndef WAITIO_USES_POLL
00030 #include "apr_poll.h"
00031 #endif
00032 
00033 /* System headers the file I/O library needs */
00034 #if APR_HAVE_FCNTL_H
00035 #include <fcntl.h>
00036 #endif
00037 #if APR_HAVE_SYS_TYPES_H
00038 #include <sys/types.h>
00039 #endif
00040 #if APR_HAVE_ERRNO_H
00041 #include <errno.h>
00042 #endif
00043 #if APR_HAVE_STRING_H
00044 #include <string.h>
00045 #endif
00046 #if APR_HAVE_STRINGS_H
00047 #include <strings.h>
00048 #endif
00049 #if APR_HAVE_DIRENT_H
00050 #include <dirent.h>
00051 #endif
00052 #ifdef HAVE_SYS_STAT_H
00053 #include <sys/stat.h>
00054 #endif
00055 #if APR_HAVE_UNISTD_H
00056 #include <unistd.h>
00057 #endif
00058 #if APR_HAVE_STDIO_H
00059 #include <stdio.h>
00060 #endif
00061 #if APR_HAVE_STDLIB_H
00062 #include <stdlib.h>
00063 #endif
00064 #if APR_HAVE_SYS_UIO_H
00065 #include <sys/uio.h>
00066 #endif
00067 #if APR_HAVE_SYS_TIME_H
00068 #include <sys/time.h>
00069 #endif
00070 #ifdef BEOS
00071 #include <kernel/OS.h>
00072 #endif
00073 
00074 #if BEOS_BONE
00075 # ifndef BONE7
00076   /* prior to BONE/7 fd_set & select were defined in sys/socket.h */
00077 #  include <sys/socket.h>
00078 # else
00079   /* Be moved the fd_set stuff and also the FIONBIO definition... */
00080 #  include <sys/ioctl.h>
00081 # endif
00082 #endif
00083 /* End System headers */
00084 
00085 #define APR_FILE_BUFSIZE 4096
00086 
00087 struct apr_file_t {
00088     apr_pool_t *pool;
00089     int filedes;
00090     char *fname;
00091     apr_int32_t flags;
00092     int eof_hit;
00093     int is_pipe;
00094     apr_interval_time_t timeout;
00095     int buffered;
00096     enum {BLK_UNKNOWN, BLK_OFF, BLK_ON } blocking;
00097     int ungetchar;    /* Last char provided by an unget op. (-1 = no char)*/
00098 #ifndef WAITIO_USES_POLL
00099     /* if there is a timeout set, then this pollset is used */
00100     apr_pollset_t *pollset;
00101 #endif
00102     /* Stuff for buffered mode */
00103     char *buffer;
00104     int bufpos;               /* Read/Write position in buffer */
00105     unsigned long dataRead;   /* amount of valid data read into buffer */
00106     int direction;            /* buffer being used for 0 = read, 1 = write */
00107     apr_off_t filePtr;        /* position in file of handle */
00108 #if APR_HAS_THREADS
00109     struct apr_thread_mutex_t *thlock;
00110 #endif
00111 };
00112 
00113 #if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
00114 #define stat(f,b) stat64(f,b)
00115 #define lstat(f,b) lstat64(f,b)
00116 #define fstat(f,b) fstat64(f,b)
00117 #define lseek(f,o,w) lseek64(f,o,w)
00118 #define ftruncate(f,l) ftruncate64(f,l)
00119 typedef struct stat64 struct_stat;
00120 #else
00121 typedef struct stat struct_stat;
00122 #endif
00123 
00124 struct apr_dir_t {
00125     apr_pool_t *pool;
00126     char *dirname;
00127     DIR *dirstruct;
00128     struct dirent *entry;
00129 };
00130 
00131 apr_status_t apr_unix_file_cleanup(void *);
00132 
00133 mode_t apr_unix_perms2mode(apr_fileperms_t perms);
00134 apr_fileperms_t apr_unix_mode2perms(mode_t mode);
00135 
00136 
00137 #endif  /* ! FILE_IO_H */
00138 

Apacheに対してSun Jul 19 22:05:24 2009に生成されました。  doxygen 1.4.7