summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2001-08-10 21:04:49 +0000
committerRyan Bloom <rbb@apache.org>2001-08-10 21:04:49 +0000
commit30939cddd74e3c78354e30a5c757abe8827b3c1e (patch)
tree2a0e1e4819381de7a0bacb68ba78c5ea5ae6c8de /file_io
parent3273cb90b4d65f94584c221344fba2ceefaff046 (diff)
downloadapr-30939cddd74e3c78354e30a5c757abe8827b3c1e.tar.gz
Wrap all APR functions in APR_DECLARE macro.
Submitted by: Sterling Hughes <sterling@designmultimedia.com> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/os2/dir.c20
-rw-r--r--file_io/os2/filedup.c2
-rw-r--r--file_io/os2/filestat.c14
-rw-r--r--file_io/os2/flock.c4
-rw-r--r--file_io/os2/open.c24
-rw-r--r--file_io/os2/pipe.c8
-rw-r--r--file_io/os2/readwrite.c21
-rw-r--r--file_io/os2/seek.c4
-rw-r--r--file_io/unix/filestat.c15
-rw-r--r--file_io/unix/flock.c4
-rw-r--r--file_io/unix/open.c24
-rw-r--r--file_io/unix/pipe.c10
-rw-r--r--file_io/unix/readwrite.c20
-rw-r--r--file_io/unix/seek.c2
14 files changed, 85 insertions, 87 deletions
diff --git a/file_io/os2/dir.c b/file_io/os2/dir.c
index 12d5679e7..3281d7a4b 100644
--- a/file_io/os2/dir.c
+++ b/file_io/os2/dir.c
@@ -67,7 +67,7 @@ static apr_status_t dir_cleanup(void *thedir)
-apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt)
+APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntxt)
{
apr_dir_t *thedir = (apr_dir_t *)apr_palloc(cntxt, sizeof(apr_dir_t));
@@ -89,7 +89,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cntx
-apr_status_t apr_dir_close(apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_dir_close(apr_dir_t *thedir)
{
int rv = 0;
@@ -106,8 +106,8 @@ apr_status_t apr_dir_close(apr_dir_t *thedir)
-apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
- apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
+ apr_dir_t *thedir)
{
int rv;
ULONG entries = 1;
@@ -161,28 +161,28 @@ apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
-apr_status_t apr_dir_rewind(apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir)
{
return apr_dir_close(thedir);
}
-apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *cont)
{
return APR_OS2_STATUS(DosCreateDir(path, NULL));
}
-apr_status_t apr_dir_remove(const char *path, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t *cont)
{
return APR_OS2_STATUS(DosDeleteDir(path));
}
-apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir)
+APR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir)
{
if (dir == NULL) {
return APR_ENODIR;
@@ -193,8 +193,8 @@ apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir)
-apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir,
+ apr_pool_t *cont)
{
if ((*dir) == NULL) {
(*dir) = (apr_dir_t *)apr_pcalloc(cont, sizeof(apr_dir_t));
diff --git a/file_io/os2/filedup.c b/file_io/os2/filedup.c
index 717d08ed9..6a3acf3ef 100644
--- a/file_io/os2/filedup.c
+++ b/file_io/os2/filedup.c
@@ -59,7 +59,7 @@
#include <string.h>
#include "inherit.h"
-apr_status_t apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_file_dup(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
{
int rv;
apr_file_t *dup_file;
diff --git a/file_io/os2/filestat.c b/file_io/os2/filestat.c
index 71c59bba6..e9a7820ad 100644
--- a/file_io/os2/filestat.c
+++ b/file_io/os2/filestat.c
@@ -115,8 +115,8 @@ static apr_status_t handle_type(apr_filetype_e *ftype, HFILE file)
-apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted,
- apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted,
+ apr_file_t *thefile)
{
ULONG rc;
FILESTATUS3 fstatus;
@@ -145,14 +145,14 @@ apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted,
return APR_OS2_STATUS(rc);
}
-apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms)
+APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname, apr_fileperms_t perms)
{
return APR_ENOTIMPL;
}
-apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname,
- apr_int32_t wanted, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
+ apr_int32_t wanted, apr_pool_t *cont)
{
ULONG rc;
FILESTATUS3 fstatus;
@@ -177,8 +177,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname,
-apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname,
- apr_int32_t wanted, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
+ apr_int32_t wanted, apr_pool_t *cont)
{
return apr_stat(finfo, fname, wanted, cont);
}
diff --git a/file_io/os2/flock.c b/file_io/os2/flock.c
index 98e6c52d1..697f2cc84 100644
--- a/file_io/os2/flock.c
+++ b/file_io/os2/flock.c
@@ -54,7 +54,7 @@
#include "fileio.h"
-apr_status_t apr_file_lock(apr_file_t *thefile, int type)
+APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
{
FILELOCK lockrange = { 0, 0x7fffffff };
ULONG rc;
@@ -65,7 +65,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type)
return APR_FROM_OS_ERROR(rc);
}
-apr_status_t apr_file_unlock(apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile)
{
FILELOCK unlockrange = { 0, 0x7fffffff };
ULONG rc;
diff --git a/file_io/os2/open.c b/file_io/os2/open.c
index 05089f5bf..91a5d3922 100644
--- a/file_io/os2/open.c
+++ b/file_io/os2/open.c
@@ -68,7 +68,7 @@ apr_status_t apr_file_cleanup(void *thefile)
-apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt)
+APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cntxt)
{
int oflags = 0;
int mflags = OPEN_FLAGS_FAIL_ON_ERROR|OPEN_SHARE_DENYNONE;
@@ -150,7 +150,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag
-apr_status_t apr_file_close(apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file)
{
ULONG rc;
apr_status_t status;
@@ -179,7 +179,7 @@ apr_status_t apr_file_close(apr_file_t *file)
-apr_status_t apr_file_remove(const char *path, apr_pool_t *cntxt)
+APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cntxt)
{
ULONG rc = DosDelete(path);
return APR_OS2_STATUS(rc);
@@ -187,8 +187,8 @@ apr_status_t apr_file_remove(const char *path, apr_pool_t *cntxt)
-apr_status_t apr_file_rename(const char *from_path, const char *to_path,
- apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path,
+ apr_pool_t *p)
{
ULONG rc = DosMove(from_path, to_path);
@@ -205,7 +205,7 @@ apr_status_t apr_file_rename(const char *from_path, const char *to_path,
-apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
{
*thefile = file->filedes;
return APR_SUCCESS;
@@ -213,7 +213,7 @@ apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
-apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont)
{
apr_os_file_t *dafile = thefile;
@@ -229,8 +229,7 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile, apr_pool
}
-
-apr_status_t apr_file_eof(apr_file_t *fptr)
+APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr)
{
if (!fptr->isopen || fptr->eof_hit == 1) {
return APR_EOF;
@@ -239,8 +238,7 @@ apr_status_t apr_file_eof(apr_file_t *fptr)
}
-
-apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
{
apr_os_file_t fd = 2;
@@ -249,7 +247,7 @@ apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
-apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
{
apr_os_file_t fd = 1;
@@ -257,7 +255,7 @@ apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
}
-apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
{
apr_os_file_t fd = 0;
diff --git a/file_io/os2/pipe.c b/file_io/os2/pipe.c
index 2e20caf12..6219c34e4 100644
--- a/file_io/os2/pipe.c
+++ b/file_io/os2/pipe.c
@@ -61,7 +61,7 @@
#include <string.h>
#include <process.h>
-apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont)
{
ULONG filedes[2];
ULONG rc, action;
@@ -141,7 +141,7 @@ apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t
-apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, apr_fileperms_t perm, apr_pool_t *cont)
{
/* Not yet implemented, interface not suitable */
return APR_ENOTIMPL;
@@ -149,7 +149,7 @@ apr_status_t apr_file_namedpipe_create(const char *filename, apr_fileperms_t per
-apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
+APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
{
if (thepipe->pipe == 1) {
thepipe->timeout = timeout;
@@ -172,7 +172,7 @@ apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t
-apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout)
+APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout)
{
if (thepipe->pipe == 1) {
*timeout = thepipe->timeout;
diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
index b2077486b..86c474f5a 100644
--- a/file_io/os2/readwrite.c
+++ b/file_io/os2/readwrite.c
@@ -62,7 +62,7 @@
#include <malloc.h>
-apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
{
ULONG rc = 0;
ULONG bytesread;
@@ -144,7 +144,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
-apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
{
ULONG rc = 0;
ULONG byteswritten;
@@ -200,7 +200,7 @@ apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nb
#ifdef HAVE_WRITEV
-apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes)
{
int bytes;
if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
@@ -216,7 +216,7 @@ apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec, apr_s
-apr_status_t apr_file_putc(char ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile)
{
ULONG rc;
ULONG byteswritten;
@@ -236,15 +236,14 @@ apr_status_t apr_file_putc(char ch, apr_file_t *thefile)
-apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile)
{
apr_off_t offset = -1;
return apr_file_seek(thefile, APR_CUR, &offset);
}
-
-apr_status_t apr_file_getc(char *ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile)
{
ULONG rc;
apr_size_t bytesread;
@@ -270,7 +269,7 @@ apr_status_t apr_file_getc(char *ch, apr_file_t *thefile)
-apr_status_t apr_file_puts(const char *str, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile)
{
apr_size_t len;
@@ -279,8 +278,7 @@ apr_status_t apr_file_puts(const char *str, apr_file_t *thefile)
}
-
-apr_status_t apr_file_flush(apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile)
{
if (thefile->buffered) {
ULONG written = 0;
@@ -304,8 +302,7 @@ apr_status_t apr_file_flush(apr_file_t *thefile)
}
-
-apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile)
{
size_t readlen;
apr_status_t rv = APR_SUCCESS;
diff --git a/file_io/os2/seek.c b/file_io/os2/seek.c
index 1744553fd..fc51d5ddb 100644
--- a/file_io/os2/seek.c
+++ b/file_io/os2/seek.c
@@ -85,7 +85,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
-apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
+APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
{
if (!thefile->isopen) {
return APR_EBADF;
@@ -134,7 +134,7 @@ apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_
-apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
+APR_DECLARE(apr_status_t) apr_file_trunc(apr_file_t *fp, apr_off_t offset)
{
int rc = DosSetFileSize(fp->filedes, offset);
diff --git a/file_io/unix/filestat.c b/file_io/unix/filestat.c
index 070db8e29..1f2f48df2 100644
--- a/file_io/unix/filestat.c
+++ b/file_io/unix/filestat.c
@@ -105,8 +105,9 @@ static void fill_out_finfo(apr_finfo_t *finfo, struct stat *info,
*/
}
-apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted,
- apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_info_get(apr_finfo_t *finfo,
+ apr_int32_t wanted,
+ apr_file_t *thefile)
{
struct stat info;
@@ -121,7 +122,8 @@ apr_status_t apr_file_info_get(apr_finfo_t *finfo, apr_int32_t wanted,
}
}
-apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms)
+APR_DECLARE(apr_status_t) apr_file_perms_set(const char *fname,
+ apr_fileperms_t perms)
{
mode_t mode = apr_unix_perms2mode(perms);
@@ -130,8 +132,9 @@ apr_status_t apr_file_perms_set(const char *fname, apr_fileperms_t perms)
return APR_SUCCESS;
}
-apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname,
- apr_int32_t wanted, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo,
+ const char *fname,
+ apr_int32_t wanted, apr_pool_t *cont)
{
struct stat info;
int srv;
@@ -186,7 +189,7 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname,
/* Perhaps this becomes nothing but a macro?
*/
-apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname,
+APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
apr_int32_t wanted, apr_pool_t *cont)
{
return apr_stat(finfo, fname, wanted | APR_FINFO_LINK, cont);
diff --git a/file_io/unix/flock.c b/file_io/unix/flock.c
index e656b1baf..f95df8a61 100644
--- a/file_io/unix/flock.c
+++ b/file_io/unix/flock.c
@@ -61,7 +61,7 @@
#include <sys/file.h>
#endif
-apr_status_t apr_file_lock(apr_file_t *thefile, int type)
+APR_DECLARE(apr_status_t) apr_file_lock(apr_file_t *thefile, int type)
{
int rc;
@@ -112,7 +112,7 @@ apr_status_t apr_file_lock(apr_file_t *thefile, int type)
return APR_SUCCESS;
}
-apr_status_t apr_file_unlock(apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_unlock(apr_file_t *thefile)
{
int rc;
diff --git a/file_io/unix/open.c b/file_io/unix/open.c
index 10156ce62..6fee1a7b9 100644
--- a/file_io/unix/open.c
+++ b/file_io/unix/open.c
@@ -82,7 +82,7 @@ apr_status_t apr_unix_file_cleanup(void *thefile)
return rv != APR_SUCCESS ? rv : flush_rv;
}
-apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont)
{
int oflags = 0;
#if APR_HAS_THREADS
@@ -172,7 +172,7 @@ apr_status_t apr_file_open(apr_file_t **new, const char *fname, apr_int32_t flag
return APR_SUCCESS;
}
-apr_status_t apr_file_close(apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file)
{
apr_status_t rv;
@@ -183,7 +183,7 @@ apr_status_t apr_file_close(apr_file_t *file)
return rv;
}
-apr_status_t apr_file_remove(const char *path, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t *cont)
{
if (unlink(path) == 0) {
return APR_SUCCESS;
@@ -193,8 +193,8 @@ apr_status_t apr_file_remove(const char *path, apr_pool_t *cont)
}
}
-apr_status_t apr_file_rename(const char *from_path, const char *to_path,
- apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_file_rename(const char *from_path, const char *to_path,
+ apr_pool_t *p)
{
if (rename(from_path, to_path) != 0) {
return errno;
@@ -202,14 +202,14 @@ apr_status_t apr_file_rename(const char *from_path, const char *to_path,
return APR_SUCCESS;
}
-apr_status_t apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile, apr_file_t *file)
{
*thefile = file->filedes;
return APR_SUCCESS;
}
-apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile,
+ apr_pool_t *cont)
{
int *dafile = thefile;
@@ -227,7 +227,7 @@ apr_status_t apr_os_file_put(apr_file_t **file, apr_os_file_t *thefile,
return APR_SUCCESS;
}
-apr_status_t apr_file_eof(apr_file_t *fptr)
+APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr)
{
if (fptr->eof_hit == 1) {
return APR_EOF;
@@ -235,21 +235,21 @@ apr_status_t apr_file_eof(apr_file_t *fptr)
return APR_SUCCESS;
}
-apr_status_t apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
{
int fd = STDERR_FILENO;
return apr_os_file_put(thefile, &fd, cont);
}
-apr_status_t apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
{
int fd = STDOUT_FILENO;
return apr_os_file_put(thefile, &fd, cont);
}
-apr_status_t apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
{
int fd = STDIN_FILENO;
diff --git a/file_io/unix/pipe.c b/file_io/unix/pipe.c
index 7a99b4e3c..310ad91dd 100644
--- a/file_io/unix/pipe.c
+++ b/file_io/unix/pipe.c
@@ -126,7 +126,7 @@ static apr_status_t pipenonblock(apr_file_t *thepipe)
return APR_SUCCESS;
}
-apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
+APR_DECLARE(apr_status_t) apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
{
if (thepipe->pipe == 1) {
thepipe->timeout = timeout;
@@ -145,7 +145,7 @@ apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t
return APR_EINVAL;
}
-apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout)
+APR_DECLARE(apr_status_t) apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t *timeout)
{
if (thepipe->pipe == 1) {
*timeout = thepipe->timeout;
@@ -154,7 +154,7 @@ apr_status_t apr_file_pipe_timeout_get(apr_file_t *thepipe, apr_interval_time_t
return APR_EINVAL;
}
-apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t *cont)
{
int filedes[2];
@@ -194,8 +194,8 @@ apr_status_t apr_file_pipe_create(apr_file_t **in, apr_file_t **out, apr_pool_t
return APR_SUCCESS;
}
-apr_status_t apr_file_namedpipe_create(const char *filename,
- apr_fileperms_t perm, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename,
+ apr_fileperms_t perm, apr_pool_t *cont)
{
mode_t mode = apr_unix_perms2mode(perm);
diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c
index 9f4795a73..cda958e0b 100644
--- a/file_io/unix/readwrite.c
+++ b/file_io/unix/readwrite.c
@@ -102,7 +102,7 @@ static apr_status_t wait_for_io_or_timeout(apr_file_t *file, int for_read)
/* problems:
* 1) ungetchar not used for buffered files
*/
-apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
{
apr_ssize_t rv;
apr_size_t bytes_read;
@@ -206,7 +206,7 @@ apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
}
}
-apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
{
apr_size_t rv;
@@ -277,8 +277,8 @@ apr_status_t apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nb
}
}
-apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec,
- apr_size_t nvec, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_file_writev(apr_file_t *thefile, const struct iovec *vec,
+ apr_size_t nvec, apr_size_t *nbytes)
{
#ifdef HAVE_WRITEV
int bytes;
@@ -297,34 +297,34 @@ apr_status_t apr_file_writev(apr_file_t *thefile, const struct iovec *vec,
#endif
}
-apr_status_t apr_file_putc(char ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_putc(char ch, apr_file_t *thefile)
{
apr_size_t nbytes = 1;
return apr_file_write(thefile, &ch, &nbytes);
}
-apr_status_t apr_file_ungetc(char ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_ungetc(char ch, apr_file_t *thefile)
{
thefile->ungetchar = (unsigned char)ch;
return APR_SUCCESS;
}
-apr_status_t apr_file_getc(char *ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_getc(char *ch, apr_file_t *thefile)
{
apr_size_t nbytes = 1;
return apr_file_read(thefile, ch, &nbytes);
}
-apr_status_t apr_file_puts(const char *str, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile)
{
apr_size_t nbytes = strlen(str);
return apr_file_write(thefile, str, &nbytes);
}
-apr_status_t apr_file_flush(apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile)
{
if (thefile->buffered) {
apr_int64_t written = 0;
@@ -346,7 +346,7 @@ apr_status_t apr_file_flush(apr_file_t *thefile)
return APR_SUCCESS;
}
-apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile)
{
apr_status_t rv = APR_SUCCESS; /* get rid of gcc warning */
apr_size_t nbytes;
diff --git a/file_io/unix/seek.c b/file_io/unix/seek.c
index c4f4d8bec..2b58cf9c4 100644
--- a/file_io/unix/seek.c
+++ b/file_io/unix/seek.c
@@ -86,7 +86,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
}
-apr_status_t apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
+APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
{
apr_off_t rv;