]> gitweb @ CieloNegro.org - bindings-apr.git/commitdiff
more bindings
authorPHO <pho@cielonegro.org>
Sun, 8 Aug 2010 10:55:19 +0000 (19:55 +0900)
committerPHO <pho@cielonegro.org>
Sun, 8 Aug 2010 10:55:19 +0000 (19:55 +0900)
Bindings/APR/Allocator.hsc
Bindings/APR/Thread/Mutex.hsc [new file with mode: 0644]
bindings-apr.cabal

index 0ee0f9713fc82232f3b9b5ce80bd002c33567cfd..236fff908837cff4a2b441d5f67149626609ebcd 100644 (file)
@@ -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 <apr_allocator_t> -> <apr_size_t> -> IO ()
 
--- FIXME: incomplete
\ No newline at end of file
+#ccall apr_allocator_mutex_set, Ptr <apr_allocator_t> -> Ptr <apr_thread_mutex_t> -> IO ()
+#ccall apr_allocator_mutex_get, Ptr <apr_allocator_t> -> IO (Ptr <apr_thread_mutex_t>)
diff --git a/Bindings/APR/Thread/Mutex.hsc b/Bindings/APR/Thread/Mutex.hsc
new file mode 100644 (file)
index 0000000..07c7ddd
--- /dev/null
@@ -0,0 +1,21 @@
+#include <bindings.dsl.h>
+#include <apr_thread_mutex.h>
+
+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 <apr_thread_mutex_t> -> CUInt -> Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_thread_mutex_lock   , Ptr <apr_thread_mutex_t> -> IO <apr_status_t>
+#ccall apr_thread_mutex_trylock, Ptr <apr_thread_mutex_t> -> IO <apr_status_t>
+#ccall apr_thread_mutex_unlock , Ptr <apr_thread_mutex_t> -> IO <apr_status_t>
+#ccall apr_thread_mutex_destroy, Ptr <apr_thread_mutex_t> -> IO <apr_status_t>
+
+#ccall apr_thread_mutex_pool_get, Ptr <apr_thread_mutex_t> -> IO (Ptr <apr_pool_t>)
index af4b80edd95b0939f193d6cb5a33271be1c502e0..4e703739d657a72b1982513c199cf21afe6185a0 100644 (file)
@@ -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: <http://apr.apache.org/>
 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