Apache HTTPD
apr_file_io.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef APR_FILE_IO_H
18#define APR_FILE_IO_H
19
25#include "apr.h"
26#include "apr_pools.h"
27#include "apr_time.h"
28#include "apr_errno.h"
29#include "apr_file_info.h"
30#include "apr_inherit.h"
31
32#define APR_WANT_STDIO
33#define APR_WANT_IOVEC
34#include "apr_want.h"
35
36#ifdef __cplusplus
37extern "C" {
38#endif /* __cplusplus */
39
51/* Note to implementors: Values in the range 0x00100000--0x80000000
52 are reserved for platform-specific values. */
53
54#define APR_FOPEN_READ 0x00001
55#define APR_FOPEN_WRITE 0x00002
56#define APR_FOPEN_CREATE 0x00004
57#define APR_FOPEN_APPEND 0x00008
58#define APR_FOPEN_TRUNCATE 0x00010
60#define APR_FOPEN_BINARY 0x00020
63#define APR_FOPEN_EXCL 0x00040
65#define APR_FOPEN_BUFFERED 0x00080
66#define APR_FOPEN_DELONCLOSE 0x00100
67#define APR_FOPEN_XTHREAD 0x00200
70#define APR_FOPEN_SHARELOCK 0x00400
74#define APR_FOPEN_NOCLEANUP 0x00800
79#define APR_FOPEN_SENDFILE_ENABLED 0x01000
82#define APR_FOPEN_LARGEFILE 0x04000
85#define APR_FOPEN_SPARSE 0x08000
88#define APR_FOPEN_NONBLOCK 0x40000
92/* backcompat */
93#define APR_READ APR_FOPEN_READ
94#define APR_WRITE APR_FOPEN_WRITE
95#define APR_CREATE APR_FOPEN_CREATE
96#define APR_APPEND APR_FOPEN_APPEND
97#define APR_TRUNCATE APR_FOPEN_TRUNCATE
98#define APR_BINARY APR_FOPEN_BINARY
99#define APR_EXCL APR_FOPEN_EXCL
100#define APR_BUFFERED APR_FOPEN_BUFFERED
101#define APR_DELONCLOSE APR_FOPEN_DELONCLOSE
102#define APR_XTHREAD APR_FOPEN_XTHREAD
103#define APR_SHARELOCK APR_FOPEN_SHARELOCK
104#define APR_FILE_NOCLEANUP APR_FOPEN_NOCLEANUP
105#define APR_SENDFILE_ENABLED APR_FOPEN_SENDFILE_ENABLED
106#define APR_LARGEFILE APR_FOPEN_LARGEFILE
143/* flags for apr_file_seek */
145#define APR_SET SEEK_SET
147#define APR_CUR SEEK_CUR
149#define APR_END SEEK_END
157/* flags for apr_file_attrs_set */
158#define APR_FILE_ATTR_READONLY 0x01
159#define APR_FILE_ATTR_EXECUTABLE 0x02
160#define APR_FILE_ATTR_HIDDEN 0x04
167#if defined(DOXYGEN)
168#define APR_MAX_IOVEC_SIZE 1024
170#elif defined(IOV_MAX)
171#define APR_MAX_IOVEC_SIZE IOV_MAX
172#elif defined(MAX_IOVEC)
173#define APR_MAX_IOVEC_SIZE MAX_IOVEC
174#else
175#define APR_MAX_IOVEC_SIZE 1024
176#endif
181
184
188typedef struct apr_file_t apr_file_t;
189
190/* File lock types/flags */
196#define APR_FLOCK_SHARED 1
202#define APR_FLOCK_EXCLUSIVE 2
207#define APR_FLOCK_TYPEMASK 0x000F
208#define APR_FLOCK_NONBLOCK 0x0010
253
259
268
279 const char *to_path,
281
289 const char *to_path);
290
304 const char *to_path,
307
324 const char *to_path,
327
334
352
362
372
393
414
435
455
473
490 const struct iovec *vec,
492
516
538 const void *buf,
541
542
557 const struct iovec *vec,
566
573
580
591
598
604
610
616
627
638 apr_pool_t *p);
639
653 apr_pool_t *p);
654
667 char * buffer,
669
675
690
707
729 apr_file_t **out,
732
755 apr_file_t **out,
759
769
777
786
799
805
815
824
833 const char *key,
835
844 const char *format, ...)
846
861
882
894
903
914
923
933
934
942
949
954
960
965
985
986
997 apr_pool_t *p);
998
1001#ifdef __cplusplus
1002}
1003#endif
1004
1005#endif /* ! APR_FILE_IO_H */
APR Error Codes.
APR File Information.
APR File Handle Inheritance Helpers.
#define APR_DECLARE_INHERIT_SET(type)
Definition apr_inherit.h:35
#define APR_DECLARE_INHERIT_UNSET(type)
Definition apr_inherit.h:47
APR memory allocation.
APR Time Library.
APR Standard Headers Support.
apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_pool_t *pool)
request_rec int int apr_table_t const char * path
apr_file_t * f
const void apr_status_t(*) apr_status_t(* APR_DECLARE)(void) apr_pool_pre_cleanup_register(apr_pool_t *p
Definition apr_pools.h:646
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
apr_int32_t apr_fileperms_t
apr_file_t * thefile
const char * key
apr_uint32_t apr_fileattrs_t
void apr_size_t * nbytes
const char apr_fileperms_t perms
char * templ
apr_seek_where_t where
const char apr_int32_t flag
const struct iovec * vec
apr_fileattrs_t attributes
apr_seek_where_t apr_off_t * offset
apr_int32_t wanted
apr_file_t apr_pool_t * p
void * buf
apr_file_t apr_int32_t apr_pool_t apr_pool_t * pool_out
const char * fname
const char * format
void apr_size_t apr_size_t * bytes_read
void * data
const void apr_size_t apr_size_t * bytes_written
int apr_seek_where_t
const char apr_file_t * file
void const char apr_status_t(* cleanup)(void *))
apr_file_t * old_file
char apr_size_t bufsize
apr_int32_t flags
int type
apr_file_t ** out
const struct iovec apr_size_t nvec
apr_file_t apr_int32_t blocking
const char * to_path
const char apr_int32_t apr_fileperms_t apr_pool_t * pool
apr_time_t mtime
const char apr_int32_t apr_fileperms_t perm
apr_file_t apr_int32_t apr_pool_t * pool_in
apr_fileattrs_t apr_fileattrs_t attr_mask
int len
char * buffer
APR_DECLARE_NONSTD(void) apr_terminate(void)
Definition start.c:173
const char apr_status_t(*) apr_pool_t *poo __attribute__)((nonnull(2, 4)))
Definition apr_pools.h:567
#define APR_POOL_DECLARE_ACCESSOR(type)
Definition apr_pools.h:81
apr_size_t const char * filename
Definition apr_shm.h:72
apr_int32_t in
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_status_t apr_file_lock(apr_file_t *thefile, int type)
Definition flock.c:21
apr_status_t apr_file_unlock(apr_file_t *thefile)
Definition flock.c:33
apr_finfo_t * finfo
apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool)
Definition dir.c:297
apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool)
Definition dir.c:343
apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
Definition seek.c:99
#define str
IN ULONG IN INT timeout