#strict_import
import Bindings.APR
import Bindings.APR.Allocator.Types
-import Bindings.APR.Errno
+import Bindings.APR.ErrNo
import Bindings.APR.Thread.Mutex
import Bindings.APR.Pools
#opaque_t apr_allocator_t
#starttype struct apr_memnode_t
-#field next , Ptr <apr_memnode_t>
-#field ref , Ptr (Ptr <apr_memnode_t>)
-#field index , <apr_uint32_t>
-#field free_index , <apr_uint32_t>
-#field first_avail, Ptr CChar
-#field endp , Ptr CChar
+# field next , Ptr <apr_memnode_t>
+# field ref , Ptr (Ptr <apr_memnode_t>)
+# field index , <apr_uint32_t>
+# field free_index , <apr_uint32_t>
+# field first_avail, Ptr CChar
+# field endp , Ptr CChar
#stoptype
--- /dev/null
+#include <bindings.dsl.h>
+#include <apr_anylock.h>
+
+module Bindings.APR.AnyLock where
+#strict_import
+import Bindings.APR.ErrNo
+import Bindings.APR.Proc.Mutex
+import Bindings.APR.Thread.Mutex
+import Bindings.APR.Thread.RWLock
+
+#synonym_t tm_lock, CInt
+#num apr_anylock_none
+#num apr_anylock_procmutex
+#num apr_anylock_readlock
+#num apr_anylock_writelock
+
+#starttype union apr_anylock_u_t
+# union_field pm, Ptr <apr_proc_mutex_t>
+# if APR_HAS_THREADS
+# union_field tm, Ptr <apr_thread_mutex_t>
+# union_field rw, Ptr <apr_thread_rwlock_t>
+# endif
+#stoptype
+
+#starttype struct apr_anylock_t
+#field type, <tm_lock>
+#field lock, <apr_anylock_u_t>
+#stoptype
+
+#cinline APR_ANYLOCK_LOCK , Ptr <apr_anylock_t> -> IO <apr_status_t>
+#cinline APR_ANYLOCK_TRYLOCK, Ptr <apr_anylock_t> -> IO <apr_status_t>
+#cinline APR_ANYLOCK_UNLOCK , Ptr <apr_anylock_t> -> IO <apr_status_t>
#include <bindings.dsl.h>
#include <apr_errno.h>
-module Bindings.APR.Errno where
+module Bindings.APR.ErrNo where
#strict_import
import Bindings.APR
#strict_import
import Bindings.APR
import Bindings.APR.Allocator.Types
-import Bindings.APR.Errno
+import Bindings.APR.ErrNo
#opaque_t apr_pool_t
--- /dev/null
+#include <bindings.dsl.h>
+#include <apr_proc_mutex.h>
+
+module Bindings.APR.Proc.Mutex where
+#strict_import
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+
+#integral_t apr_lockmech_e
+#num APR_LOCK_FCNTL
+#num APR_LOCK_FLOCK
+#num APR_LOCK_SYSVSEM
+#num APR_LOCK_PROC_PTHREAD
+#num APR_LOCK_POSIXSEM
+#num APR_LOCK_DEFAULT
+
+#opaque_t apr_proc_mutex_t
+
+#ccall apr_proc_mutex_create , Ptr (Ptr <apr_proc_mutex_t>) -> Ptr CChar -> <apr_lockmech_e> -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_proc_mutex_child_init, Ptr (Ptr <apr_proc_mutex_t>) -> Ptr CChar -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_proc_mutex_lock , Ptr <apr_proc_mutex_t> -> IO <apr_status_t>
+#ccall apr_proc_mutex_trylock , Ptr <apr_proc_mutex_t> -> IO <apr_status_t>
+#ccall apr_proc_mutex_unlock , Ptr <apr_proc_mutex_t> -> IO <apr_status_t>
+#ccall apr_proc_mutex_destroy , Ptr <apr_proc_mutex_t> -> IO <apr_status_t>
+#ccall apr_proc_mutex_cleanup , Ptr () -> IO <apr_status_t>
+#ccall apr_proc_mutex_lockfile , Ptr <apr_proc_mutex_t> -> IO (Ptr CChar)
+#ccall apr_proc_mutex_name , Ptr <apr_proc_mutex_t> -> IO (Ptr CChar)
+#ccall apr_proc_mutex_defname , IO (Ptr CChar)
+
+#ccall apr_proc_mutex_pool_get , Ptr <apr_proc_mutex_t> -> IO (Ptr <apr_pool_t>)
module Bindings.APR.Thread.Mutex where
#strict_import
-import Bindings.APR.Errno
+import Bindings.APR.ErrNo
import Bindings.APR.Pools
#opaque_t apr_thread_mutex_t
--- /dev/null
+#include <bindings.dsl.h>
+#include <apr_thread_rwlock.h>
+
+module Bindings.APR.Thread.RWLock where
+#strict_import
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+
+#opaque_t apr_thread_rwlock_t
+
+#ccall apr_thread_rwlock_create , Ptr (Ptr <apr_thread_rwlock_t>) -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_thread_rwlock_rdlock , Ptr <apr_thread_rwlock_t> -> IO <apr_status_t>
+#ccall apr_thread_rwlock_tryrdlock, Ptr <apr_thread_rwlock_t> -> IO <apr_status_t>
+#ccall apr_thread_rwlock_wrlock , Ptr <apr_thread_rwlock_t> -> IO <apr_status_t>
+#ccall apr_thread_rwlock_trywrlock, Ptr <apr_thread_rwlock_t> -> IO <apr_status_t>
+#ccall apr_thread_rwlock_destroy , Ptr <apr_thread_rwlock_t> -> IO <apr_status_t>
+
+#ccall apr_thread_rwlock_pool_get , Ptr <apr_thread_rwlock_t> -> IO (Ptr <apr_pool_t>)
Bindings.APR
Bindings.APR.Allocator
Bindings.APR.Allocator.Types
- Bindings.APR.Errno
+ Bindings.APR.AnyLock
+ Bindings.APR.ErrNo
Bindings.APR.Pools
+ Bindings.APR.Proc.Mutex
Bindings.APR.Thread.Mutex
+ Bindings.APR.Thread.RWLock
C-Sources:
+ cbits/helper_apr_anylock.c
cbits/helper_apr_errno.c
cbits/helper_apr_pools.c
--- /dev/null
+#include <bindings.cmacros.h>
+#include <apr_anylock.h>
+
+BC_INLINE1(APR_ANYLOCK_LOCK , apr_anylock_t*, apr_status_t)
+BC_INLINE1(APR_ANYLOCK_TRYLOCK, apr_anylock_t*, apr_status_t)
+BC_INLINE1(APR_ANYLOCK_UNLOCK , apr_anylock_t*, apr_status_t)