diff options
author | dougm <dougm@13f79535-47bb-0310-9956-ffa450edef68> | 2000-08-02 05:26:45 +0000 |
---|---|---|
committer | dougm <dougm@13f79535-47bb-0310-9956-ffa450edef68> | 2000-08-02 05:26:45 +0000 |
commit | 8fcf6e0fadd7ec31d02e7249dc69922b24747c11 (patch) | |
tree | 4da0bfd73d36292921960aaabc877a57e680b8c4 /locks | |
parent | 5198c260c1982414023e984799ce1c3b04bb6b43 (diff) | |
download | libapr-8fcf6e0fadd7ec31d02e7249dc69922b24747c11.tar.gz |
prefix libapr functions and types with apr_
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks')
-rw-r--r-- | locks/beos/crossproc.c | 26 | ||||
-rw-r--r-- | locks/beos/intraproc.c | 24 | ||||
-rw-r--r-- | locks/beos/locks.c | 42 | ||||
-rw-r--r-- | locks/beos/locks.h | 26 | ||||
-rw-r--r-- | locks/os2/locks.c | 38 | ||||
-rw-r--r-- | locks/os2/locks.h | 8 | ||||
-rw-r--r-- | locks/unix/crossproc.c | 112 | ||||
-rw-r--r-- | locks/unix/intraproc.c | 30 | ||||
-rw-r--r-- | locks/unix/locks.c | 68 | ||||
-rw-r--r-- | locks/unix/locks.h | 28 | ||||
-rw-r--r-- | locks/win32/locks.c | 44 | ||||
-rw-r--r-- | locks/win32/locks.h | 8 |
12 files changed, 227 insertions, 227 deletions
diff --git a/locks/beos/crossproc.c b/locks/beos/crossproc.c index 8a27e0d6e..ee541cfcb 100644 --- a/locks/beos/crossproc.c +++ b/locks/beos/crossproc.c @@ -54,9 +54,9 @@ #include "locks.h" -ap_status_t lock_inter_cleanup(void * data) +apr_status_t lock_inter_cleanup(void * data) { - ap_lock_t *lock = (ap_lock_t*)data; + apr_lock_t *lock = (apr_lock_t*)data; if (lock->curr_locked == 1) { if (atomic_add(&lock->ben_interproc , -1) > 1){ release_sem (lock->sem_interproc); @@ -66,12 +66,12 @@ ap_status_t lock_inter_cleanup(void * data) return APR_SUCCESS; } -ap_status_t create_inter_lock(ap_lock_t *new) +apr_status_t create_inter_lock(apr_lock_t *new) { int32 stat; - new->sem_interproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); - new->ben_interproc = (int32)ap_palloc(new->cntxt, sizeof(int32)); + new->sem_interproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); + new->ben_interproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); if ((stat = create_sem(0, "ap_interproc")) < B_NO_ERROR) { lock_inter_cleanup(new); @@ -80,12 +80,12 @@ ap_status_t create_inter_lock(ap_lock_t *new) new->ben_interproc = 0; new->curr_locked = 0; new->sem_interproc = stat; - ap_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_inter_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t lock_inter(ap_lock_t *lock) +apr_status_t lock_inter(apr_lock_t *lock) { int32 stat; @@ -99,7 +99,7 @@ ap_status_t lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_inter(ap_lock_t *lock) +apr_status_t unlock_inter(apr_lock_t *lock) { int32 stat; @@ -113,17 +113,17 @@ ap_status_t unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_inter_lock(ap_lock_t *lock) +apr_status_t destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_inter_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_inter_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } diff --git a/locks/beos/intraproc.c b/locks/beos/intraproc.c index 89bfc17bc..93032f561 100644 --- a/locks/beos/intraproc.c +++ b/locks/beos/intraproc.c @@ -54,9 +54,9 @@ #include "locks.h" -ap_status_t lock_intra_cleanup(void *data) +apr_status_t lock_intra_cleanup(void *data) { - ap_lock_t *lock = (ap_lock_t *)data; + apr_lock_t *lock = (apr_lock_t *)data; if (lock->curr_locked == 1) { if (atomic_add(&lock->ben_intraproc , -1) > 1){ release_sem (lock->sem_intraproc); @@ -68,11 +68,11 @@ ap_status_t lock_intra_cleanup(void *data) return APR_SUCCESS; } -ap_status_t create_intra_lock(ap_lock_t *new) +apr_status_t create_intra_lock(apr_lock_t *new) { int32 stat; - new->sem_intraproc = (sem_id)ap_palloc(new->cntxt, sizeof(sem_id)); - new->ben_intraproc = (int32)ap_palloc(new->cntxt, sizeof(int32)); + new->sem_intraproc = (sem_id)apr_palloc(new->cntxt, sizeof(sem_id)); + new->ben_intraproc = (int32)apr_palloc(new->cntxt, sizeof(int32)); if ((stat = create_sem(0, "ap_intraproc")) < B_NO_ERROR){ @@ -82,12 +82,12 @@ ap_status_t create_intra_lock(ap_lock_t *new) new->ben_intraproc = 0; new->sem_intraproc = stat; new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t lock_intra(ap_lock_t *lock) +apr_status_t lock_intra(apr_lock_t *lock) { int32 stat; @@ -101,7 +101,7 @@ ap_status_t lock_intra(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t unlock_intra(ap_lock_t *lock) +apr_status_t unlock_intra(apr_lock_t *lock) { int32 stat; @@ -115,11 +115,11 @@ ap_status_t unlock_intra(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t destroy_intra_lock(ap_lock_t *lock) +apr_status_t destroy_intra_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/beos/locks.c b/locks/beos/locks.c index 18c9ebea9..37dbd236e 100644 --- a/locks/beos/locks.c +++ b/locks/beos/locks.c @@ -54,14 +54,14 @@ #include "locks.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_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) { - ap_lock_t *new; - ap_status_t stat; + apr_lock_t *new; + apr_status_t stat; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if (new == NULL){ return APR_ENOMEM; } @@ -69,7 +69,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, new->cntxt = cont; new->type = type; new->scope = scope; - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); if (scope != APR_CROSS_PROCESS) { if ((stat = create_intra_lock(new)) != APR_SUCCESS) { @@ -85,9 +85,9 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = lock_intra(lock)) != APR_SUCCESS) { @@ -102,9 +102,9 @@ ap_status_t ap_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = unlock_intra(lock)) != APR_SUCCESS) { return stat; @@ -118,9 +118,9 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { if ((stat = destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; @@ -134,10 +134,10 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; if ((*lock)->scope != APR_CROSS_PROCESS) { if ((stat = child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; @@ -146,14 +146,14 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } diff --git a/locks/beos/locks.h b/locks/beos/locks.h index fefc0d30a..685f8a89b 100644 --- a/locks/beos/locks.h +++ b/locks/beos/locks.h @@ -61,10 +61,10 @@ #include "apr_general.h" #include "apr_lib.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; /* Inter proc */ @@ -75,17 +75,17 @@ struct ap_lock_t { int32 ben_intraproc; }; -ap_status_t create_intra_lock(struct ap_lock_t *new); -ap_status_t lock_intra(struct ap_lock_t *lock); -ap_status_t unlock_intra(struct ap_lock_t *lock); -ap_status_t destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t create_intra_lock(struct apr_lock_t *new); +apr_status_t lock_intra(struct apr_lock_t *lock); +apr_status_t unlock_intra(struct apr_lock_t *lock); +apr_status_t destroy_intra_lock(struct apr_lock_t *lock); -ap_status_t create_inter_lock(struct ap_lock_t *new); -ap_status_t lock_inter(struct ap_lock_t *lock); -ap_status_t unlock_inter(struct ap_lock_t *lock); -ap_status_t destroy_inter_lock(struct ap_lock_t *lock); +apr_status_t create_inter_lock(struct apr_lock_t *new); +apr_status_t lock_inter(struct apr_lock_t *lock); +apr_status_t unlock_inter(struct apr_lock_t *lock); +apr_status_t destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); diff --git a/locks/os2/locks.c b/locks/os2/locks.c index dc288b6c9..60184795a 100644 --- a/locks/os2/locks.c +++ b/locks/os2/locks.c @@ -69,54 +69,54 @@ void setup_lock() -static ap_status_t lock_cleanup(void *thelock) +static apr_status_t lock_cleanup(void *thelock) { - ap_lock_t *lock = thelock; - return ap_destroy_lock(lock); + apr_lock_t *lock = thelock; + return apr_destroy_lock(lock); } -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, ap_lockscope_e scope, - const char *fname, ap_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) { - ap_lock_t *new; + apr_lock_t *new; ULONG rc; char *semname; PIB *ppib; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); new->cntxt = cont; new->type = type; new->scope = scope; new->owner = 0; new->lock_count = 0; - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); DosGetInfoBlocks(&(new->tib), &ppib); if (fname == NULL) semname = NULL; else - semname = ap_pstrcat(cont, "/SEM32/", fname, NULL); + semname = apr_pstrcat(cont, "/SEM32/", fname, NULL); rc = DosCreateMutexSem(semname, &(new->hMutex), scope == APR_CROSS_PROCESS ? DC_SEM_SHARED : 0, FALSE); *lock = new; if (!rc) - ap_register_cleanup(cont, new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, new, lock_cleanup, apr_null_cleanup); return APR_OS2_STATUS(rc); } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { int rc; PIB *ppib; - *lock = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + *lock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if (lock == NULL) return APR_ENOMEM; @@ -127,14 +127,14 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, rc = DosOpenMutexSem( (char *)fname, &(*lock)->hMutex ); if (!rc) - ap_register_cleanup(cont, *lock, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(cont, *lock, lock_cleanup, apr_null_cleanup); return APR_OS2_STATUS(rc); } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { ULONG rc; @@ -150,7 +150,7 @@ ap_status_t ap_lock(ap_lock_t *lock) -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { ULONG rc; @@ -165,14 +165,14 @@ ap_status_t ap_unlock(ap_lock_t *lock) -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { ULONG rc; - ap_status_t stat = APR_SUCCESS; + apr_status_t stat = APR_SUCCESS; if (lock->owner == CurrentTid) { while (lock->lock_count > 0 && stat == APR_SUCCESS) - stat = ap_unlock(lock); + stat = apr_unlock(lock); } if (stat != APR_SUCCESS) diff --git a/locks/os2/locks.h b/locks/os2/locks.h index d416b6b08..50ffdc652 100644 --- a/locks/os2/locks.h +++ b/locks/os2/locks.h @@ -60,10 +60,10 @@ #define INCL_DOS #include <os2.h> -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; char *fname; HMTX hMutex; TID owner; diff --git a/locks/unix/crossproc.c b/locks/unix/crossproc.c index 556e8443f..f140183e1 100644 --- a/locks/unix/crossproc.c +++ b/locks/unix/crossproc.c @@ -61,7 +61,7 @@ static struct sembuf op_on; static struct sembuf op_off; -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { op_on.sem_num = 0; op_on.sem_op = -1; @@ -71,9 +71,9 @@ void ap_unix_setup_lock(void) op_off.sem_flg = SEM_UNDO; } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; union semun ick; if (lock->interproc != -1) { @@ -83,7 +83,7 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { union semun ick; @@ -99,11 +99,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -117,7 +117,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -131,32 +131,32 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } #elif (APR_USE_PROC_PTHREAD_SERIALIZE) -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; - ap_status_t stat; + apr_lock_t *lock=lock_; + apr_status_t stat; if (lock->curr_locked == 1) { if ((stat = pthread_mutex_unlock(lock->interproc))) { @@ -172,9 +172,9 @@ static ap_status_t lock_cleanup(void *lock_) return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { - ap_status_t stat; + apr_status_t stat; int fd; pthread_mutexattr_t mattr; @@ -222,13 +222,13 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_mutex_lock(lock->interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -240,9 +240,9 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = pthread_mutex_unlock(lock->interproc))) { #ifdef PTHREAD_SETS_ERRNO @@ -254,17 +254,17 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const char *fname) +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; } @@ -274,7 +274,7 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, const cha static struct flock lock_it; static struct flock unlock_it; -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { lock_it.l_whence = SEEK_SET; /* from current point */ lock_it.l_start = 0; /* -"- */ @@ -288,23 +288,23 @@ void ap_unix_setup_lock(void) unlock_it.l_pid = 0; /* pid not actually interesting */ } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return ap_unix_unlock_inter(lock); + return apr_unix_unlock_inter(lock); } return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { if (new->fname) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0644); } else { - new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); new->interproc = mkstemp(new->fname); } @@ -315,11 +315,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) new->curr_locked=0; unlink(new->fname); - ap_register_cleanup(new->cntxt, new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -333,7 +333,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -347,17 +347,17 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { return APR_SUCCESS; @@ -365,28 +365,28 @@ ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, #elif (APR_USE_FLOCK_SERIALIZE) -void ap_unix_setup_lock(void) +void apr_unix_setup_lock(void) { } -static ap_status_t lock_cleanup(void *lock_) +static apr_status_t lock_cleanup(void *lock_) { - ap_lock_t *lock=lock_; + apr_lock_t *lock=lock_; if (lock->curr_locked == 1) { - return ap_unix_unlock_inter(lock); + return apr_unix_unlock_inter(lock); } unlink(lock->fname); return APR_SUCCESS; } -ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) +apr_status_t apr_unix_create_inter_lock(apr_lock_t *new) { if (new->fname) { new->interproc = open(new->fname, O_CREAT | O_WRONLY | O_EXCL, 0600); } else { - new->fname = ap_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); + new->fname = apr_pstrdup(new->cntxt, "/tmp/aprXXXXXX"); new->interproc = mkstemp(new->fname); } @@ -395,11 +395,11 @@ ap_status_t ap_unix_create_inter_lock(ap_lock_t *new) return errno; } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_cleanup, ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_cleanup, apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_inter(ap_lock_t *lock) +apr_status_t apr_unix_lock_inter(apr_lock_t *lock) { int rc; @@ -413,7 +413,7 @@ ap_status_t ap_unix_lock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) +apr_status_t apr_unix_unlock_inter(apr_lock_t *lock) { int rc; @@ -427,27 +427,27 @@ ap_status_t ap_unix_unlock_inter(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_unix_destroy_inter_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_inter_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_cleanup); return APR_SUCCESS; } return stat; } -ap_status_t ap_unix_child_init_lock(ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(apr_lock_t **lock, apr_pool_t *cont, const char *fname) { - ap_lock_t *new; + apr_lock_t *new; - new = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); new->interproc = open(new->fname, O_WRONLY, 0600); if (new->interproc == -1) { - ap_unix_destroy_inter_lock(new); + apr_unix_destroy_inter_lock(new); return errno; } *lock = new; diff --git a/locks/unix/intraproc.c b/locks/unix/intraproc.c index e598e56e3..3b5b9a97e 100644 --- a/locks/unix/intraproc.c +++ b/locks/unix/intraproc.c @@ -58,10 +58,10 @@ #if (APR_USE_PTHREAD_SERIALIZE) -static ap_status_t lock_intra_cleanup(void *data) +static apr_status_t lock_intra_cleanup(void *data) { - ap_lock_t *lock = (ap_lock_t *) data; - ap_status_t stat; + apr_lock_t *lock = (apr_lock_t *) data; + apr_status_t stat; stat = pthread_mutex_unlock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -72,12 +72,12 @@ static ap_status_t lock_intra_cleanup(void *data) return stat; } -ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) +apr_status_t apr_unix_create_intra_lock(apr_lock_t *new) { - ap_status_t stat; + apr_status_t stat; pthread_mutexattr_t mattr; - new->intraproc = (pthread_mutex_t *)ap_palloc(new->cntxt, + new->intraproc = (pthread_mutex_t *)apr_palloc(new->cntxt, sizeof(pthread_mutex_t)); if (new->intraproc == NULL ) { return errno; @@ -107,14 +107,14 @@ ap_status_t ap_unix_create_intra_lock(ap_lock_t *new) } new->curr_locked = 0; - ap_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, - ap_null_cleanup); + apr_register_cleanup(new->cntxt, (void *)new, lock_intra_cleanup, + apr_null_cleanup); return APR_SUCCESS; } -ap_status_t ap_unix_lock_intra(ap_lock_t *lock) +apr_status_t apr_unix_lock_intra(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; stat = pthread_mutex_lock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -125,9 +125,9 @@ ap_status_t ap_unix_lock_intra(ap_lock_t *lock) return stat; } -ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) +apr_status_t apr_unix_unlock_intra(apr_lock_t *lock) { - ap_status_t status; + apr_status_t status; status = pthread_mutex_unlock(lock->intraproc); #ifdef PTHREAD_SETS_ERRNO @@ -138,11 +138,11 @@ ap_status_t ap_unix_unlock_intra(ap_lock_t *lock) return status; } -ap_status_t ap_unix_destroy_intra_lock(ap_lock_t *lock) +apr_status_t apr_unix_destroy_intra_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if ((stat = lock_intra_cleanup(lock)) == APR_SUCCESS) { - ap_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); + apr_kill_cleanup(lock->cntxt, lock, lock_intra_cleanup); return APR_SUCCESS; } return stat; diff --git a/locks/unix/locks.c b/locks/unix/locks.c index 3e25cc67e..44feb31fa 100644 --- a/locks/unix/locks.c +++ b/locks/unix/locks.c @@ -56,14 +56,14 @@ #include "apr_strings.h" #include "apr_portable.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_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) { - ap_lock_t *new; - ap_status_t stat; + apr_lock_t *new; + apr_status_t stat; - new = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); + new = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); new->cntxt = cont; new->type = type; @@ -72,14 +72,14 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, /* file-based serialization primitives */ if (scope != APR_INTRAPROCESS) { if (fname != NULL) { - new->fname = ap_pstrdup(cont, fname); + new->fname = apr_pstrdup(cont, fname); } } #endif if (scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_create_intra_lock(new)) != APR_SUCCESS) { + if ((stat = apr_unix_create_intra_lock(new)) != APR_SUCCESS) { return stat; } #else @@ -87,7 +87,7 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, #endif } if (scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_create_inter_lock(new)) != APR_SUCCESS) { + if ((stat = apr_unix_create_inter_lock(new)) != APR_SUCCESS) { return stat; } } @@ -95,12 +95,12 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_lock_intra(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_lock_intra(lock)) != APR_SUCCESS) { return stat; } #else @@ -108,20 +108,20 @@ ap_status_t ap_lock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_lock_inter(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_lock_inter(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_unlock_intra(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_unlock_intra(lock)) != APR_SUCCESS) { return stat; } #else @@ -129,19 +129,19 @@ ap_status_t ap_unlock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_unlock_inter(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_unlock_inter(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { - ap_status_t stat; + apr_status_t stat; if (lock->scope != APR_CROSS_PROCESS) { #if APR_HAS_THREADS - if ((stat = ap_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_destroy_intra_lock(lock)) != APR_SUCCESS) { return stat; } #else @@ -149,37 +149,37 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) #endif } if (lock->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_destroy_inter_lock(lock)) != APR_SUCCESS) { + if ((stat = apr_unix_destroy_inter_lock(lock)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +apr_status_t apr_child_init_lock(apr_lock_t **lock, const char *fname, + apr_pool_t *cont) { - ap_status_t stat; + apr_status_t stat; if ((*lock)->scope != APR_INTRAPROCESS) { - if ((stat = ap_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { + if ((stat = apr_unix_child_init_lock(lock, cont, fname)) != APR_SUCCESS) { return stat; } } return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } -ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) +apr_status_t apr_get_os_lock(apr_os_lock_t *oslock, apr_lock_t *lock) { oslock->crossproc = lock->interproc; #if APR_HAS_THREADS @@ -191,14 +191,14 @@ ap_status_t ap_get_os_lock(ap_os_lock_t *oslock, ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont) +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; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_pcalloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_pcalloc(cont, sizeof(apr_lock_t)); (*lock)->cntxt = cont; } (*lock)->interproc = thelock->crossproc; diff --git a/locks/unix/locks.h b/locks/unix/locks.h index d6ecae5db..321cdd18a 100644 --- a/locks/unix/locks.h +++ b/locks/unix/locks.h @@ -112,10 +112,10 @@ union semun { }; #endif -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; int curr_locked; char *fname; #if APR_USE_SYSVSEM_SERIALIZE @@ -142,19 +142,19 @@ struct ap_lock_t { }; #if APR_HAS_THREADS -ap_status_t ap_unix_create_intra_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_intra(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_intra_lock(struct ap_lock_t *lock); +apr_status_t apr_unix_create_intra_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_intra(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_intra_lock(struct apr_lock_t *lock); #endif -void ap_unix_setup_lock(void); -ap_status_t ap_unix_create_inter_lock(struct ap_lock_t *new); -ap_status_t ap_unix_lock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_unlock_inter(struct ap_lock_t *lock); -ap_status_t ap_unix_destroy_inter_lock(struct ap_lock_t *lock); +void apr_unix_setup_lock(void); +apr_status_t apr_unix_create_inter_lock(struct apr_lock_t *new); +apr_status_t apr_unix_lock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_unlock_inter(struct apr_lock_t *lock); +apr_status_t apr_unix_destroy_inter_lock(struct apr_lock_t *lock); -ap_status_t ap_unix_child_init_lock(struct ap_lock_t **lock, ap_pool_t *cont, +apr_status_t apr_unix_child_init_lock(struct apr_lock_t **lock, apr_pool_t *cont, const char *fname); #endif /* LOCKS_H */ diff --git a/locks/win32/locks.c b/locks/win32/locks.c index 22f53b7b5..f499be5cf 100644 --- a/locks/win32/locks.c +++ b/locks/win32/locks.c @@ -57,20 +57,20 @@ #include "locks.h" #include "apr_portable.h" -ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, - ap_lockscope_e scope, const char *fname, - ap_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) { - ap_lock_t *newlock; + apr_lock_t *newlock; SECURITY_ATTRIBUTES sec; - newlock = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + newlock = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); newlock->cntxt = cont; /* ToDo: How to handle the case when no context is available? * How to cleanup the storage properly? */ - newlock->fname = ap_pstrdup(cont, fname); + newlock->fname = apr_pstrdup(cont, fname); newlock->type = type; newlock->scope = scope; sec.nLength = sizeof(SECURITY_ATTRIBUTES); @@ -92,18 +92,18 @@ ap_status_t ap_create_lock(ap_lock_t **lock, ap_locktype_e type, return APR_SUCCESS; } -ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, - ap_pool_t *cont) +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 */ - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); if ((*lock) == NULL) { return APR_ENOMEM; } - (*lock)->fname = ap_pstrdup(cont, fname); + (*lock)->fname = apr_pstrdup(cont, fname); (*lock)->mutex = OpenMutex(MUTEX_ALL_ACCESS, TRUE, fname); if ((*lock)->mutex == NULL) { @@ -112,7 +112,7 @@ ap_status_t ap_child_init_lock(ap_lock_t **lock, const char *fname, return APR_SUCCESS; } -ap_status_t ap_lock(ap_lock_t *lock) +apr_status_t apr_lock(apr_lock_t *lock) { DWORD rv; if (lock->scope == APR_INTRAPROCESS) { @@ -128,7 +128,7 @@ ap_status_t ap_lock(ap_lock_t *lock) return GetLastError(); } -ap_status_t ap_unlock(ap_lock_t *lock) +apr_status_t apr_unlock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { LeaveCriticalSection(&lock->section); @@ -141,7 +141,7 @@ ap_status_t ap_unlock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_destroy_lock(ap_lock_t *lock) +apr_status_t apr_destroy_lock(apr_lock_t *lock) { if (lock->scope == APR_INTRAPROCESS) { DeleteCriticalSection(&lock->section); @@ -154,31 +154,31 @@ ap_status_t ap_destroy_lock(ap_lock_t *lock) return APR_SUCCESS; } -ap_status_t ap_get_lockdata(ap_lock_t *lock, const char *key, void *data) +apr_status_t apr_get_lockdata(apr_lock_t *lock, const char *key, void *data) { - return ap_get_userdata(data, key, lock->cntxt); + return apr_get_userdata(data, key, lock->cntxt); } -ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, const char *key, - ap_status_t (*cleanup) (void *)) +apr_status_t apr_set_lockdata(apr_lock_t *lock, void *data, const char *key, + apr_status_t (*cleanup) (void *)) { - return ap_set_userdata(data, key, cleanup, lock->cntxt); + return apr_set_userdata(data, key, cleanup, lock->cntxt); } -ap_status_t ap_get_os_lock(ap_os_lock_t *thelock, ap_lock_t *lock) +apr_status_t apr_get_os_lock(apr_os_lock_t *thelock, apr_lock_t *lock) { *thelock = lock->mutex; return APR_SUCCESS; } -ap_status_t ap_put_os_lock(ap_lock_t **lock, ap_os_lock_t *thelock, - ap_pool_t *cont) +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; } if ((*lock) == NULL) { - (*lock) = (ap_lock_t *)ap_palloc(cont, sizeof(ap_lock_t)); + (*lock) = (apr_lock_t *)apr_palloc(cont, sizeof(apr_lock_t)); (*lock)->cntxt = cont; } (*lock)->mutex = *thelock; diff --git a/locks/win32/locks.h b/locks/win32/locks.h index 602c2eb67..a7515f238 100644 --- a/locks/win32/locks.h +++ b/locks/win32/locks.h @@ -57,10 +57,10 @@ #include "apr_lock.h" -struct ap_lock_t { - ap_pool_t *cntxt; - ap_locktype_e type; - ap_lockscope_e scope; +struct apr_lock_t { + apr_pool_t *cntxt; + apr_locktype_e type; + apr_lockscope_e scope; HANDLE mutex; CRITICAL_SECTION section; char *fname; |