summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apr.dsp10
-rw-r--r--file_io/unix/fileacc.c11
-rw-r--r--file_io/unix/fullrw.c10
-rw-r--r--file_io/win32/dir.c33
-rw-r--r--file_io/win32/filedup.c3
-rw-r--r--file_io/win32/filestat.c12
-rw-r--r--file_io/win32/flock.c4
-rw-r--r--file_io/win32/open.c26
-rw-r--r--file_io/win32/pipe.c6
-rw-r--r--file_io/win32/readwrite.c22
-rw-r--r--file_io/win32/seek.c2
-rw-r--r--include/apr.hw2
-rw-r--r--include/apr_file_io.h330
-rw-r--r--include/apr_fnmatch.h4
-rw-r--r--include/apr_general.h18
-rw-r--r--include/apr_getopt.h9
-rw-r--r--include/apr_hash.h6
-rw-r--r--include/apr_lib.h14
-rw-r--r--include/apr_lock.h34
-rw-r--r--include/apr_md5.h12
-rw-r--r--include/apr_mmap.h15
-rw-r--r--include/apr_network_io.h191
-rw-r--r--include/apr_pools.h45
-rw-r--r--include/apr_portable.h99
-rw-r--r--include/apr_shmem.h30
-rw-r--r--include/apr_strings.h10
-rw-r--r--include/apr_tables.h94
-rw-r--r--include/apr_thread_proc.h170
-rw-r--r--include/apr_time.h33
-rw-r--r--include/apr_uuid.h16
-rw-r--r--include/apr_xlate.h30
-rw-r--r--include/arch/win32/fileio.h2
-rw-r--r--libapr.def281
-rw-r--r--libapr.dsp445
-rw-r--r--locks/win32/locks.c35
-rw-r--r--misc/unix/errorcodes.c3
-rw-r--r--misc/unix/start.c6
-rw-r--r--misc/unix/uuid.c5
-rw-r--r--misc/win32/getuuid.c2
-rw-r--r--misc/win32/rand.c3
-rw-r--r--mmap/unix/common.c3
-rw-r--r--mmap/win32/mmap.c7
-rw-r--r--network_io/unix/sa_common.c41
-rw-r--r--network_io/win32/poll.c35
-rw-r--r--network_io/win32/sendrecv.c17
-rw-r--r--network_io/win32/sockets.c40
-rw-r--r--network_io/win32/sockopt.c9
-rw-r--r--strings/apr_strnatcmp.c6
-rw-r--r--threadproc/win32/proc.c50
-rw-r--r--threadproc/win32/signals.c2
-rw-r--r--threadproc/win32/thread.c40
-rw-r--r--threadproc/win32/threadpriv.c31
-rw-r--r--time/win32/time.c33
-rw-r--r--time/win32/timestr.c9
54 files changed, 1407 insertions, 999 deletions
diff --git a/apr.dsp b/apr.dsp
index c2195befa..2388dc6c9 100644
--- a/apr.dsp
+++ b/apr.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "LibR"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c
+# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibR\apr" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
@@ -64,8 +64,8 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "LibD"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c
+# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_STATIC" /D "WIN32" /D "_WINDOWS" /Fd"LibD\apr" /FD /c
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
@@ -518,9 +518,5 @@ SOURCE=.\include\apr_uuid.h
SOURCE=.\include\apr_xlate.h
# End Source File
# End Group
-# Begin Source File
-
-SOURCE=.\libapr.def
-# End Source File
# End Target
# End Project
diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c
index ecc78fc4d..60304c2ec 100644
--- a/file_io/unix/fileacc.c
+++ b/file_io/unix/fileacc.c
@@ -57,7 +57,8 @@
/* A file to put ALL of the accessor functions for apr_file_t types. */
-apr_status_t apr_get_filename(const char **fname, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_get_filename(const char **fname,
+ apr_file_t *thefile)
{
#ifdef WIN32 /* this test is only good until some other platform trys wchar* */
#if APR_HAS_UNICODE_FS
@@ -136,13 +137,15 @@ apr_fileperms_t apr_unix_mode2perms(mode_t mode)
}
#endif
-apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key,
+ apr_file_t *file)
{
return apr_get_userdata(data, key, file->cntxt);
}
-apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key,
- apr_status_t (*cleanup) (void *))
+APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void *))
{
return apr_set_userdata(data, key, cleanup, file->cntxt);
}
diff --git a/file_io/unix/fullrw.c b/file_io/unix/fullrw.c
index b6d719ff6..3d749ee92 100644
--- a/file_io/unix/fullrw.c
+++ b/file_io/unix/fullrw.c
@@ -55,8 +55,9 @@
#include "apr_file_io.h"
-apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes,
- apr_size_t *bytes_read)
+APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf,
+ apr_size_t nbytes,
+ apr_size_t *bytes_read)
{
apr_status_t status;
apr_size_t total_read = 0;
@@ -76,8 +77,9 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes,
return status;
}
-apr_status_t apr_full_write(apr_file_t *thefile, const void *buf,
- apr_size_t nbytes, apr_size_t *bytes_written)
+APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf,
+ apr_size_t nbytes,
+ apr_size_t *bytes_written)
{
apr_status_t status;
apr_size_t total_written = 0;
diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c
index e1bf138ae..0188f6d87 100644
--- a/file_io/win32/dir.c
+++ b/file_io/win32/dir.c
@@ -82,7 +82,8 @@ apr_status_t dir_cleanup(void *thedir)
return APR_SUCCESS;
}
-apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new, const char *dirname,
+ apr_pool_t *cont)
{
/* Note that we won't open a directory that is greater than MAX_PATH,
* including the trailing /* wildcard suffix. If a * won't fit, then
@@ -173,7 +174,7 @@ apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *cont
return APR_SUCCESS;
}
-apr_status_t apr_closedir(apr_dir_t *dir)
+APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *dir)
{
if (dir->dirhand != INVALID_HANDLE_VALUE && !FindClose(dir->dirhand)) {
return apr_get_os_error();
@@ -182,7 +183,7 @@ apr_status_t apr_closedir(apr_dir_t *dir)
return APR_SUCCESS;
}
-apr_status_t apr_readdir(apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir)
{
/* The while loops below allow us to skip all invalid file names, so that
* we aren't reporting any files where their absolute paths are too long.
@@ -231,7 +232,7 @@ apr_status_t apr_readdir(apr_dir_t *thedir)
return APR_SUCCESS;
}
-apr_status_t apr_rewinddir(apr_dir_t *dir)
+APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *dir)
{
dir_cleanup(dir);
if (!FindClose(dir->dirhand)) {
@@ -241,7 +242,8 @@ apr_status_t apr_rewinddir(apr_dir_t *dir)
return APR_SUCCESS;
}
-apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm,
+ apr_pool_t *cont)
{
#if APR_HAS_UNICODE_FS
apr_oslevel_e os_level;
@@ -262,7 +264,7 @@ apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *co
return APR_SUCCESS;
}
-apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont)
{
#if APR_HAS_UNICODE_FS
apr_oslevel_e os_level;
@@ -283,7 +285,8 @@ apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont)
return APR_SUCCESS;
}
-apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_ssize_t *size,
+ apr_dir_t *thedir)
{
if (thedir == NULL || thedir->n.entry == NULL) {
return APR_ENODIR;
@@ -293,7 +296,8 @@ apr_status_t apr_dir_entry_size(apr_ssize_t *size, apr_dir_t *thedir)
return APR_SUCCESS;
}
-apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *time,
+ apr_dir_t *thedir)
{
if (thedir == NULL || thedir->n.entry == NULL) {
return APR_ENODIR;
@@ -302,7 +306,8 @@ apr_status_t apr_dir_entry_mtime(apr_time_t *time, apr_dir_t *thedir)
return APR_SUCCESS;
}
-apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type,
+ apr_dir_t *thedir)
{
switch(thedir->n.entry->dwFileAttributes) {
case FILE_ATTRIBUTE_DIRECTORY: {
@@ -320,7 +325,8 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir)
}
}
-apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir)
+APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new,
+ apr_dir_t *thedir)
{
#if APR_HAS_UNICODE_FS
apr_oslevel_e os_level;
@@ -337,7 +343,8 @@ apr_status_t apr_get_dir_filename(const char **new, apr_dir_t *thedir)
return APR_SUCCESS;
}
-apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir)
+APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir,
+ apr_dir_t *dir)
{
if (dir == NULL) {
return APR_ENODIR;
@@ -353,7 +360,9 @@ apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir)
* on cached info that we simply don't have our hands on when
* we use this function. Maybe APR_ENOTIMPL would be better?
*/
-apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir,
+ apr_os_dir_t *thedir,
+ apr_pool_t *cont)
{
if (cont == NULL) {
return APR_ENOPOOL;
diff --git a/file_io/win32/filedup.c b/file_io/win32/filedup.c
index b14e34fdd..630300815 100644
--- a/file_io/win32/filedup.c
+++ b/file_io/win32/filedup.c
@@ -58,7 +58,8 @@
#include "apr_strings.h"
#include <string.h>
-apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file,
+ apr_file_t *old_file, apr_pool_t *p)
{
BOOLEAN isStdHandle = FALSE;
HANDLE hCurrentProcess = GetCurrentProcess();
diff --git a/file_io/win32/filestat.c b/file_io/win32/filestat.c
index cf5a80087..859ed0d38 100644
--- a/file_io/win32/filestat.c
+++ b/file_io/win32/filestat.c
@@ -99,7 +99,8 @@ BOOLEAN is_exe(const char* fname, apr_pool_t *cont) {
return FALSE;
}
-apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo,
+ apr_file_t *thefile)
{
BY_HANDLE_FILE_INFORMATION FileInformation;
DWORD FileType;
@@ -191,12 +192,14 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile)
return APR_SUCCESS;
}
-apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms)
+APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname,
+ apr_fileperms_t perms)
{
return APR_ENOTIMPL;
}
-apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
+ apr_pool_t *cont)
{
apr_oslevel_e os_level;
/*
@@ -324,7 +327,8 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
return APR_SUCCESS;
}
-apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
+ apr_pool_t *cont)
{
apr_oslevel_e os_level;
if (apr_get_oslevel(cont, &os_level) || os_level < APR_WIN_2000)
diff --git a/file_io/win32/flock.c b/file_io/win32/flock.c
index 0d319c728..18d00b322 100644
--- a/file_io/win32/flock.c
+++ b/file_io/win32/flock.c
@@ -54,7 +54,7 @@
#include "fileio.h"
-apr_status_t apr_lock_file(apr_file_t *thefile, int type)
+APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type)
{
OVERLAPPED offset;
DWORD flags, len = 0xffffffff;
@@ -70,7 +70,7 @@ apr_status_t apr_lock_file(apr_file_t *thefile, int type)
return APR_SUCCESS;
}
-apr_status_t apr_unlock_file(apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile)
{
OVERLAPPED offset;
DWORD len = 0xffffffff;
diff --git a/file_io/win32/open.c b/file_io/win32/open.c
index 3a90d9d26..e5fd64c37 100644
--- a/file_io/win32/open.c
+++ b/file_io/win32/open.c
@@ -163,8 +163,9 @@ apr_status_t file_cleanup(void *thefile)
return APR_SUCCESS;
}
-apr_status_t apr_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_open(apr_file_t **new, const char *fname,
+ apr_int32_t flag, apr_fileperms_t perm,
+ apr_pool_t *cont)
{
DWORD oflags = 0;
DWORD createflags = 0;
@@ -281,7 +282,7 @@ apr_status_t apr_open(apr_file_t **new, const char *fname,
return APR_SUCCESS;
}
-apr_status_t apr_close(apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_close(apr_file_t *file)
{
apr_status_t stat;
if ((stat = file_cleanup(file)) == APR_SUCCESS) {
@@ -295,7 +296,7 @@ apr_status_t apr_close(apr_file_t *file)
return stat;
}
-apr_status_t apr_remove_file(const char *path, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont)
{
#if APR_HAS_UNICODE_FS
apr_oslevel_e os_level;
@@ -314,8 +315,9 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont)
return apr_get_os_error();
}
-apr_status_t apr_rename_file(const char *from_path, const char *to_path,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path,
+ const char *to_path,
+ apr_pool_t *cont)
{
#if APR_HAS_UNICODE_FS
apr_oslevel_e os_level;
@@ -337,7 +339,8 @@ apr_status_t apr_rename_file(const char *from_path, const char *to_path,
return apr_get_os_error();
}
-apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file)
+APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile,
+ apr_file_t *file)
{
if (file == NULL) {
return APR_ENOFILE;
@@ -346,8 +349,9 @@ apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file)
return APR_SUCCESS;
}
-apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file,
+ apr_os_file_t *thefile,
+ apr_pool_t *cont)
{
if ((*file) == NULL) {
if (cont == NULL) {
@@ -361,7 +365,7 @@ apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile,
return APR_SUCCESS;
}
-apr_status_t apr_eof(apr_file_t *fptr)
+APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr)
{
if (fptr->eof_hit == 1) {
return APR_EOF;
@@ -369,7 +373,7 @@ apr_status_t apr_eof(apr_file_t *fptr)
return APR_SUCCESS;
}
-apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
{
(*thefile) = apr_pcalloc(cont, sizeof(apr_file_t));
if ((*thefile) == NULL) {
diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c
index 1c9189a2c..5226a1444 100644
--- a/file_io/win32/pipe.c
+++ b/file_io/win32/pipe.c
@@ -63,7 +63,7 @@
#include <sys/stat.h>
#include "misc.h"
-apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout)
+APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout)
{
if (thepipe->pipe == 1) {
thepipe->timeout = timeout;
@@ -72,7 +72,7 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo
return APR_EINVAL;
}
-apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout)
+APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout)
{
if (thepipe->pipe == 1) {
*timeout = thepipe->timeout;
@@ -81,7 +81,7 @@ apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *time
return APR_EINVAL;
}
-apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *p)
{
SECURITY_ATTRIBUTES sa;
diff --git a/file_io/win32/readwrite.c b/file_io/win32/readwrite.c
index db5fccffa..48429bd55 100644
--- a/file_io/win32/readwrite.c
+++ b/file_io/win32/readwrite.c
@@ -148,7 +148,7 @@ static apr_status_t read_with_timeout(apr_file_t *file, void *buf, apr_size_t le
return rv;
}
-apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *len)
+APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, apr_size_t *len)
{
apr_size_t rv;
DWORD bytes_read = 0;
@@ -221,7 +221,7 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *len)
return rv;
}
-apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
{
apr_status_t rv;
DWORD bwrote;
@@ -275,8 +275,10 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
/*
* Too bad WriteFileGather() is not supported on 95&98 (or NT prior to SP2)
*/
-apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec,
- apr_size_t *nbytes)
+APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile,
+ const struct iovec *vec,
+ apr_size_t nvec,
+ apr_size_t *nbytes)
{
apr_status_t rv = APR_SUCCESS;
int i;
@@ -296,20 +298,20 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t
return rv;
}
-apr_status_t apr_putc(char ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile)
{
DWORD len = 1;
return apr_write(thefile, &ch, &len);
}
-apr_status_t apr_ungetc(char ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile)
{
thefile->ungetchar = (unsigned char) ch;
return APR_SUCCESS;
}
-apr_status_t apr_getc(char *ch, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile)
{
apr_status_t rc;
int bread;
@@ -328,14 +330,14 @@ apr_status_t apr_getc(char *ch, apr_file_t *thefile)
return APR_SUCCESS;
}
-apr_status_t apr_puts(const char *str, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile)
{
DWORD len = strlen(str);
return apr_write(thefile, str, &len);
}
-apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile)
{
apr_size_t readlen;
apr_status_t rv = APR_SUCCESS;
@@ -361,7 +363,7 @@ apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile)
return rv;
}
-apr_status_t apr_flush(apr_file_t *thefile)
+APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile)
{
if (thefile->buffered) {
DWORD written = 0;
diff --git a/file_io/win32/seek.c b/file_io/win32/seek.c
index 554826133..adaede8d8 100644
--- a/file_io/win32/seek.c
+++ b/file_io/win32/seek.c
@@ -86,7 +86,7 @@ static apr_status_t setptr(apr_file_t *thefile, unsigned long pos )
-apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
+APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
{
DWORD howmove;
DWORD rv;
diff --git a/include/apr.hw b/include/apr.hw
index b38cbd830..111bbc90e 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -53,7 +53,7 @@
*/
/*
- * Note: This is a Windows specific version of apr.h. It is renamed to
+ * Note: This is a Windows specific version of apr.h. It is copied as
* apr.h at the start of a Windows build.
*/
diff --git a/include/apr_file_io.h b/include/apr_file_io.h
index 4a4e3919b..06658c6ce 100644
--- a/include/apr_file_io.h
+++ b/include/apr_file_io.h
@@ -134,11 +134,6 @@ typedef struct apr_finfo_t apr_finfo_t;
*/
typedef struct apr_dir_t apr_dir_t;
/**
- * Structure for determining canonical filenames.
- * @defvar apr_canon_t
- */
-typedef struct apr_canon_t apr_canon_t;
-/**
* Structure for determining file permissions.
* @defvar apr_fileperms_t
*/
@@ -216,157 +211,6 @@ struct apr_finfo_t {
#define APR_FLOCK_NONBLOCK 0x0010 /* do not block while acquiring the
file lock */
-
-/* Make and Merge Canonical Name Options */
-#define APR_CANON_ONLY_ABSOLUTE 0
-#define APR_CANON_ALLOW_RELATIVE 2
-#define APR_CANON_ONLY_RELATIVE 3
-#define APR_CANON_CHILD_OF_TRUSTED 4
-#define APR_CANON_LOWERCASE
-#define APR_CANON_TRUECASE
-
-
-/* This is a hack, because none of these functions actually exist yet. The
- * problem is that we generate our exports from the header files, so we are
- * trying to export these functions, but they don't exist, so we can't link.
- * This just makes sure that we don't try to link these functions until
- * they actually exist.
- */
-#ifdef APR_NOT_DONE_YET
-/**
- * Canonicalize the path and name.
- * @param new_name The newly allocated canonicalized trusted+child name
- * @param trusted_name Already canonical parent path; may be NULL.
- * @param child_name An absolute path or path relative to trusted_name.
- * @param options Bit-wise OR of:
- * <PRE>
- * APR_CANON_ONLY_ABSOLUTE Require the trusted_name+child_name result is
- * an absolute product or fail with error for the
- * make and merge canonical name functions.
- * APR_CANON_ALLOW_RELATIVE Allow that the trusted_name+child_name result
- * may be a relative result for the make and
- * merge canonical name functions.
- * APR_CANON_ONLY_RELATIVE Require the trusted_name+child_name result is
- * not an absolute path or fail with error for
- * the make and merge canonical name functions.
- * APR_CANON_CHILD_OF_TRUSTED Require the trusted_name+child_name result is
- * a child of trusted_name or fail with error for
- * the make and merge canonical name functions.
- * APR_CANON_LOWERCASE If file path elements exist (can stat) then
- * fold the element's name to lowercase for the
- * make and merge canonical name functions.
- * APR_CANON_TRUECASE If file path elements exist (can readdir) then
- * fold the element's name to the true case
- * lowercase for the make and merge canonical
- * name functions.
- * </PRE>
- * @param pool The pool in which to allocate the new_name apr_canon_t
- *
- * @tip A canonical name is a name stripped of embedded backrefs "../",
- * thisrefs "./", successive slashes (//), or any other ambigious file
- * name element. Absolute canonical names referencing the same file must
- * strcmp() identically, excluding symlinks or inconsistent use of the
- * APR_CANON_LOWERCASE or APR_CANON_TRUECASE options.
- *
- * If the name does not exist, or resolves to a relative name the given case
- * is preserved. Insignificant elements are eliminated. For example, on Win32
- * this function removes trailing dots (which are allowed, but not stored in
- * the file system), and "/../" under Unix is resolved to "/". The relative
- * canonical name may contain leading backrefs "../", but will never contain
- * any other prohibited element.
- */
-apr_status_t apr_make_canonical_name(apr_canon_t **new_name,
- const apr_canon_t *trusted_name,
- const char *child_name,
- int options,
- apr_pool_t *pool);
-
-/**
- * Merge two canonical names into a single canonical name.
- * @param new_name The newly allocated canonicalized trusted+child name
- * @param trusted_name Already canonical parent path; may be NULL.
- * @param child_name An already canonical absolute path or path relative to
- * trusted_name.
- * @param options See apr_make_canonical_name for options
- * @param pool The pool to allocate the new_name out of.
- * @see apr_make_canonical_name
- */
-apr_status_t apr_merge_canonical_name(apr_canon_t **new_name,
- const apr_canon_t *trusted_name,
- const apr_canon_t *child_name,
- int options,
- apr_pool_t *pool);
-
-/**
- * Get the canonical path in a character string
- * @param path A location to store the canocical name
- * @param trusted_name An already canonicalized file path
- * @param pool The pool to allocate the path out of.
- */
-apr_status_t apr_get_canonical_name(char **path,
- const apr_canon_t *trusted_name,
- apr_pool_t *pool);
-
-/**
- * Count the number of elements in a canonical name.
- * @param trusted_name An already canonicalized file path
- * @return The number of elements in the name
- */
-int apr_count_canonical_elements(const apr_canon_t *trusted_name);
-
-/**
- * Query the length of some elements of the canonical name
- * @param trusted_name An already canonicalized file path
- * @param firstelement The numerical position of the element to start the
- * length at.
- * @param lastelement The numerical position of the element to end the
- * length at.
- * @return The length of requested elements.
- */
-int apr_get_canonical_elements_length(const apr_canon_t *trusted_name,
- int firstelement, int lastelement);
-
-/**
- * Get the requested elements of a canonical name in a character string
- * @param path_elements A location to store the path elements.
- * @param trusted_name An already canonicalized file path
- * @param firstelement The numerical position of the element to start the
- * length at.
- * @param lastelement The numerical position of the element to end the
- * length at.
- * @param pool The pool to allocate the path out of.
- */
-apr_status_t apr_get_canonical_elements(char **path_elements,
- const apr_canon_t *trusted_name,
- int firstelement, int lastelement,
- apr_pool_t *pool);
-
-/**
- * Determine if a canonical name is absolute.
- * @param path The canonical name to check
- * @warning Do not trust !apr_is_absolute to determine if the path is
- * relative. Also, test apr_is_virtualroot to avoid non-filesystem
- * pseudo roots.
- */
-apr_status_t apr_is_absolute(apr_canon_t **path);
-
-/**
- * Determine if a canonical name is relative
- * @param path The canonical name to check
- * @warning Do not trust !apr_is_relative to determine if the path is absolute
- */
-apr_status_t apr_is_relative(apr_canon_t **path);
-
-/**
- * Determine if the elements 0..elements resolves to a platform's non-physical
- * root, e.g. the //machine/ name that isn't an adaquately complete root for
- * UNC paths.
- * @param path The canonical name to check
- * @param elements The number of elements to check.
- */
-apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements);
-#endif
-
/**
* Open the specified file.
* @param new_file The opened file descriptor.
@@ -386,26 +230,30 @@ apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements);
* </PRE>
* @param perm Access permissions for file.
* @param cont The pool to use.
+ * @deffunc apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont)
* @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate
* default permissions will be used. *arg1 must point to a valid file_t,
* or NULL (in which case it will be allocated)
*/
-apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag,
- apr_fileperms_t perm, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_open(apr_file_t **new_file, const char *fname,
+ apr_int32_t flag, apr_fileperms_t perm,
+ apr_pool_t *cont);
/**
* Close the specified file.
* @param file The file descriptor to close.
+ * @deffunc apr_status_t apr_close(apr_file_t *file)
*/
-apr_status_t apr_close(apr_file_t *file);
+APR_DECLARE(apr_status_t) apr_close(apr_file_t *file);
/**
* delete the specified file.
* @param path The full path to the file (using / on all systems)
* @param cont The pool to use.
+ * @deffunc apr_status_t apr_remove_file(const char *path, apr_pool_t *cont)
* @tip If the file is open, it won't be removed until all instances are closed.
*/
-apr_status_t apr_remove_file(const char *path, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont);
/**
* rename the specified file.
@@ -414,30 +262,36 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont);
* @param pool The pool to use.
* @tip If a file exists at the new location, then it will be overwritten.
* Moving files or directories across devices may not be possible.
+ * @deffunc apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *pool)
*/
-apr_status_t apr_rename_file(const char *from_path, const char *to_path,
- apr_pool_t *pool);
+APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path,
+ const char *to_path,
+ apr_pool_t *pool);
/**
* Are we at the end of the file
* @param fptr The apr file we are testing.
* @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise.
+ * @deffunc apr_status_t apr_eof(apr_file_t *fptr)
*/
-apr_status_t apr_eof(apr_file_t *fptr);
+APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr);
/**
* Is there an error on the stream?
* @param fptr The apr file we are testing.
* @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise.
+ * @deffunc apr_status_t apr_ferror(apr_file_t *fptr)
*/
-apr_status_t apr_ferror(apr_file_t *fptr);
+APR_DECLARE(apr_status_t) apr_ferror(apr_file_t *fptr);
/**
* open standard error as an apr file pointer.
* @param thefile The apr file to use as stderr.
* @param cont The pool to allocate the file out of.
+ * @deffunc apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
*/
-apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile,
+ apr_pool_t *cont);
/**
* Read data from the specified file.
@@ -454,8 +308,10 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont);
* error to be returned.
*
* APR_EINTR is never returned.
+ * @deffunc apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
*/
-apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes);
+APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf,
+ apr_size_t *nbytes);
/**
* Write data to the specified file.
@@ -471,8 +327,10 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes);
* It is possible for both bytes to be written and an error to be returned.
*
* APR_EINTR is never returned.
+ * @deffunc apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
*/
-apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes);
+APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf,
+ apr_size_t *nbytes);
/**
* Write data from iovec array to the specified file.
@@ -488,9 +346,11 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
* apr_writev is available even if the underlying operating system
*
* doesn't provide writev().
+ * @deffunc apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes)
*/
-apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec,
- apr_size_t nvec, apr_size_t *nbytes);
+APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile,
+ const struct iovec *vec,
+ apr_size_t nvec, apr_size_t *nbytes);
/**
* Read data from the specified file, ensuring that the buffer is filled
@@ -509,9 +369,11 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec,
* error to be returned.
*
* APR_EINTR is never returned.
+ * @deffunc apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read)
*/
-apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes,
- apr_size_t *bytes_read);
+APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf,
+ apr_size_t nbytes,
+ apr_size_t *bytes_read);
/**
* Write data to the specified file, ensuring that all of the data is
@@ -528,51 +390,59 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes,
* It is possible for both bytes to be written and an error to be returned.
*
* APR_EINTR is never returned.
+ * @deffunc apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written)
*/
-apr_status_t apr_full_write(apr_file_t *thefile, const void *buf,
- apr_size_t nbytes, apr_size_t *bytes_written);
+APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf,
+ apr_size_t nbytes,
+ apr_size_t *bytes_written);
/**
* put a character into the specified file.
* @param ch The character to write.
* @param thefile The file descriptor to write to
+ * @deffunc apr_status_t apr_putc(char ch, apr_file_t *thefile)
*/
-apr_status_t apr_putc(char ch, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile);
/**
* get a character from the specified file.
* @param ch The character to write.
* @param thefile The file descriptor to write to
+ * @deffunc apr_status_t apr_getc(char *ch, apr_file_t *thefile)
*/
-apr_status_t apr_getc(char *ch, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile);
/**
* put a character back onto a specified stream.
* @param ch The character to write.
* @param thefile The file descriptor to write to
+ * @deffunc apr_status_t apr_ungetc(char ch, apr_file_t *thefile)
*/
-apr_status_t apr_ungetc(char ch, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile);
/**
* Get a string from a specified file.
* @param str The buffer to store the string in.
* @param len The length of the string
* @param thefile The file descriptor to read from
+ * @deffunc apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile)
*/
-apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile);
/**
* Put the string into a specified file.
* @param str The string to write.
* @param thefile The file descriptor to write to
+ * @deffunc apr_status_t apr_puts(const char *str, apr_file_t *thefile)
*/
-apr_status_t apr_puts(const char *str, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile);
/**
* Flush the file's buffer.
* @param thefile The file descriptor to flush
+ * @deffunc apr_status_t apr_flush(apr_file_t *thefile)
*/
-apr_status_t apr_flush(apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile);
/**
* duplicate the specified file descriptor.
@@ -580,15 +450,20 @@ apr_status_t apr_flush(apr_file_t *thefile);
* @param old_file The file to duplicate.
* @param p The pool to use for the new file.
* @tip *arg1 must point to a valid apr_file_t, or point to NULL
+ * @deffunc apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p)
*/
-apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p);
+APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file,
+ apr_file_t *old_file,
+ apr_pool_t *p);
/**
* get the specified file's stats.
* @param finfo Where to store the information about the file.
* @param thefile The file to get information about.
+ * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile)
*/
-apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo,
+ apr_file_t *thefile);
/**
* set the specified file's permission bits.
@@ -599,8 +474,10 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile);
* are specified which could not be set.
*
* Platforms which do not implement this feature will return APR_ENOTIMPL.
+ * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms)
*/
-apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms);
+APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname,
+ apr_fileperms_t perms);
/**
* get the specified file's stats. The file is specified by filename,
@@ -609,8 +486,10 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms);
* never touched if the call fails.
* @param fname The name of the file to stat.
* @param cont the pool to use to allocate the new file.
+ * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
*/
-apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname,
+ apr_pool_t *cont);
/**
* get the specified file's stats. The file is specified by filename,
@@ -620,8 +499,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont);
* never touched if the call fails.
* @param fname The name of the file to stat.
* @param cont the pool to use to allocate the new file.
+ * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont)
*/
-apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname,
+ apr_pool_t *cont);
/**
* Move the read/write file offset to a specified byte within a file.
@@ -634,83 +515,102 @@ apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont);
* @param offset The offset to move the pointer to.
* @tip The third argument is modified to be the offset the pointer
was actually moved to.
+ * @deffunc apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
*/
-apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where,apr_off_t *offset);
+APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile,
+ apr_seek_where_t where,
+ apr_off_t *offset);
/**
* Open the specified directory.
* @param new_dir The opened directory descriptor.
* @param dirname The full path to the directory (use / on all systems)
* @param cont The pool to use.
+ * @deffunc apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont)
*/
-apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir,
+ const char *dirname,
+ apr_pool_t *cont);
/**
* close the specified directory.
* @param thedir the directory descriptor to close.
+ * @deffunc apr_status_t apr_closedir(apr_dir_t *thedir)
*/
-apr_status_t apr_closedir(apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *thedir);
/**
* Read the next entry from the specified directory.
* @param thedir the directory descriptor to read from, and fill out.
* @tip All systems return . and .. as the first two files.
+ * @deffunc apr_status_t apr_readdir(apr_dir_t *thedir)
*/
-apr_status_t apr_readdir(apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir);
/**
* Rewind the directory to the first entry.
* @param thedir the directory descriptor to rewind.
+ * @deffunc apr_status_t apr_rewinddir(apr_dir_t *thedir)
*/
-apr_status_t apr_rewinddir(apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *thedir);
/**
* Create a new directory on the file system.
* @param path the path for the directory to be created. (use / on all systems)
* @param perm Permissions for the new direcoty.
* @param cont the pool to use.
+ * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont)
*/
-apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm,
+APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm,
apr_pool_t *cont);
/**
* Remove directory from the file system.
* @param path the path for the directory to be removed. (use / on all systems)
* @param cont the pool to use.
+ * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont)
*/
-apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont);
/**
* Create an anonymous pipe.
* @param in The file descriptor to use as input to the pipe.
* @param out The file descriptor to use as output from the pipe.
* @param cont The pool to operate on.
+ * @deffunc apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont)
*/
-apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out,
+ apr_pool_t *cont);
/**
* Create a named pipe.
* @param filename The filename of the named pipe
* @param perm The permissions for the newly created pipe.
* @param cont The pool to operate on.
+ * @deffunc apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont)
*/
-apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename,
+ apr_fileperms_t perm,
+ apr_pool_t *cont);
/**
* Get the timeout value for a pipe or manipulate the blocking state.
* @param thepipe The pipe we are getting a timeout for.
* @param timeout The current timeout value in microseconds.
+ * @deffunc apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout)
*/
-apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout);
+APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe,
+ apr_interval_time_t *timeout);
/**
* Set the timeout value for a pipe or manipulate the blocking state.
* @param thepipe The pipe we are setting a timeout on.
* @param timeout The timeout value in microseconds. Values < 0 mean wait
* forever, 0 means do not wait at all.
+ * @deffunc apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout)
*/
-apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout);
+APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe,
+ apr_interval_time_t timeout);
/** file (un)locking functions. */
@@ -722,14 +622,16 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo
* block.
* @param thefile The file to lock.
* @param type The type of lock to establish on the file.
+ * @deffunc apr_status_t apr_lock_file(apr_file_t *thefile, int type)
*/
-apr_status_t apr_lock_file(apr_file_t *thefile, int type);
+APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type);
/**
* Remove any outstanding locks on the file.
* @param thefile The file to unlock.
+ * @deffunc apr_status_t apr_unlock_file(apr_file_t *thefile)
*/
-apr_status_t apr_unlock_file(apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile);
/**accessor and general file_io functions. */
@@ -737,23 +639,29 @@ apr_status_t apr_unlock_file(apr_file_t *thefile);
* return the file name of the current file.
* @param new_path The path of the file.
* @param thefile The currently open file.
+ * @deffunc apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile)
*/
-apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile);
+APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path,
+ apr_file_t *thefile);
/**
* Get the file name of the current directory entry.
* @param new_path the file name of the directory entry.
* @param thedir the currently open directory.
+ * @deffunc apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir)
*/
-apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new_path,
+ apr_dir_t *thedir);
/**
* Return the data associated with the current file.
* @param data The user data associated with the file.
* @param key The key to use for retreiving data associated with this file.
* @param file The currently open file.
+ * @deffunc apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file)
*/
-apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file);
+APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key,
+ apr_file_t *file);
/**
* Set the data associated with the current file.
@@ -761,30 +669,38 @@ apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file);
* @param data The user data to associate with the file.
* @param key The key to use for assocaiteing data with the file.
* @param cleanup The cleanup routine to use when the file is destroyed.
+ * @deffunc apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *))
*/
-apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key,
- apr_status_t (*cleanup) (void *));
+APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void *));
/**
* Get the size of the current directory entry.
* @param size the size of the directory entry.
* @param thedir the currently open directory.
+ * @deffunc apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir)
*/
-apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_size_t *size,
+ apr_dir_t *thedir);
/**
* Get the last modified time of the current directory entry.
* @param mtime the last modified time of the directory entry.
* @param thedir the currently open directory.
+ * @deffunc apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir)
*/
-apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *mtime,
+ apr_dir_t *thedir);
/**
* Get the file type of the current directory entry.
* @param type the file type of the directory entry.
* @param thedir the currently open directory.
+ * @deffunc apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir)
*/
-apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir);
+APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type,
+ apr_dir_t *thedir);
/**
* Write a string to a file using a printf format.
@@ -794,7 +710,7 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir);
* @return The number of bytes written
* @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...)
*/
-APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...)
+APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...)
__attribute__((format(printf,2,3)));
#ifdef __cplusplus
diff --git a/include/apr_fnmatch.h b/include/apr_fnmatch.h
index 70e9ec296..c43828ea9 100644
--- a/include/apr_fnmatch.h
+++ b/include/apr_fnmatch.h
@@ -69,8 +69,8 @@ extern "C" {
* @deffunc apr_status_t apr_fnmatch(const char *pattern, const char *strings, int flags)
*/
-APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern, const char *strings,
- int flags);
+APR_DECLARE(apr_status_t) apr_fnmatch(const char *pattern,
+ const char *strings, int flags);
/**
* Determine if the given pattern is a regular expression.
diff --git a/include/apr_general.h b/include/apr_general.h
index 4eebdef61..77ec5cf3c 100644
--- a/include/apr_general.h
+++ b/include/apr_general.h
@@ -253,20 +253,25 @@ int strncasecmp(const char *a, const char *b, size_t n);
*/
#if APR_HAS_RANDOM
+
+/* TODO: I'm not sure this is the best place to put this prototype...*/
/**
* Generate a string of random bytes.
* @param buf Random bytes go here
* @param length size of the buffer
+ * @deffunc apr_status_t apr_generate_random_bytes(unsigned char * buf, int length)
*/
-/* TODO: I'm not sure this is the best place to put this prototype...*/
-apr_status_t apr_generate_random_bytes(unsigned char * buf, int length);
+APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
+ int length);
+
#endif
/**
* Setup any APR internal data structures. This MUST be the first function
* called for any APR program.
+ * @deffunc apr_status_t apr_initialize(void)
*/
-apr_status_t apr_initialize(void);
+APR_DECLARE(apr_status_t) apr_initialize(void);
/**
* Tear down any APR internal data structures which aren't torn down
@@ -274,8 +279,9 @@ apr_status_t apr_initialize(void);
* @tip An APR program must call this function at termination once it
* has stopped using APR services. The APR developers suggest using
* atexit to ensure this is called.
+ * @deffunc void apr_terminate(void)
*/
-void apr_terminate(void);
+APR_DECLARE(void) apr_terminate(void);
/**
* Set the APR_ABORT function.
@@ -285,8 +291,10 @@ void apr_terminate(void);
* to actually exit the program. If this function is not called,
* then APR will return an error and expect the calling program to
* deal with the error accordingly.
+ * @deffunc apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont)
*/
-apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode),
+ apr_pool_t *cont);
#ifdef __cplusplus
}
diff --git a/include/apr_getopt.h b/include/apr_getopt.h
index 63037bda5..9feb6a721 100644
--- a/include/apr_getopt.h
+++ b/include/apr_getopt.h
@@ -57,6 +57,10 @@
#include "apr_pools.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/**
* @package APR command arguments
*/
@@ -165,4 +169,9 @@ APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
const apr_getopt_option_t *opts,
int *optch, const char **optarg);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* ! APR_GETOPT_H */
diff --git a/include/apr_hash.h b/include/apr_hash.h
index 15cdab7b3..5f3f9ef43 100644
--- a/include/apr_hash.h
+++ b/include/apr_hash.h
@@ -111,7 +111,7 @@ APR_DECLARE(apr_hash_t *) apr_make_hash(apr_pool_t *pool);
* @deffunc void apr_hash_set(apr_hash_t *ht, const void *key, apr_size_t klen, const void *val)
*/
APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
- apr_ssize_t klen, const void *val);
+ apr_ssize_t klen, const void *val);
/**
* Look up the value associated with a key in a hash table.
@@ -122,7 +122,7 @@ APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
* @deffunc void *apr_hash_get(apr_hash_t *ht, const void *key, apr_size_t klen)
*/
APR_DECLARE(void*) apr_hash_get(apr_hash_t *ht, const void *key,
- apr_ssize_t klen);
+ apr_ssize_t klen);
/**
* Start iterating over the entries in a hash table.
@@ -171,7 +171,7 @@ APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi);
* @deffunc void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_size_t *klen, void **val);
*/
APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
- apr_size_t *klen, void **val);
+ apr_size_t *klen, void **val);
/**
* Get the number of key/value pairs in the hash table.
diff --git a/include/apr_lib.h b/include/apr_lib.h
index dc35ac028..fbaeac5c3 100644
--- a/include/apr_lib.h
+++ b/include/apr_lib.h
@@ -205,8 +205,8 @@ APR_DECLARE(const char *) apr_filename_of_pathname(const char *pathname);
* @deffunc int apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b), apr_vformatter_buff_t *c, const char *fmt, va_list ap)
*/
APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
- apr_vformatter_buff_t *c, const char *fmt,
- va_list ap);
+ apr_vformatter_buff_t *c, const char *fmt,
+ va_list ap);
/**
* Validate any password encypted with any algorithm that APR understands
@@ -214,7 +214,8 @@ APR_DECLARE(int) apr_vformatter(int (*flush_func)(apr_vformatter_buff_t *b),
* @param hash The password to validate against
* @deffunc apr_status_t apr_validate_password(const char *passwd, const char *hash)
*/
-APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char *hash);
+APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd,
+ const char *hash);
/*
* These are snprintf implementations based on apr_vformatter().
@@ -243,7 +244,7 @@ APR_DECLARE(apr_status_t) apr_validate_password(const char *passwd, const char *
* @deffunc int apr_snprintf(char *buf, size_t len, const char *format, ...)
*/
APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len,
- const char *format, ...)
+ const char *format, ...)
__attribute__((format(printf,3,4)));
/**
@@ -256,7 +257,7 @@ APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, size_t len,
* @deffunc int apr_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
*/
APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format,
- va_list ap);
+ va_list ap);
/**
* Display a prompt and read in the password from stdin.
@@ -265,7 +266,8 @@ APR_DECLARE(int) apr_vsnprintf(char *buf, size_t len, const char *format,
* @param bufsize The length of the password string.
* @deffunc apr_status_t apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize)
*/
-APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf, size_t *bufsize);
+APR_DECLARE(apr_status_t) apr_getpass(const char *prompt, char *pwbuf,
+ size_t *bufsize);
#ifdef __cplusplus
}
diff --git a/include/apr_lock.h b/include/apr_lock.h
index d385a14b2..eaeaff977 100644
--- a/include/apr_lock.h
+++ b/include/apr_lock.h
@@ -96,30 +96,36 @@ typedef struct apr_lock_t apr_lock_t;
* @param cont The pool to operate on.
* @tip APR_CROSS_PROCESS may lock both processes and threads, but it is
* only guaranteed to lock processes.
+ * @deffunc apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type, apr_lockscope_e scope, const char *fname, apr_pool_t *cont)
*/
-apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type,
- apr_lockscope_e scope, const char *fname,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock,
+ apr_locktype_e type,
+ apr_lockscope_e scope,
+ const char *fname,
+ apr_pool_t *cont);
/**
* Lock a protected region.
* @param lock The lock to set.
+ * @deffunc apr_status_t apr_lock(apr_lock_t *lock)
*/
-apr_status_t apr_lock(apr_lock_t *lock);
+APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock);
/**
* Unlock a protected region.
* @param lock The lock to reset.
+ * @deffunc apr_status_t apr_unlock(apr_lock_t *lock)
*/
-apr_status_t apr_unlock(apr_lock_t *lock);
+APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock);
/**
* Free the memory associated with a lock.
* @param lock The lock to free.
+ * @deffunc apr_status_t apr_destroy_lock(apr_lock_t *lock)
* @tip If the lock is currently active when it is destroyed, it
* will be unlocked first.
*/
-apr_status_t apr_destroy_lock(apr_lock_t *lock);
+APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock);
/**
* Re-open a lock in a child process.
@@ -133,17 +139,21 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock);
* locking mechanism chosen for the platform, but it is a good
* idea to call it regardless, because it makes the code more
* portable.
+ * @deffunc apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, apr_pool_t *cont)
*/
-apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock,
+ const char *fname,
+ apr_pool_t *cont);
/**
* Return the pool associated with the current lock.
* @param lock The currently open lock.
* @param key The key to use when retreiving data associated with this lock
* @param data The user data associated with the lock.
+ * @deffunc apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data)
*/
-apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data);
+APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key,
+ void *data);
/**
* Return the pool associated with the current lock.
@@ -151,9 +161,11 @@ apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data);
* @param data The user data to associate with the lock.
* @param key The key to use when associating data with this lock
* @param cleanup The cleanup to use when the lock is destroyed.
+ * @deffunc apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, apr_status_t (*cleanup)(void *))
*/
-apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key,
- apr_status_t (*cleanup) (void *));
+APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void *));
#ifdef __cplusplus
}
diff --git a/include/apr_md5.h b/include/apr_md5.h
index d3405c1ec..b38fc2584 100644
--- a/include/apr_md5.h
+++ b/include/apr_md5.h
@@ -131,8 +131,8 @@ APR_DECLARE(apr_status_t) apr_MD5Init(apr_md5_ctx_t *context);
* @deffunc apr_status_t apr_MD5SetXlate(apr_md5_ctx_t *context, apr_xlate_t *xlate)
*/
#if APR_HAS_XLATE
-APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context,
- apr_xlate_t *xlate);
+APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context,
+ apr_xlate_t *xlate);
#else
#define apr_MD5SetXlate(context, xlate) APR_ENOTIMPL
#endif
@@ -146,8 +146,8 @@ APR_DECLARE(apr_status_t) apr_MD5SetXlate(apr_md5_ctx_t *context,
* @deffunc apr_status_t apr_MD5Update(apr_md5_ctx_t *context, const unsigned char *input, unsigned int inputLen)
*/
APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context,
- const unsigned char *input,
- unsigned int inputLen);
+ const unsigned char *input,
+ unsigned int inputLen);
/**
* MD5 finalization. Ends an MD5 message-digest operation, writing the
@@ -157,7 +157,7 @@ APR_DECLARE(apr_status_t) apr_MD5Update(apr_md5_ctx_t *context,
* @deffunc apr_status_t apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE], apr_md5_ctx_t *context)
*/
APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE],
- apr_md5_ctx_t *context);
+ apr_md5_ctx_t *context);
/**
* Encode a password using an MD5 algorithm
@@ -168,7 +168,7 @@ APR_DECLARE(apr_status_t) apr_MD5Final(unsigned char digest[MD5_DIGESTSIZE],
* @deffunc apr_status_t apr_MD5Encode(const char *password, const char *salt, char *result, size_t nbytes)
*/
APR_DECLARE(apr_status_t) apr_MD5Encode(const char *password, const char *salt,
- char *result, size_t nbytes);
+ char *result, size_t nbytes);
#ifdef __cplusplus
}
diff --git a/include/apr_mmap.h b/include/apr_mmap.h
index a95cedaef..67ea0cac0 100644
--- a/include/apr_mmap.h
+++ b/include/apr_mmap.h
@@ -122,24 +122,29 @@ struct apr_mmap_t {
* APR_MMAP_WRITE MMap opened for writing
* </PRE>
* @param cntxt The pool to use when creating the mmap.
+ * @deffunc apr_status_t apr_mmap_create(apr_mmap_t **newmmap, apr_file_t *file, apr_off_t offset, apr_size_t size, apr_int32_t flag, apr_pool_t *cntxt)
*/
-apr_status_t apr_mmap_create(apr_mmap_t ** newmmap, apr_file_t *file,
- apr_off_t offset, apr_size_t size,
- apr_int32_t flag, apr_pool_t *cntxt);
+APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **newmmap,
+ apr_file_t *file, apr_off_t offset,
+ apr_size_t size, apr_int32_t flag,
+ apr_pool_t *cntxt);
/**
* Remove a mmap'ed.
* @param mmap The mmap'ed file.
+ * @deffunc apr_status_t apr_mmap_delete(apr_mmap_t *mmap)
*/
-apr_status_t apr_mmap_delete(apr_mmap_t *mmap);
+APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap);
/**
* Move the pointer into the mmap'ed file to the specified offset.
* @param addr The pointer to the offset specified.
* @param mmap The mmap'ed file.
* @param offset The offset to move to.
+ * @deffunc apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset)
*/
-apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset);
+APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap,
+ apr_off_t offset);
#endif /* APR_HAS_MMAP */
diff --git a/include/apr_network_io.h b/include/apr_network_io.h
index e5a48442f..a235ecd56 100644
--- a/include/apr_network_io.h
+++ b/include/apr_network_io.h
@@ -219,9 +219,11 @@ struct apr_hdtr_t {
* @param family The address family of the socket (e.g., APR_INET).
* @param type The type of the socket (e.g., SOCK_STREAM).
* @param cont The pool to use
+ * @deffunc apr_status_t apr_create_socket(apr_socket_t **new_sock, int family, int type, apr_pool_t *cont)
*/
-apr_status_t apr_create_socket(apr_socket_t **new_sock, int family,
- int type, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new_sock,
+ int family, int type,
+ apr_pool_t *cont);
/**
* Shutdown either reading, writing, or both sides of a tcp socket.
@@ -232,16 +234,19 @@ apr_status_t apr_create_socket(apr_socket_t **new_sock, int family,
* APR_SHUTDOWN_WRITE no longer allow write requests
* APR_SHUTDOWN_READWRITE no longer allow read or write requests
* </PRE>
+ * @deffunc apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
* @tip This does not actually close the socket descriptor, it just
* controls which calls are still valid on the socket.
*/
-apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how);
+APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket,
+ apr_shutdown_how_e how);
/**
* Close a tcp socket.
* @param thesocket The socket to close
+ * @deffunc apr_status_t apr_close_socket(apr_socket_t *thesocket)
*/
-apr_status_t apr_close_socket(apr_socket_t *thesocket);
+APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket);
/**
* Bind the socket to its associated port
@@ -249,8 +254,9 @@ apr_status_t apr_close_socket(apr_socket_t *thesocket);
* @param sa The socket address to bind to
* @tip This may be where we will find out if there is any other process
* using the selected port.
+ * @deffunc apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
*/
-apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa);
+APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa);
/**
* Listen to a bound socket for connections.
@@ -258,8 +264,9 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa);
* @param backlog The number of outstanding connections allowed in the sockets
* listen queue. If this value is less than zero, the listen
* queue size is set to zero.
+ * @deffunc apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog)
*/
-apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog);
+APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog);
/**
* Accept a new connection request
@@ -268,9 +275,11 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog);
* be used for all future communication.
* @param sock The socket we are listening on.
* @param connection_pool The pool for the new socket.
+ * @deffunc apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock, apr_pool_t *connection_pool)
*/
-apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock,
- apr_pool_t *connection_pool);
+APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new_sock,
+ apr_socket_t *sock,
+ apr_pool_t *connection_pool);
/**
* Issue a connection request to a socket either on the same machine
@@ -279,8 +288,9 @@ apr_status_t apr_accept(apr_socket_t **new_sock, apr_socket_t *sock,
* @param sa The address of the machine we wish to connect to. If NULL,
* APR assumes that the sockaddr_in in the apr_socket is
* completely filled out.
+ * @deffunc apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
*/
-apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa);
+APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa);
/**
* Create apr_sockaddr_t from hostname, address family, and port.
@@ -291,23 +301,25 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa);
* @param port The port number.
* @param flags Special processing flags.
* @param p The pool for the apr_sockaddr_t and associated storage.
+ * @deffunc apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, apr_int32_t family, apr_port_t port, apr_int32_t flags, apr_pool_t *p)
*/
-apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa,
- const char *hostname,
- apr_int32_t family,
- apr_port_t port,
- apr_int32_t flags,
- apr_pool_t *p);
+APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa,
+ const char *hostname,
+ apr_int32_t family,
+ apr_port_t port,
+ apr_int32_t flags,
+ apr_pool_t *p);
/**
* Look up the host name from an apr_sockaddr_t.
* @param hostname The hostname.
* @param sa The apr_sockaddr_t.
* @param flags Special processing flags.
+ * @deffunc apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sa, apr_int32_t flags)
*/
-apr_status_t apr_getnameinfo(char **hostname,
- apr_sockaddr_t *sa,
- apr_int32_t flags);
+APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
+ apr_sockaddr_t *sa,
+ apr_int32_t flags);
/**
* Parse hostname/IP address with scope id and port.
@@ -335,12 +347,13 @@ apr_status_t apr_getnameinfo(char **hostname,
* @tip If scope id shouldn't be allowed, check for scope_id != NULL in addition
* to checking the return code. If addr/hostname should be required, check
* for addr == NULL in addition to checking the return code.
+ * @deffunc apr_status_t apr_parse_addr_port(char **addr, char **scope_id, apr_port_t *port, const char *str, apr_pool_t *p)
*/
-apr_status_t apr_parse_addr_port(char **addr,
- char **scope_id,
- apr_port_t *port,
- const char *str,
- apr_pool_t *p);
+APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr,
+ char **scope_id,
+ apr_port_t *port,
+ const char *str,
+ apr_pool_t *p);
/**
* Get name of the current machine
@@ -348,17 +361,19 @@ apr_status_t apr_parse_addr_port(char **addr,
* @param len The maximum length of the hostname that can be stored in the
* buffer provided.
* @param cont The pool to use.
+ * @deffunc apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont)
*/
-apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len, apr_pool_t *cont);
/**
* Return the data associated with the current socket
* @param data The user data associated with the socket.
* @param key The key to associate with the user data.
* @param sock The currently open socket.
+ * @deffunc apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *sock)
*/
-apr_status_t apr_get_socketdata(void **data, const char *key,
- apr_socket_t *sock);
+APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key,
+ apr_socket_t *sock);
/**
* Set the data associated with the current socket.
@@ -366,10 +381,11 @@ apr_status_t apr_get_socketdata(void **data, const char *key,
* @param data The user data to associate with the socket.
* @param key The key to associate with the data.
* @param cleanup The cleanup to call when the socket is destroyed.
+ * @deffunc apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data, const char *key, apr_status_t (*cleanup)(void*))
*/
-apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data,
- const char *key,
- apr_status_t (*cleanup) (void*));
+APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *sock, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void*));
/**
* Send data over a network.
@@ -377,6 +393,7 @@ apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data,
* @param buf The buffer which contains the data to be sent.
* @param len On entry, the number of bytes to send; on exit, the number
* of bytes sent.
+ * @deffunc apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
* @tip
* <PRE>
* This functions acts like a blocking write by default. To change
@@ -387,7 +404,8 @@ apr_status_t apr_set_socketdata(apr_socket_t *sock, void *data,
* APR_EINTR is never returned.
* </PRE>
*/
-apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len);
+APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf,
+ apr_size_t *len);
/**
* Send multiple packets of data over a network.
@@ -395,6 +413,7 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len);
* @param vec The array of iovec structs containing the data to send
* @param nvec The number of iovec structs in the array
* @param len Receives the number of bytes actually written
+ * @deffunc apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len)
* @tip
* <PRE>
* This functions acts like a blocking write by default. To change
@@ -406,10 +425,12 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len);
* APR_EINTR is never returned.
* </PRE>
*/
-apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec,
- apr_int32_t nvec, apr_size_t *len);
+APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock,
+ const struct iovec *vec,
+ apr_int32_t nvec, apr_size_t *len);
#if APR_HAS_SENDFILE
+
/**
* Send a file from an open file descriptor to a socket, along with
* optional headers and trailers
@@ -421,14 +442,16 @@ apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec,
* (output) - Number of bytes actually sent,
* including headers, file, and trailers
* @param flags APR flags that are mapped to OS specific flags
+ * @deffunc apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file, apr_hdtr_t *hdtr, apr_off_t *offset, apr_size_t *len, apr_int32_t flags)
* @tip This functions acts like a blocking write by default. To change
* this behavior, use apr_setsocketopt with the APR_SO_TIMEOUT option.
* The number of bytes actually sent is stored in argument 5.
*/
-apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
- apr_hdtr_t *hdtr, apr_off_t *offset,
- apr_size_t *len, apr_int32_t flags);
-#endif
+APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+ apr_hdtr_t *hdtr, apr_off_t *offset,
+ apr_size_t *len, apr_int32_t flags);
+
+#endif /* APR_HAS_SENDFILE */
/**
* Read data from a network.
@@ -436,6 +459,7 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
* @param buf The buffer to store the data in.
* @param len On entry, the number of bytes to receive; on exit, the number
* of bytes received.
+ * @deffunc apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
* @tip
* <PRE>
* This functions acts like a blocking read by default. To change
@@ -448,7 +472,8 @@ apr_status_t apr_sendfile(apr_socket_t *sock, apr_file_t *file,
* APR_EINTR is never returned.
* </PRE>
*/
-apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len);
+APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock,
+ char *buf, apr_size_t *len);
/**
* Setup socket options for the specified socket
@@ -469,9 +494,10 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len);
* APR_SO_RCVBUF -- Set the ReceiveBufferSize
* </PRE>
* @param on Value for the option.
+ * @deffunc apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
*/
-apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt,
- apr_int32_t on);
+APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock,
+ apr_int32_t opt, apr_int32_t on);
/**
* Query socket options for the specified socket
@@ -494,57 +520,70 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt,
* (Currently only used on Windows)
* </PRE>
* @param on Socket option returned on the call.
+ * @deffunc apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t* on)
*/
-apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt,
- apr_int32_t* on);
+APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock,
+ apr_int32_t opt, apr_int32_t* on);
/**
* Return an apr_sockaddr_t from an apr_socket_t
* @param sa The returned apr_sockaddr_t.
* @param which Which interface do we want the apr_sockaddr_t for?
* @param sock The socket to use
+ * @deffunc apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock)
*/
-apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which,
- apr_socket_t *sock);
+APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa,
+ apr_interface_e which,
+ apr_socket_t *sock);
/**
* Set the port in an APR socket address.
* @param sockaddr The socket address to set.
* @param port The port to be stored in the socket address.
+ * @deffunc apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port)
*/
-apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port);
+APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr,
+ apr_port_t port);
/**
* Return the port in an APR socket address.
* @param port The port from the socket address.
* @param sockaddr The socket address to reference.
+ * @deffunc apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr)
*/
-apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr);
+APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port,
+ apr_sockaddr_t *sockaddr);
/**
* Set the IP address in an APR socket address.
* @param sockaddr The socket address to use
* @param addr The IP address to attach to the socket.
* Use APR_ANYADDR to use any IP addr on the machine.
+ * @deffunc apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr)
*/
-apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr);
+APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr,
+ const char *addr);
/**
* Return the IP address (in numeric address string format) in
* an APR socket address.
* @param addr The IP address.
* @param sockaddr The socket address to reference.
+ * @deffunc apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr)
*/
-apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr);
+APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr,
+ apr_sockaddr_t *sockaddr);
/**
* Setup the memory required for poll to operate properly
* @param new_poll The poll structure to be used.
* @param num The number of socket descriptors to be polled.
* @param cont The pool to operate on.
+ * @deffunc apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont)
*/
-apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new_poll,
+ apr_int32_t num,
+ apr_pool_t *cont);
/**
* Poll the sockets in the poll structure
@@ -561,8 +600,10 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new_poll, apr_int32_t num,
* This is a blocking call, and it will not return until either a
* socket has been signalled, or the timeout has expired.
* </PRE>
+ * @deffunc apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout)
*/
-apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time_t timeout);
+APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
+ apr_interval_time_t timeout);
/**
* Add a socket to the poll structure.
@@ -574,9 +615,11 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds, apr_interval_time
* APR_POLLPRI signal if prioirty data is availble to be read
* APR_POLLOUT signal if write will not block
* </PRE>
+ * @deffunc apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event)
*/
-apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock,
- apr_int16_t event);
+APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset,
+ apr_socket_t *sock,
+ apr_int16_t event);
/**
* Modify a socket in the poll structure with mask.
@@ -588,15 +631,19 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock,
* APR_POLLPRI signal if prioirty data is availble to be read
* APR_POLLOUT signal if write will not block
* </PRE>
+ * @deffunc apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events)
*/
-apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock,
- apr_int16_t events);
+APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset,
+ apr_socket_t *sock,
+ apr_int16_t events);
/**
* Remove a socket from the poll structure.
* @param aprset The poll structure we will be using.
* @param sock The socket to remove from the current poll structure.
+ * @deffunc apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock)
*/
-apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock);
+APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset,
+ apr_socket_t *sock);
/**
* Remove all sockets from the poll structure.
@@ -607,8 +654,10 @@ apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock);
* APR_POLLPRI signal if prioirty data is availble to be read
* APR_POLLOUT signal if write will not block
* </PRE>
+ * @deffunc apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events)
*/
-apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events);
+APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset,
+ apr_int16_t events);
/**
* Get the return events for the specified socket.
@@ -624,17 +673,21 @@ apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events);
* </PRE>
* @param sock The socket we wish to get information about.
* @param aprset The poll structure we will be using.
+ * @deffunc apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset)
*/
-apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock,
- apr_pollfd_t *aprset);
+APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event,
+ apr_socket_t *sock,
+ apr_pollfd_t *aprset);
/**
* Return the data associated with the current poll.
* @param pollfd The currently open pollfd.
* @param key The key to use for retreiving data associated with a poll struct.
* @param data The user data associated with the pollfd.
+ * @deffunc apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data)
*/
-apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data);
+APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd,
+ const char *key, void *data);
/**
* Set the data associated with the current poll.
@@ -642,30 +695,36 @@ apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data)
* @param data The key to associate with the data.
* @param key The user data to associate with the pollfd.
* @param cleanup The cleanup function
+ * @deffunc apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key, apr_status_t (*cleanup)(void *))
*/
-apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data,
- const char *key,
- apr_status_t (*cleanup) (void *));
+APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void *));
#if APR_FILES_AS_SOCKETS
+
/**
* Convert a File type to a socket so that it can be used in a poll operation.
* @param newsock the newly created socket which represents a file.
* @param file the file to mask as a socket.
+ * @deffunc apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file)
* @warning This is not available on all platforms. Platforms that have the
* ability to poll files for data to be read/written/exceptions will
* have the APR_FILES_AS_SOCKETS macro defined as true.
*/
-apr_status_t apr_socket_from_file(apr_socket_t **newsock, apr_file_t *file);
-#endif
+APR_DECLARE(apr_status_t) apr_socket_from_file(apr_socket_t **newsock,
+ apr_file_t *file);
+
+#endif /* APR_FILES_AS_SOCKETS */
/**
* Given an apr_sockaddr_t and a service name, set the port for the service
* @param sockaddr The apr_sockaddr_t that will have it's port set
* @param servname The name of the service you wish to use
+ * @deffunc apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname)
*/
-
-apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname);
+APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
+ const char *servname);
#ifdef __cplusplus
}
diff --git a/include/apr_pools.h b/include/apr_pools.h
index dddab520f..a5c5f1715 100644
--- a/include/apr_pools.h
+++ b/include/apr_pools.h
@@ -73,8 +73,8 @@ extern "C" {
* Instead, we maintain pools, and allocate items (both memory and I/O
* handlers) from the pools --- currently there are two, one for per
* transaction info, and one for config info. When a transaction is over,
- * we can delete everything in the per-transaction apr_pool_t without fear, and
- * without thinking too hard about it either.
+ * we can delete everything in the per-transaction apr_pool_t without fear,
+ * and without thinking too hard about it either.
*
* rst
*/
@@ -139,9 +139,10 @@ struct apr_pool_t {
struct apr_pool_t *joined;
#endif
/** A function to control how pools behave when they receive ENOMEM
- * @deffunc int apr_abort(int retcode) */
+ * @deffunc int (*apr_abort)(int retcode) */
int (*apr_abort)(int retcode);
- /** A place to hold user data associated with this pool
+ /**
+ * A place to hold user data associated with this pool
* @defvar apr_hash_t *prog_data */
struct apr_hash_t *prog_data;
};
@@ -240,7 +241,8 @@ APR_DECLARE(void) apr_term_alloc(apr_pool_t *globalp);
* be a sub-pool.
* @deffunc apr_status_t apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont)
*/
-APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont,
+ apr_pool_t *cont);
/**
* Set the data associated with the current pool
@@ -256,11 +258,11 @@ APR_DECLARE(apr_status_t) apr_create_pool(apr_pool_t **newcont, apr_pool_t *cont
* data by choosing a key that another part of the program is using
* It is advised that steps are taken to ensure that a unique
* key is used at all times.
- * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup) (void *), apr_pool_t *cont)
+ * @deffunc apr_status_t apr_set_userdata(const void *data, const char *key, apr_status_t (*cleanup)(void *), apr_pool_t *cont)
*/
-APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key,
- apr_status_t (*cleanup) (void *),
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key,
+ apr_status_t (*cleanup)(void *),
+ apr_pool_t *cont);
/**
* Return the data associated with the current pool.
@@ -269,7 +271,8 @@ APR_DECLARE(apr_status_t) apr_set_userdata(const void *data, const char *key,
* @param cont The current pool.
* @deffunc apr_status_t apr_get_userdata(void **data, const char *key, apr_pool_t *cont)
*/
-APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key,
+ apr_pool_t *cont);
/**
* make a sub pool from the current pool
@@ -280,7 +283,8 @@ APR_DECLARE(apr_status_t) apr_get_userdata(void **data, const char *key, apr_poo
* machine is out of memory. By default, APR will return on error.
* @deffunc apr_pool_t *apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode))
*/
-APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p, int (*apr_abort)(int retcode));
+APR_DECLARE(apr_pool_t *) apr_make_sub_pool(apr_pool_t *p,
+ int (*apr_abort)(int retcode));
/**
* clear all memory in the pool
@@ -339,31 +343,31 @@ APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr_size_t size);
* @param plain_cleanup The function to call when the pool is cleared
* or destroyed
* @param child_cleanup The function to call when a child process is created
- * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup) (void *), apr_status_t (*child_cleanup) (void *))
+ * @deffunc void apr_register_cleanup(apr_pool_t *p, const void *data, apr_status_t (*plain_cleanup)(void *), apr_status_t (*child_cleanup)(void *))
*/
APR_DECLARE(void) apr_register_cleanup(apr_pool_t *p, const void *data,
- apr_status_t (*plain_cleanup) (void *),
- apr_status_t (*child_cleanup) (void *));
+ apr_status_t (*plain_cleanup)(void *),
+ apr_status_t (*child_cleanup)(void *));
/**
* remove a previously registered cleanup function
* @param p The pool remove the cleanup from
* @param data The data to remove from cleanup
* @param cleanup The function to remove from cleanup
- * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup) (void *))
+ * @deffunc void apr_kill_cleanup(apr_pool_t *p, const void *data, apr_status_t (*cleanup)(void *))
*/
APR_DECLARE(void) apr_kill_cleanup(apr_pool_t *p, const void *data,
- apr_status_t (*cleanup) (void *));
+ apr_status_t (*cleanup)(void *));
/**
* Run the specified cleanup function immediately and unregister it
* @param p The pool remove the cleanup from
* @param data The data to remove from cleanup
* @param cleanup The function to remove from cleanup
- * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup) (void *))
+ * @deffunc apr_status_t apr_run_cleanup(apr_pool_t *p, void *data, apr_status_t (*cleanup)(void *))
*/
APR_DECLARE(apr_status_t) apr_run_cleanup(apr_pool_t *p, void *data,
- apr_status_t (*cleanup) (void *));
+ apr_status_t (*cleanup)(void *));
/* Preparing for exec() --- close files, etc., but *don't* flush I/O
* buffers, *don't* wait for subprocesses, and *don't* free any memory.
@@ -382,9 +386,8 @@ APR_DECLARE(void) apr_cleanup_for_exec(void);
*/
APR_DECLARE_NONSTD(apr_status_t) apr_null_cleanup(void *data);
-
-/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t will not be
- * destroyed before the parent pool
+/* used to guarantee to the apr_pool_t debugging code that the sub apr_pool_t
+ * will not be destroyed before the parent pool
*/
#ifndef APR_POOL_DEBUG
#ifdef apr_pool_join
diff --git a/include/apr_portable.h b/include/apr_portable.h
index ffa1246f9..24683fcd3 100644
--- a/include/apr_portable.h
+++ b/include/apr_portable.h
@@ -130,7 +130,7 @@ struct apr_os_lock_t {
typedef int apr_os_file_t;
typedef DIR apr_os_dir_t;
typedef int apr_os_sock_t;
-typedef struct apr_os_lock_t apr_os_lock_t;
+typedef struct apr_os_lock_t apr_os_lock_t;
typedef thread_id apr_os_thread_t;
typedef thread_id apr_os_proc_t;
typedef int apr_os_threadkey_t;
@@ -174,7 +174,7 @@ struct apr_os_lock_t {
typedef int apr_os_file_t;
typedef DIR apr_os_dir_t;
typedef int apr_os_sock_t;
-typedef struct apr_os_lock_t apr_os_lock_t;
+typedef struct apr_os_lock_t apr_os_lock_t;
#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H
typedef pthread_t apr_os_thread_t;
typedef pthread_key_t apr_os_threadkey_t;
@@ -202,91 +202,114 @@ typedef struct apr_os_sock_info_t apr_os_sock_info_t;
* convert the file from apr type to os specific type.
* @param thefile The os specific file we are converting to
* @param file The apr file to convert.
+ * @deffunc apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file)
* @tip On Unix, it is only possible to get a file descriptor from
* an apr file type.
*/
-apr_status_t apr_get_os_file(apr_os_file_t *thefile, apr_file_t *file);
+APR_DECLARE(apr_status_t) apr_get_os_file(apr_os_file_t *thefile,
+ apr_file_t *file);
/**
* convert the dir from apr type to os specific type.
* @param thedir The os specific dir we are converting to
* @param dir The apr dir to convert.
+ * @deffunc apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir)
*/
-apr_status_t apr_get_os_dir(apr_os_dir_t **thedir, apr_dir_t *dir);
+APR_DECLARE(apr_status_t) apr_get_os_dir(apr_os_dir_t **thedir,
+ apr_dir_t *dir);
/**
* Convert the socket from an apr type to an OS specific socket
* @param thesock The socket to convert.
* @param sock The os specifc equivelant of the apr socket..
+ * @deffunc apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock)
*/
-apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock);
+APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock,
+ apr_socket_t *sock);
/**
* Convert the lock from os specific type to apr type
* @param oslock The os specific lock we are converting to.
* @param lock The apr lock to convert.
+ * @deffunc apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock)
*/
-apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock);
+APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *oslock,
+ apr_lock_t *lock);
/**
* Get the exploded time in the platforms native format.
* @param ostime the native time format
* @param aprtime the time to convert
+ * @deffunc apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime, apr_exploded_time_t *aprtime)
*/
-apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime,
+APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime,
apr_exploded_time_t *aprtime);
/**
* Get the imploded time in the platforms native format.
* @param ostime the native time format
* @param aprtimethe time to convert
+ * @deffunc apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime)
*/
-apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime);
+APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime,
+ apr_time_t *aprtime);
#if APR_HAS_THREADS
+
/**
* convert the thread to os specific type from apr type.
* @param thethd The apr thread to convert
* @param thd The os specific thread we are converting to
+ * @deffunc apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd)
*/
-apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd);
+APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd,
+ apr_thread_t *thd);
/**
* convert the thread private memory key to os specific type from an apr type.
* @param thekey The apr handle we are converting from.
* @param key The os specific handle we are converting to.
+ * @deffunc apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key)
*/
-apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key);
-#endif
+APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey,
+ apr_threadkey_t *key);
+
+#endif /* APR_HAS_THREADS */
/**
* convert the file from os specific type to apr type.
* @param file The apr file we are converting to.
* @param thefile The os specific file to convert
* @param cont The pool to use if it is needed.
+ * @deffunc apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile, apr_pool_t *cont)
* @tip On Unix, it is only possible to put a file descriptor into
* an apr file type.
*/
-apr_status_t apr_put_os_file(apr_file_t **file, apr_os_file_t *thefile,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_file(apr_file_t **file,
+ apr_os_file_t *thefile,
+ apr_pool_t *cont);
/**
* convert the dir from os specific type to apr type.
* @param dir The apr dir we are converting to.
* @param thedir The os specific dir to convert
* @param cont The pool to use when creating to apr directory.
+ * @deffunc apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *cont)
*/
-apr_status_t apr_put_os_dir(apr_dir_t **dir, apr_os_dir_t *thedir,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_dir(apr_dir_t **dir,
+ apr_os_dir_t *thedir,
+ apr_pool_t *cont);
/**
* Convert a socket from the os specific type to the apr type
* @param sock The pool to use.
* @param thesock The socket to convert to.
* @param cont The socket we are converting to an apr type.
+ * @deffunc apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont)
*/
-apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock,
+ apr_os_sock_t *thesock,
+ apr_pool_t *cont);
/**
* Create a socket from an existing descriptor and local and remote
@@ -295,60 +318,72 @@ apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock,
* @param os_sock_info The os representation of the socket handle and
* other characteristics of the socket
* @param cont The pool to use
+ * @deffunc apr_status_t apr_make_os_sock(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont)
* @tip If you only know the descriptor/handle or if it isn't really
* a true socket, use apr_put_os_sock() instead.
*/
-apr_status_t apr_make_os_sock(apr_socket_t **apr_sock,
- apr_os_sock_info_t *os_sock_info,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock,
+ apr_os_sock_info_t *os_sock_info,
+ apr_pool_t *cont);
/**
* Convert the lock from os specific type to apr type
* @param lock The apr lock we are converting to.
* @param thelock The os specific lock to convert.
* @param cont The pool to use if it is needed.
+ * @deffunc apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock, apr_pool_t *cont)
*/
-apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock,
+ apr_os_lock_t *thelock,
+ apr_pool_t *cont);
/**
* Put the imploded time in the APR format.
* @param aprtime the APR time format
* @param ostime the time to convert
* @param cont the pool to use if necessary
+ * @deffunc apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime, apr_pool_t *cont)
*/
-apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime,
+ apr_os_imp_time_t **ostime,
+ apr_pool_t *cont);
/**
* Put the exploded time in the APR format.
* @param aprtime the APR time format
* @param ostime the time to convert
* @param cont the pool to use if necessary
+ * @deffunc apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime, apr_os_exp_time_t **ostime, apr_pool_t *cont)
*/
-apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime,
- apr_os_exp_time_t **ostime, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime,
+ apr_os_exp_time_t **ostime,
+ apr_pool_t *cont);
#if APR_HAS_THREADS
+
/**
* convert the thread from os specific type to apr type.
* @param thd The apr thread we are converting to.
* @param thethd The os specific thread to convert
* @param cont The pool to use if it is needed.
+ * @deffunc apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd,
*/
-apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd,
+ apr_os_thread_t *thethd,
+ apr_pool_t *cont);
/**
* convert the thread private memory key from os specific type to apr type.
* @param key The apr handle we are converting to.
* @param thekey The os specific handle to convert
* @param cont The pool to use if it is needed.
+ * @deffunc apr_status_t apr_put_os_threadkey(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *cont)
*/
-apr_status_t apr_put_os_threadkey(apr_threadkey_t **key,
- apr_os_threadkey_t *thekey,
- apr_pool_t *cont);
-#endif
+APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key,
+ apr_os_threadkey_t *thekey,
+ apr_pool_t *cont);
+
+#endif /* APR_HAS_THREADS */
#ifdef __cplusplus
}
diff --git a/include/apr_shmem.h b/include/apr_shmem.h
index 75023869e..908b10a2a 100644
--- a/include/apr_shmem.h
+++ b/include/apr_shmem.h
@@ -87,35 +87,41 @@ typedef struct shmem_t apr_shmem_t;
* @param file The file to use for the shared memory on platforms
* that require it.
* @param cont The pool to use
+ * @deffunc apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont)
*/
-apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_shm_init(apr_shmem_t **m, apr_size_t reqsize,
+ const char *file, apr_pool_t *cont);
/**
* Destroy the shared memory block.
* @param m The shared memory block to destroy.
+ * @deffunc apr_status_t apr_shm_destroy(apr_shmem_t *m)
*/
-apr_status_t apr_shm_destroy(apr_shmem_t *m);
+APR_DECLARE(apr_status_t) apr_shm_destroy(apr_shmem_t *m);
/**
* allocate memory from the block of shared memory.
* @param c The shared memory block to destroy.
* @param reqsize How much memory to allocate
+ * @deffunc void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize)
*/
-void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize);
+APR_DECLARE(void *) apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize);
/**
* allocate memory from the block of shared memory and initialize it to zero.
* @param shared The shared memory block to destroy.
* @param size How much memory to allocate
+ * @deffunc void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size)
*/
-void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size);
+APR_DECLARE(void *) apr_shm_calloc(apr_shmem_t *shared, apr_size_t size);
/**
* free shared memory previously allocated.
* @param shared The shared memory block to destroy.
* @param entity The actual data to free.
+ * @deffunc apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity)
*/
-apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity);
+APR_DECLARE(apr_status_t) apr_shm_free(apr_shmem_t *shared, void *entity);
/**
* Get the name of the shared memory segment if not using anonymous
@@ -128,8 +134,10 @@ apr_status_t apr_shm_free(apr_shmem_t *shared, void *entity);
* based on file access. APR_USES_KEYBASED_SHM if shared
* memory is based on a key value such as shmctl. If the
* shared memory is anonymous, the name is NULL.
+ * @deffunc apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name)
*/
-apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name);
+APR_DECLARE(apr_status_t) apr_get_shm_name(apr_shmem_t *c,
+ apr_shm_name_t **name);
/**
* Set the name of the shared memory segment if not using anonymous
@@ -141,21 +149,25 @@ apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name);
* @return APR_USES_ANONYMOUS_SHM if we are using anonymous shared
* memory. APR_SUCCESS if we are using named shared memory
* and we were able to assign the name correctly.
+ * @deffunc apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name)
*/
-apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name);
+APR_DECLARE(apr_status_t) apr_set_shm_name(apr_shmem_t *c,
+ apr_shm_name_t *name);
/**
* Open the shared memory block in a child process.
* @param The shared memory block to open in the child.
+ * @deffunc apr_status_t apr_open_shmem(apr_shmem_t *c)
*/
-apr_status_t apr_open_shmem(apr_shmem_t *c);
+APR_DECLARE(apr_status_t) apr_open_shmem(apr_shmem_t *c);
/**
* Determine how much memory is available in the specified shared memory block
* @param c The shared memory block to open in the child.
* @param avail The amount of space available in the shared memory block.
+ * @deffunc apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail)
*/
-apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail);
+APR_DECLARE(apr_status_t) apr_shm_avail(apr_shmem_t *c, apr_size_t *avail);
#ifdef __cplusplus
}
diff --git a/include/apr_strings.h b/include/apr_strings.h
index 46d10df02..8c87a57f4 100644
--- a/include/apr_strings.h
+++ b/include/apr_strings.h
@@ -101,8 +101,9 @@ extern "C" {
* @return Either <0, 0, or >0. If the first string is less than the second
* this returns <0, if they are equivalent it returns 0, and if the
* first string is greater than second string it retuns >0.
+ * @deffunc int apr_strnatcmp(char const *a, char const *b)
*/
-int apr_strnatcmp(char const *a, char const *b);
+APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b);
/**
* Do a natural order comparison of two strings ignoring the case of the
@@ -112,8 +113,9 @@ int apr_strnatcmp(char const *a, char const *b);
* @return Either <0, 0, or >0. If the first string is less than the second
* this returns <0, if they are equivalent it returns 0, and if the
* first string is greater than second string it retuns >0.
+ * @deffunc int apr_strnatcasecmp(char const *a, char const *b)
*/
-int apr_strnatcasecmp(char const *a, char const *b);
+APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b);
/**
* duplicate a string into memory allocated out of a pool
@@ -203,8 +205,8 @@ APR_DECLARE(char *) apr_collapse_spaces(char *dest, const char *src);
* @deffunc apr_status_t apr_tokenize_to_argv(const char *arg_str, char ***argv_out, apr_pool_t *token_context);
*/
APR_DECLARE(apr_status_t) apr_tokenize_to_argv(const char *arg_str,
- char ***argv_out,
- apr_pool_t *token_context);
+ char ***argv_out,
+ apr_pool_t *token_context);
#ifdef __cplusplus
}
diff --git a/include/apr_tables.h b/include/apr_tables.h
index fce17e3b3..84de6e917 100644
--- a/include/apr_tables.h
+++ b/include/apr_tables.h
@@ -179,6 +179,7 @@ struct apr_btable_entry_t {
* @deffunc apr_array_header_t *apr_table_elts(apr_table_t *t)
*/
#define apr_table_elts(t) ((apr_array_header_t *)(t))
+
/**
* Get the elements from a binary table
* @param t The table
@@ -191,6 +192,7 @@ struct apr_btable_entry_t {
* Determine if the table is empty
* @param t The table to check
* @return True if empty, Falso otherwise
+ * @deffunc int apr_is_empty_table(apr_table_t *t)
*/
#define apr_is_empty_table(t) (((t) == NULL) \
|| (((apr_array_header_t *)(t))->nelts == 0))
@@ -198,6 +200,7 @@ struct apr_btable_entry_t {
* Determine if the binary table is empty
* @param t The table to check
* @return True if empty, Falso otherwise
+ * @deffunc int apr_is_empty_btable(apr_table_t *t)
*/
#define apr_is_empty_btable(t) apr_is_empty_table(t)
@@ -207,10 +210,10 @@ struct apr_btable_entry_t {
* @param nelts the number of elements in the initial array
* @param elt_size The size of each element in the array.
* @return The new array
- * #deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size)
+ * @deffunc apr_array_header_t *apr_make_array(struct apr_pool_t *p, int nelts, int elt_size)
*/
APR_DECLARE(apr_array_header_t *) apr_make_array(struct apr_pool_t *p,
- int nelts, int elt_size);
+ int nelts, int elt_size);
/**
* Add a new element to an array
@@ -230,21 +233,21 @@ APR_DECLARE(void *) apr_push_array(apr_array_header_t *arr);
* @deffunc void apr_array_cat(apr_array_header_t *dst, const apr_array_header_t *src)
*/
APR_DECLARE(void) apr_array_cat(apr_array_header_t *dst,
- const apr_array_header_t *src);
+ const apr_array_header_t *src);
-/* copy_array copies the *entire* array. copy_array_hdr just copies
- * the header, and arranges for the elements to be copied if (and only
- * if) the code subsequently does a push or arraycat.
- */
/**
* Copy the entire array
* @param p The pool to allocate the copy of the array out of
* @param arr The array to copy
* @return An exact copy of the array passed in
* @deffunc apr_array_header_t *apr_copy_array(apr_pool_t *p, const apr_array_header_t *arr)
+ * @tip The alternate apr_copy_array_hdr copies only the header, and arranges
+ * for the elements to be copied if (and only if) the code subsequently does
+ * a push or arraycat.
*/
-APR_DECLARE(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p,
- const apr_array_header_t *arr);
+APR_DECLARE(apr_array_header_t *)
+ apr_copy_array(struct apr_pool_t *p,
+ const apr_array_header_t *arr);
/**
* Copy the headers of the array, and arrange for the elements to be copied if
* and only if the code subsequently does a push or arraycat.
@@ -252,10 +255,11 @@ APR_DECLARE(apr_array_header_t *) apr_copy_array(struct apr_pool_t *p,
* @param arr The array to copy
* @return An exact copy of the array passed in
* @deffunc apr_array_header_t *apr_copy_array_hdr(apr_pool_t *p, const apr_array_header_t *arr)
+ * @tip The alternate apr_copy_array copies the *entire* array.
*/
APR_DECLARE(apr_array_header_t *)
- apr_copy_array_hdr(struct apr_pool_t *p,
- const apr_array_header_t *arr);
+ apr_copy_array_hdr(struct apr_pool_t *p,
+ const apr_array_header_t *arr);
/**
* Append one array to the end of another, creating a new array in the process.
@@ -266,9 +270,9 @@ APR_DECLARE(apr_array_header_t *)
* @deffunc apr_array_header_t *apr_append_arrays(apr_pool_t *p, const apr_array_header_t *first, const apr_array_header_t *second)
*/
APR_DECLARE(apr_array_header_t *)
- apr_append_arrays(struct apr_pool_t *p,
- const apr_array_header_t *first,
- const apr_array_header_t *second);
+ apr_append_arrays(struct apr_pool_t *p,
+ const apr_array_header_t *first,
+ const apr_array_header_t *second);
/**
* Generates a new string from the apr_pool_t containing the concatenated
@@ -280,11 +284,11 @@ APR_DECLARE(apr_array_header_t *)
* @param arr The array to generate the string from
* @param sep The separator to use
* @return A string containing all of the data in the array.
- * @deffuncchar *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep)
+ * @deffunc char *apr_array_pstrcat(apr_pool_t *p, const apr_array_header_t *arr, const char sep)
*/
APR_DECLARE(char *) apr_array_pstrcat(struct apr_pool_t *p,
- const apr_array_header_t *arr,
- const char sep);
+ const apr_array_header_t *arr,
+ const char sep);
/**
* Make a new table
@@ -310,19 +314,20 @@ APR_DECLARE(apr_btable_t *) apr_make_btable(struct apr_pool_t *p, int nelts);
* @param p The pool to allocate the new table out of
* @param t The table to copy
* @return A copy of the table passed in
- * @deffunc apr_table_t *) apr_copy_table(apr_pool_t *p, const apr_table_t *t)
+ * @deffunc apr_table_t *apr_copy_table(apr_pool_t *p, const apr_table_t *t)
*/
APR_DECLARE(apr_table_t *) apr_copy_table(struct apr_pool_t *p,
- const apr_table_t *t);
+ const apr_table_t *t);
+
/**
* Create a new binary table and copy another table into it
* @param p The pool to allocate the new table out of
* @param t The table to copy
* @return A copy of the table passed in
- * @deffunc apr_table_t *) apr_copy_btable(apr_pool_t *p, const apr_btable_t *t)
+ * @deffunc apr_table_t *apr_copy_btable(apr_pool_t *p, const apr_btable_t *t)
*/
APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p,
- const apr_btable_t *t);
+ const apr_btable_t *t);
/**
* Delete all of the elements from a table
@@ -330,6 +335,7 @@ APR_DECLARE(apr_btable_t *) apr_copy_btable(struct apr_pool_t *p,
* @deffunc void apr_clear_table(apr_table_t *t)
*/
APR_DECLARE(void) apr_clear_table(apr_table_t *t);
+
/**
* Delete all of the elements from a binary table
* @param t The table to clear
@@ -346,6 +352,7 @@ APR_DECLARE(void) apr_clear_btable(apr_btable_t *t);
* @deffunc const char *apr_table_get(const apr_table_t *t, const char *key)
*/
APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key);
+
/**
* Get the value associated with a given key from a binary table. After this
* call, the data is still in the table.
@@ -355,7 +362,7 @@ APR_DECLARE(const char *) apr_table_get(const apr_table_t *t, const char *key);
* @deffunc const apr_item_t *apr_btable_get(const apr_btable_t *t, const char *key)
*/
APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t,
- const char *key);
+ const char *key);
/**
* Add a key/value pair to a table, if another element already exists with the
@@ -368,7 +375,8 @@ APR_DECLARE(const apr_item_t *) apr_btable_get(const apr_btable_t *t,
* @deffunc void apr_table_set(apr_table_t *t, const char *key, const char *val)
*/
APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key,
- const char *val);
+ const char *val);
+
/**
* Add a key/value pair to a binary table if another element already exists
* with the same key, this will over-write the old data.
@@ -381,7 +389,7 @@ APR_DECLARE(void) apr_table_set(apr_table_t *t, const char *key,
* @deffunc void apr_btable_set(apr_btable_t *t, const char *key, size_t size, const void *val)
*/
APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key,
- size_t size, const void *val);
+ size_t size, const void *val);
/**
* Add a key/value pair to a table, if another element already exists with the
@@ -395,7 +403,7 @@ APR_DECLARE(void) apr_btable_set(apr_btable_t *t, const char *key,
* @deffunc void apr_table_setn(apr_table_t *t, const char *key, const char *val)
*/
APR_DECLARE(void) apr_table_setn(apr_table_t *t, const char *key,
- const char *val);
+ const char *val);
/**
* Add a key/value pair to a binary table if another element already exists
* with the same key, this will over-write the old data.
@@ -418,6 +426,7 @@ APR_DECLARE(void) apr_btable_setn(apr_btable_t *t, const char *key,
* @deffunc void apr_table_unset(apr_table_t *t, const char *key)
*/
APR_DECLARE(void) apr_table_unset(apr_table_t *t, const char *key);
+
/**
* Remove data from a binary table
* @param t The table to remove data from
@@ -436,7 +445,8 @@ APR_DECLARE(void) apr_btable_unset(apr_btable_t *t, const char *key);
* @deffunc void apr_table_merge(apr_table_t *t, const char *key, const char *val)
*/
APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
- const char *val);
+ const char *val);
+
/**
* Add data to a table by merging the value with data that has already been
* stored
@@ -447,7 +457,7 @@ APR_DECLARE(void) apr_table_merge(apr_table_t *t, const char *key,
* @deffunc void apr_table_mergen(apr_table_t *t, const char *key, const char *val)
*/
APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key,
- const char *val);
+ const char *val);
/**
* Add data to a table, regardless of whether there is another element with the
@@ -460,7 +470,8 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key,
* @deffunc void apr_table_add(apr_table_t *t, const char *key, const char *val)
*/
APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key,
- const char *val);
+ const char *val);
+
/**
* Add data to a binary table, regardless of whether there is another element
* with the same key.
@@ -473,7 +484,7 @@ APR_DECLARE(void) apr_table_add(apr_table_t *t, const char *key,
* @deffunc void apr_btable_add(apr_btable_t *t, const char *key, size_t size, const char *val)
*/
APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key,
- size_t size, const void *val);
+ size_t size, const void *val);
/**
* Add data to a table, regardless of whether there is another element with the
@@ -487,7 +498,8 @@ APR_DECLARE(void) apr_btable_add(apr_btable_t *t, const char *key,
* @deffunc void apr_table_addn(apr_table_t *t, const char *key, const char *val)
*/
APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key,
- const char *val);
+ const char *val);
+
/**
* Add data to a binary table, regardless of whether there is another element
* with the same key.
@@ -501,7 +513,7 @@ APR_DECLARE(void) apr_table_addn(apr_table_t *t, const char *key,
* @deffunc void apr_btable_addn(apr_btable_t *t, const char *key, size_t size, const char *val)
*/
APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key,
- size_t size, const void *val);
+ size_t size, const void *val);
/**
* Merge two tables into one new table
@@ -512,8 +524,8 @@ APR_DECLARE(void) apr_btable_addn(apr_btable_t *t, const char *key,
* @deffunc apr_table_t *apr_overlay_tables(apr_pool_t *p, const apr_table_t *overlay, const apr_table_t *base);
*/
APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p,
- const apr_table_t *overlay,
- const apr_table_t *base);
+ const apr_table_t *overlay,
+ const apr_table_t *base);
/**
* Merge two binary tables into one new table
* @param p The pool to use for the new table
@@ -523,8 +535,8 @@ APR_DECLARE(apr_table_t *) apr_overlay_tables(struct apr_pool_t *p,
* @deffunc apr_btable_t *apr_overlay_tables(apr_pool_t *p, const apr_btable_t *overlay, const apr_btable_t *base);
*/
APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p,
- const apr_btable_t *overlay,
- const apr_btable_t *base);
+ const apr_btable_t *overlay,
+ const apr_btable_t *base);
/**
* Iterate over a table running the provided function once for every
@@ -540,9 +552,9 @@ APR_DECLARE(apr_btable_t *) apr_overlay_btables(struct apr_pool_t *p,
* are run.
* @deffunc void apr_table_do(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, ...)
*/
-APR_DECLARE(void)
- apr_table_do(int (*comp) (void *, const char *, const char *),
- void *rec, const apr_table_t *t, ...);
+APR_DECLARE_NONSTD(void)
+ apr_table_do(int (*comp) (void *, const char *, const char *),
+ void *rec, const apr_table_t *t, ...);
/**
* Iterate over a table running the provided function once for every
@@ -559,8 +571,8 @@ APR_DECLARE(void)
* @deffunc void apr_table_vdo(int (*comp) (void *, const char *, const char *), void *rec, const apr_table_t *t, va_list vp)
*/
APR_DECLARE(void)
- apr_table_vdo(int (*comp) (void *, const char *, const char *),
- void *rec, const apr_table_t *t, va_list);
+ apr_table_vdo(int (*comp) (void *, const char *, const char *),
+ void *rec, const apr_table_t *t, va_list);
/* Conceptually, apr_overlap_tables does this:
*
@@ -599,7 +611,7 @@ APR_DECLARE(void)
* @deffunc void apr_overlap_tables(apr_table_t *a, const apr_table_t *b, unsigned flags)
*/
APR_DECLARE(void) apr_overlap_tables(apr_table_t *a, const apr_table_t *b,
- unsigned flags);
+ unsigned flags);
#ifdef __cplusplus
}
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
index 18452d451..f77bd22e6 100644
--- a/include/apr_thread_proc.h
+++ b/include/apr_thread_proc.h
@@ -157,21 +157,26 @@ struct process_chain {
* Create and initialize a new threadattr variable
* @param new_attr The newly created threadattr.
* @param cont The pool to use
+ * @deffunc apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont)
*/
-apr_status_t apr_create_threadattr(apr_threadattr_t **new_attr, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new_attr,
+ apr_pool_t *cont);
/**
* Set if newly created threads should be created in detach mode.
* @param attr The threadattr to affect
* @param on Thread detach state on or off
+ * @deffunc apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on)
*/
-apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on);
+APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr,
+ apr_int32_t on);
/**
* Get the detach mode for this threadattr.
* @param attr The threadattr to reference
+ * @deffunc apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr)
*/
-apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr);
+APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr);
/**
* Create a new thread of execution
@@ -180,38 +185,47 @@ apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr);
* @param func The function to start the new thread in
* @param data Any data to be passed to the starting function
* @param cont The pool to use
+ * @deffunc apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont)
*/
-apr_status_t apr_create_thread(apr_thread_t **new_thread, apr_threadattr_t *attr,
- apr_thread_start_t func, void *data,
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new_thread,
+ apr_threadattr_t *attr,
+ apr_thread_start_t func,
+ void *data, apr_pool_t *cont);
/**
* stop the current thread
* @param thd The thread to stop
* @param retval The return value to pass back to any thread that cares
+ * @deffunc apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
*/
-apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval);
+APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd,
+ apr_status_t *retval);
/**
* block until the desired thread stops executing.
* @param retval The return value from the dead thread.
* @param thd The thread to join
+ * @deffunc apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd);
*/
-apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd);
+APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
+ apr_thread_t *thd);
/**
* detach a thread
* @param thd The thread to detach
+ * @deffunc apr_status_t apr_thread_detach(apr_thread_t *thd)
*/
-apr_status_t apr_thread_detach(apr_thread_t *thd);
+APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd);
/**
* Return the pool associated with the current thread.
* @param data The user data associated with the thread.
* @param key The key to associate with the data
* @param thread The currently open thread.
+ * @deffunc apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread)
*/
-apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread);
+APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key,
+ apr_thread_t *thread);
/**
* Return the pool associated with the current thread.
@@ -219,47 +233,57 @@ apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thre
* @param key The key to use for associating the data with the tread
* @param cleanup The cleanup routine to use when the thread is destroyed.
* @param thread The currently open thread.
+ * @deffunc apr_status_t apr_set_threaddata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread)
*/
-apr_status_t apr_set_threaddata(void *data, const char *key,
- apr_status_t (*cleanup) (void *),
- apr_thread_t *thread);
+APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key,
+ apr_status_t (*cleanup) (void *),
+ apr_thread_t *thread);
/**
* Create and initialize a new thread private address space
* @param key The thread private handle.
* @param dest The destructor to use when freeing the private memory.
* @param cont The pool to use
+ * @deffunc apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *), apr_pool_t *cont)
*/
-apr_status_t apr_create_thread_private(apr_threadkey_t **key, void (*dest)(void *),
- apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key,
+ void (*dest)(void *),
+ apr_pool_t *cont);
/**
* Get a pointer to the thread private memory
* @param new_mem The data stored in private memory
* @param key The handle for the desired thread private memory
+ * @deffunc apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key)
*/
-apr_status_t apr_get_thread_private(void **new_mem, apr_threadkey_t *key);
+APR_DECLARE(apr_status_t) apr_get_thread_private(void **new_mem,
+ apr_threadkey_t *key);
/**
* Set the data to be stored in thread private memory
* @param priv The data to be stored in private memory
* @param key The handle for the desired thread private memory
+ * @deffunc apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key)
*/
-apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key);
+APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv,
+ apr_threadkey_t *key);
/**
* Free the thread private memory
* @param key The handle for the desired thread private memory
+ * @deffunc apr_status_t apr_delete_thread_private(apr_threadkey_t *key)
*/
-apr_status_t apr_delete_thread_private(apr_threadkey_t *key);
+APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key);
/**
* Return the pool associated with the current threadkey.
* @param data The user data associated with the threadkey.
* @param key The key associated with the data
* @param threadkey The currently open threadkey.
+ * @deffunc apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey)
*/
-apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t *threadkey);
+APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key,
+ apr_threadkey_t *threadkey);
/**
* Return the pool associated with the current threadkey.
@@ -267,10 +291,11 @@ apr_status_t apr_get_threadkeydata(void **data, const char *key, apr_threadkey_t
* @param key The key to associate with the data.
* @param cleanup The cleanup routine to use when the file is destroyed.
* @param threadkey The currently open threadkey.
+ * @deffunc apr_status_t apr_set_threadkeydata(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_threadkey_t *threadkey)
*/
-apr_status_t apr_set_threadkeydata(void *data, const char *key,
- apr_status_t (*cleanup) (void *),
- apr_threadkey_t *threadkey);
+APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key,
+ apr_status_t (*cleanup) (void *),
+ apr_threadkey_t *threadkey);
/* Process Function definitions */
@@ -282,8 +307,10 @@ apr_status_t apr_set_threadkeydata(void *data, const char *key,
* Create and initialize a new procattr variable
* @param new_attr The newly created procattr.
* @param cont The pool to use
+ * @deffunc apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont)
*/
-apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new_attr,
+ apr_pool_t *cont);
/**
* Determine if any of stdin, stdout, or stderr should be linked to pipes
@@ -292,15 +319,18 @@ apr_status_t apr_createprocattr_init(apr_procattr_t **new_attr, apr_pool_t *cont
* @param in Should stdin be a pipe back to the parent?
* @param out Should stdout be a pipe back to the parent?
* @param err Should stderr be a pipe back to the parent?
+ * @deffunc apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err)
*/
-apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in,
- apr_int32_t out, apr_int32_t err);
+APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr,
+ apr_int32_t in, apr_int32_t out,
+ apr_int32_t err);
/**
* Set the child_in and/or parent_in values to existing apr_file_t values.
* @param attr The procattr we care about.
* @param child_in apr_file_t value to use as child_in. Must be a valid file.
* @param parent_in apr_file_t value to use as parent_in. Must be a valid file.
+ * @deffunc apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in)
* @tip This is NOT a required initializer function. This is
* useful if you have already opened a pipe (or multiple files)
* that you wish to use, perhaps persistently across multiple
@@ -308,36 +338,39 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in,
* extra function calls by not creating your own pipe since this
* creates one in the process space for you.
*/
-apr_status_t apr_setprocattr_childin(struct apr_procattr_t *attr, apr_file_t *child_in,
- apr_file_t *parent_in);
+APR_DECLARE(apr_status_t) apr_setprocattr_childin(struct apr_procattr_t *attr,
+ apr_file_t *child_in,
+ apr_file_t *parent_in);
/**
* Set the child_out and parent_out values to existing apr_file_t values.
* @param attr The procattr we care about.
* @param child_out apr_file_t value to use as child_out. Must be a valid file.
* @param parent_out apr_file_t value to use as parent_out. Must be a valid file.
+ * @deffunc apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out)
* @tip This is NOT a required initializer function. This is
* useful if you have already opened a pipe (or multiple files)
* that you wish to use, perhaps persistently across multiple
* process invocations - such as a log file.
*/
-apr_status_t apr_setprocattr_childout(struct apr_procattr_t *attr,
- apr_file_t *child_out,
- apr_file_t *parent_out);
+APR_DECLARE(apr_status_t) apr_setprocattr_childout(struct apr_procattr_t *attr,
+ apr_file_t *child_out,
+ apr_file_t *parent_out);
/**
* Set the child_err and parent_err values to existing apr_file_t values.
* @param attr The procattr we care about.
* @param child_err apr_file_t value to use as child_err. Must be a valid file.
* @param parent_err apr_file_t value to use as parent_err. Must be a valid file.
+ * @deffunc apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err)
* @tip This is NOT a required initializer function. This is
* useful if you have already opened a pipe (or multiple files)
* that you wish to use, perhaps persistently across multiple
* process invocations - such as a log file.
*/
-apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr,
- apr_file_t *child_err,
- apr_file_t *parent_err);
+APR_DECLARE(apr_status_t) apr_setprocattr_childerr(struct apr_procattr_t *attr,
+ apr_file_t *child_err,
+ apr_file_t *parent_err);
/**
* Set which directory the child process should start executing in.
@@ -345,8 +378,10 @@ apr_status_t apr_setprocattr_childerr(struct apr_procattr_t *attr,
* @param dir Which dir to start in. By default, this is the same dir as
* the parent currently resides in, when the createprocess call
* is made.
+ * @deffunc apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir)
*/
-apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir);
+APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr,
+ const char *dir);
/**
* Set what type of command the child process will call.
@@ -356,15 +391,19 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr, const char *dir);
* APR_SHELLCMD -- Shell script
* APR_PROGRAM -- Executable program (default)
* </PRE>
+ * @deffunc apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd)
*/
-apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr, apr_cmdtype_e cmd);
+APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr,
+ apr_cmdtype_e cmd);
/**
* Determine if the chlid should start in detached state.
* @param attr The procattr we care about.
* @param detach Should the child start in detached state? Default is no.
+ * @deffunc apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach)
*/
-apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach);
+APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr,
+ apr_int32_t detach);
#if APR_HAVE_STRUCT_RLIMIT
/**
@@ -377,9 +416,11 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t detach);
* APR_LIMIT_NPROC
* </PRE>
* @param limit Value to set the limit to.
+ * @deffunc apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what, apr_int32_t what, struct rlimit *limit)
*/
-apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what,
- struct rlimit *limit);
+APR_DECLARE(apr_status_t) apr_setprocattr_limit(apr_procattr_t *attr,
+ apr_int32_t what,
+ struct rlimit *limit);
#endif
#if APR_HAS_FORK
@@ -388,8 +429,9 @@ apr_status_t apr_setprocattr_limit(apr_procattr_t *attr, apr_int32_t what,
* a standard unix fork.
* @param proc The resulting process handle.
* @param cont The pool to use.
+ * @deffunc apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont)
*/
-apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_fork(apr_proc_t *proc, apr_pool_t *cont);
#endif
/**
@@ -403,11 +445,14 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont);
* @param attr the procattr we should use to determine how to create the new
* process
* @param cont The pool to use.
+ * @deffunc apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname, const char * const *args, const char * const *env, apr_procattr_t *attr, apr_pool_t *cont)
*/
-apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname,
- const char * const *args,
- const char * const *env,
- apr_procattr_t *attr, apr_pool_t *cont);
+APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new_proc,
+ const char *progname,
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr,
+ apr_pool_t *cont);
/**
* Wait for a child process to die
@@ -418,14 +463,15 @@ apr_status_t apr_create_process(apr_proc_t *new_proc, const char *progname,
* APR_NOWAIT -- return immediately regardless of if the
* child is dead or not.
* </PRE>
+ * @deffunc apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow)
* @tip The childs status is in the return code to this process. It is one of:
* <PRE>
* APR_CHILD_DONE -- child is no longer running.
* APR_CHILD_NOTDONE -- child is still running.
* </PRE>
*/
-apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow);
-
+APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc,
+ apr_wait_how_e waithow);
/**
* Wait for any current child process to die and return information
@@ -442,9 +488,12 @@ apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e waithow);
* child is dead or not.
* </PRE>
* @param p Pool to allocate child information out of.
+ * @deffunc apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, apr_wait_how_e waithow, apr_pool_t *p)
*/
-apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status,
- apr_wait_how_e waithow, apr_pool_t *p);
+APR_DECLARE(apr_status_t) apr_wait_all_procs(apr_proc_t *proc,
+ apr_wait_t *status,
+ apr_wait_how_e waithow,
+ apr_pool_t *p);
/**
* Detach the process from the controlling terminal.
@@ -452,6 +501,7 @@ apr_status_t apr_wait_all_procs(apr_proc_t *proc, apr_wait_t *status,
apr_status_t apr_detach(void);
#if APR_HAS_OTHER_CHILD
+
/**
* Register an other_child -- a child which must be kept track of so
* that the program knows when it has dies or disappeared.
@@ -463,49 +513,59 @@ apr_status_t apr_detach(void);
* then the maintenance is invoked with reason
* OC_REASON_UNWRITABLE.
* @param p The pool to use for allocating memory.
+ * @deffunc void apr_register_other_child(apr_proc_t *pid, void (*maintenance) (int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p)
*/
-void apr_register_other_child(apr_proc_t *pid,
- void (*maintenance) (int reason, void *, int status),
- void *data, apr_file_t *write_fd, apr_pool_t *p);
+APR_DECLARE(void) apr_register_other_child(apr_proc_t *pid,
+ void (*maintenance) (int reason,
+ void *,
+ int status),
+ void *data, apr_file_t *write_fd,
+ apr_pool_t *p);
/**
* Stop watching the specified process.
* @param data The data to pass to the maintenance function. This is
* used to find the process to unregister.
+ * @deffunc void apr_unregister_other_child(void *data)
* @tip Since this can be called by a maintenance function while we're
* scanning the other_children list, all scanners should protect
* themself by loading ocr->next before calling any maintenance
* function.
*/
-void apr_unregister_other_child(void *data);
+APR_DECLARE(void) apr_unregister_other_child(void *data);
/**
* Check on the specified process. If it is gone, call the maintenance
* function.
* @param pid The process to check.
* @param status The status to pass to the maintenance function.
+ * @deffunc apr_status_t apr_reap_other_child(apr_proc_t *pid, int status);
*/
-apr_status_t apr_reap_other_child(apr_proc_t *pid, int status);
+APR_DECLARE(apr_status_t) apr_reap_other_child(apr_proc_t *pid, int status);
/**
* Loop through all registered other_children and call the appropriate
* maintenance function when necessary.
+ * @deffunc void apr_check_other_child();
*/
-void apr_check_other_child(void);
+APR_DECLARE(void) apr_check_other_child(void);
/**
* Ensure all the registered write_fds are still writable, otherwise
* invoke the maintenance functions as appropriate.
+ * @deffunc void apr_probe_writable_fds()
*/
-void apr_probe_writable_fds(void);
+APR_DECLARE(void) apr_probe_writable_fds(void);
+
#endif /* APR_HAS_OTHER_CHILD */
/**
* Terminate a process.
* @param proc The process to terminate.
* @param sig How to kill the process.
+ * @deffunc apr_status_t apr_kill(apr_proc_t *proc, int sig)
*/
-apr_status_t apr_kill(apr_proc_t *proc, int sig);
+APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int sig);
/**
* Register a process to be killed when a pool dies.
diff --git a/include/apr_time.h b/include/apr_time.h
index d0aff4d6e..0f520aa8f 100644
--- a/include/apr_time.h
+++ b/include/apr_time.h
@@ -90,8 +90,9 @@ typedef apr_int32_t apr_interval_time_t;
/**
* return the current time
+ * @deffunc apr_time_t apr_now(void)
*/
-apr_time_t apr_now(void);
+APR_DECLARE(apr_time_t) apr_now(void);
typedef struct apr_exploded_time_t apr_exploded_time_t;
/**
@@ -128,37 +129,46 @@ struct apr_exploded_time_t {
* convert an ansi time_t to an apr_time_t
* @param result the resulting apr_time_t
* @param input the time_t to convert
+ * @deffunc apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input)
*/
-apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input);
+APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result,
+ time_t input);
/**
* convert a time to its human readable components in GMT timezone
* @param result the exploded time
* @param input the time to explode
+ * @deffunc apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input)
*/
-apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input);
+APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result,
+ apr_time_t input);
/**
* convert a time to its human readable components in local timezone
* @param result the exploded time
* @param input the time to explode
+ * @deffunc apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input)
*/
-apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input);
+APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result,
+ apr_time_t input);
/**
* Convert time value from human readable format to number of seconds
* since epoch
* @param result the resulting imploded time
* @param input the input exploded time
+ * @deffunc apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input)
*/
-apr_status_t apr_implode_time(apr_time_t *result, apr_exploded_time_t *input);
+APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *result,
+ apr_exploded_time_t *input);
/**
* Sleep for the specified number of micro-seconds.
* @param t desired amount of time to sleep.
+ * @deffunc void apr_sleep(apr_interval_time_t t)
* @tip May sleep for longer than the specified time.
*/
-void apr_sleep(apr_interval_time_t t);
+APR_DECLARE(void) apr_sleep(apr_interval_time_t t);
#define APR_RFC822_DATE_LEN (30)
/**
@@ -168,8 +178,9 @@ void apr_sleep(apr_interval_time_t t);
* including trailing \0
* @param date_str String to write to.
* @param t the time to convert
+ * @deffunc apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
*/
-apr_status_t apr_rfc822_date(char *date_str, apr_time_t t);
+APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t);
#define APR_CTIME_LEN (25)
/**
@@ -179,8 +190,9 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t);
* including trailing \0
* @param date_str String to write to.
* @param t the time to convert
+ * @deffunc apr_status_t apr_ctime(char *date_str, apr_time_t t)
*/
-apr_status_t apr_ctime(char *date_str, apr_time_t t);
+APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t);
/**
* formats the exploded time according to the format specified
@@ -189,8 +201,11 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t);
* @param max The maximum length of the string
* @param format The format for the time string
* @param tm The time to convert
+ * @deffunc apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *tm)
*/
-apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_exploded_time_t *tm);
+APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
+ apr_size_t max, const char *format,
+ apr_exploded_time_t *tm);
#ifdef __cplusplus
}
diff --git a/include/apr_uuid.h b/include/apr_uuid.h
index a401a6256..c33b70351 100644
--- a/include/apr_uuid.h
+++ b/include/apr_uuid.h
@@ -58,6 +58,10 @@
#include "apr.h"
#include "apr_errno.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/**
* @package APR UUID Handling
*/
@@ -76,7 +80,7 @@ typedef struct {
* @param uuid The resulting UUID
* @deffunc void apr_get_uuid(apr_uuid_t *uuid)
*/
-void apr_get_uuid(apr_uuid_t *uuid);
+APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid);
/**
* Format a UUID into a string, following the standard format
@@ -84,9 +88,9 @@ void apr_get_uuid(apr_uuid_t *uuid);
* be at least APR_UUID_FORMATTED_LENGTH + 1 bytes long to hold
* the formatted UUID and a null terminator
* @param uuid The UUID to format
- * @deffunc void apr_format_uuid(apr_pool_t *p, const apr_uuid_t *uuid)
+ * @deffunc void apr_format_uuid(char *buffer, const apr_uuid_t *uuid)
*/
-void apr_format_uuid(char *buffer, const apr_uuid_t *uuid);
+APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid);
/**
* Parse a standard-format string into a UUID
@@ -94,6 +98,10 @@ void apr_format_uuid(char *buffer, const apr_uuid_t *uuid);
* @param uuid_str The formatted UUID
* @deffunc apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str)
*/
-apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str);
+APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str);
+
+#ifdef __cplusplus
+}
+#endif
#endif /* APR_UUID_H */
diff --git a/include/apr_xlate.h b/include/apr_xlate.h
index 3b35e7997..dd8bd0bff 100644
--- a/include/apr_xlate.h
+++ b/include/apr_xlate.h
@@ -83,6 +83,7 @@ typedef struct apr_xlate_t apr_xlate_t;
* @param topage The name of the target charset
* @param frompage The name of the source charset
* @param pool The pool to use
+ * @deffunc apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage, const char *frompage, apr_pool_t *pool)
* @tip
* <PRE>
* Specify APR_DEFAULT_CHARSET for one of the charset
@@ -98,8 +99,10 @@ typedef struct apr_xlate_t apr_xlate_t;
* names to indicate the charset of the current locale.
* </PRE>
*/
-apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage,
- const char *frompage, apr_pool_t *pool);
+APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset,
+ const char *topage,
+ const char *frompage,
+ apr_pool_t *pool);
#define APR_DEFAULT_CHARSET (const char *)0
#define APR_LOCALE_CHARSET (const char *)1
@@ -109,9 +112,10 @@ apr_status_t apr_xlate_open(apr_xlate_t **convset, const char *topage,
* @param convset The handle allocated by apr_xlate_open, specifying the
* parameters of conversion
* @param onoff Output: whether or not the conversion is single-byte-only
+ * @deffunc apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff)
*/
-apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff);
+APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff)
/**
* Convert a buffer of text from one codepage to another.
@@ -123,10 +127,13 @@ apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff);
* @param outbuf The address of the destination buffer
* @param outbytes_left Input: the size of the output buffer
* Output: the amount of the output buffer not yet used
+ * @deffunc apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf, apr_size_t *inbytes_left, char *outbuf, apr_size_t *outbytes_left)
*/
-apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf,
- apr_size_t *inbytes_left, char *outbuf,
- apr_size_t *outbytes_left);
+APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset,
+ const char *inbuf,
+ apr_size_t *inbytes_left,
+ char *outbuf,
+ apr_size_t *outbytes_left);
/* See the comment in apr_file_io.h about this hack */
#ifdef APR_NOT_DONE_YET
@@ -138,8 +145,10 @@ apr_status_t apr_xlate_conv_buffer(apr_xlate_t *convset, const char *inbuf,
* parameters of conversion
* @param inchar The character to convert
* @param outchar The converted character
+ * @deffunc apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar)
*/
-apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar);
+APR_DECLARE(apr_status_t) apr_xlate_conv_char(apr_xlate_t *convset,
+ char inchar, char outchar);
#endif
/**
@@ -147,16 +156,19 @@ apr_status_t apr_xlate_conv_char(apr_xlate_t *convset, char inchar, char outchar
* @param convset The handle allocated by apr_xlate_open, specifying the
* parameters of conversion
* @param inchar The single-byte character to convert.
+ * @deffunc apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar)
* @tip This only works when converting between single-byte character sets.
* -1 will be returned if the conversion can't be performed.
*/
-apr_int32_t apr_xlate_conv_byte(apr_xlate_t *convset, unsigned char inchar);
+APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset,
+ unsigned char inchar);
/**
* Close a codepage translation handle.
* @param convset The codepage translation handle to close
+ * @deffunc apr_status_t apr_xlate_close(apr_xlate_t *convset)
*/
-apr_status_t apr_xlate_close(apr_xlate_t *convset);
+APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset);
#else
diff --git a/include/arch/win32/fileio.h b/include/arch/win32/fileio.h
index 66ffd3bea..3fb7bd0cc 100644
--- a/include/arch/win32/fileio.h
+++ b/include/arch/win32/fileio.h
@@ -174,8 +174,6 @@ struct apr_file_t {
char *fname;
} n;
};
- apr_canon_t *canonname;
-
DWORD dwFileAttributes;
int eof_hit;
BOOLEAN buffered; // Use buffered I/O?
diff --git a/libapr.def b/libapr.def
deleted file mode 100644
index 557f7fd2c..000000000
--- a/libapr.def
+++ /dev/null
@@ -1,281 +0,0 @@
-; libapr.def :
-
-LIBRARY libapr
-DESCRIPTION ''
-
-EXPORTS
-; Add new API calls to the end of this list.
-; apr_file_io.h
- apr_open
- apr_close
- apr_remove_file
- apr_rename_file
- apr_eof
- apr_read
- apr_write
- apr_writev
- apr_full_read
- apr_full_write
- apr_putc
- apr_getc
- apr_ungetc
- apr_fgets
- apr_puts
- apr_flush
- apr_dupfile
- apr_getfileinfo
- apr_setfileperms
- apr_stat
- apr_lstat
- apr_seek
- apr_dir_open
- apr_closedir
- apr_readdir
- apr_rewinddir
- apr_make_dir
- apr_remove_dir
- apr_dir_entry_size
- apr_dir_entry_mtime
- apr_dir_entry_ftype
- apr_get_dir_filename
-; apr_get_filename
- apr_create_pipe
-; apr_create_namedpipe
-; apr_set_pipe_timeout
- apr_get_filedata
- apr_set_filedata
- apr_get_os_file
- apr_put_os_file
- apr_get_os_dir
- apr_fprintf
- apr_lock_file
- apr_unlock_file
-
-;
-; apr_network_io.h
- apr_get_sockaddr
- apr_getaddrinfo
- apr_create_socket
- apr_shutdown
- apr_close_socket
- apr_bind
- apr_listen
- apr_accept
- apr_connect
- apr_gethostname
- apr_send
- apr_recv
- apr_setsocketopt
- apr_sendv
- apr_sendfile
- apr_setup_poll
- apr_poll
- apr_add_poll_socket
- apr_get_revents
- apr_get_socketdata
- apr_set_socketdata
- apr_get_polldata
- apr_set_polldata
- apr_make_os_sock
- apr_put_os_sock
- apr_get_os_sock
- apr_remove_poll_socket
- apr_clear_poll_sockets
- apr_getsocketopt
- apr_get_ipaddr
- apr_set_ipaddr
- apr_get_port
- apr_set_port
- apr_parse_addr_port
- apr_getnameinfo
-
-;
-;
-; apr_thread_proc.h
- apr_createprocattr_init
- apr_setprocattr_io
- apr_setprocattr_dir
- apr_setprocattr_cmdtype
- apr_setprocattr_detach
- apr_setprocattr_childin
- apr_setprocattr_childout
- apr_setprocattr_childerr
- apr_create_process
-;
-;
-;
- apr_wait_proc
- apr_kill
- apr_create_threadattr
- apr_setthreadattr_detach
- apr_getthreadattr_detach
- apr_create_thread
- apr_thread_exit
- apr_thread_join
- apr_thread_detach
-;
- apr_create_thread_private
- apr_get_thread_private
- apr_set_thread_private
- apr_delete_thread_private
- apr_get_threaddata
- apr_set_threaddata
- apr_get_threadkeydata
- apr_set_threadkeydata
-;
-;
-;
- apr_get_os_thread
- apr_get_os_threadkey
-
-
- apr_create_pool
-;
-;
-;
- apr_get_userdata
- apr_set_userdata
- apr_initialize
-; apr_make_time
- apr_ansi_time_to_apr_time
- apr_now
- apr_explode_gmt
- apr_explode_localtime
- apr_implode_time
- apr_get_os_imp_time
- apr_get_os_exp_time
- apr_put_os_imp_time
- apr_put_os_exp_time
- apr_ctime
- apr_rfc822_date
- apr_strftime
-;
-;
-;
-;
-;
-;
-;
-;
-;
-;
- apr_MD5Final
- apr_MD5Init
- apr_MD5Update
- apr_cpystrn
- apr_register_cleanup
- apr_kill_cleanup
- apr_fnmatch
- apr_is_fnmatch
- apr_MD5Encode
- apr_validate_password
-;
-; apr_pools.h
- apr_make_sub_pool
- apr_init_alloc
- apr_clear_pool
- apr_destroy_pool
- apr_bytes_in_pool
- apr_bytes_in_free_blocks
- apr_palloc
- apr_pcalloc
- apr_pstrdup
- apr_pstrndup
- apr_pstrcat
- apr_pvsprintf
- apr_psprintf
-;
-; apr_tables.h
- apr_make_array
- apr_push_array
- apr_array_cat
- apr_copy_array
- apr_copy_array_hdr
- apr_append_arrays
- apr_array_pstrcat
- apr_make_table
- apr_copy_table
- apr_clear_table
- apr_table_get
- apr_table_set
- apr_table_setn
- apr_table_unset
- apr_table_merge
- apr_table_mergen
- apr_table_add
- apr_table_addn
- apr_overlay_tables
- apr_table_do
- apr_table_vdo
- apr_overlap_tables
-;
-;
- apr_run_cleanup
- apr_cleanup_for_exec
- apr_null_cleanup
- apr_note_subprocess
-;
- apr_vformatter
- apr_snprintf
- apr_vsnprintf
- apr_getpass
-
- apr_tokenize_to_argv
- apr_filename_of_pathname
-
- apr_open_stderr
- apr_get_pipe_timeout
- apr_set_pipe_timeout
- apr_terminate
- apr_dso_load
- apr_dso_unload
- apr_dso_sym
- apr_collapse_spaces
- apr_month_snames
- apr_day_snames
- apr_strerror
- apr_generate_random_bytes
- apr_strnatcmp
- apr_strnatcasecmp
- apr_dso_error
-;
-; apr_hash.h
- apr_make_hash
- apr_hash_set
- apr_hash_get
- apr_hash_first
- apr_hash_next
- apr_hash_this
- apr_hash_count
-;
-; apr_lock.h
- apr_create_lock
- apr_lock
- apr_unlock
- apr_destroy_lock
- apr_child_init_lock
- apr_get_lockdata
- apr_set_lockdata
- apr_get_os_lock
-;
-; apr_uuid.h
- apr_format_uuid
- apr_parse_uuid
- apr_get_uuid
-
-; apr_mmap.h
- apr_mmap_create
- apr_mmap_delete
- apr_mmap_offset
-
-; Moved out of the way for Bill Stoddard's reorg
-;
-; apr_getopt.h
- apr_getopt
- apr_initopt
-; apr_opterr
-; apr_optind
-; apr_optopt
-; apr_optreset
-; apr_optarg
-
diff --git a/libapr.dsp b/libapr.dsp
index b33699aa5..87e3333bc 100644
--- a/libapr.dsp
+++ b/libapr.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\libapr" /FD /c
+# ADD CPP /nologo /MD /W3 /O2 /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "NDEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Release\apr" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
# ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -52,8 +52,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386
-# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386
+# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 /OPT:NOREF
+# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /machine:I386 /OPT:NOREF
!ELSEIF "$(CFG)" == "libapr - Win32 Debug"
@@ -69,7 +69,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\libapr" /FD /c
+# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "./include" /I "./include/arch" /I "./include/arch/win32" /I "./include/arch/unix" /D "_DEBUG" /D "APR_DECLARE_EXPORT" /D "WIN32" /D "_WINDOWS" /Fd"Debug\apr" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -78,8 +78,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386
-# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386
+# ADD BASE LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF
+# ADD LINK32 kernel32.lib advapi32.lib ws2_32.lib mswsock.lib ole32.lib /nologo /base:"0x6EE0000" /subsystem:windows /dll /incremental:no /map /debug /machine:I386 /OPT:NOREF
!ENDIF
@@ -87,13 +87,442 @@ LINK32=link.exe
# Name "libapr - Win32 Release"
# Name "libapr - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ".c"
+# Begin Group "time"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\time\win32\access.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\atime.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\time\win32\time.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\time\win32\timestr.c
+# End Source File
+# End Group
+# Begin Group "strings"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\strings\apr_cpystrn.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strings\apr_fnmatch.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strings\apr_snprintf.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strings\apr_strings.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strings\apr_strnatcmp.c
+# End Source File
+# End Group
+# Begin Group "passwd"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\passwd\apr_getpass.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\passwd\apr_md5.c
+# End Source File
+# End Group
+# Begin Group "tables"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\tables\apr_hash.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\tables\apr_tables.c
+# End Source File
+# End Group
+# Begin Group "misc"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\misc\unix\errorcodes.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\unix\getopt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\win32\getuuid.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\win32\misc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\unix\misc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\win32\names.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\win32\rand.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\unix\start.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\misc\unix\uuid.c
+# End Source File
+# End Group
+# Begin Group "file_io"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\file_io\win32\canonfile.c
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\unix\fileacc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\filedup.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\fileio.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\filestat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\flock.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\unix\fullrw.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\open.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\pipe.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\readwrite.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_io\win32\seek.c
+# End Source File
+# End Group
+# Begin Group "locks"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\locks\win32\locks.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\locks.h
+# End Source File
+# End Group
+# Begin Group "network_io"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\network_io\unix\inet_ntop.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\networkio.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\network_io\win32\poll.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\network_io\unix\sa_common.c
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\network_io\win32\sendrecv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\network_io\win32\sockaddr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\network_io\win32\sockets.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\network_io\win32\sockopt.c
+# End Source File
+# End Group
+# Begin Group "threadproc"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\threadproc\win32\proc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\threadproc\win32\signals.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\threadproc\win32\thread.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\threadproc\win32\threadpriv.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\threadproc.h
+# End Source File
+# End Group
+# Begin Group "dso"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\dso\win32\dso.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\dso.h
+# End Source File
+# End Group
+# Begin Group "lib"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\lib\apr_pools.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\lib\apr_signal.c
+# End Source File
+# End Group
+# Begin Group "i18n"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\include\arch\unix\i18n.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\i18n\unix\utf8_ucs2.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\i18n\unix\xlate.c
+# PROP Exclude_From_Build 1
+# End Source File
+# End Group
+# Begin Group "shmem"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\shmem\win32\shmem.c
+# PROP Exclude_From_Build 1
+# End Source File
+# End Group
+# Begin Group "mmap"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\mmap\unix\common.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\mmap\win32\mmap.c
+# End Source File
+# End Group
+# End Group
+# Begin Group "Generated Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\include\apr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr.h.in
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr.hw
+
+!IF "$(CFG)" == "libapr - Win32 Release"
+
+# Begin Custom Build
+InputPath=.\include\apr.hw
+
+".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy .\include\apr.hw .\include\apr.h > nul
+ echo Created apr.h from apr.hw
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "libapr - Win32 Debug"
+
+# Begin Custom Build
+InputPath=.\include\apr.hw
+
+".\include\apr.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ copy .\include\apr.hw .\include\apr.h > nul
+ echo Created apr.h from apr.hw
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\arch\win32\apr_private.h
+# End Source File
+# End Group
+# Begin Group "External Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\include\apr_compat.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_dso.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_errno.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_file_io.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_fnmatch.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_general.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_getopt.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_hash.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_lib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_lock.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_md5.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_mmap.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_network_io.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_pools.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_portable.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_shmem.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_strings.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_tables.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_thread_proc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\apr_time.h
+# End Source File
# Begin Source File
-SOURCE=.\misc\win32\libapr.c
+SOURCE=.\include\apr_uuid.h
# End Source File
# Begin Source File
-SOURCE=.\libapr.def
+SOURCE=.\include\apr_xlate.h
# End Source File
+# End Group
# End Target
# End Project
diff --git a/locks/win32/locks.c b/locks/win32/locks.c
index 67940bb5e..701e2c281 100644
--- a/locks/win32/locks.c
+++ b/locks/win32/locks.c
@@ -57,9 +57,11 @@
#include "win32/locks.h"
#include "apr_portable.h"
-apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type,
- apr_lockscope_e scope, const char *fname,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_create_lock(apr_lock_t **lock,
+ apr_locktype_e type,
+ apr_lockscope_e scope,
+ const char *fname,
+ apr_pool_t *cont)
{
apr_lock_t *newlock;
SECURITY_ATTRIBUTES sec;
@@ -92,8 +94,9 @@ apr_status_t apr_create_lock(apr_lock_t **lock, apr_locktype_e type,
return APR_SUCCESS;
}
-apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_child_init_lock(apr_lock_t **lock,
+ const char *fname,
+ apr_pool_t *cont)
{
/* This routine should not be called (and OpenMutex will fail if called)
* on a INTRAPROCESS lock
@@ -112,7 +115,7 @@ apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname,
return APR_SUCCESS;
}
-apr_status_t apr_lock(apr_lock_t *lock)
+APR_DECLARE(apr_status_t) apr_lock(apr_lock_t *lock)
{
DWORD rv;
if (lock->scope == APR_INTRAPROCESS) {
@@ -128,7 +131,7 @@ apr_status_t apr_lock(apr_lock_t *lock)
return apr_get_os_error();
}
-apr_status_t apr_unlock(apr_lock_t *lock)
+APR_DECLARE(apr_status_t) apr_unlock(apr_lock_t *lock)
{
if (lock->scope == APR_INTRAPROCESS) {
LeaveCriticalSection(&lock->section);
@@ -141,7 +144,7 @@ apr_status_t apr_unlock(apr_lock_t *lock)
return APR_SUCCESS;
}
-apr_status_t apr_destroy_lock(apr_lock_t *lock)
+APR_DECLARE(apr_status_t) apr_destroy_lock(apr_lock_t *lock)
{
if (lock->scope == APR_INTRAPROCESS) {
DeleteCriticalSection(&lock->section);
@@ -154,25 +157,29 @@ apr_status_t apr_destroy_lock(apr_lock_t *lock)
return APR_SUCCESS;
}
-apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data)
+APR_DECLARE(apr_status_t) apr_get_lockdata(apr_lock_t *lock, const char *key,
+ void *data)
{
return apr_get_userdata(data, key, lock->cntxt);
}
-apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key,
- apr_status_t (*cleanup) (void *))
+APR_DECLARE(apr_status_t) apr_set_lockdata(apr_lock_t *lock, void *data,
+ const char *key,
+ apr_status_t (*cleanup) (void *))
{
return apr_set_userdata(data, key, cleanup, lock->cntxt);
}
-apr_status_t apr_get_os_lock(apr_os_lock_t *thelock, apr_lock_t *lock)
+APR_DECLARE(apr_status_t) apr_get_os_lock(apr_os_lock_t *thelock,
+ apr_lock_t *lock)
{
*thelock = lock->mutex;
return APR_SUCCESS;
}
-apr_status_t apr_put_os_lock(apr_lock_t **lock, apr_os_lock_t *thelock,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_lock(apr_lock_t **lock,
+ apr_os_lock_t *thelock,
+ apr_pool_t *cont)
{
if (cont == NULL) {
return APR_ENOPOOL;
diff --git a/misc/unix/errorcodes.c b/misc/unix/errorcodes.c
index a454ada4f..cfa879f43 100644
--- a/misc/unix/errorcodes.c
+++ b/misc/unix/errorcodes.c
@@ -346,7 +346,8 @@ static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err)
}
#endif
-char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize)
+APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf,
+ apr_size_t bufsize)
{
if (statcode < APR_OS_START_ERROR) {
return stuffbuffer(buf, bufsize, strerror(statcode));
diff --git a/misc/unix/start.c b/misc/unix/start.c
index 0cd81cd87..f208c2019 100644
--- a/misc/unix/start.c
+++ b/misc/unix/start.c
@@ -63,7 +63,7 @@
static int initialized = 0;
static apr_pool_t *global_apr_pool;
-apr_status_t apr_initialize(void)
+APR_DECLARE(apr_status_t) apr_initialize(void)
{
apr_status_t status;
#if defined WIN32
@@ -98,7 +98,7 @@ apr_status_t apr_initialize(void)
return status;
}
-void apr_terminate(void)
+APR_DECLARE(void) apr_terminate(void)
{
initialized--;
if (initialized) {
@@ -107,7 +107,7 @@ void apr_terminate(void)
apr_term_alloc(global_apr_pool);
}
-apr_status_t apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_set_abort(int (*apr_abort)(int retcode), apr_pool_t *cont)
{
cont->apr_abort = apr_abort;
return APR_SUCCESS;
diff --git a/misc/unix/uuid.c b/misc/unix/uuid.c
index 1a3401b50..dc3580818 100644
--- a/misc/unix/uuid.c
+++ b/misc/unix/uuid.c
@@ -60,7 +60,7 @@
#include "apr_lib.h"
-void apr_format_uuid(char *buffer, const apr_uuid_t *uuid)
+APR_DECLARE(void) apr_format_uuid(char *buffer, const apr_uuid_t *uuid)
{
const unsigned char *d = uuid->data;
@@ -95,7 +95,8 @@ static unsigned char parse_hexpair(const char *s)
return (unsigned char)result;
}
-apr_status_t apr_parse_uuid(apr_uuid_t *uuid, const char *uuid_str)
+APR_DECLARE(apr_status_t) apr_parse_uuid(apr_uuid_t *uuid,
+ const char *uuid_str)
{
int i;
unsigned char *d = uuid->data;
diff --git a/misc/win32/getuuid.c b/misc/win32/getuuid.c
index 5af3636e7..465ef215c 100644
--- a/misc/win32/getuuid.c
+++ b/misc/win32/getuuid.c
@@ -62,7 +62,7 @@
#include "apr.h"
#include "apr_uuid.h"
-void apr_get_uuid(apr_uuid_t *uuid)
+APR_DECLARE(void) apr_get_uuid(apr_uuid_t *uuid)
{
GUID guid;
diff --git a/misc/win32/rand.c b/misc/win32/rand.c
index deeacff73..e81b2deda 100644
--- a/misc/win32/rand.c
+++ b/misc/win32/rand.c
@@ -56,7 +56,8 @@
#include "apr_general.h"
#include <wincrypt.h>
-apr_status_t apr_generate_random_bytes(unsigned char * buf, int length)
+APR_DECLARE(apr_status_t) apr_generate_random_bytes(unsigned char * buf,
+ int length)
{
HCRYPTPROV hProv;
apr_status_t res = APR_SUCCESS;
diff --git a/mmap/unix/common.c b/mmap/unix/common.c
index f2a84438f..cec98e225 100644
--- a/mmap/unix/common.c
+++ b/mmap/unix/common.c
@@ -68,7 +68,8 @@
#if APR_HAS_MMAP || defined(BEOS)
-apr_status_t apr_mmap_offset(void **addr, apr_mmap_t *mmap, apr_off_t offset)
+APR_DECLARE(apr_status_t) apr_mmap_offset(void **addr, apr_mmap_t *mmap,
+ apr_off_t offset)
{
if (offset < 0 || offset > mmap->size)
return APR_EINVAL;
diff --git a/mmap/win32/mmap.c b/mmap/win32/mmap.c
index 6e66e8800..28c522469 100644
--- a/mmap/win32/mmap.c
+++ b/mmap/win32/mmap.c
@@ -91,8 +91,9 @@ static apr_status_t mmap_cleanup(void *themmap)
return APR_SUCCESS;
}
-apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offset,
- apr_size_t size, apr_int32_t flag, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_mmap_create(apr_mmap_t **new, apr_file_t *file,
+ apr_off_t offset, apr_size_t size,
+ apr_int32_t flag, apr_pool_t *cont)
{
static DWORD memblock = 0;
DWORD fmaccess = 0, mvaccess = 0;
@@ -151,7 +152,7 @@ apr_status_t apr_mmap_create(apr_mmap_t **new, apr_file_t *file, apr_off_t offse
return APR_SUCCESS;
}
-apr_status_t apr_mmap_delete(apr_mmap_t *mmap)
+APR_DECLARE(apr_status_t) apr_mmap_delete(apr_mmap_t *mmap)
{
apr_status_t rv;
diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c
index 42e9fae9e..d4444c381 100644
--- a/network_io/unix/sa_common.c
+++ b/network_io/unix/sa_common.c
@@ -70,7 +70,8 @@
#include <stdlib.h>
#endif
-apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port)
+APR_DECLARE(apr_status_t) apr_set_port(apr_sockaddr_t *sockaddr,
+ apr_port_t port)
{
/* XXX IPv6: assumes sin_port and sin6_port at same offset */
sockaddr->sa.sin.sin_port = htons(port);
@@ -81,7 +82,8 @@ apr_status_t apr_set_port(apr_sockaddr_t *sockaddr, apr_port_t port)
* since we have apr_getaddrinfo(), but we need to clean up Apache's
* listen.c a bit more first.
*/
-apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr)
+APR_DECLARE(apr_status_t) apr_set_ipaddr(apr_sockaddr_t *sockaddr,
+ const char *addr)
{
u_long ipaddr;
@@ -103,14 +105,16 @@ apr_status_t apr_set_ipaddr(apr_sockaddr_t *sockaddr, const char *addr)
return APR_SUCCESS;
}
-apr_status_t apr_get_port(apr_port_t *port, apr_sockaddr_t *sockaddr)
+APR_DECLARE(apr_status_t) apr_get_port(apr_port_t *port,
+ apr_sockaddr_t *sockaddr)
{
/* XXX IPv6 - assumes sin_port and sin6_port at same offset */
*port = ntohs(sockaddr->sa.sin.sin_port);
return APR_SUCCESS;
}
-apr_status_t apr_get_ipaddr(char **addr, apr_sockaddr_t *sockaddr)
+APR_DECLARE(apr_status_t) apr_get_ipaddr(char **addr,
+ apr_sockaddr_t *sockaddr)
{
*addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len);
apr_inet_ntop(sockaddr->sa.sin.sin_family,
@@ -150,7 +154,9 @@ static void set_sockaddr_vars(apr_sockaddr_t *addr, int family)
#endif
}
-apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_socket_t *sock)
+APR_DECLARE(apr_status_t) apr_get_sockaddr(apr_sockaddr_t **sa,
+ apr_interface_e which,
+ apr_socket_t *sock)
{
if (which == APR_LOCAL) {
if (sock->local_interface_unknown || sock->local_port_unknown) {
@@ -172,11 +178,11 @@ apr_status_t apr_get_sockaddr(apr_sockaddr_t **sa, apr_interface_e which, apr_so
return APR_SUCCESS;
}
-apr_status_t apr_parse_addr_port(char **addr,
- char **scope_id,
- apr_port_t *port,
- const char *str,
- apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_parse_addr_port(char **addr,
+ char **scope_id,
+ apr_port_t *port,
+ const char *str,
+ apr_pool_t *p)
{
const char *ch, *lastchar;
int big_port;
@@ -297,9 +303,10 @@ static void save_addrinfo(apr_pool_t *p, apr_sockaddr_t *sa,
}
#endif
-apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname,
- apr_int32_t family, apr_port_t port,
- apr_int32_t flags, apr_pool_t *p)
+APR_DECLARE(apr_status_t) apr_getaddrinfo(apr_sockaddr_t **sa,
+ const char *hostname,
+ apr_int32_t family, apr_port_t port,
+ apr_int32_t flags, apr_pool_t *p)
{
(*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t));
if ((*sa) == NULL)
@@ -417,8 +424,9 @@ apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname,
return APR_SUCCESS;
}
-apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr,
- apr_int32_t flags)
+APR_DECLARE(apr_status_t) apr_getnameinfo(char **hostname,
+ apr_sockaddr_t *sockaddr,
+ apr_int32_t flags)
{
#if defined(HAVE_GETNAMEINFO) && APR_HAVE_IPV6
int rc;
@@ -472,7 +480,8 @@ apr_status_t apr_getnameinfo(char **hostname, apr_sockaddr_t *sockaddr,
#endif
}
-apr_status_t apr_getservbyname(apr_sockaddr_t *sockaddr, const char *servname)
+APR_DECLARE(apr_status_t) apr_getservbyname(apr_sockaddr_t *sockaddr,
+ const char *servname)
{
struct servent *se;
diff --git a/network_io/win32/poll.c b/network_io/win32/poll.c
index 925fd7da7..5baa00768 100644
--- a/network_io/win32/poll.c
+++ b/network_io/win32/poll.c
@@ -60,7 +60,8 @@
#include <time.h>
-apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_setup_poll(apr_pollfd_t **new, apr_int32_t num,
+ apr_pool_t *cont)
{
(*new) = (apr_pollfd_t *)apr_palloc(cont, sizeof(apr_pollfd_t) * num);
if ((*new) == NULL) {
@@ -79,8 +80,9 @@ apr_status_t apr_setup_poll(apr_pollfd_t **new, apr_int32_t num, apr_pool_t *con
return APR_SUCCESS;
}
-apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset,
- apr_socket_t *sock, apr_int16_t event)
+APR_DECLARE(apr_status_t) apr_add_poll_socket(apr_pollfd_t *aprset,
+ apr_socket_t *sock,
+ apr_int16_t event)
{
if (event & APR_POLLIN) {
FD_SET(sock->sock, aprset->read);
@@ -97,8 +99,8 @@ apr_status_t apr_add_poll_socket(apr_pollfd_t *aprset,
return APR_SUCCESS;
}
-apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
- apr_interval_time_t timeout)
+APR_DECLARE(apr_status_t) apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
+ apr_interval_time_t timeout)
{
int rv;
struct timeval tv, *tvptr;
@@ -140,7 +142,9 @@ apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t *nsds,
return APR_SUCCESS;
}
-apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset)
+APR_DECLARE(apr_status_t) apr_get_revents(apr_int16_t *event,
+ apr_socket_t *sock,
+ apr_pollfd_t *aprset)
{
apr_int16_t revents = 0;
WSABUF data;
@@ -194,19 +198,22 @@ apr_status_t apr_get_revents(apr_int16_t *event, apr_socket_t *sock, apr_pollfd_
return APR_SUCCESS;
}
-apr_status_t apr_get_polldata(apr_pollfd_t *pollfd, const char *key, void *data)
+APR_DECLARE(apr_status_t) apr_get_polldata(apr_pollfd_t *pollfd,
+ const char *key, void *data)
{
return apr_get_userdata(data, key, pollfd->cntxt);
}
-apr_status_t apr_set_polldata(apr_pollfd_t *pollfd, void *data, const char *key,
- apr_status_t (*cleanup) (void *))
+APR_DECLARE(apr_status_t) apr_set_polldata(apr_pollfd_t *pollfd, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void *))
{
return apr_set_userdata(data, key, cleanup, pollfd->cntxt);
}
-apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset,
- apr_socket_t *sock, apr_int16_t events)
+APR_DECLARE(apr_status_t) apr_mask_poll_socket(apr_pollfd_t *aprset,
+ apr_socket_t *sock,
+ apr_int16_t events)
{
if (events & APR_POLLIN) {
FD_CLR(sock->sock, aprset->read);
@@ -223,12 +230,14 @@ apr_status_t apr_mask_poll_socket(apr_pollfd_t *aprset,
return APR_SUCCESS;
}
-apr_status_t apr_remove_poll_socket(apr_pollfd_t *aprset, apr_socket_t *sock)
+APR_DECLARE(apr_status_t) apr_remove_poll_socket(apr_pollfd_t *aprset,
+ apr_socket_t *sock)
{
return apr_mask_poll_socket(aprset, sock, ~0);
}
-apr_status_t apr_clear_poll_sockets(apr_pollfd_t *aprset, apr_int16_t events)
+APR_DECLARE(apr_status_t) apr_clear_poll_sockets(apr_pollfd_t *aprset,
+ apr_int16_t events)
{
if (events & APR_POLLIN) {
FD_ZERO(aprset->read);
diff --git a/network_io/win32/sendrecv.c b/network_io/win32/sendrecv.c
index 06eec4989..1aa12dca3 100644
--- a/network_io/win32/sendrecv.c
+++ b/network_io/win32/sendrecv.c
@@ -69,7 +69,8 @@
* bytes.
*/
#define MAX_SEGMENT_SIZE 65536
-apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
+APR_DECLARE(apr_status_t) apr_send(apr_socket_t *sock, const char *buf,
+ apr_size_t *len)
{
apr_ssize_t rv;
WSABUF wsaData;
@@ -90,7 +91,8 @@ apr_status_t apr_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
return APR_SUCCESS;
}
-apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
+APR_DECLARE(apr_status_t) apr_recv(apr_socket_t *sock, char *buf,
+ apr_size_t *len)
{
apr_ssize_t rv;
WSABUF wsaData;
@@ -113,8 +115,9 @@ apr_status_t apr_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
}
-apr_status_t apr_sendv(apr_socket_t *sock, const struct iovec *vec,
- apr_int32_t nvec, apr_int32_t *nbytes)
+APR_DECLARE(apr_status_t) apr_sendv(apr_socket_t *sock,
+ const struct iovec *vec,
+ apr_int32_t nvec, apr_int32_t *nbytes)
{
apr_ssize_t rv;
int i;
@@ -189,9 +192,9 @@ static void collapse_iovec(char **buf, int *len, struct iovec *iovec, int numvec
* arg 5) Number of bytes to send out of the file
* arg 6) APR flags that are mapped to OS specific flags
*/
-apr_status_t apr_sendfile(apr_socket_t * sock, apr_file_t * file,
- apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len,
- apr_int32_t flags)
+APR_DECLARE(apr_status_t) apr_sendfile(apr_socket_t *sock, apr_file_t *file,
+ apr_hdtr_t *hdtr, apr_off_t *offset,
+ apr_size_t *len, apr_int32_t flags)
{
apr_status_t status = APR_SUCCESS;
apr_ssize_t rv;
diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c
index 84ca396b0..9d792332c 100644
--- a/network_io/win32/sockets.c
+++ b/network_io/win32/sockets.c
@@ -112,8 +112,8 @@ static void alloc_socket(apr_socket_t **new, apr_pool_t *p)
sizeof(apr_sockaddr_t));
}
-apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_create_socket(apr_socket_t **new, int ofamily,
+ int type, apr_pool_t *cont)
{
int family = ofamily;
@@ -159,7 +159,8 @@ apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type,
return APR_SUCCESS;
}
-apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
+APR_DECLARE(apr_status_t) apr_shutdown(apr_socket_t *thesocket,
+ apr_shutdown_how_e how)
{
int winhow;
@@ -185,13 +186,13 @@ apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
}
}
-apr_status_t apr_close_socket(apr_socket_t *thesocket)
+APR_DECLARE(apr_status_t) apr_close_socket(apr_socket_t *thesocket)
{
apr_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup);
return socket_cleanup(thesocket);
}
-apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
+APR_DECLARE(apr_status_t) apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
{
if (bind(sock->sock,
(struct sockaddr *)&sa->sa,
@@ -207,7 +208,7 @@ apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
}
}
-apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog)
+APR_DECLARE(apr_status_t) apr_listen(apr_socket_t *sock, apr_int32_t backlog)
{
if (listen(sock->sock, backlog) == SOCKET_ERROR)
return apr_get_netos_error();
@@ -215,7 +216,8 @@ apr_status_t apr_listen(apr_socket_t *sock, apr_int32_t backlog)
return APR_SUCCESS;
}
-apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *connection_context)
+APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock,
+ apr_pool_t *connection_context)
{
alloc_socket(new, connection_context);
set_socket_vars(*new, sock->local_addr->sa.sin.sin_family);
@@ -263,7 +265,7 @@ apr_status_t apr_accept(apr_socket_t **new, apr_socket_t *sock, apr_pool_t *conn
return APR_SUCCESS;
}
-apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
+APR_DECLARE(apr_status_t) apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
{
apr_status_t lasterror;
fd_set temp;
@@ -297,26 +299,29 @@ apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
return APR_SUCCESS;
}
-apr_status_t apr_get_socketdata(void **data, const char *key, apr_socket_t *socket)
+APR_DECLARE(apr_status_t) apr_get_socketdata(void **data, const char *key,
+ apr_socket_t *socket)
{
return apr_get_userdata(data, key, socket->cntxt);
}
-apr_status_t apr_set_socketdata(apr_socket_t *socket, void *data, const char *key,
- apr_status_t (*cleanup) (void *))
+APR_DECLARE(apr_status_t) apr_set_socketdata(apr_socket_t *socket, void *data,
+ const char *key,
+ apr_status_t (*cleanup)(void *))
{
return apr_set_userdata(data, key, cleanup, socket->cntxt);
}
-apr_status_t apr_get_os_sock(apr_os_sock_t *thesock, apr_socket_t *sock)
+APR_DECLARE(apr_status_t) apr_get_os_sock(apr_os_sock_t *thesock,
+ apr_socket_t *sock)
{
*thesock = sock->sock;
return APR_SUCCESS;
}
-apr_status_t apr_make_os_sock(apr_socket_t **apr_sock,
- apr_os_sock_info_t *os_sock_info,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_make_os_sock(apr_socket_t **apr_sock,
+ apr_os_sock_info_t *os_sock_info,
+ apr_pool_t *cont)
{
alloc_socket(apr_sock, cont);
set_socket_vars(*apr_sock, os_sock_info->family);
@@ -345,8 +350,9 @@ apr_status_t apr_make_os_sock(apr_socket_t **apr_sock,
return APR_SUCCESS;
}
-apr_status_t apr_put_os_sock(apr_socket_t **sock, apr_os_sock_t *thesock,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_sock(apr_socket_t **sock,
+ apr_os_sock_t *thesock,
+ apr_pool_t *cont)
{
if ((*sock) == NULL) {
alloc_socket(sock, cont);
diff --git a/network_io/win32/sockopt.c b/network_io/win32/sockopt.c
index ecc990701..29d5edae5 100644
--- a/network_io/win32/sockopt.c
+++ b/network_io/win32/sockopt.c
@@ -78,7 +78,8 @@ apr_status_t sononblock(SOCKET sd)
return APR_SUCCESS;
}
-apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t on)
+APR_DECLARE(apr_status_t) apr_setsocketopt(apr_socket_t *sock,
+ apr_int32_t opt, apr_int32_t on)
{
int one;
apr_status_t stat;
@@ -169,7 +170,8 @@ apr_status_t apr_setsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t o
return APR_SUCCESS;
}
-apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *on)
+APR_DECLARE(apr_status_t) apr_getsocketopt(apr_socket_t *sock,
+ apr_int32_t opt, apr_int32_t *on)
{
switch (opt) {
case APR_SO_TIMEOUT:
@@ -193,7 +195,8 @@ apr_status_t apr_getsocketopt(apr_socket_t *sock, apr_int32_t opt, apr_int32_t *
}
-apr_status_t apr_gethostname(char *buf, int len, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_gethostname(char *buf, int len,
+ apr_pool_t *cont)
{
if (gethostname(buf, len) == -1)
return apr_get_netos_error();
diff --git a/strings/apr_strnatcmp.c b/strings/apr_strnatcmp.c
index 32140e3b3..a69b0c7d6 100644
--- a/strings/apr_strnatcmp.c
+++ b/strings/apr_strnatcmp.c
@@ -140,12 +140,14 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
-int apr_strnatcmp(char const *a, char const *b) {
+APR_DECLARE(int) apr_strnatcmp(char const *a, char const *b)
+{
return strnatcmp0(a, b, 0);
}
/* Compare, recognizing numeric string and ignoring case. */
-int apr_strnatcasecmp(char const *a, char const *b) {
+APR_DECLARE(int) apr_strnatcasecmp(char const *a, char const *b)
+{
return strnatcmp0(a, b, 1);
}
diff --git a/threadproc/win32/proc.c b/threadproc/win32/proc.c
index 664f4de3a..c0fe0c8f0 100644
--- a/threadproc/win32/proc.c
+++ b/threadproc/win32/proc.c
@@ -71,7 +71,8 @@
*
*/
-apr_status_t apr_createprocattr_init(apr_procattr_t **new, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_createprocattr_init(apr_procattr_t **new,
+ apr_pool_t *cont)
{
(*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t));
@@ -169,8 +170,10 @@ static apr_status_t make_inheritable_duplicate(apr_file_t *original,
return APR_SUCCESS;
}
-apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in,
- apr_int32_t out, apr_int32_t err)
+APR_DECLARE(apr_status_t) apr_setprocattr_io(apr_procattr_t *attr,
+ apr_int32_t in,
+ apr_int32_t out,
+ apr_int32_t err)
{
apr_status_t stat;
@@ -201,9 +204,9 @@ apr_status_t apr_setprocattr_io(apr_procattr_t *attr, apr_int32_t in,
return APR_SUCCESS;
}
-apr_status_t apr_setprocattr_childin(apr_procattr_t *attr,
- apr_file_t *child_in,
- apr_file_t *parent_in)
+APR_DECLARE(apr_status_t) apr_setprocattr_childin(apr_procattr_t *attr,
+ apr_file_t *child_in,
+ apr_file_t *parent_in)
{
apr_status_t stat;
@@ -224,9 +227,9 @@ apr_status_t apr_setprocattr_childin(apr_procattr_t *attr,
return stat;
}
-apr_status_t apr_setprocattr_childout(apr_procattr_t *attr,
- apr_file_t *child_out,
- apr_file_t *parent_out)
+APR_DECLARE(apr_status_t) apr_setprocattr_childout(apr_procattr_t *attr,
+ apr_file_t *child_out,
+ apr_file_t *parent_out)
{
apr_status_t stat;
@@ -247,9 +250,9 @@ apr_status_t apr_setprocattr_childout(apr_procattr_t *attr,
return stat;
}
-apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr,
- apr_file_t *child_err,
- apr_file_t *parent_err)
+APR_DECLARE(apr_status_t) apr_setprocattr_childerr(apr_procattr_t *attr,
+ apr_file_t *child_err,
+ apr_file_t *parent_err)
{
apr_status_t stat;
@@ -270,8 +273,8 @@ apr_status_t apr_setprocattr_childerr(apr_procattr_t *attr,
return stat;
}
-apr_status_t apr_setprocattr_dir(apr_procattr_t *attr,
- const char *dir)
+APR_DECLARE(apr_status_t) apr_setprocattr_dir(apr_procattr_t *attr,
+ const char *dir)
{
char path[MAX_PATH];
int length;
@@ -294,14 +297,15 @@ apr_status_t apr_setprocattr_dir(apr_procattr_t *attr,
return APR_ENOMEM;
}
-apr_status_t apr_setprocattr_cmdtype(apr_procattr_t *attr,
- apr_cmdtype_e cmd)
+APR_DECLARE(apr_status_t) apr_setprocattr_cmdtype(apr_procattr_t *attr,
+ apr_cmdtype_e cmd)
{
attr->cmdtype = cmd;
return APR_SUCCESS;
}
-apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det)
+APR_DECLARE(apr_status_t) apr_setprocattr_detach(apr_procattr_t *attr,
+ apr_int32_t det)
{
attr->detached = det;
return APR_SUCCESS;
@@ -312,10 +316,12 @@ apr_status_t apr_setprocattr_detach(apr_procattr_t *attr, apr_int32_t det)
* Q150956
*/
-apr_status_t apr_create_process(apr_proc_t *new, const char *progname,
- const char * const *args,
- const char * const *env,
- apr_procattr_t *attr, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_create_process(apr_proc_t *new,
+ const char *progname,
+ const char * const *args,
+ const char * const *env,
+ apr_procattr_t *attr,
+ apr_pool_t *cont)
{
int i, iEnvBlockLen;
char *cmdline;
@@ -450,7 +456,7 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname,
return apr_get_os_error();
}
-apr_status_t apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait)
+APR_DECLARE(apr_status_t) apr_wait_proc(apr_proc_t *proc, apr_wait_how_e wait)
{
DWORD stat;
if (!proc)
diff --git a/threadproc/win32/signals.c b/threadproc/win32/signals.c
index 9c283bf30..056de8904 100644
--- a/threadproc/win32/signals.c
+++ b/threadproc/win32/signals.c
@@ -64,7 +64,7 @@
#endif
/* Windows only really support killing process, but that will do for now. */
-apr_status_t apr_kill(apr_proc_t *proc, int signal)
+APR_DECLARE(apr_status_t) apr_kill(apr_proc_t *proc, int signal)
{
if (TerminateProcess((HANDLE)proc->pid, signal) == 0) {
return apr_get_os_error();
diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
index 75fc18db9..231d2e366 100644
--- a/threadproc/win32/thread.c
+++ b/threadproc/win32/thread.c
@@ -61,7 +61,8 @@
#include <process.h>
-apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_create_threadattr(apr_threadattr_t **new,
+ apr_pool_t *cont)
{
(*new) = (apr_threadattr_t *)apr_palloc(cont,
sizeof(apr_threadattr_t));
@@ -74,22 +75,24 @@ apr_status_t apr_create_threadattr(apr_threadattr_t **new, apr_pool_t *cont)
return APR_SUCCESS;
}
-apr_status_t apr_setthreadattr_detach(apr_threadattr_t *attr, apr_int32_t on)
+APR_DECLARE(apr_status_t) apr_setthreadattr_detach(apr_threadattr_t *attr,
+ apr_int32_t on)
{
attr->detach = on;
return APR_SUCCESS;
}
-apr_status_t apr_getthreadattr_detach(apr_threadattr_t *attr)
+APR_DECLARE(apr_status_t) apr_getthreadattr_detach(apr_threadattr_t *attr)
{
if (attr->detach == 1)
return APR_DETACH;
return APR_NOTDETACH;
}
-apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr,
- apr_thread_start_t func, void *data,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_create_thread(apr_thread_t **new,
+ apr_threadattr_t *attr,
+ apr_thread_start_t func,
+ void *data, apr_pool_t *cont)
{
apr_status_t stat;
unsigned temp;
@@ -127,14 +130,16 @@ apr_status_t apr_create_thread(apr_thread_t **new, apr_threadattr_t *attr,
return APR_SUCCESS;
}
-apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval)
+APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd,
+ apr_status_t *retval)
{
apr_destroy_pool(thd->cntxt);
_endthreadex(*retval);
return APR_SUCCESS;
}
-apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
+APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
+ apr_thread_t *thd)
{
apr_status_t stat;
@@ -149,7 +154,7 @@ apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
}
}
-apr_status_t apr_thread_detach(apr_thread_t *thd)
+APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
{
if (CloseHandle(thd->td)) {
return APR_SUCCESS;
@@ -159,19 +164,21 @@ apr_status_t apr_thread_detach(apr_thread_t *thd)
}
}
-apr_status_t apr_get_threaddata(void **data, const char *key, apr_thread_t *thread)
+APR_DECLARE(apr_status_t) apr_get_threaddata(void **data, const char *key,
+ apr_thread_t *thread)
{
return apr_get_userdata(data, key, thread->cntxt);
}
-apr_status_t apr_set_threaddata(void *data, const char *key,
- apr_status_t (*cleanup) (void *),
- apr_thread_t *thread)
+APR_DECLARE(apr_status_t) apr_set_threaddata(void *data, const char *key,
+ apr_status_t (*cleanup) (void *),
+ apr_thread_t *thread)
{
return apr_set_userdata(data, key, cleanup, thread->cntxt);
}
-apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd)
+APR_DECLARE(apr_status_t) apr_get_os_thread(apr_os_thread_t **thethd,
+ apr_thread_t *thd)
{
if (thd == NULL) {
return APR_ENOTHREAD;
@@ -180,8 +187,9 @@ apr_status_t apr_get_os_thread(apr_os_thread_t **thethd, apr_thread_t *thd)
return APR_SUCCESS;
}
-apr_status_t apr_put_os_thread(apr_thread_t **thd, apr_os_thread_t *thethd,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_thread(apr_thread_t **thd,
+ apr_os_thread_t *thethd,
+ apr_pool_t *cont)
{
if (cont == NULL) {
return APR_ENOPOOL;
diff --git a/threadproc/win32/threadpriv.c b/threadproc/win32/threadpriv.c
index 940750f64..701282356 100644
--- a/threadproc/win32/threadpriv.c
+++ b/threadproc/win32/threadpriv.c
@@ -59,8 +59,9 @@
#include "apr_errno.h"
#include "apr_portable.h"
-apr_status_t apr_create_thread_private(apr_threadkey_t **key,
- void (*dest)(void *), apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_create_thread_private(apr_threadkey_t **key,
+ void (*dest)(void *),
+ apr_pool_t *cont)
{
if (((*key)->key = TlsAlloc()) != 0xFFFFFFFF) {
return APR_SUCCESS;
@@ -68,7 +69,8 @@ apr_status_t apr_create_thread_private(apr_threadkey_t **key,
return apr_get_os_error();
}
-apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key)
+APR_DECLARE(apr_status_t) apr_get_thread_private(void **new,
+ apr_threadkey_t *key)
{
if ((*new) = TlsGetValue(key->key)) {
return APR_SUCCESS;
@@ -76,7 +78,8 @@ apr_status_t apr_get_thread_private(void **new, apr_threadkey_t *key)
return apr_get_os_error();
}
-apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key)
+APR_DECLARE(apr_status_t) apr_set_thread_private(void *priv,
+ apr_threadkey_t *key)
{
if (TlsSetValue(key->key, priv)) {
return APR_SUCCESS;
@@ -84,7 +87,7 @@ apr_status_t apr_set_thread_private(void *priv, apr_threadkey_t *key)
return apr_get_os_error();
}
-apr_status_t apr_delete_thread_private(apr_threadkey_t *key)
+APR_DECLARE(apr_status_t) apr_delete_thread_private(apr_threadkey_t *key)
{
if (TlsFree(key->key)) {
return APR_SUCCESS;
@@ -92,27 +95,29 @@ apr_status_t apr_delete_thread_private(apr_threadkey_t *key)
return apr_get_os_error();
}
-apr_status_t apr_get_threadkeydata(void **data, const char *key,
- apr_threadkey_t *threadkey)
+APR_DECLARE(apr_status_t) apr_get_threadkeydata(void **data, const char *key,
+ apr_threadkey_t *threadkey)
{
return apr_get_userdata(data, key, threadkey->cntxt);
}
-apr_status_t apr_set_threadkeydata(void *data, const char *key,
- apr_status_t (*cleanup) (void *),
- apr_threadkey_t *threadkey)
+APR_DECLARE(apr_status_t) apr_set_threadkeydata(void *data, const char *key,
+ apr_status_t (*cleanup)(void *),
+ apr_threadkey_t *threadkey)
{
return apr_set_userdata(data, key, cleanup, threadkey->cntxt);
}
-apr_status_t apr_get_os_threadkey(apr_os_threadkey_t *thekey, apr_threadkey_t *key)
+APR_DECLARE(apr_status_t) apr_get_os_threadkey(apr_os_threadkey_t *thekey,
+ apr_threadkey_t *key)
{
*thekey = key->key;
return APR_SUCCESS;
}
-apr_status_t apr_put_os_threadkey(apr_threadkey_t **key,
- apr_os_threadkey_t *thekey, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_threadkey(apr_threadkey_t **key,
+ apr_os_threadkey_t *thekey,
+ apr_pool_t *cont)
{
if (cont == NULL) {
return APR_ENOPOOL;
diff --git a/time/win32/time.c b/time/win32/time.c
index 3bbeadfd1..894a5db3c 100644
--- a/time/win32/time.c
+++ b/time/win32/time.c
@@ -123,14 +123,15 @@ void SystemTimeToAprExpTime(apr_exploded_time_t *xt, SYSTEMTIME *tm)
return;
}
-apr_status_t apr_ansi_time_to_apr_time(apr_time_t *result, time_t input)
+APR_DECLARE(apr_status_t) apr_ansi_time_to_apr_time(apr_time_t *result,
+ time_t input)
{
*result = (apr_time_t) input * APR_USEC_PER_SEC;
return APR_SUCCESS;
}
/* Return micro-seconds since the Unix epoch (jan. 1, 1970) UTC */
-apr_time_t apr_now(void)
+APR_DECLARE(apr_time_t) apr_now(void)
{
LONGLONG aprtime = 0;
FILETIME time;
@@ -139,7 +140,8 @@ apr_time_t apr_now(void)
return aprtime;
}
-apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input)
+APR_DECLARE(apr_status_t) apr_explode_gmt(apr_exploded_time_t *result,
+ apr_time_t input)
{
FILETIME ft;
SYSTEMTIME st;
@@ -149,7 +151,8 @@ apr_status_t apr_explode_gmt(apr_exploded_time_t *result, apr_time_t input)
return APR_SUCCESS;
}
-apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input)
+APR_DECLARE(apr_status_t) apr_explode_localtime(apr_exploded_time_t *result,
+ apr_time_t input)
{
SYSTEMTIME st;
FILETIME ft, localft;
@@ -161,7 +164,8 @@ apr_status_t apr_explode_localtime(apr_exploded_time_t *result, apr_time_t input
return APR_SUCCESS;
}
-apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt)
+APR_DECLARE(apr_status_t) apr_implode_time(apr_time_t *t,
+ apr_exploded_time_t *xt)
{
int year;
time_t days;
@@ -195,15 +199,16 @@ apr_status_t apr_implode_time(apr_time_t *t, apr_exploded_time_t *xt)
return APR_SUCCESS;
}
-apr_status_t apr_get_os_imp_time(apr_os_imp_time_t **ostime, apr_time_t *aprtime)
+APR_DECLARE(apr_status_t) apr_get_os_imp_time(apr_os_imp_time_t **ostime,
+ apr_time_t *aprtime)
{
/* TODO: Consider not passing in pointer to apr_time_t (e.g., call by value) */
AprTimeToFileTime(*ostime, *aprtime);
return APR_SUCCESS;
}
-apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime,
- apr_exploded_time_t *aprexptime)
+APR_DECLARE(apr_status_t) apr_get_os_exp_time(apr_os_exp_time_t **ostime,
+ apr_exploded_time_t *aprexptime)
{
(*ostime)->wYear = aprexptime->tm_year + 1900;
(*ostime)->wMonth = aprexptime->tm_mon + 1;
@@ -216,21 +221,23 @@ apr_status_t apr_get_os_exp_time(apr_os_exp_time_t **ostime,
return APR_SUCCESS;
}
-apr_status_t apr_put_os_imp_time(apr_time_t *aprtime, apr_os_imp_time_t **ostime,
- apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_imp_time(apr_time_t *aprtime,
+ apr_os_imp_time_t **ostime,
+ apr_pool_t *cont)
{
FileTimeToAprTime(aprtime, *ostime);
return APR_SUCCESS;
}
-apr_status_t apr_put_os_exp_time(apr_exploded_time_t *aprtime,
- apr_os_exp_time_t **ostime, apr_pool_t *cont)
+APR_DECLARE(apr_status_t) apr_put_os_exp_time(apr_exploded_time_t *aprtime,
+ apr_os_exp_time_t **ostime,
+ apr_pool_t *cont)
{
SystemTimeToAprExpTime(aprtime, *ostime);
return APR_SUCCESS;
}
-void apr_sleep(apr_interval_time_t t)
+APR_DECLARE(void) apr_sleep(apr_interval_time_t t)
{
Sleep(t/1000);
}
diff --git a/time/win32/timestr.c b/time/win32/timestr.c
index 69db6fcd3..9c7cfc106 100644
--- a/time/win32/timestr.c
+++ b/time/win32/timestr.c
@@ -64,7 +64,7 @@ APR_DECLARE_DATA const char apr_day_snames[7][4] =
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
-apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
+APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t)
{
apr_exploded_time_t xt;
const char *s;
@@ -112,7 +112,7 @@ apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
return APR_SUCCESS;
}
-apr_status_t apr_ctime(char *date_str, apr_time_t t)
+APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t)
{
apr_exploded_time_t xt;
const char *s;
@@ -154,8 +154,9 @@ apr_status_t apr_ctime(char *date_str, apr_time_t t)
return APR_SUCCESS;
}
-apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max,
- const char *format, apr_exploded_time_t *xt)
+APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
+ apr_size_t max, const char *format,
+ apr_exploded_time_t *xt)
{
struct tm tm;
memset(&tm, 0, sizeof tm);