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/os2 | |
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/os2')
-rw-r--r-- | threadproc/os2/proc.c | 48 | ||||
-rw-r--r-- | threadproc/os2/thread.c | 34 | ||||
-rw-r--r-- | threadproc/os2/threadpriv.c | 28 |
3 files changed, 56 insertions, 54 deletions
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; |