[core] rename lib apr symbols to fspr

This commit is contained in:
Chris Rienzo authored and Andrey Volk committed 2022-08-29 20:17:08 +03:00
1 parent 3c7e8ff989
commit 5c2726f413
354 files changed
+11614 -11614

No files matched your search

+71 -71
View File
@@ -14,8 +14,8 @@
* limitations under the License.
*/
#include "apr_arch_threadproc.h"
#include "apr_strings.h"
#include "fspr_arch_threadproc.h"
#include "fspr_strings.h"
struct send_pipe {
int in;
@@ -23,10 +23,10 @@ struct send_pipe {
int err;
};
APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_procattr_create(fspr_procattr_t **new, fspr_pool_t *pool)
{
(*new) = (apr_procattr_t *)apr_palloc(pool,
sizeof(apr_procattr_t));
(*new) = (fspr_procattr_t *)fspr_palloc(pool,
sizeof(fspr_procattr_t));
if ((*new) == NULL) {
return APR_ENOMEM;
@@ -44,65 +44,65 @@ APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *
return APR_SUCCESS;
}
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_DECLARE(fspr_status_t) fspr_procattr_io_set(fspr_procattr_t *attr, fspr_int32_t in,
fspr_int32_t out, fspr_int32_t err)
{
apr_status_t status;
fspr_status_t status;
if (in != 0) {
if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in,
if ((status = fspr_file_pipe_create(&attr->child_in, &attr->parent_in,
attr->pool)) != APR_SUCCESS) {
return status;
}
switch (in) {
case APR_FULL_BLOCK:
apr_file_pipe_timeout_set(attr->child_in, -1);
apr_file_pipe_timeout_set(attr->parent_in, -1);
fspr_file_pipe_timeout_set(attr->child_in, -1);
fspr_file_pipe_timeout_set(attr->parent_in, -1);
break;
case APR_PARENT_BLOCK:
apr_file_pipe_timeout_set(attr->child_in, -1);
fspr_file_pipe_timeout_set(attr->child_in, -1);
break;
case APR_CHILD_BLOCK:
apr_file_pipe_timeout_set(attr->parent_in, -1);
fspr_file_pipe_timeout_set(attr->parent_in, -1);
break;
default:
break;
}
}
if (out) {
if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out,
if ((status = fspr_file_pipe_create(&attr->parent_out, &attr->child_out,
attr->pool)) != APR_SUCCESS) {
return status;
}
switch (out) {
case APR_FULL_BLOCK:
apr_file_pipe_timeout_set(attr->child_out, -1);
apr_file_pipe_timeout_set(attr->parent_out, -1);
fspr_file_pipe_timeout_set(attr->child_out, -1);
fspr_file_pipe_timeout_set(attr->parent_out, -1);
break;
case APR_PARENT_BLOCK:
apr_file_pipe_timeout_set(attr->child_out, -1);
fspr_file_pipe_timeout_set(attr->child_out, -1);
break;
case APR_CHILD_BLOCK:
apr_file_pipe_timeout_set(attr->parent_out, -1);
fspr_file_pipe_timeout_set(attr->parent_out, -1);
break;
default:
break;
}
}
if (err) {
if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err,
if ((status = fspr_file_pipe_create(&attr->parent_err, &attr->child_err,
attr->pool)) != APR_SUCCESS) {
return status;
}
switch (err) {
case APR_FULL_BLOCK:
apr_file_pipe_timeout_set(attr->child_err, -1);
apr_file_pipe_timeout_set(attr->parent_err, -1);
fspr_file_pipe_timeout_set(attr->child_err, -1);
fspr_file_pipe_timeout_set(attr->parent_err, -1);
break;
case APR_PARENT_BLOCK:
apr_file_pipe_timeout_set(attr->child_err, -1);
fspr_file_pipe_timeout_set(attr->child_err, -1);
break;
case APR_CHILD_BLOCK:
apr_file_pipe_timeout_set(attr->parent_err, -1);
fspr_file_pipe_timeout_set(attr->parent_err, -1);
break;
default:
break;
@@ -111,17 +111,17 @@ APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_dir_set(fspr_procattr_t *attr,
const char *dir)
{
char * cwd;
if (dir[0] != '/') {
cwd = (char*)malloc(sizeof(char) * PATH_MAX);
getcwd(cwd, PATH_MAX);
attr->currdir = (char *)apr_pstrcat(attr->pool, cwd, "/", dir, NULL);
attr->currdir = (char *)fspr_pstrcat(attr->pool, cwd, "/", dir, NULL);
free(cwd);
} else {
attr->currdir = (char *)apr_pstrdup(attr->pool, dir);
attr->currdir = (char *)fspr_pstrdup(attr->pool, dir);
}
if (attr->currdir) {
return APR_SUCCESS;
@@ -129,20 +129,20 @@ APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
return APR_ENOMEM;
}
APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
apr_cmdtype_e cmd)
APR_DECLARE(fspr_status_t) fspr_procattr_cmdtype_set(fspr_procattr_t *attr,
fspr_cmdtype_e cmd)
{
attr->cmdtype = cmd;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach)
APR_DECLARE(fspr_status_t) fspr_procattr_detach_set(fspr_procattr_t *attr, fspr_int32_t detach)
{
attr->detached = detach;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_proc_fork(fspr_proc_t *proc, fspr_pool_t *pool)
{
int pid;
@@ -195,32 +195,32 @@ APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool)
return APR_INPARENT;
}
APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
apr_child_errfn_t *errfn)
APR_DECLARE(fspr_status_t) fspr_procattr_child_errfn_set(fspr_procattr_t *attr,
fspr_child_errfn_t *errfn)
{
/* won't ever be called on this platform, so don't save the function pointer */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
apr_int32_t chk)
APR_DECLARE(fspr_status_t) fspr_procattr_error_check_set(fspr_procattr_t *attr,
fspr_int32_t chk)
{
/* won't ever be used on this platform, so don't save the flag */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
apr_int32_t addrspace)
APR_DECLARE(fspr_status_t) fspr_procattr_addrspace_set(fspr_procattr_t *attr,
fspr_int32_t addrspace)
{
/* won't ever be used on this platform, so don't save the flag */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
APR_DECLARE(fspr_status_t) fspr_proc_create(fspr_proc_t *new, const char *progname,
const char * const *args,
const char * const *env,
apr_procattr_t *attr,
apr_pool_t *pool)
fspr_procattr_t *attr,
fspr_pool_t *pool)
{
int i=0,nargs=0;
char **newargs = NULL;
@@ -228,7 +228,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
struct send_pipe *sp;
char * dir = NULL;
sp = (struct send_pipe *)apr_palloc(pool, sizeof(struct send_pipe));
sp = (struct send_pipe *)fspr_palloc(pool, sizeof(struct send_pipe));
new->in = attr->parent_in;
new->err = attr->parent_err;
@@ -243,7 +243,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
}
newargs = (char**)malloc(sizeof(char *) * (i + 4));
newargs[0] = strdup("/boot/home/config/bin/apr_proc_stub");
newargs[0] = strdup("/boot/home/config/bin/fspr_proc_stub");
if (attr->currdir == NULL) {
/* we require the directory , so use a temp. variable */
dir = malloc(sizeof(char) * PATH_MAX);
@@ -278,13 +278,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
resume_thread(newproc);
if (attr->child_in) {
apr_file_close(attr->child_in);
fspr_file_close(attr->child_in);
}
if (attr->child_out) {
apr_file_close(attr->child_out);
fspr_file_close(attr->child_out);
}
if (attr->child_err) {
apr_file_close(attr->child_err);
fspr_file_close(attr->child_err);
}
send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe));
@@ -298,26 +298,26 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,
APR_DECLARE(fspr_status_t) fspr_proc_wait_all_procs(fspr_proc_t *proc,
int *exitcode,
apr_exit_why_e *exitwhy,
apr_wait_how_e waithow,
apr_pool_t *p)
fspr_exit_why_e *exitwhy,
fspr_wait_how_e waithow,
fspr_pool_t *p)
{
proc->pid = -1;
return apr_proc_wait(proc, exitcode, exitwhy, waithow);
return fspr_proc_wait(proc, exitcode, exitwhy, waithow);
}
APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
APR_DECLARE(fspr_status_t) fspr_proc_wait(fspr_proc_t *proc,
int *exitcode,
apr_exit_why_e *exitwhy,
apr_wait_how_e waithow)
fspr_exit_why_e *exitwhy,
fspr_wait_how_e waithow)
{
pid_t pstatus;
int waitpid_options = WUNTRACED;
int exit_int;
int ignore;
apr_exit_why_e ignorewhy;
fspr_exit_why_e ignorewhy;
if (exitcode == NULL) {
exitcode = &ignore;
@@ -354,65 +354,65 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,
return errno;
}
APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,
apr_file_t *parent_in)
APR_DECLARE(fspr_status_t) fspr_procattr_child_in_set(fspr_procattr_t *attr, fspr_file_t *child_in,
fspr_file_t *parent_in)
{
if (attr->child_in == NULL && attr->parent_in == NULL)
apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
fspr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);
if (child_in != NULL)
apr_file_dup(&attr->child_in, child_in, attr->pool);
fspr_file_dup(&attr->child_in, child_in, attr->pool);
if (parent_in != NULL)
apr_file_dup(&attr->parent_in, parent_in, attr->pool);
fspr_file_dup(&attr->parent_in, parent_in, attr->pool);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,
apr_file_t *parent_out)
APR_DECLARE(fspr_status_t) fspr_procattr_child_out_set(fspr_procattr_t *attr, fspr_file_t *child_out,
fspr_file_t *parent_out)
{
if (attr->child_out == NULL && attr->parent_out == NULL)
apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
fspr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);
if (child_out != NULL)
apr_file_dup(&attr->child_out, child_out, attr->pool);
fspr_file_dup(&attr->child_out, child_out, attr->pool);
if (parent_out != NULL)
apr_file_dup(&attr->parent_out, parent_out, attr->pool);
fspr_file_dup(&attr->parent_out, parent_out, attr->pool);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,
apr_file_t *parent_err)
APR_DECLARE(fspr_status_t) fspr_procattr_child_err_set(fspr_procattr_t *attr, fspr_file_t *child_err,
fspr_file_t *parent_err)
{
if (attr->child_err == NULL && attr->parent_err == NULL)
apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
fspr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);
if (child_err != NULL)
apr_file_dup(&attr->child_err, child_err, attr->pool);
fspr_file_dup(&attr->child_err, child_err, attr->pool);
if (parent_err != NULL)
apr_file_dup(&attr->parent_err, parent_err, attr->pool);
fspr_file_dup(&attr->parent_err, parent_err, attr->pool);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what,
APR_DECLARE(fspr_status_t) fspr_procattr_limit_set(fspr_procattr_t *attr, fspr_int32_t what,
void *limit)
{
return APR_ENOTIMPL;
}
APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_user_set(fspr_procattr_t *attr,
const char *username,
const char *password)
{
return APR_ENOTIMPL;
}
APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,
APR_DECLARE(fspr_status_t) fspr_procattr_group_set(fspr_procattr_t *attr,
const char *groupname)
{
return APR_ENOTIMPL;
+42 -42
View File
@@ -14,13 +14,13 @@
* limitations under the License.
*/
#include "apr_arch_threadproc.h"
#include "apr_portable.h"
#include "fspr_arch_threadproc.h"
#include "fspr_portable.h"
APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_threadattr_create(fspr_threadattr_t **new, fspr_pool_t *pool)
{
(*new) = (apr_threadattr_t *)apr_palloc(pool,
sizeof(apr_threadattr_t));
(*new) = (fspr_threadattr_t *)fspr_palloc(pool,
sizeof(fspr_threadattr_t));
if ((*new) == NULL) {
return APR_ENOMEM;
@@ -32,7 +32,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new, apr_pool
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on)
APR_DECLARE(fspr_status_t) fspr_threadattr_detach_set(fspr_threadattr_t *attr, fspr_int32_t on)
{
if (on == 1){
attr->detached = 1;
@@ -42,7 +42,7 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_set(apr_threadattr_t *attr, apr_
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
APR_DECLARE(fspr_status_t) fspr_threadattr_detach_get(fspr_threadattr_t *attr)
{
if (attr->detached == 1){
return APR_DETACH;
@@ -50,32 +50,32 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
return APR_NOTDETACH;
}
APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
apr_size_t stacksize)
APR_DECLARE(fspr_status_t) fspr_threadattr_stacksize_set(fspr_threadattr_t *attr,
fspr_size_t stacksize)
{
return APR_ENOTIMPL;
}
APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
apr_size_t size)
APR_DECLARE(fspr_status_t) fspr_threadattr_guardsize_set(fspr_threadattr_t *attr,
fspr_size_t size)
{
return APR_ENOTIMPL;
}
static void *dummy_worker(void *opaque)
{
apr_thread_t *thd = (apr_thread_t*)opaque;
fspr_thread_t *thd = (fspr_thread_t*)opaque;
return thd->func(thd, thd->data);
}
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)
APR_DECLARE(fspr_status_t) fspr_thread_create(fspr_thread_t **new, fspr_threadattr_t *attr,
fspr_thread_start_t func, void *data,
fspr_pool_t *pool)
{
int32 temp;
apr_status_t stat;
fspr_status_t stat;
(*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t));
(*new) = (fspr_thread_t *)fspr_palloc(pool, sizeof(fspr_thread_t));
if ((*new) == NULL) {
return APR_ENOMEM;
}
@@ -91,7 +91,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t
else
temp = B_NORMAL_PRIORITY;
stat = apr_pool_create(&(*new)->pool, pool);
stat = fspr_pool_create(&(*new)->pool, pool);
if (stat != APR_SUCCESS) {
return stat;
}
@@ -110,26 +110,26 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new, apr_threadattr_t
}
}
APR_DECLARE(apr_os_thread_t) apr_os_thread_current(void)
APR_DECLARE(fspr_os_thread_t) fspr_os_thread_current(void)
{
return find_thread(NULL);
}
int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
int fspr_os_thread_equal(fspr_os_thread_t tid1, fspr_os_thread_t tid2)
{
return tid1 == tid2;
}
APR_DECLARE(apr_status_t) apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
APR_DECLARE(fspr_status_t) fspr_thread_exit(fspr_thread_t *thd, fspr_status_t retval)
{
apr_pool_destroy(thd->pool);
fspr_pool_destroy(thd->pool);
thd->exitval = retval;
exit_thread ((status_t)(retval));
/* This will never be reached... */
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
APR_DECLARE(fspr_status_t) fspr_thread_join(fspr_status_t *retval, fspr_thread_t *thd)
{
status_t rv = 0, ret;
ret = wait_for_thread(thd->td, &rv);
@@ -149,7 +149,7 @@ APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval, apr_thread_t *th
}
}
APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
APR_DECLARE(fspr_status_t) fspr_thread_detach(fspr_thread_t *thd)
{
if (suspend_thread(thd->td) == B_NO_ERROR){
return APR_SUCCESS;
@@ -159,45 +159,45 @@ APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
}
}
void apr_thread_yield()
void fspr_thread_yield()
{
}
APR_DECLARE(apr_status_t) apr_thread_data_get(void **data, const char *key, apr_thread_t *thread)
APR_DECLARE(fspr_status_t) fspr_thread_data_get(void **data, const char *key, fspr_thread_t *thread)
{
return apr_pool_userdata_get(data, key, thread->pool);
return fspr_pool_userdata_get(data, key, thread->pool);
}
APR_DECLARE(apr_status_t) apr_thread_data_set(void *data, const char *key,
apr_status_t (*cleanup) (void *),
apr_thread_t *thread)
APR_DECLARE(fspr_status_t) fspr_thread_data_set(void *data, const char *key,
fspr_status_t (*cleanup) (void *),
fspr_thread_t *thread)
{
return apr_pool_userdata_set(data, key, cleanup, thread->pool);
return fspr_pool_userdata_set(data, key, cleanup, thread->pool);
}
APR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd, apr_thread_t *thd)
APR_DECLARE(fspr_status_t) fspr_os_thread_get(fspr_os_thread_t **thethd, fspr_thread_t *thd)
{
*thethd = &thd->td;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd, apr_os_thread_t *thethd,
apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_os_thread_put(fspr_thread_t **thd, fspr_os_thread_t *thethd,
fspr_pool_t *pool)
{
if (pool == NULL) {
return APR_ENOPOOL;
}
if ((*thd) == NULL) {
(*thd) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t));
(*thd) = (fspr_thread_t *)fspr_pcalloc(pool, sizeof(fspr_thread_t));
(*thd)->pool = pool;
}
(*thd)->td = *thethd;
return APR_SUCCESS;
}
static apr_status_t thread_once_cleanup(void *vcontrol)
static fspr_status_t thread_once_cleanup(void *vcontrol)
{
apr_thread_once_t *control = (apr_thread_once_t *)vcontrol;
fspr_thread_once_t *control = (fspr_thread_once_t *)vcontrol;
if (control->sem) {
release_sem(control->sem);
@@ -207,23 +207,23 @@ static apr_status_t thread_once_cleanup(void *vcontrol)
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_once_init(apr_thread_once_t **control,
apr_pool_t *p)
APR_DECLARE(fspr_status_t) fspr_thread_once_init(fspr_thread_once_t **control,
fspr_pool_t *p)
{
int rc;
*control = (apr_thread_once_t *)apr_pcalloc(p, sizeof(apr_thread_once_t));
*control = (fspr_thread_once_t *)fspr_pcalloc(p, sizeof(fspr_thread_once_t));
(*control)->hit = 0; /* we haven't done it yet... */
rc = ((*control)->sem = create_sem(1, "thread_once"));
if (rc < 0)
return rc;
apr_pool_cleanup_register(p, control, thread_once_cleanup, apr_pool_cleanup_null);
fspr_pool_cleanup_register(p, control, thread_once_cleanup, fspr_pool_cleanup_null);
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_thread_once(apr_thread_once_t *control,
APR_DECLARE(fspr_status_t) fspr_thread_once(fspr_thread_once_t *control,
void (*func)(void))
{
if (!control->hit) {
+18 -18
View File
@@ -14,16 +14,16 @@
* limitations under the License.
*/
#include "apr_arch_threadproc.h"
#include "fspr_arch_threadproc.h"
static struct beos_key key_table[BEOS_MAX_DATAKEYS];
static struct beos_private_data *beos_data[BEOS_MAX_DATAKEYS];
static sem_id lock;
APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
void (*dest)(void *), apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_threadkey_private_create(fspr_threadkey_t **key,
void (*dest)(void *), fspr_pool_t *pool)
{
(*key) = (apr_threadkey_t *)apr_palloc(pool, sizeof(apr_threadkey_t));
(*key) = (fspr_threadkey_t *)fspr_palloc(pool, sizeof(fspr_threadkey_t));
if ((*key) == NULL) {
return APR_ENOMEM;
}
@@ -44,7 +44,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_create(apr_threadkey_t **key,
return APR_ENOMEM;
}
APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t *key)
APR_DECLARE(fspr_status_t) fspr_threadkey_private_get(void **new, fspr_threadkey_t *key)
{
thread_id tid;
int i, index=0;
@@ -76,7 +76,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_get(void **new, apr_threadkey_t
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t *key)
APR_DECLARE(fspr_status_t) fspr_threadkey_private_set(void *priv, fspr_threadkey_t *key)
{
thread_id tid;
int i,index = 0, ret = 0;
@@ -131,7 +131,7 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_set(void *priv, apr_threadkey_t
return APR_ENOMEM;
}
APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key)
APR_DECLARE(fspr_status_t) fspr_threadkey_private_delete(fspr_threadkey_t *key)
{
if (key->key < BEOS_MAX_DATAKEYS){
acquire_sem(key_table[key->key].lock);
@@ -146,33 +146,33 @@ APR_DECLARE(apr_status_t) apr_threadkey_private_delete(apr_threadkey_t *key)
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_threadkey_data_get(void **data, const char *key,
apr_threadkey_t *threadkey)
APR_DECLARE(fspr_status_t) fspr_threadkey_data_get(void **data, const char *key,
fspr_threadkey_t *threadkey)
{
return apr_pool_userdata_get(data, key, threadkey->pool);
return fspr_pool_userdata_get(data, key, threadkey->pool);
}
APR_DECLARE(apr_status_t) apr_threadkey_data_set(void *data, const char *key,
apr_status_t (*cleanup) (void *),
apr_threadkey_t *threadkey)
APR_DECLARE(fspr_status_t) fspr_threadkey_data_set(void *data, const char *key,
fspr_status_t (*cleanup) (void *),
fspr_threadkey_t *threadkey)
{
return apr_pool_userdata_set(data, key, cleanup, threadkey->pool);
return fspr_pool_userdata_set(data, key, cleanup, threadkey->pool);
}
APR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key)
APR_DECLARE(fspr_status_t) fspr_os_threadkey_get(fspr_os_threadkey_t *thekey, fspr_threadkey_t *key)
{
*thekey = key->key;
return APR_SUCCESS;
}
APR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
apr_os_threadkey_t *thekey, apr_pool_t *pool)
APR_DECLARE(fspr_status_t) fspr_os_threadkey_put(fspr_threadkey_t **key,
fspr_os_threadkey_t *thekey, fspr_pool_t *pool)
{
if (pool == NULL) {
return APR_ENOPOOL;
}
if ((*key) == NULL) {
(*key) = (apr_threadkey_t *)apr_pcalloc(pool, sizeof(apr_threadkey_t));
(*key) = (fspr_threadkey_t *)fspr_pcalloc(pool, sizeof(fspr_threadkey_t));
(*key)->pool = pool;
}
(*key)->key = *thekey;