diff options
author | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2001-08-10 21:04:49 +0000 |
---|---|---|
committer | rbb <rbb@13f79535-47bb-0310-9956-ffa450edef68> | 2001-08-10 21:04:49 +0000 |
commit | 8e4cc219df597f7e5ecc4cb1b8250b8d2880de64 (patch) | |
tree | 2a0e1e4819381de7a0bacb68ba78c5ea5ae6c8de /threadproc | |
parent | 94449e76e5bd4880a31259ddf7d6e655dd24e124 (diff) | |
download | libapr-8e4cc219df597f7e5ecc4cb1b8250b8d2880de64.tar.gz |
Wrap all APR functions in APR_DECLARE macro.
Submitted by: Sterling Hughes <sterling@designmultimedia.com>
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/beos/proc.c | 48 | ||||
-rw-r--r-- | threadproc/beos/thread.c | 34 | ||||
-rw-r--r-- | threadproc/beos/threadpriv.c | 28 | ||||
-rw-r--r-- | threadproc/os2/proc.c | 48 | ||||
-rw-r--r-- | threadproc/os2/thread.c | 34 | ||||
-rw-r--r-- | threadproc/os2/threadpriv.c | 28 | ||||
-rw-r--r-- | threadproc/unix/proc.c | 53 | ||||
-rw-r--r-- | threadproc/unix/procsup.c | 2 | ||||
-rw-r--r-- | threadproc/unix/signals.c | 4 | ||||
-rw-r--r-- | threadproc/unix/thread.c | 34 | ||||
-rw-r--r-- | threadproc/unix/threadpriv.c | 28 |
11 files changed, 172 insertions, 169 deletions
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 063b993ec..99ca78f0b 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -61,7 +61,7 @@ struct send_pipe { int err; }; -apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -82,8 +82,8 @@ apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { @@ -146,8 +146,8 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, return APR_SUCCESS; } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, - const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, + const char *dir) { char * cwd; if (strncmp("/",dir,1) != 0 ) { @@ -166,20 +166,20 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -201,10 +201,10 @@ apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) } -apr_status_t apr_proc_create(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_proc_create(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=0,nargs=0; char **newargs = NULL; @@ -279,8 +279,8 @@ apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_proc_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_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -297,8 +297,8 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_proc_wait(apr_proc_t *proc, - apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e wait) { status_t exitval, rv; @@ -321,7 +321,7 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, return APR_CHILD_NOTDONE; } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) @@ -336,8 +336,8 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i return APR_SUCCESS; } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -351,8 +351,8 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ return APR_SUCCESS; } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); @@ -366,8 +366,8 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ return APR_SUCCESS; } -apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, - void *limit) +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, + void *limit) { return APR_ENOTIMPL; } diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c index 8ceda143a..c37fffec7 100644 --- a/threadproc/beos/thread.c +++ b/threadproc/beos/thread.c @@ -55,7 +55,7 @@ #include "threadproc.h" #include "apr_portable.h" -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -70,7 +70,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { if (on == 1){ attr->detached = 1; @@ -80,7 +80,7 @@ apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) return APR_SUCCESS; } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { if (attr->detached == 1){ return APR_DETACH; @@ -94,9 +94,9 @@ static void *dummy_worker(void *opaque) return thd->func(thd, thd->data); } -apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, - apr_thread_start_t func, void *data, - apr_pool_t *pool) +APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *pool) { int32 temp; apr_status_t stat; @@ -131,7 +131,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, } } -apr_os_thread_t apr_os_thread_current(void) +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { return find_thread(NULL); } @@ -141,14 +141,14 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) return tid1 == tid2; } -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_pool_destroy(thd->cntxt); exit_thread ((status_t)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) { if (wait_for_thread(thd->td,(void *)&retval) == B_NO_ERROR) { return APR_SUCCESS; @@ -158,7 +158,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 (suspend_thread(thd->td) == B_NO_ERROR){ return APR_SUCCESS; @@ -172,26 +172,26 @@ void apr_thread_yield() { } -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->td; return APR_SUCCESS; } -apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/threadproc/beos/threadpriv.c b/threadproc/beos/threadpriv.c index 949d67afa..4ca030aa5 100644 --- a/threadproc/beos/threadpriv.c +++ b/threadproc/beos/threadpriv.c @@ -58,8 +58,8 @@ static struct beos_key key_table[BEOS_MAX_DATAKEYS]; static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS]; static sem_id lock; -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); if ((*key) == NULL) { @@ -82,7 +82,7 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, return APR_ENOMEM; } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { thread_id tid; int i, index=0; @@ -114,7 +114,7 @@ apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { thread_id tid; int i,index = 0, ret; @@ -169,7 +169,7 @@ apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) return APR_ENOMEM; } -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { if (key->key < BEOS_MAX_DATAKEYS){ acquire_sem(key_table[key->key].lock); @@ -184,27 +184,27 @@ apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, + apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; @@ -215,4 +215,4 @@ apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, } (*key)->key = *thekey; return APR_SUCCESS; -} +} diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c index 9b4061648..7d3db004a 100644 --- a/threadproc/os2/proc.c +++ b/threadproc/os2/proc.c @@ -72,7 +72,7 @@ #include <process.h> #include <stdlib.h> -apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_palloc(cont, sizeof(apr_procattr_t)); @@ -93,8 +93,8 @@ apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { apr_status_t stat; if (in) { @@ -157,8 +157,8 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, return APR_SUCCESS; } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); @@ -173,8 +173,8 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -189,8 +189,8 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); @@ -205,7 +205,7 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -214,20 +214,20 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir) return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -278,10 +278,10 @@ static char *double_quotes(apr_pool_t *cntxt, const char *str) -apr_status_t apr_proc_create(apr_proc_t *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_proc_create(apr_proc_t *proc, const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *cont) { int i, arg, numargs, cmdlen; apr_status_t status; @@ -495,8 +495,8 @@ apr_status_t apr_proc_create(apr_proc_t *proc, const char *progname, -apr_status_t apr_proc_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_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { RESULTCODES codes; ULONG rc; @@ -523,8 +523,8 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, -apr_status_t apr_proc_wait(apr_proc_t *proc, - apr_wait_how_e wait) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e wait) { RESULTCODES codes; ULONG rc; @@ -546,7 +546,7 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, -apr_status_t apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) +APR_DECLARE(apr_status_t) apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) { if (proc == NULL) { return APR_ENOPROC; @@ -557,7 +557,7 @@ apr_status_t apr_get_os_proc(apr_os_proc_t *theproc, apr_proc_t *proc) -apr_status_t apr_proc_detach() +APR_DECLARE(apr_status_t) apr_proc_detach() { return APR_ENOTIMPL; } diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c index 0aaa342c5..9653edf50 100644 --- a/threadproc/os2/thread.c +++ b/threadproc/os2/thread.c @@ -62,7 +62,7 @@ #include "fileio.h" #include <stdlib.h> -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { (*new) = (apr_threadattr_t *)apr_palloc(cont, sizeof(apr_threadattr_t)); @@ -77,7 +77,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -85,7 +85,7 @@ apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { return (attr->attr & APR_THREADATTR_DETACHED) ? APR_DETACH : APR_NOTDETACH; } @@ -100,9 +100,9 @@ static void apr_thread_begin(void *arg) -apr_status_t apr_thread_create(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_thread_create(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { apr_status_t stat; apr_thread_t *thread; @@ -144,7 +144,7 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, -apr_os_thread_t apr_os_thread_current() +APR_DECLARE(apr_os_thread_t) apr_os_thread_current() { PIB *ppib; TIB *ptib; @@ -154,7 +154,7 @@ apr_os_thread_t apr_os_thread_current() -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) { thd->rv = retval; _endthread(); @@ -163,7 +163,7 @@ apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t *retval) -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) { ULONG rc; TID waittid = thd->tid; @@ -182,7 +182,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) { thd->attr->attr |= APR_THREADATTR_DETACHED; return APR_SUCCESS; @@ -196,7 +196,7 @@ void apr_thread_yield() -apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = &thd->tid; return APR_SUCCESS; @@ -204,8 +204,8 @@ apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) -apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, - apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, + apr_pool_t *cont) { if ((*thd) == NULL) { (*thd) = (apr_thread_t *)apr_pcalloc(cont, sizeof(apr_thread_t)); @@ -224,16 +224,16 @@ int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_thread_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } diff --git a/threadproc/os2/threadpriv.c b/threadproc/os2/threadpriv.c index 5a93765e4..e04dc6a88 100644 --- a/threadproc/os2/threadpriv.c +++ b/threadproc/os2/threadpriv.c @@ -60,8 +60,9 @@ #include "apr_lib.h" #include "fileio.h" -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), + apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_palloc(cont, sizeof(apr_threadkey_t)); @@ -73,44 +74,45 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, return APR_OS2_STATUS(DosAllocThreadLocalMemory(1, &((*key)->key))); } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { (*new) = (void *)*(key->key); return APR_SUCCESS; } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { *(key->key) = (ULONG)priv; return APR_SUCCESS; } -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { return APR_OS2_STATUS(DosFreeThreadLocalMemory(key->key)); } -apr_status_t apr_threadkey_data_get(void **data, const char *key, - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, + apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, + apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 4c4f74d54..41f8007c9 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -57,7 +57,7 @@ #include "apr_portable.h" #include "apr_signal.h" -apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) { (*new) = (apr_procattr_t *)apr_pcalloc(cont, sizeof(apr_procattr_t)); @@ -69,8 +69,8 @@ apr_status_t apr_procattr_create(apr_procattr_t **new, apr_pool_t *cont) return APR_SUCCESS; } -apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, - apr_int32_t out, apr_int32_t err) +APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, + apr_int32_t out, apr_int32_t err) { apr_status_t status; if (in != 0) { @@ -134,8 +134,8 @@ apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, } -apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, - apr_file_t *parent_in) +APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in, + apr_file_t *parent_in) { if (attr->child_in == NULL && attr->parent_in == NULL) apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->cntxt); @@ -150,8 +150,8 @@ apr_status_t apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_i } -apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, - apr_file_t *parent_out) +APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out, + apr_file_t *parent_out) { if (attr->child_out == NULL && attr->parent_out == NULL) apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->cntxt); @@ -166,8 +166,8 @@ apr_status_t apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, - apr_file_t *parent_err) +APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err, + apr_file_t *parent_err) { if (attr->child_err == NULL && attr->parent_err == NULL) apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->cntxt); @@ -182,8 +182,8 @@ apr_status_t apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_ } -apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, - const char *dir) +APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr, + const char *dir) { attr->currdir = apr_pstrdup(attr->cntxt, dir); if (attr->currdir) { @@ -192,20 +192,21 @@ apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, return APR_ENOMEM; } -apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, - apr_cmdtype_e cmd) +APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr, + apr_cmdtype_e cmd) { attr->cmdtype = cmd; return APR_SUCCESS; } -apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) +APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, + apr_int32_t detach) { attr->detached = detach; return APR_SUCCESS; } -apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont) { int pid; @@ -271,10 +272,10 @@ static apr_status_t limit_proc(apr_procattr_t *attr) return APR_SUCCESS; } -apr_status_t apr_proc_create(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_proc_create(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; const char **newargs; @@ -360,8 +361,8 @@ apr_status_t apr_proc_create(apr_proc_t *new, const char *progname, return APR_SUCCESS; } -apr_status_t apr_proc_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_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, + apr_wait_how_e waithow, apr_pool_t *p) { int waitpid_options = WUNTRACED; @@ -378,8 +379,8 @@ apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, apr_wait_t *status, return errno; } -apr_status_t apr_proc_wait(apr_proc_t *proc, - apr_wait_how_e waithow) +APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, + apr_wait_how_e waithow) { pid_t status; @@ -401,8 +402,8 @@ apr_status_t apr_proc_wait(apr_proc_t *proc, return errno; } -apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, - struct rlimit *limit) +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, + struct rlimit *limit) { switch(what) { case APR_LIMIT_CPU: @@ -428,4 +429,4 @@ apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, #endif } return APR_SUCCESS; -} +} diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 1b797e3aa..5c1d12fd4 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -54,7 +54,7 @@ #include "threadproc.h" -apr_status_t apr_proc_detach(void) +APR_DECLARE(apr_status_t) apr_proc_detach(void) { int x; pid_t pgrp; diff --git a/threadproc/unix/signals.c b/threadproc/unix/signals.c index 41d454307..1d905e058 100644 --- a/threadproc/unix/signals.c +++ b/threadproc/unix/signals.c @@ -67,7 +67,7 @@ #include <pthread.h> #endif -apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) +APR_DECLARE(apr_status_t) apr_proc_kill(apr_proc_t *proc, int signum) { #ifdef OS2 /* SIGTERM's don't work too well in OS/2 (only affects other EMX @@ -95,7 +95,7 @@ apr_status_t apr_proc_kill(apr_proc_t *proc, int signum) * from W. Richard Stevens' "Advanced Programming in the UNIX Environment" * (the version that does not automatically restart system calls). */ -apr_sigfunc_t *apr_signal(int signo, apr_sigfunc_t * func) +APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func) { struct sigaction act, oact; diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c index 73d6b96dd..d360543ce 100644 --- a/threadproc/unix/thread.c +++ b/threadproc/unix/thread.c @@ -59,7 +59,7 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) { apr_status_t stat; @@ -82,7 +82,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *cont) return stat; } -apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) +APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) { apr_status_t stat; #ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR @@ -102,7 +102,7 @@ apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on) } } -apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) +APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr) { int state; @@ -122,9 +122,9 @@ static void *dummy_worker(void *opaque) return thread->func(thread, thread->data); } -apr_status_t apr_thread_create(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_thread_create(apr_thread_t **new, apr_threadattr_t *attr, + apr_thread_start_t func, void *data, + apr_pool_t *cont) { apr_status_t stat; pthread_attr_t *temp; @@ -166,24 +166,24 @@ apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, } } -apr_os_thread_t apr_os_thread_current(void) +APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void) { return pthread_self(); } -int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) +APR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2) { return pthread_equal(tid1, tid2); } -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_pool_destroy(thd->cntxt); pthread_exit(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; apr_status_t *thread_stat; @@ -200,7 +200,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) { apr_status_t stat; @@ -223,25 +223,25 @@ void apr_thread_yield() { } -apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) +APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread) { return apr_pool_userdata_get(data, key, thread->cntxt); } -apr_status_t apr_thread_data_set(void *data, const char *key, +APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key, apr_status_t (*cleanup) (void *), apr_thread_t *thread) { return apr_pool_userdata_set(data, key, cleanup, thread->cntxt); } -apr_status_t apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) +APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd) { *thethd = thd->td; return APR_SUCCESS; } -apr_status_t apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, +APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd, apr_pool_t *cont) { if (cont == NULL) { @@ -262,9 +262,9 @@ APR_POOL_IMPLEMENT_ACCESSOR_X(thread, cntxt) #if !APR_HAS_THREADS -apr_status_t apr_os_thread_get(void); /* avoid warning for no prototype */ +APR_DECLARE(apr_status_t) apr_os_thread_get(void); /* avoid warning for no prototype */ -apr_status_t apr_os_thread_get(void) +APR_DECLARE(apr_status_t) apr_os_thread_get(void) { return APR_ENOTIMPL; } diff --git a/threadproc/unix/threadpriv.c b/threadproc/unix/threadpriv.c index 1799b34f1..64e6aa5d0 100644 --- a/threadproc/unix/threadpriv.c +++ b/threadproc/unix/threadpriv.c @@ -59,8 +59,8 @@ #if APR_HAS_THREADS #if APR_HAVE_PTHREAD_H -apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, - void (*dest)(void *), apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key, + void (*dest)(void *), apr_pool_t *cont) { (*key) = (apr_threadkey_t *)apr_pcalloc(cont, sizeof(apr_threadkey_t)); @@ -74,7 +74,7 @@ apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, } -apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key) { #ifdef PTHREAD_GETSPECIFIC_TAKES_TWO_ARGS if (pthread_getspecific(key->key,new)) @@ -85,7 +85,7 @@ apr_status_t apr_threadkey_private_get(void **new, apr_threadkey_t *key) return APR_SUCCESS; } -apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_setspecific(key->key, priv)) == 0) { @@ -97,7 +97,7 @@ apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key) } #ifdef HAVE_PTHREAD_KEY_DELETE -apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key) { apr_status_t stat; if ((stat = pthread_key_delete(key->key)) == 0) { @@ -107,27 +107,27 @@ apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key) } #endif -apr_status_t apr_threadkey_data_get(void **data, const char *key, +APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey) { return apr_pool_userdata_get(data, key, threadkey->cntxt); } -apr_status_t apr_threadkey_data_set(void *data, const char *key, - apr_status_t (*cleanup) (void *), - apr_threadkey_t *threadkey) +APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key, + apr_status_t (*cleanup) (void *), + apr_threadkey_t *threadkey) { return apr_pool_userdata_set(data, key, cleanup, threadkey->cntxt); } -apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key) { *thekey = key->key; return APR_SUCCESS; } -apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, - apr_os_threadkey_t *thekey, apr_pool_t *cont) +APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key, + apr_os_threadkey_t *thekey, apr_pool_t *cont) { if (cont == NULL) { return APR_ENOPOOL; @@ -143,9 +143,9 @@ apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, #endif /* APR_HAS_THREADS */ #if !APR_HAS_THREADS -apr_status_t apr_os_threadkey_get(void); /* avoid warning for no prototype */ +APR_DECLARE(apr_status_t) apr_os_threadkey_get(void); /* avoid warning for no prototype */ -apr_status_t apr_os_threadkey_get(void) +APR_DECLARE(apr_status_t) apr_os_threadkey_get(void) { return APR_ENOTIMPL; } |