import Bindings.APR.Pools
import Bindings.APR.Proc.Mutex
-#if !APR_PROC_MUTEX_IS_GLOBAL
+#opaque_t apr_global_mutex_t
-# opaque_t apr_global_mutex_t
+#cinline apr_global_mutex_create , Ptr (Ptr <apr_global_mutex_t>) -> Ptr CChar -> <apr_lockmech_e> -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#cinline apr_global_mutex_child_init, Ptr (Ptr <apr_global_mutex_t>) -> Ptr CChar -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#cinline apr_global_mutex_lock , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
+#cinline apr_global_mutex_trylock , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
+#cinline apr_global_mutex_unlock , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
+#cinline apr_global_mutex_destroy , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
-# ccall apr_global_mutex_create , Ptr (Ptr <apr_global_mutex_t>) -> Ptr CChar -> <apr_lockmech_e> -> Ptr <apr_pool_t> -> IO <apr_status_t>
-# ccall apr_global_mutex_child_init, Ptr (Ptr <apr_global_mutex_t>) -> Ptr CChar -> Ptr <apr_pool_t> -> IO <apr_status_t>
-# ccall apr_global_mutex_lock , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
-# ccall apr_global_mutex_trylock , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
-# ccall apr_global_mutex_unlock , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
-# ccall apr_global_mutex_destroy , Ptr <apr_global_mutex_t> -> IO <apr_status_t>
-
-# ccall apr_global_mutex_pool_get , Ptr <apr_global_mutex_t> -> IO (Ptr <apr_pool_t>)
-
-#else
-
-# synonym_t apr_global_mutex_t, <apr_proc_mutex_t>
-
-c'apr_global_mutex_create :: Ptr (Ptr C'apr_global_mutex_t) -> Ptr CChar -> C'apr_lockmech_e -> Ptr C'apr_pool_t -> IO C'apr_status_t
-c'apr_global_mutex_create = c'apr_proc_mutex_create
-
-c'apr_global_mutex_child_init :: Ptr (Ptr C'apr_global_mutex_t) -> Ptr CChar -> Ptr C'apr_pool_t -> IO C'apr_status_t
-c'apr_global_mutex_child_init = c'apr_proc_mutex_child_init
-
-c'apr_global_mutex_lock :: Ptr C'apr_global_mutex_t -> IO C'apr_status_t
-c'apr_global_mutex_lock = c'apr_proc_mutex_lock
-
-c'apr_global_mutex_trylock :: Ptr C'apr_global_mutex_t -> IO C'apr_status_t
-c'apr_global_mutex_trylock = c'apr_proc_mutex_trylock
-
-c'apr_global_mutex_unlock :: Ptr C'apr_global_mutex_t -> IO C'apr_status_t
-c'apr_global_mutex_unlock = c'apr_proc_mutex_unlock
-
-c'apr_global_mutex_destroy :: Ptr C'apr_global_mutex_t -> IO C'apr_status_t
-c'apr_global_mutex_destroy = c'apr_proc_mutex_destroy
-
-c'apr_global_mutex_cleanup :: Ptr () -> IO C'apr_status_t
-c'apr_global_mutex_cleanup = c'apr_proc_mutex_cleanup
-
-c'apr_global_mutex_lockfile :: Ptr C'apr_global_mutex_t -> IO (Ptr CChar)
-c'apr_global_mutex_lockfile = c'apr_proc_mutex_lockfile
-
-c'apr_global_mutex_name :: Ptr C'apr_global_mutex_t -> IO (Ptr CChar)
-c'apr_global_mutex_name = c'apr_proc_mutex_name
-
-c'apr_global_mutex_defname :: IO (Ptr CChar)
-c'apr_global_mutex_defname = c'apr_proc_mutex_defname
-
-c'apr_global_mutex_pool_get :: Ptr C'apr_global_mutex_t -> IO (Ptr C'apr_pool_t)
-c'apr_global_mutex_pool_get = c'apr_proc_mutex_pool_get
-
-#endif
+#cinline apr_global_mutex_pool_get , Ptr <apr_global_mutex_t> -> IO (Ptr <apr_pool_t>)
# field protocol, CInt
#stoptype
-#if APR_PROC_MUTEX_IS_GLOBAL
-type C'apr_os_global_mutex_t = C'apr_os_proc_mutex_t
-
-c'apr_os_global_mutex_get :: Ptr C'apr_os_global_mutex_t -> Ptr C'apr_global_mutex_t -> IO C'apr_status_t
-c'apr_os_global_mutex_get = c'apr_os_proc_mutex_get
-#else
-# starttype struct apr_os_global_mutex_t
-# field pool , Ptr <apr_pool_t>
-# field proc_mutex, Ptr <apr_proc_mutex_t>
-# if APR_HAS_THREADS
-# field thread_mutex, Ptr <apr_thread_mutex_t>
-# endif
-# stoptype
-
-# ccall apr_os_global_mutex_get, Ptr <apr_os_global_mutex_t> -> Ptr <apr_global_mutex_t> -> IO <apr_status_t>
-#endif
+#opaque_t apr_os_global_mutex_t
+#cinline apr_os_global_mutex_get, Ptr <apr_os_global_mutex_t> -> Ptr <apr_global_mutex_t> -> IO <apr_status_t>
#ccall apr_os_file_get , Ptr <apr_os_file_t> -> Ptr <apr_file_t> -> IO <apr_status_t>
#ccall apr_os_dir_get , Ptr (Ptr <apr_os_dir_t>) -> Ptr <apr_dir_t> -> IO <apr_status_t>
--- /dev/null
+#include <bindings.cmacros.h>
+#include <apr_global_mutex.h>
+
+BC_INLINE4(apr_global_mutex_create , apr_global_mutex_t**, const char*, apr_lockmech_e, apr_pool_t*, apr_status_t)
+BC_INLINE3(apr_global_mutex_child_init, apr_global_mutex_t**, const char*, apr_pool_t*, apr_status_t)
+BC_INLINE1(apr_global_mutex_lock , apr_global_mutex_t*, apr_status_t)
+BC_INLINE1(apr_global_mutex_trylock , apr_global_mutex_t*, apr_status_t)
+BC_INLINE1(apr_global_mutex_unlock , apr_global_mutex_t*, apr_status_t)
+BC_INLINE1(apr_global_mutex_destroy , apr_global_mutex_t*, apr_status_t)
+
+BC_INLINE1(apr_global_mutex_pool_get , apr_global_mutex_t*, apr_pool_t*)