From e4706506c52d72c3533c6f098e48a87ac60f57f3 Mon Sep 17 00:00:00 2001 From: PHO Date: Sun, 8 Aug 2010 19:55:19 +0900 Subject: [PATCH] more bindings --- Bindings/APR/Allocator.hsc | 4 +++- Bindings/APR/Thread/Mutex.hsc | 21 +++++++++++++++++++++ bindings-apr.cabal | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Bindings/APR/Thread/Mutex.hsc diff --git a/Bindings/APR/Allocator.hsc b/Bindings/APR/Allocator.hsc index 0ee0f97..236fff9 100644 --- a/Bindings/APR/Allocator.hsc +++ b/Bindings/APR/Allocator.hsc @@ -6,6 +6,7 @@ module Bindings.APR.Allocator where import Bindings.APR import Bindings.APR.Allocator.Types import Bindings.APR.Errno +import Bindings.APR.Thread.Mutex import Bindings.APR.Pools #num APR_MEMNODE_T_SIZE @@ -21,4 +22,5 @@ import Bindings.APR.Pools #ccall apr_allocator_max_free_set, Ptr -> -> IO () --- FIXME: incomplete \ No newline at end of file +#ccall apr_allocator_mutex_set, Ptr -> Ptr -> IO () +#ccall apr_allocator_mutex_get, Ptr -> IO (Ptr ) diff --git a/Bindings/APR/Thread/Mutex.hsc b/Bindings/APR/Thread/Mutex.hsc new file mode 100644 index 0000000..07c7ddd --- /dev/null +++ b/Bindings/APR/Thread/Mutex.hsc @@ -0,0 +1,21 @@ +#include +#include + +module Bindings.APR.Thread.Mutex where +#strict_import +import Bindings.APR.Errno +import Bindings.APR.Pools + +#opaque_t apr_thread_mutex_t + +#num APR_THREAD_MUTEX_DEFAULT +#num APR_THREAD_MUTEX_NESTED +#num APR_THREAD_MUTEX_UNNESTED + +#ccall apr_thread_mutex_create , Ptr -> CUInt -> Ptr -> IO +#ccall apr_thread_mutex_lock , Ptr -> IO +#ccall apr_thread_mutex_trylock, Ptr -> IO +#ccall apr_thread_mutex_unlock , Ptr -> IO +#ccall apr_thread_mutex_destroy, Ptr -> IO + +#ccall apr_thread_mutex_pool_get, Ptr -> IO (Ptr ) diff --git a/bindings-apr.cabal b/bindings-apr.cabal index af4b80e..4e70373 100644 --- a/bindings-apr.cabal +++ b/bindings-apr.cabal @@ -1,7 +1,7 @@ Name: bindings-apr Synopsis: Low level bindings to Apache Portable Runtime (APR) Description: - Bindings to APR: http://apr.apache.org/ + Bindings to APR: Version: 0.1 License: PublicDomain License-File: COPYING @@ -33,6 +33,7 @@ Library Bindings.APR.Allocator.Types Bindings.APR.Errno Bindings.APR.Pools + Bindings.APR.Thread.Mutex C-Sources: cbits/helper_apr_errno.c -- 2.40.0